summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 20ae86e6904a66fd4427b592a18e5127a4c893f4 (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
pkgname=brlcad
pkgver=7.32.2
pkgrel=0
pkgdesc='An extensive 3D solid modeling system.'
url='https://brlcad.org'
license=('LGPL' 'BSD' 'custom:BDL')
arch=('i686' 'x86_64')
depends=('libgl' 'libxft' 'libxi')
makedepends=('cmake' 'ninja' 'subversion')
install="${pkgname}.install"
source=('build.patch' "${pkgname}-${pkgver}::svn+svn://svn.code.sf.net/p/${pkgname}/code/${pkgname}/tags/rel-${pkgver//./-}#revision=r78207")
sha256sums=('SKIP' 'SKIP')


_build_config='Release'
_pkgprefix="/opt/${pkgname}"


prepare() {
    patch --quiet --strip=0 "--directory=${srcdir}/${pkgname}-${pkgver}" \
        "--input=${srcdir}/build.patch"
}


build() {
    cmake \
        -G Ninja \
        -S "${srcdir}/${pkgname}-${pkgver}" \
        -B "${srcdir}/build" \
        -Wno-dev \
        "-DCMAKE_INSTALL_PREFIX=${_pkgprefix}" \
        "-DCMAKE_BUILD_TYPE=${_build_config}" \
        -DBUILD_STATIC_LIBS=OFF \
        -DBRLCAD_ENABLE_COMPILER_WARNINGS=OFF \
        -DBRLCAD_ENABLE_STRICT=OFF \
        -DBRLCAD_FLAGS_DEBUG=OFF \
        -DBRLCAD_BUNDLED_LIBS=BUNDLED \
        -DBRLCAD_FREETYPE=OFF \
        -DBRLCAD_PNG=OFF \
        -DBRLCAD_REGEX=OFF \
        -DBRLCAD_ZLIB=OFF \
        -DBRLCAD_ENABLE_OPENGL=ON \
        -DBRLCAD_ENABLE_QT=OFF

    cmake --build "${srcdir}/build" --config "${_build_config}"

    echo "export PATH=\"\$PATH:${_pkgprefix}/bin\"" \
        >"${srcdir}/build/${pkgname}.sh"
}


package() {
    cmake --install "${srcdir}/build" --config "${_build_config}" \
        --prefix "${pkgdir}${_pkgprefix}"

    install -D --mode=u=rw,go=r \
        "--target-directory=${pkgdir}/usr/share/licenses/${pkgname}" \
        "${srcdir}/build/share/doc/legal/"{bdl,bsd}.txt

    install -D --mode=u=rw,go=r \
        "--target-directory=${pkgdir}/etc/profile.d" \
        "${srcdir}/build/${pkgname}.sh"
}