summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3bd638707f8e34d0b328bebd344bcb3fc975470d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Maintainer: bartus <aur@bartus.33mail.com>
pkgname=meshlab-git
pkgver=d596d7c.r0.gd596d7c0
pkgrel=1
pkgdesc="System for processing and editing of unstructured 3D models arising in 3D scanning (qt5 version)"
arch=('i686' 'x86_64')
url="http://www.meshlab.net"
conflicts=('meshlab')
provides=('meshlab')
license=('GPL2') depends=('bzip2' 'muparser' 'levmar' 'lib3ds' 'desktop-file-utils' 'glu' 'mpir' 'openssl' 'qt5-base' 'qt5-declarative' 'qt5-script')
#also create openctm(aur) jhead-lib structuresynth-lib to handle last dep
makedepends=('git')
install="${pkgname}.install"
source=("git+https://github.com/cnr-isti-vclab/meshlab.git"
        "git+https://github.com/cnr-isti-vclab/vcglib.git#branch=devel"
        "plugin_dir.patch"
        "shaders_dir.patch"
        "external.patch"
        "3ds.patch"
        "levmar.patch"
        "muparser.patch"
        "meshlabserver_GLU.patch"
        "mpir.patch"
        "rpath.patch"
        "import_bundle_out.patch"
        "qt5.11.patch"
        "meshlab.desktop")
md5sums=('SKIP'
         'SKIP'
         'c1167629f7cebe025ba2cf29846462fd'
         'ad6d2259bd491859834bd42cec92f245'
         '0ac7701c703d3d88a9295f8fb39beeb9'
         '473a1af178e0ea2e92441e5dc29a3842'
         '32581c7128c8e544705c39e59647ab10'
         'f1efa4f1400cc0952fdcd44adc11174b'
         'a4f7548978564637e502ecdbd2b537e0'
         '726e5aeee66681b586150c08cafbe3f1'
         'eb89ce7e86bba52ca4ad4aa173d3f8a2'
         '3fc5cafa9792a89807b51c5a1859d152'
         'fc06e29d2f91b01a768ab29707a65725'
         '18aed0a21276a22325bf8c32166fb110')

pkgver() {
  cd ${srcdir}/${pkgname%-git}
  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd ${srcdir}/${pkgname%-git}

  # remove bundled headers and libraries
  rm -fr meshlab/src/external/{inc,lib}

  msg "truncate external lib"
  patch -Np1 -i ../external.patch
  msg "fix rpath"
  patch -Np1 -i ../rpath.patch
  msg "fix meshalbserver missing -lGLU"
  patch -Np1 -i ../meshlabserver_GLU.patch
  msg "using system mpir lib"
  patch -Np1 -i ../mpir.patch
  msg "using system muparser lib"
  patch -Np1 -i ../muparser.patch
  msg "using system levmar lib"
  patch -Np1 -i ../levmar.patch
  msg "using system 3ds lib"
  patch -Np1 -i ../3ds.patch
  msg "put plugins in /usr/lib/mashlab"
  patch -Np1 -i ../plugin_dir.patch
  msg "put shaders in /usr/shade/meshlab"
  patch -Np1 -i ../shaders_dir.patch
  msg "qt(5.11) compatibility"
  patch -Np1 -i ../qt5.11.patch
  cd ${srcdir}/vcglib
  msg "fix import bundler/nvm"
  patch -Np1 -i ../import_bundle_out.patch
}

build() {
  cd "${srcdir}/meshlab/src"

  msg "build external libraries"
  cd external
  qmake external.pro -r 
  make

  msg "build meshlab"
  cd ..
  qmake meshlab_full.pro -r 
  make
}

package() {
  cd ${srcdir}/meshlab/src/distrib

  # install meshlab
  install -d -m755 ${pkgdir}/usr/bin
  install -d -m755 ${pkgdir}/usr/lib/meshlab
  install -d -m755 ${pkgdir}/usr/share/meshlab
  install -t ${pkgdir}/usr/bin meshlab*
  install -t ${pkgdir}/usr/lib/meshlab libcommon*

  cp -a plugins  ${pkgdir}/usr/lib/meshlab 
  cp -a shaders  ${pkgdir}/usr/share/meshlab
  cp -a textures ${pkgdir}/usr/share/meshlab
  cp -a sample   ${pkgdir}/usr/share/meshlab

  # install man pages
  install -d -m755 "${pkgdir}/usr/share/man/man1"
  install -m644 "${srcdir}/meshlab/docs/meshlab.1" "${pkgdir}"/usr/share/man/man1
  install -m644 "${srcdir}/meshlab/docs/meshlabserver.1" "${pkgdir}"/usr/share/man/man1

  # install icons
  install -d -m755 "${pkgdir}/usr/share/pixmaps"
  install -m644 "${srcdir}/meshlab/src/meshlab/images/eye_cropped.png" "${pkgdir}/usr/share/pixmaps/meshlab.png"

  # install desktop entry
  install -d -m755 "${pkgdir}/usr/share/applications"
  install -m644 "${srcdir}/meshlab.desktop" "${pkgdir}/usr/share/applications"
  sed -i "s#Version=.*#Version=$pkgver#" "${pkgdir}/usr/share/applications/meshlab.desktop"
  
  # add xml symlinks to propper show info in "help>plugin info" dialog
  cd ${pkgdir}/usr/lib/meshlab/plugins
  for xml in *.xml ; do ln -s $xml lib${xml} ; done
}

# vim:set ts=2 sw=2 et: