summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 355c151f5d6a061b8ac21bed40797864e12bb4b7 (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
# Maintainer: Christian Krause ("wookietreiber") <christian.krause@mailbox.org>
# Maintainer: Alberto Ronzani ("albron") <alberto.ronzani@gmail.com>
# shellcheck disable=2034
# shellcheck disable=2148

pkgname=dfhack
pkgver=0.47.04
_pkgver=$pkgver-r3
pkgrel=5
pkgdesc="memory hacking library for Dwarf Fortress and a set of tools that use it"
arch=('x86_64' 'i686')
url="https://dfhack.readthedocs.io/en/stable/"
license=('custom')
depends=("dwarffortress=$pkgver" lua protobuf libpng12 libxrandr libjpeg6 freetype2 libglvnd libxcursor libxinerama)
makedepends=('cmake' 'git' 'python-sphinx' 'perl-xml-libxml' 'perl-xml-libxslt')
conflicts=('dfhack-bin' 'dfhack-git')

source=("$pkgname::git+https://github.com/DFHack/dfhack#tag=$_pkgver"
        dfhack.sh
        dfhack-run.sh)

md5sums=('SKIP'
         '81f5909c1a32391679f968e40f24d5ca'
         '3853c6f890d3541f710f2c4833a9e696')

prepare() {
  # shellcheck disable=2154
  cd "$srcdir"/$pkgname || exit 1

  git remote set-url origin https://github.com/DFHack/dfhack
  git submodule sync
  git submodule update --init
}

build() {
  cd "$srcdir"/$pkgname/build || exit 1

  cmake \
    -DCMAKE_INSTALL_PREFIX=/opt/dwarffortress \
    -DCMAKE_BUILD_TYPE=Release \
    -DBUILD_DOCS=ON \
    -DBUILD_STONESENSE=ON \
    -DDFHACK_BUILD_ARCH=64 \
    ..

  make
}

package() {
  cd "$srcdir"/$pkgname/build || exit 1

  # shellcheck disable=2154
  make DESTDIR="$pkgdir" install

  install -Dm755 "$srcdir"/dfhack.sh     "$pkgdir"/usr/bin/dfhack
  install -Dm755 "$srcdir"/dfhack-run.sh "$pkgdir"/usr/bin/dfhack-run

  install -Dm644 ../LICENSE.rst "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}