diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2018-11-01 16:47:42 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2018-11-01 16:47:42 -0400 |
commit | e3082c313b75f13e8e1049673efe6a42dcd1499f (patch) | |
tree | 0d11815c9bed24ca9f27d3839ac0f9577d8308e5 /pkgs/games/nethack | |
parent | f2ed7c7af9f5b2db5e88b78e192b470c47f4c4fd (diff) | |
parent | cc41aefe4485dea399930b8d173c26e438cb5e22 (diff) | |
download | nixlib-e3082c313b75f13e8e1049673efe6a42dcd1499f.tar nixlib-e3082c313b75f13e8e1049673efe6a42dcd1499f.tar.gz nixlib-e3082c313b75f13e8e1049673efe6a42dcd1499f.tar.bz2 nixlib-e3082c313b75f13e8e1049673efe6a42dcd1499f.tar.lz nixlib-e3082c313b75f13e8e1049673efe6a42dcd1499f.tar.xz nixlib-e3082c313b75f13e8e1049673efe6a42dcd1499f.tar.zst nixlib-e3082c313b75f13e8e1049673efe6a42dcd1499f.zip |
Merge remote-tracking branch 'upstream/master' into release-lib-cleanup
Diffstat (limited to 'pkgs/games/nethack')
-rw-r--r-- | pkgs/games/nethack/default.nix | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/pkgs/games/nethack/default.nix b/pkgs/games/nethack/default.nix index 2a39e3499ed9..56904ae2dfe1 100644 --- a/pkgs/games/nethack/default.nix +++ b/pkgs/games/nethack/default.nix @@ -1,6 +1,7 @@ { stdenv, lib, fetchurl, coreutils, ncurses, gzip, flex, bison , less, makeWrapper -, x11Mode ? false, qtMode ? false, libXaw, libXext, mkfontdir, pkgconfig, qt5 +, buildPackages +, x11Mode ? false, qtMode ? false, libXaw, libXext, bdftopcf, mkfontdir, pkgconfig, qt5 }: let @@ -33,10 +34,11 @@ in stdenv.mkDerivation rec { ++ lib.optionals qtMode [ gzip qt5.qtbase.bin qt5.qtmultimedia.bin ]; nativeBuildInputs = [ flex bison ] - ++ lib.optionals x11Mode [ mkfontdir ] + ++ lib.optionals x11Mode [ mkfontdir bdftopcf ] ++ lib.optionals qtMode [ pkgconfig mkfontdir qt5.qtbase.dev qt5.qtmultimedia.dev makeWrapper + bdftopcf ]; makeFlags = [ "PREFIX=$(out)" ]; @@ -64,12 +66,24 @@ in stdenv.mkDerivation rec { -e 's,^CFLAGS=-g,CFLAGS=,' \ -i sys/unix/hints/macosx10.10 sed -e '/define CHDIR/d' -i include/config.h + ${lib.optionalString qtMode '' sed \ -e 's,^QTDIR *=.*,QTDIR=${qt5.qtbase.dev},' \ -e 's,CFLAGS.*QtGui.*,CFLAGS += `pkg-config Qt5Gui --cflags`,' \ -e 's,CFLAGS+=-DCOMPRESS.*,CFLAGS+=-DCOMPRESS=\\"${gzip}/bin/gzip\\" \\\ -DCOMPRESS_EXTENSION=\\".gz\\",' \ -i sys/unix/hints/linux-qt4 + ''} + ${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) + # If we're cross-compiling, replace the paths to the data generation tools + # with the ones from the build platform's nethack package, since we can't + # run the ones we've built here. + '' + ${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 = '' @@ -80,6 +94,8 @@ in stdenv.mkDerivation rec { popd ''; + enableParallelBuilding = true; + postInstall = '' mkdir -p $out/games/lib/nethackuserdir for i in xlogfile logfile perm record save; do @@ -116,6 +132,8 @@ 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} -t $out/libexec/nethack/ + ${lib.optionalString (!(x11Mode || qtMode)) "install -Dm 555 util/dlb -t $out/libexec/nethack/"} ''; postFixup = lib.optionalString qtMode '' |