summary refs log tree commit diff
path: root/pkgs/games/nethack
diff options
context:
space:
mode:
authorLinus Heckemann <git@sphalerite.org>2018-09-20 19:32:36 +0200
committerLinus Heckemann <git@sphalerite.org>2018-09-20 19:32:36 +0200
commit86b1f5c71098cf37fbdefafc5cb174e6cae899ea (patch)
treeac74735bd4ac19f567328738d700a41254eb4dbd /pkgs/games/nethack
parent6af4a8e6d72660344485e0300d8ef4b360fcea1b (diff)
downloadnixpkgs-86b1f5c71098cf37fbdefafc5cb174e6cae899ea.tar
nixpkgs-86b1f5c71098cf37fbdefafc5cb174e6cae899ea.tar.gz
nixpkgs-86b1f5c71098cf37fbdefafc5cb174e6cae899ea.tar.bz2
nixpkgs-86b1f5c71098cf37fbdefafc5cb174e6cae899ea.tar.lz
nixpkgs-86b1f5c71098cf37fbdefafc5cb174e6cae899ea.tar.xz
nixpkgs-86b1f5c71098cf37fbdefafc5cb174e6cae899ea.tar.zst
nixpkgs-86b1f5c71098cf37fbdefafc5cb174e6cae899ea.zip
nethack: enable cross-compilation
also parallel building
Diffstat (limited to 'pkgs/games/nethack')
-rw-r--r--pkgs/games/nethack/default.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkgs/games/nethack/default.nix b/pkgs/games/nethack/default.nix
index be522b2bacf..56342728b40 100644
--- a/pkgs/games/nethack/default.nix
+++ b/pkgs/games/nethack/default.nix
@@ -1,5 +1,6 @@
 { stdenv, lib, fetchurl, coreutils, ncurses, gzip, flex, bison
 , less, makeWrapper
+, buildPackages
 , x11Mode ? false, qtMode ? false, libXaw, libXext, mkfontdir, pkgconfig, qt5
 }:
 
@@ -72,6 +73,12 @@ in stdenv.mkDerivation rec {
         -DCOMPRESS_EXTENSION=\\".gz\\",' \
       -i sys/unix/hints/linux-qt4
     ''}
+    ${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
+    ${buildPackages.perl}/bin/perl -p \
+      -e 's,[a-z./]+/(makedefs|dgn_comp|lev_comp|dlb)(?!\.),${buildPackages.nethack}/libexec/nethack/\1,g' \
+      -i sys/unix/Makefile.*
+    ''}
+    sed -i -e '/rm -f $(MAKEDEFS)/d' sys/unix/Makefile.src
   '';
 
   configurePhase = ''
@@ -82,6 +89,8 @@ in stdenv.mkDerivation rec {
     popd
   '';
 
+  enableParallelBuilding = true;
+
   postInstall = ''
     mkdir -p $out/games/lib/nethackuserdir
     for i in xlogfile logfile perm record save; do
@@ -118,6 +127,7 @@ in stdenv.mkDerivation rec {
     chmod +x $out/bin/nethack
     ${lib.optionalString x11Mode "mv $out/bin/nethack $out/bin/nethack-x11"}
     ${lib.optionalString qtMode "mv $out/bin/nethack $out/bin/nethack-qt"}
+    install -Dm 555 util/{makedefs,dgn_comp,lev_comp,dlb} -t $out/libexec/nethack/
   '';
 
   postFixup = lib.optionalString qtMode ''