summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5b5623a121d631cecd9fc7d8ec8f6d6c311cde42 (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
# Maintainer: Angelo Theodorou <encelo at gmail dot com>

pkgname=nctiledviewer-git
pkgver=r13.1027c4a
pkgrel=1
pkgdesc="A viewer for Tiled maps made with the nCine"
arch=('i686' 'x86_64')
url="http://ncine.github.io"
license=('MIT')
depends=('ncine')
makedepends=('git' 'cmake')
conflicts=('nctiledviewer')
provides=('nctiledviewer')
options=(!strip)
source=(
  'git+https://github.com/nCine/ncTiledViewer'
  'git+https://github.com/nCine/ncTiledViewer-data'
)
md5sums=(
  'SKIP'
  'SKIP'
)

pkgver() {
  cd "$srcdir/ncTiledViewer"
  ( set -o pipefail
    git describe --tags --long --exact-match 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

build() {
  mkdir -p build && cd build

  cmake ../ncTiledViewer\
        -DCMAKE_BUILD_TYPE=Release\
        -DCMAKE_PREFIX_PATH=/usr/lib/cmake/nCine\
        -DNCPROJECT_BUILD_ANDROID=OFF\
        -DNCPROJECT_STRIP_BINARIES=ON\
        -DCMAKE_INSTALL_PREFIX=/usr
  make
}

package() {
  make -C build DESTDIR=$pkgdir PREFIX= install
  install -Dm0644 $srcdir/ncTiledViewer/LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
}