summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a75f4888261adc8663cc7a6bec0e0371eed2df4c (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
# Maintainer: carstene1ns <arch carsten-teibes de> - http://git.io/ctPKG
# Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>

pkgname=mars-shooter-git
pkgver=0.7.4.r7.c855d04
pkgrel=1
pkgdesc="A ridiculous space shooter with nice graphics (development version)"
arch=('i686' 'x86_64')
url="http://mars-game.sourceforge.net/"
license=('custom' 'GPL')
install=mars.install
depends=('sfml' 'taglib' 'fribidi' 'hicolor-icon-theme')
makedepends=('cmake' 'git')
provides=('mars-shooter')
conflicts=('mars-shooter')
source=(mars-shooter::"git+https://github.com/thelaui/M.A.R.S..git"
        mars-fribidi.patch
        mars-shader.patch::"https://github.com/thelaui/M.A.R.S./pull/2.patch"
        mars-noglu.patch::"https://github.com/thelaui/M.A.R.S./pull/17.patch"
        mars-archinstall.patch)
sha256sums=('SKIP'
            '6fb105bd6c7f0b3c35bedc13240e1b1f9ad37bb5b4b1328438532b4f40e19c6e'
            '2cb61532d94eb68100ddf24888c513a06ef44c32fc867a3b20dfd901d0a0b1d2'
            '729fb013fe4ad95e2a15e59bf1ce94eddc3fc42f942253522a9e7b041e052664'
            'd33d6cd40bf6b2846c069524ed3344e2f4c3afe373e89c74d3e4888d63e2261a')

pkgver() {
  cd mars-shooter
  # todo: remove hardcoded version number (when proper tags are in repo)
  printf "0.7.4.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  # reset build dir
  rm -rf build
  mkdir build

  cd mars-shooter
  # add include dir of fribidi
  patch -Np1 < ../mars-fribidi.patch
  # fix use of sfml2 shader
  patch -Np1 < ../mars-shader.patch
  # remove glu dependency
  patch -Np1 < ../mars-noglu.patch
  # fix install target
  patch -Np0 < ../mars-archinstall.patch
  # fix executable name in and remove mimetype from launcher
  sed 's/Exec=mars$/&-shooter/;/MimeType=.*/d' -i resources/mars.desktop
}

build() {
  cd build

  cmake ../mars-shooter -DCMAKE_INSTALL_PREFIX=/usr
  make
}

package() {
  cd build
  make DESTDIR="$pkgdir" install

  # rename executable
  mv "$pkgdir"/usr/bin/mars "$pkgdir"/usr/bin/mars-shooter
}