summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 430bbd8d1ee29c414d6e64e3cc9862cfb2daf5b7 (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
# Maintainer: Lone_Wolf <lone_wolf@klaas-de-kat.nl>
# Contributor: Michael Fitzmayer <mail@michael-fitzmayer.de>
pkgname=openscenegraph-openmw-git
epoch=1
_pkgver=3.6.5
pkgver=3.6.5.r16171.68c5c573d
pkgrel=2
pkgdesc="Fork of OpenSceneGraph , with openmw-specific changes"
arch=('x86_64' 'aarch64')
url="http://www.openscenegraph.org/"
license=('custom:OSGPL')
depends=('libglvnd' 'fontconfig' 'libxinerama' 'libxrandr' 'collada-dom' 
                    'freetype2' 'glibc' 'libjpeg-turbo' 'libpng' 'gcc-libs' 'zlib' 'libx11')
makedepends=('git' 'cmake')
provides=('openscenegraph')
conflicts=('openscenegraph')
source=('git+https://github.com/OpenMW/osg.git')
md5sums=('SKIP')
options=(debug strip)

pkgver() {
    cd osg
    printf "%s.r%s.%s" "${_pkgver}" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
    # a slightly adjusted version of the example in wiki usable when upstream doesn't provide useful tags
}

build() {

    # Build only minimal debug info to reduce size
    CFLAGS=${CFLAGS/-g /-g1 }
    CXXFLAGS=${CXXFLAGS/-g /-g1 }

    cmake \
        -B _build \
        -S "$srcdir"/osg \
        -D CMAKE_INSTALL_PREFIX=/usr \
        -D CMAKE_BUILD_TYPE=Release \
        -D BUILD_OSG_APPLICATIONS=OFF \
        -D BUILD_OSG_DEPRECATED_SERIALIZERS=OFF \
        -D OSG_FIND_3RD_PARTY_DEPS=OFF \
        -D BUILD_OSG_PLUGINS_BY_DEFAULT=OFF \
        -D BUILD_OSG_PLUGIN_BMP=ON \
        -D BUILD_OSG_PLUGIN_DAE=ON \
        -D BUILD_OSG_PLUGIN_DDS=ON \
        -D BUILD_OSG_PLUGIN_FREETYPE=ON \
        -D BUILD_OSG_PLUGIN_JPEG=ON \
        -D BUILD_OSG_PLUGIN_KTX=ON \
        -D BUILD_OSG_PLUGIN_OSG=ON \
        -D BUILD_OSG_PLUGIN_PNG=1 \
        -D BUILD_OSG_PLUGIN_TGA=1 \
        -D OSG_USE_FLOAT_MATRIX=OFF \
        -D OSG_USE_FLOAT_PLANE=OFF \
        -D OSG_USE_FLOAT_QUAT=OFF \
        -D OPENGL_PROFILE="GL2" \
        -D BUILD_SHARED_LIBS=ON \
        -D DYNAMIC_OPENTHREADS=ON \
        -D DYNAMIC_OPENSCENEGRAPH=ON \
       -Wno-dev

    VERBOSE=1 make -C _build
}

package(){
    make -C _build DESTDIR="${pkgdir}" install
    install -Dm 644 $srcdir/osg/LICENSE.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
}