summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0dfa40437c94e0dcc4acc30162dfe5d4f6530191 (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
# Maintainer: sum01 <sum01@protonmail.com>
pkgname=serious-engine-git
pkgver=r480.698af6d
_srcname="Serious-Engine"
pkgrel=1
pkgdesc="A game engine developed by Croteam for the classic Serious Sam games."
arch=('i686' 'x86_64')
url="https://github.com/ptitSeb/Serious-Engine"
license=('GPL2')
depends=('sdl2' 'python' 'bash')
makedepends=('cmake' 'make' 'sed' 'git' 'flex' 'bison' 'libogg')
source=("git+https://github.com/ptitSeb/Serious-Engine.git")
sha512sums=('SKIP')
if [[ $CARCH = "i686" ]]; then
  _bits="32"
else
  _bits="64"
fi

pkgver(){
  cd "$srcdir/$_srcname"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare(){
  cd "$srcdir/$_srcname/Sources/"
  sed -i 's/cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo/cmake -DCMAKE_BUILD_TYPE=Release/g' build-linux$_bits.sh
  sed 's/cmake -DCMAKE_BUILD_TYPE=Release/cmake -DTFE=TRUE -DCMAKE_BUILD_TYPE=Release/g' build-linux$_bits.sh > build-linux$_bits-tfe.sh
  chmod 755 "build-linux$_bits-tfe.sh"
}

build(){
  cd "$srcdir/$_srcname/Sources/"
  ./build-linux$_bits.sh
  cp cmake-build/ssam ../Bin/
  cp cmake-build/Debug/* ../Bin/
  rm -rf cmake-build
  ./build-linux$_bits.sh -DTFE=TRUE
  cp cmake-build/ssam-tfe ../Bin/
  cp cmake-build/Debug/* ../Bin/
}

package(){
  mkdir -p "$pkgdir"/usr/{bin,share}/
  mv "$srcdir/$_srcname" "$pkgdir/usr/share/$pkgname"
  ln -s /usr/share/$pkgname/Bin/ssam "$pkgdir/usr/bin/ssam"
  ln -s /usr/share/$pkgname/Bin/ssam-tfe "$pkgdir/usr/bin/ssam-tfe"
}