2021-01-15 05:31:39 +01:00
|
|
|
{ lib, stdenv, fetchurl, ncurses, flex, bison, autoconf, automake, m4, coreutils }:
|
2016-01-26 00:31:20 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2018-11-11 12:36:26 +01:00
|
|
|
pname = "zangband";
|
|
|
|
version = "2.7.4b";
|
2009-05-12 06:26:52 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 14:41:18 +02:00
|
|
|
url = "mirror://sourceforge/project/${pname}/${pname}-src/${version}/${pname}-${version}.tar.gz";
|
2018-11-11 12:36:26 +01:00
|
|
|
sha256 = "0kkz6f9myhjnr3308sdab8q186rd55lapvcp38w8qmakdbhc828j";
|
2009-05-12 06:26:52 +02:00
|
|
|
};
|
|
|
|
|
2022-03-31 03:11:06 +02:00
|
|
|
nativeBuildInputs = [ autoconf automake ];
|
2016-01-26 00:31:20 +01:00
|
|
|
buildInputs = [
|
2022-03-31 03:11:06 +02:00
|
|
|
ncurses flex bison m4
|
2016-01-26 00:31:20 +01:00
|
|
|
];
|
2009-05-12 06:26:52 +02:00
|
|
|
|
2016-01-26 00:31:20 +01:00
|
|
|
preConfigure = ''
|
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
|
2018-11-11 12:36:26 +01:00
|
|
|
autoconf
|
2016-01-26 00:31:20 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall = ''
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p $out/share/games/zangband
|
|
|
|
mkdir -p $out/share/man
|
|
|
|
mkdir -p $out/bin
|
2016-01-26 00:31:20 +01:00
|
|
|
'';
|
2009-05-12 06:26:52 +02:00
|
|
|
|
2016-01-26 00:31:20 +01:00
|
|
|
postInstall = ''
|
2009-05-12 06:26:52 +02:00
|
|
|
mv $out/bin/zangband $out/bin/.zangband.real
|
2019-01-15 23:41:31 +01:00
|
|
|
echo '#! ${stdenv.shell}
|
2016-01-26 00:31:20 +01:00
|
|
|
PATH="$PATH:${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/}"
|
2018-11-11 12:36:26 +01:00
|
|
|
mkdir -p "$(dirname "$REL_PATH")"
|
|
|
|
ln -s "$i" "$REL_PATH" &>/dev/null
|
2009-05-12 06:26:52 +02:00
|
|
|
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
|
2016-01-26 00:31:20 +01:00
|
|
|
'';
|
2014-11-06 01:44:33 +01:00
|
|
|
|
2009-05-12 06:26:52 +02:00
|
|
|
meta = {
|
2016-06-20 12:53:46 +02:00
|
|
|
description = "Rogue-like game";
|
2021-01-15 05:31:39 +01:00
|
|
|
license = lib.licenses.unfree;
|
2018-11-11 12:36:26 +01:00
|
|
|
broken = true; # broken in runtime, will not get pass character generation
|
2009-05-12 06:26:52 +02:00
|
|
|
};
|
|
|
|
}
|