zagband: use mkDerivation

This commit is contained in:
Robin Gloster 2016-01-25 23:31:20 +00:00
parent a44d003502
commit 2ac5b56135
2 changed files with 23 additions and 22 deletions

View File

@ -1,35 +1,40 @@
a @ { ncurses, flex, bison, autoconf, automake, m4, coreutils, ... } :
let
fetchurl = a.fetchurl;
{ stdenv, fetchurl, ncurses, flex, bison, autoconf, automake, m4, coreutils }:
stdenv.mkDerivation rec {
name = "zangband-${version}";
version = "2.7.3";
version = a.lib.attrByPath ["version"] "2.7.3" a;
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 = [];
buildInputs = [
ncurses flex bison autoconf automake m4
];
preConfigure = a.fullDepEntry (''
# fails during chmod due to broken permissions
dontMakeSourcesWritable = true;
postUnpack = ''
chmod a+rwX -R .
'';
preConfigure = ''
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
'';
preInstall = ''
mkdir -p $out/share/games/zangband
mkdir -p $out/share/man
mkdir -p $out/bin
'') ["minInit" "doUnpack" "addInputs" "defEnsureDir"];
'';
postInstall = a.fullDepEntry (''
postInstall = ''
mv $out/bin/zangband $out/bin/.zangband.real
echo '#! /bin/sh
PATH="$PATH:${a.coreutils}/bin"
PATH="$PATH:${coreutils}/bin"
ZANGBAND_PATH="$HOME/.zangband"
ORIG_PATH="'$out'"/share/games/zangband
@ -49,14 +54,10 @@ rec {
"'$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"];
name = "zangband-" + version;
meta = {
description = "rogue-like game";
license = a.lib.licenses.unfree;
license = stdenv.lib.licenses.unfree;
};
}

View File

@ -14554,7 +14554,7 @@ let
zandronum-bin = callPackage ../games/zandronum/bin.nix { };
zangband = builderDefsPackage (callPackage ../games/zangband) {};
zangband = callPackage ../games/zangband { };
zdoom = callPackage ../games/zdoom { };