diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2016-02-28 21:04:23 -0600 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2016-02-28 21:04:23 -0600 |
commit | 818f2cd19fcb0d450e2b0847b3dd3598007ba38a (patch) | |
tree | f0ed8826707b06095792540980189d91ea72532e /pkgs/games/nethack/default.nix | |
parent | a133ef9a0c866479d1b420549d4ce633e7b6f337 (diff) |
nethack: fix darwin support
Diffstat (limited to 'pkgs/games/nethack/default.nix')
-rw-r--r-- | pkgs/games/nethack/default.nix | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/pkgs/games/nethack/default.nix b/pkgs/games/nethack/default.nix index 05c39fb2f2b5f..ce12196d3c365 100644 --- a/pkgs/games/nethack/default.nix +++ b/pkgs/games/nethack/default.nix @@ -6,6 +6,7 @@ let else abort "Unknown platform for NetHack"; unixHint = if stdenv.isLinux then "linux" + else if stdenv.isDarwin then "macosx10.10" # We probably want something different for Darwin else "unix"; userDir = "~/.config/nethack"; @@ -24,25 +25,30 @@ in stdenv.mkDerivation { makeFlags = [ "PREFIX=$(out)" ]; + patchPhase = '' + sed -e '/^ *cd /d' -i sys/unix/nethack.sh + sed \ + -e 's/^YACC *=.*/YACC = bison -y/' \ + -e 's/^LEX *=.*/LEX = flex/' \ + -i sys/unix/Makefile.utl + sed \ + -e 's,/bin/gzip,${gzip}/bin/gzip,g' \ + -e 's,^WINTTYLIB=.*,WINTTYLIB=-lncurses,' \ + -i sys/unix/hints/linux + sed \ + -e 's,^CC=.*$,CC=cc,' \ + -e 's,^HACKDIR=.*$,HACKDIR=\$(PREFIX)/games/lib/\$(GAME)dir,' \ + -e 's,^SHELLDIR=.*$,SHELLDIR=\$(PREFIX)/games,' \ + -i sys/unix/hints/macosx10.10 + sed -e '/define CHDIR/d' -i include/config.h + ''; + configurePhase = '' cd sys/${platform} ${lib.optionalString (platform == "unix") '' - sed -e '/^ *cd /d' -i nethack.sh - ${lib.optionalString (unixHint == "linux") '' - sed \ - -e 's,/bin/gzip,${gzip}/bin/gzip,g' \ - -e 's,^WINTTYLIB=.*,WINTTYLIB=-lncurses,' \ - -i hints/linux - ''} sh setup.sh hints/${unixHint} ''} cd ../.. - - sed -e '/define CHDIR/d' -i include/config.h - sed \ - -e 's/^YACC *=.*/YACC = bison -y/' \ - -e 's/^LEX *=.*/LEX = flex/' \ - -i util/Makefile ''; postInstall = '' @@ -61,7 +67,7 @@ in stdenv.mkDerivation { chmod -R +w ${userDir} fi - RUNDIR=\$(mktemp -td nethack.\$USER.XXXXX) + RUNDIR=\$(mktemp -d) cleanup() { rm -rf \$RUNDIR |