summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d6977e8e94730ca064bb4eb602bd8cfec98f9182 (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
# Maintainer: carstene1ns <arch carsten-teibes de> - http://git.io/ctPKG
# Contributor: Fernando Carmona Varo <ferkiwi @t gmail dot com>
# Contributor: BenObiWan <benobiwan @t gmail dot com>

pkgname=solarus-git
pkgver=1.5.0.r81.gd0601b4
pkgrel=1
pkgdesc="An open-source Zelda-like 2D game engine used by the games zsxd and zsdx (development version)"
arch=('i686' 'x86_64')
url="http://www.solarus-engine.org/"
license=('GPL3')
depends=('sdl2_image' 'sdl2_ttf' 'luajit' 'physfs' 'openal' 'libmodplug' 'libvorbis')
makedepends=('git' 'cmake')
optdepends=('zsxd-git: Free 2D Zelda fangame Quest'
            'zsdx-git: Free 2D Zelda fangame Quest with humoristic characters')
provides=('solarus-engine' 'solarus')
conflicts=('solarus')
source=($pkgname::'git+https://github.com/christopho/solarus.git')
md5sums=('SKIP')

pkgver() {
  cd $pkgname
  local _tag=$(git tag -l 'v*' | sort -r | head -n1 | tr -cd 0-9.)
  local _rev=$(git rev-list --count v${_tag}..HEAD)
  local _hash=$(git rev-parse --short HEAD)
  printf "%s.r%s.g%s" "$_tag" "$_rev" "$_hash"  
}

prepare() {
  cd $pkgname

  rm -rf build
  mkdir build
}

build() {
  cd $pkgname/build

  cmake .. -DCMAKE_INSTALL_PREFIX="/usr" -DCMAKE_BUILD_TYPE=Release
  make
}

check() {
  make -C $pkgname/build test
}

package() {
  make -C $pkgname/build DESTDIR="$pkgdir/" install
}