summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e07218c2a68c3ef4266c9de9a1bc508d6799dd00 (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: Pellegrino Prevete <pellegrinoprevete@gmail.com>
# Contributor: Sam S. <smls75@gmail.com>

pkgbase="proteus"
_app_id="com.twistedtreegames.${pkgbase}"
pkgname="${pkgbase}"
pkgver=1.2+h20140516
_hibver=05162014
_installer="${pkgname}-${_hibver}-bin"
pkgrel=1
pkgdesc='An audio-visual exploration game (Humble Bundle version)'
url='http://www.visitproteus.com/'
arch=('x86_64' 'i686')
license=('custom:commercial')
makedepends=('ipfs-dlagent')
depends=('sdl2' 'sdl2_image' 'sdl2_mixer' 'glu' 'alsa-lib' 'libogg' 'libvorbis')
provides=("${pkgname}-hib")
options=(
  '!strip'
  # '!upx'
)
PKGEXT='.pkg.tar.gz'
DLAGENTS+=(
  'hib::/usr/bin/echo "Could not find %u. Manually download it to \"$(pwd)\", or set up a hib:// DLAGENT in /etc/makepkg.conf."; exit 1'
  'ipfs::/usr/bin/echo "Could not find %u. Manually download it to \"$(pwd)\", or set up a ipfs:// DLAGENT in /etc/makepkg.conf."; exit 1'
)
source=(
  # "hib://${_installer}"
  "${_installer}::ipfs://Qmdkx5nZpu7vto3yyxGgCLSd3pwdbpc7uEFUpn71SPMiYb"
  "${pkgname}.desktop"
)
sha256sums=('86bc532ee9562e2699ac56efc48b4f6674afe378c09ca4c2da8c9e52a0b54343'
            '5e340f06ae64d419aaa206cf1fe172a620fa779f49f1cf51b7e5bf74d6c2abd8')

package() {
  cd "$srcdir"
  _target="/usr/games/${_app_id}"
  [ $CARCH == i686 ] && { _lib=lib   ; _other=lib64 ; _arch=x86    ;} \
                     || { _lib=lib64 ; _other=lib   ; _arch=x86_64 ;}
  
  # Install game files
  mkdir -p "${pkgdir}/${_target}"
  cp -Tal data "${pkgdir}/${_target}"
  
  # Remove bundled libraries (use distro versions instead)
  ( cd "${pkgdir}/${_target}/${_lib}"
    rm -r libSDL2-2.0.so.0 libSDL2_image-2.0.so.0 libSDL2_mixer-2.0.so.0 \
          libvorbis.so.0 libvorbisfile.so.3 libogg.so.0 ../$_other )
  
  # Install desktop entry
  install -Dm644 "$pkgname.desktop" \
                 "$pkgdir/usr/share/applications/${pkgname}.desktop"
  
  # Install icon
  install -Dm644 data/Proteus.png "${pkgdir}/usr/share/pixmaps/proteus.png"
  
  # Install launch script
  echo -e "#!/bin/sh\ncd ${_target} && TERM=xterm ./Proteus.bin.${_arch}" > launcher.sh
  install -Dm755 launcher.sh "${pkgdir}/usr/bin/proteus"
}