aboutsummaryrefslogtreecommitdiffstats
path: root/testing/irrlicht/APKBUILD
blob: 96442ac50a949957ab8c3ab6a97e89b48adfad30 (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
# Maintainer: Jeff Bilyk <jbilyk@alpinelinux.org>
pkgname=irrlicht
pkgver=1.7.2
pkgrel=0
pkgdesc="3D graphics engine"
url="http://irrlicht.sourceforge.net"
arch="all"
license="ZLIB"
depends=
depends_dev="mesa-dev jpeg-dev bzip2 libpng-dev zlib-dev"
makedepends="$depends_dev"
install=""
source="http://downloads.sourceforge.net/irrlicht/irrlicht-$pkgver.zip"

_builddir="$srcdir"/$pkgname-$pkgver/source/Irrlicht
prepare() {
       local i
       cd "$_builddir"
       for i in $source; do
               case $i in
               *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
               esac
       done
}

build() {
       cd "$_builddir"
       make sharedlib || return 1
       make || return 1

       #from arch pkgbuild: example build helper
       ln -s libIrrlicht.so.$pkgver "$srcdir"/$pkgname-$pkgver/lib/Linux/libIrrlicht.so

       cd ../../examples
       # Fix examples building
       sed -i '/define USE_IRRKLANG/s:.*://&:' ./Demo/CDemo.h
       make || return 1
}

package() {
       cd "$_builddir"

       mkdir -p "$pkgdir"/usr/lib
       mkdir -p "$pkgdir"/usr/share/licenses/$pkgname
       mkdir -p "$pkgdir"/usr/share/$pkgname/examples/bin
       mkdir -p "$pkgdir"/usr/share/doc/$pkgname
       mkdir -p "$pkgdir"/usr/include/$pkgname/include

       make INSTALL_DIR="$pkgdir" install || return 1

       cd ../..
       install -m644 readme.txt "$pkgdir"/usr/share/licenses/$pkgname

       #from arch pkgbuild: install static library and fix perms
       install -m644 lib/Linux/libIrrlicht.a "$pkgdir"/usr/lib

       #from arch pkgbuild: install media file examples
       cp -r media "$pkgdir"/usr/share/$pkgname

       #from arch pkgbuild: install docs
       cp -r doc/* "$pkgdir"/usr/share/doc/$pkgname
       rm -f "$pkgdir"/usr/share/doc/$pkgname/*.txt

       cd "$pkgdir"/usr/lib
       mv ../../libIrrlicht* ./
       ln -s libIrrlicht.so.$pkgver libIrrlicht.so.1

       mv "$pkgdir"/../include/* "$pkgdir"/usr/include/$pkgname/include/
       rm -rf "$pkgdir"/../include/

       install -m755 "$srcdir"/$pkgname-$pkgver/bin/Linux/* "$pkgdir"/usr/share/$pkgname/examples/bin/
}

md5sums="eb627d4c432bf73f12bc6d9ddc700b07  irrlicht-1.7.2.zip"