archrelease: copy trunk to community-any
[ArchLinux/community.git] / wesnoth / repos / community-x86_64 / PKGBUILD
blobab23747e95b17606f641cee015074122fb134534
1 # Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
2 # Contributor: Jan de Groot <jgc@archlinux.org>
3 # Contributor: Tobias Powalowski <tpowa@archlinux.org>
4 # Contributor: Jacobo Arvelo <unix4all@ya.com>
5 # Contributor: Douglas Soares de Andrade <douglas@archlinux.org>
7 pkgname=wesnoth
8 # NOTE: Odd minor versions are unstable! Do not package those.
9 pkgver=1.16.9
10 epoch=1
11 pkgrel=1
12 pkgdesc="A turn-based strategy game on a fantasy world"
13 arch=('x86_64')
14 license=('GPL')
15 url="https://www.wesnoth.org/"
16 depends=('sdl2_mixer' 'sdl2_image' 'boost-libs' 'pango' 'dbus')
17 makedepends=('boost' 'cmake' 'git' 'ninja')
18 replaces=('wesnoth-data')
19 options=(!emptydirs)
20 source=("git+https://github.com/wesnoth/wesnoth.git#tag=${pkgver}")
21 sha512sums=('SKIP')
23 build() {
24   cd "$pkgname"
26   cmake \
27       -GNinja \
28       -Bbuild \
29       -DCMAKE_INSTALL_PREFIX=/usr \
30       -DENABLE_TOOLS=ON \
31       -DFIFO_DIR=/run/wesnothd \
32       -DENABLE_DISPLAY_REVISION=OFF
33   ninja -C build
36 package() {
37   cd "$pkgname"
39   DESTDIR="$pkgdir" ninja -C build install
41   # See https://forums.wesnoth.org/viewtopic.php?t=51038
42   echo "Linux repository" > "$pkgdir"/usr/share/wesnoth/data/dist
44   mkdir -p "$pkgdir"/usr/lib/{tmpfiles.d,systemd/system}
45   sed "s|@FIFO_DIR@|/run/wesnothd|" packaging/systemd/wesnothd.tmpfiles.conf.in > "$pkgdir"/usr/lib/tmpfiles.d/wesnothd.conf
46   sed -e "s|@FIFO_DIR@|/run/wesnothd|" -e "s|@BINARY_SUFFIX@||" -e "s|@CMAKE_INSTALL_FULL_BINDIR@|/usr/bin|" packaging/systemd/wesnothd.service.in > "$pkgdir"/usr/lib/systemd/system/wesnothd.service