mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 08:23:09 +00:00
nethack: fix darwin support
This commit is contained in:
parent
a133ef9a0c
commit
818f2cd19f
@ -6,6 +6,7 @@ let
|
|||||||
else abort "Unknown platform for NetHack";
|
else abort "Unknown platform for NetHack";
|
||||||
unixHint =
|
unixHint =
|
||||||
if stdenv.isLinux then "linux"
|
if stdenv.isLinux then "linux"
|
||||||
|
else if stdenv.isDarwin then "macosx10.10"
|
||||||
# We probably want something different for Darwin
|
# We probably want something different for Darwin
|
||||||
else "unix";
|
else "unix";
|
||||||
userDir = "~/.config/nethack";
|
userDir = "~/.config/nethack";
|
||||||
@ -24,25 +25,30 @@ in stdenv.mkDerivation {
|
|||||||
|
|
||||||
makeFlags = [ "PREFIX=$(out)" ];
|
makeFlags = [ "PREFIX=$(out)" ];
|
||||||
|
|
||||||
configurePhase = ''
|
patchPhase = ''
|
||||||
cd sys/${platform}
|
sed -e '/^ *cd /d' -i sys/unix/nethack.sh
|
||||||
${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 \
|
sed \
|
||||||
-e 's/^YACC *=.*/YACC = bison -y/' \
|
-e 's/^YACC *=.*/YACC = bison -y/' \
|
||||||
-e 's/^LEX *=.*/LEX = flex/' \
|
-e 's/^LEX *=.*/LEX = flex/' \
|
||||||
-i util/Makefile
|
-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") ''
|
||||||
|
sh setup.sh hints/${unixHint}
|
||||||
|
''}
|
||||||
|
cd ../..
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
@ -61,7 +67,7 @@ in stdenv.mkDerivation {
|
|||||||
chmod -R +w ${userDir}
|
chmod -R +w ${userDir}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RUNDIR=\$(mktemp -td nethack.\$USER.XXXXX)
|
RUNDIR=\$(mktemp -d)
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
rm -rf \$RUNDIR
|
rm -rf \$RUNDIR
|
||||||
|
Loading…
Reference in New Issue
Block a user