# Maintainer: Jan Alexander Steffens (heftig) # Contributor: Ivy Foster # Contributor: Jakob Gruber pkgbase=crawl-git pkgname=( crawl-data-git crawl-ncurses-git crawl-tiles-git ) pkgver=0.33a0+527+gae92cfba07 pkgrel=1 pkgdesc="Dungeon Crawl Stone Soup: open-source, single-player, role-playing \ roguelike game of exploration and treasure-hunting" url="https://crawl.develz.org/" license=(GPL-2.0-or-later) arch=(x86_64) depends=( gcc-libs glibc hicolor-icon-theme lua51 sqlite zlib ) _ncurses_depends=( ncurses ) _tiles_depends=( freetype2 glu libglvnd sdl2 sdl2_image sdl2_mixer ttf-dejavu ) makedepends=( "${_ncurses_depends[@]}" "${_tiles_depends[@]}" bison flex git imagemagick mesa perl pngcrush python-yaml ) source=("git+https://github.com/crawl/crawl") b2sums=('SKIP') pkgver() { git -C crawl describe --long | sed -r 's/^([^-]+)(-([^-]+))?-([0-9]+)-(g.*)$/\1\3+\4+\5/' } prepare() { cp -a crawl crawl-tiles } _make() { local make_options=( # Don't let Makefile override our optimization with -O0 # https://github.com/crawl/crawl/issues/4152 # https://github.com/crawl/crawl/issues/4156 CFOPTIMIZE= EXTERNAL_FLAGS="$CXXFLAGS" EXTERNAL_LDFLAGS="$LDFLAGS" INSTALL_UGRP=root:root MCHMOD=755 NO_TRY_GOLD=1 NO_TRY_LLD=1 SOUND=1 STRIP=/usr/bin/true bin_prefix=bin prefix=/usr ) if [[ $1 == crawl-tiles ]]; then make_options+=( GAME=crawl-tiles TILES=y ) fi make -C "$1/crawl-ref/source" "${make_options[@]}" "${@:2}" } build() { _make crawl all _make crawl-tiles all } _pick() { local p="$1" f d; shift for f; do d="$srcdir/$p/${f#$pkgdir/}" mkdir -p "$(dirname "$d")" mv "$f" "$d" rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")" done } package_crawl-data-git() { pkgdesc+=" - game data" depends=() optdepends=( 'crawl-ncurses-git: ncurses user interface' 'crawl-tiles-git: graphical user interface' ) conflicts=(crawl-data) _make crawl DESTDIR="$pkgdir" install install-xdg-data _make crawl-tiles DESTDIR="$pkgdir" install install-xdg-data ( cd "$pkgdir" _pick ncurses usr/bin/crawl _pick ncurses usr/share/applications/org.develz.Crawl_console.* _pick ncurses usr/share/icons/hicolor/*/apps/org.develz.Crawl_console.* _pick ncurses usr/share/metainfo/org.develz.Crawl_console.* _pick tiles usr/bin/crawl-tiles usr/share/crawl/dat/tiles _pick tiles usr/share/applications/org.develz.Crawl_tiles.* _pick tiles usr/share/icons/hicolor/*/apps/org.develz.Crawl_tiles.* _pick tiles usr/share/metainfo/org.develz.Crawl_tiles.* ) install -Dm644 crawl/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname" } package_crawl-ncurses-git() { pkgdesc+=" - ncurses version (terminal)" depends+=( "crawl-data-git=$pkgver-$pkgrel" "${_ncurses_depends[@]}" ) conflicts=(crawl-ncurses) replaces=(crawl-git) mv ncurses/* "$pkgdir" install -Dm644 crawl/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname" } package_crawl-tiles-git() { pkgdesc+=" - graphical version (SDL)" depends+=( "crawl-data-git=$pkgver-$pkgrel" "${_tiles_depends[@]}" ) conflicts=(crawl-tiles) replaces=(crawl-git) mv tiles/* "$pkgdir" install -Dm644 crawl/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname" } # vim:set sw=2 sts=-1 et: