2014-11-06 01:44:33 +01:00
|
|
|
a :
|
|
|
|
let
|
2009-05-12 06:26:52 +02:00
|
|
|
fetchurl = a.fetchurl;
|
|
|
|
|
2014-11-06 01:44:33 +01:00
|
|
|
version = a.lib.attrByPath ["version"] "2.7.3" a;
|
2009-05-12 06:26:52 +02:00
|
|
|
buildInputs = with a; [
|
|
|
|
ncurses flex bison autoconf automake m4
|
|
|
|
];
|
|
|
|
in
|
|
|
|
rec {
|
|
|
|
src = fetchurl {
|
|
|
|
url = "ftp://ftp.sunet.se/pub/games/Angband/Variant/ZAngband/zangband-${version}.tar.gz";
|
|
|
|
sha256 = "0654m8fzklsc8565sqdad76mxjsm1z9c280srq8863sd10af0bdq";
|
|
|
|
};
|
|
|
|
|
|
|
|
inherit buildInputs;
|
|
|
|
configureFlags = [];
|
|
|
|
|
2009-05-20 01:25:58 +02:00
|
|
|
preConfigure = a.fullDepEntry (''
|
2014-11-06 01:44:33 +01:00
|
|
|
chmod a+rwX -R .
|
2009-05-12 06:26:52 +02:00
|
|
|
sed -re 's/ch(own|grp|mod)/true/' -i lib/*/makefile.zb makefile.in
|
|
|
|
sed -e '/FIXED_PATHS/d' -i src/z-config.h
|
|
|
|
./bootstrap
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p $out/share/games/zangband
|
|
|
|
mkdir -p $out/share/man
|
|
|
|
mkdir -p $out/bin
|
2009-05-12 06:26:52 +02:00
|
|
|
'') ["minInit" "doUnpack" "addInputs" "defEnsureDir"];
|
|
|
|
|
2009-05-20 01:25:58 +02:00
|
|
|
postInstall = a.fullDepEntry (''
|
2009-05-12 06:26:52 +02:00
|
|
|
mv $out/bin/zangband $out/bin/.zangband.real
|
|
|
|
echo '#! /bin/sh
|
2009-05-12 11:45:24 +02:00
|
|
|
PATH="$PATH:${a.coreutils}/bin"
|
2009-05-12 06:26:52 +02:00
|
|
|
|
|
|
|
ZANGBAND_PATH="$HOME/.zangband"
|
|
|
|
ORIG_PATH="'$out'"/share/games/zangband
|
|
|
|
mkdir -p "$ZANGBAND_PATH"
|
|
|
|
cd "$ZANGBAND_PATH"
|
|
|
|
for i in $(find "$ORIG_PATH" -type f); do
|
|
|
|
REL_PATH="''${i#$ORIG_PATH/}"
|
|
|
|
mkdir -p "$(dirname "$REL_PATH")"
|
|
|
|
ln -s "$i" "$REL_PATH" &>/dev/null
|
|
|
|
done
|
2009-05-12 19:27:00 +02:00
|
|
|
mkdir -p lib/user lib/save
|
2009-05-12 06:26:52 +02:00
|
|
|
for i in lib/*/*.raw; do
|
2014-11-06 01:44:33 +01:00
|
|
|
test -L "$i" && rm "$i";
|
2009-05-12 06:26:52 +02:00
|
|
|
done
|
2009-05-12 18:03:10 +02:00
|
|
|
for i in $(find lib -type l); do if ! test -e $(readlink "$i"); then rm "$i"; fi; done;
|
2009-05-12 06:26:52 +02:00
|
|
|
export ANGBAND_PATH="$PWD"
|
|
|
|
"'$out'/bin/.zangband.real" "$@"
|
|
|
|
' > $out/bin/zangband
|
|
|
|
chmod +x $out/bin/zangband
|
|
|
|
'') ["minInit" "doUnpack"];
|
|
|
|
|
|
|
|
/* doConfigure should be removed if not needed */
|
|
|
|
phaseNames = ["preConfigure" "doConfigure" "doMakeInstall" "postInstall"];
|
2014-11-06 01:44:33 +01:00
|
|
|
|
2009-05-12 06:26:52 +02:00
|
|
|
name = "zangband-" + version;
|
|
|
|
meta = {
|
|
|
|
description = "rogue-like game";
|
2014-11-06 01:44:33 +01:00
|
|
|
license = a.lib.licenses.unfree;
|
2009-05-12 06:26:52 +02:00
|
|
|
};
|
|
|
|
}
|