summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6a125bd355a3f0b6175e1a5b37ce5b3528ce1a0a (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
#!/usr/hint/bash
# Maintainer : bartus <arch-user-repoᘓbartus.33mail.com>
# shellcheck disable=SC2034,SC2154 # allow unused/uninitialized variables.

#Todo:
#* add external cmake projects to source array and patch src/externla/*.cmake
#* use system wide: levmar, libigl, qhull, structyresynth, libe57, u3d, tinygltf

#Configuration:
#Use: makepkg VAR1=0 VAR2=1 to enable(1) disable(0) a feature
#Use: {yay,paru} --mflags=VAR1=0,VAR2=1
#Use: aurutils --margs=VAR1=0,VAR2=1
#Use: VAR1=0 VAR2=1 pamac

# Use FRAGMENT={commit,tag,brach}=xxx for bisect build
_fragment="#${FRAGMENT:-branch=main}"

# Use CMAKE_FLAGS=xxx:yyy:zzz to define extra CMake flags
[[ -v CMAKE_FLAGS ]] && mapfile -t -d: _cmake_flags < <(echo -n "$CMAKE_FLAGS")

_name="meshlab"
pkgname="$_name-git"
pkgver=2023.12.r7.gdfb630012
pkgrel=1
pkgdesc="System for processing and editing of unstructured 3D models arising in 3D scanning (qt5 version)"
arch=('i686' 'x86_64')
url="https://www.meshlab.net"
conflicts=('meshlab')
provides=('meshlab')
license=('GPL2')
depends=(
    'bzip2' 'cgal' 'glew' 'glu' 'openssl' 'qt5-base' 'qt5-declarative' 'qt5-script' 'qt5-xmlpatterns' 'xerces-c'
    'gmp' 'mpfr' 'mesa' 'qhull'
)
makedepends=('boost' 'cmake' 'eigen' 'ninja' 'git' 'muparser' 'lib3ds' 'openctm-tools' 'gcc12')
optdepends=('lib3ds: for Autodesk`s 3D-Studio r3 and r4 .3DS file support'
            'muparser: for filer_func plugins'
            'openctm-tools: for compressed triangle mesh file format')
source=(
    "$_name::git+https://github.com/cnr-isti-vclab/meshlab.git${_fragment}"
)
sha256sums=('SKIP')

prepare() {
  prepare_submodule
}

pkgver() {
  git -C "${srcdir}/${_name}" describe --long --tags --match "MeshLab-[0-9.]*"| sed 's/MeshLab-//g;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  _cmake_flags+=( '-DCMAKE_INSTALL_PREFIX=/usr'
                  '-DCMAKE_BUILD_TYPE=Release'
                  '-DCMAKE_C_COMPILER=gcc-12'
                  '-DCMAKE_CXX_COMPILER=g++-12'
                )
  cmake "${_cmake_flags[@]}" -G Ninja -B "${srcdir}/build" -S "${srcdir}/meshlab"
  ninja ${MAKEFLAGS:--j1} -C "${srcdir}/build"
}

package() {
  DESTDIR="$pkgdir" ninja -C "${srcdir}/build" install
}

# Generated with git_submodule_PKGBUILD_conf.sh ( https://gist.github.com/bartoszek/41a3bfb707f1b258de061f75b109042b )
# Call prepare_submodule in prepare() function

prepare_submodule() {
  git -C "$srcdir/meshlab" -c protocol.file.allow=always submodule update --init
}

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