summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: eec95b5859e3c649bd44a5d2e0e27cb939ca3697 (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
# Maintainer: Chirantan Ekbote <chirantan.ekbote at gmail.com>
# Contributor: Brian Schubert <bewschubert@gmail.com>

_build_doc=ON
_build_apps=ON
pkgname=openmesh
pkgver=8.0
pkgrel=1
pkgdesc="A generic and efficient data structure for representing and manipulating polygonal meshes"
arch=('i686' 'x86_64')
url="http://www.openmesh.org"
license=('BSD')
depends=('mesa')
optdepends=('qt5-base: for using included applications')
source=("${pkgname}-${pkgver}.tar.bz2::http://www.openmesh.org/media/Releases/${pkgver}/OpenMesh-${pkgver}.tar.bz2"
    doc-install.patch)
sha256sums=('f3311232d3611847c523bd4792ce8700f7ec81e9e1ff2a4bdda18eac70577d33'
            'cedf4ab2e6349caba7e899b5462643435bb42d7e70c6231e582f056ddf7bf41b')

if [[ "${_build_doc}" == "ON" && "${_build_apps}" == "ON" ]]; then
    makedepends=('cmake' 'qt5-base' 'graphviz' 'doxygen')
elif [[ "${_build_doc}" == "ON" ]]; then
    makedepends=('cmake' 'graphviz' 'doxygen')
elif [[ "${_build_apps}" == "ON" ]]; then
    makedepends=('cmake' 'qt5-base')
else
    makedepends=('cmake')
fi

prepare() {
  cd "${srcdir}/OpenMesh-${pkgver}"
    if [[ "${_build_doc}" == "ON" ]]; then
	patch -Np1 -i "${srcdir}"/doc-install.patch
    fi
}

build() {
    cd "${srcdir}/OpenMesh-${pkgver}"
    mkdir -p build && cd build
    cmake \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DBUILD_APPS=${_build_apps} \
        ..
    make

    if [[ "${_build_doc}" == "ON" ]]; then
	make doc
    fi
}

package() {
    cd "${srcdir}"/OpenMesh-${pkgver}/build
    make DESTDIR="${pkgdir}" install
    
    # install licenses
    mkdir -p "${pkgdir}"/usr/share/licenses/openmesh/
    install -D -m644 ../LICENSE \
        "${pkgdir}"/usr/share/licenses/openmesh/
}