summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ccc6c6ef6ac014a4d70f104e8174f3be2ed36d50 (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
# Maintainer: SanskritFritz (gmail)
# Maintainer: Laurent Carlier <lordheavym@gmail.com>
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Arkham <arkham at archlinux dot us>
# Contributor: rabyte <rabyte*gmail>
# Contributor: Andres Blanc <andresblanc@gmail.com>

pkgname=egoboo
pkgver=2.8.1
pkgrel=5
arch=('i686' 'x86_64')
license=('GPL')
pkgdesc="An action RPG/dungeon crawling adventure with OpenGL 3D graphics."
url="http://egoboo.sourceforge.net/"
depends=('sdl_image' 'sdl_mixer' 'sdl_ttf' 'physfs' 'enet' 'mesa')
#makedepends=('sdl_image' 'sdl_mixer' 'sdl_ttf' 'physfs' 'enet' 'mesa')
conflicts=(egoboo-data)
source=("http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz"
        "keyboard_directions.patch"
        "$pkgname.png"
        "$pkgname.desktop")

build() {
    cd "$srcdir/egoboo-$pkgver"

    # Patch default depth to 24 and sound
    sed -i -e 's/\[COLOR_DEPTH\] : "32"/\[COLOR_DEPTH\] : "24"/g' \
        -e 's/\[Z_DEPTH\] : "32"/\[Z_DEPTH\] : "24"/g' \
        -e 's/\[OUTPUT_BUFFER_SIZE\] : "2548/\[OUTPUT_BUFFER_SIZE\] : "2048/g' \
        setup.txt

    cd "$srcdir/egoboo-$pkgver/src"

    # fix data paths
    sed -i -e 's#egoboo-2.x#egoboo#g' \
        -e 's#share/games#share#g' \
        -e 's#etc#share#g' \
        -e 's#games#bin#g' \
        game/platform/file_linux.c

    # fix linking
    sed -i -e 's#-lenet#-lenet -lm#g' game/Makefile

    # fix keyboard bug
    patch -p0 --binary < "$srcdir/keyboard_directions.patch"

    make all
}

package() {

    cd "$srcdir/egoboo-$pkgver"

    install -Dm755 src/game/egoboo-2.x $pkgdir/usr/bin/egoboo
    install -d $pkgdir/usr/share/doc
    cp -rf doc/ $pkgdir/usr/share/doc/$pkgname/

    # Copy data and fix permissions
    install -d ${pkgdir}/usr/share/egoboo
    cp -rf controls.txt setup.txt basicdat/ modules/ ${pkgdir}/usr/share/egoboo/
    find ${pkgdir}/usr/share/egoboo -type f -exec chmod 644 {} +

    # Install icon and desktop files
    install -Dm 644 $srcdir/$pkgname.png $pkgdir/usr/share/pixmaps/$pkgname.png
    install -Dm 644 $srcdir/$pkgname.desktop $pkgdir/usr/share/applications/$pkgname.desktop
}

md5sums=('e6f3130695d297dcd9fe74e50bd59b68'
         'd3eea226065d9a244b59cd960c5c8878'
         '7019f17b607fd45acf0d48ade746326a'
         'b81e0c8f3e0b9d8640d0cfc9b6d320a8')