nethack: enable cross-compilation
also parallel building
This commit is contained in:
parent
6af4a8e6d7
commit
86b1f5c710
@ -1,5 +1,6 @@
|
|||||||
{ stdenv, lib, fetchurl, coreutils, ncurses, gzip, flex, bison
|
{ stdenv, lib, fetchurl, coreutils, ncurses, gzip, flex, bison
|
||||||
, less, makeWrapper
|
, less, makeWrapper
|
||||||
|
, buildPackages
|
||||||
, x11Mode ? false, qtMode ? false, libXaw, libXext, mkfontdir, pkgconfig, qt5
|
, x11Mode ? false, qtMode ? false, libXaw, libXext, mkfontdir, pkgconfig, qt5
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@ -72,6 +73,12 @@ in stdenv.mkDerivation rec {
|
|||||||
-DCOMPRESS_EXTENSION=\\".gz\\",' \
|
-DCOMPRESS_EXTENSION=\\".gz\\",' \
|
||||||
-i sys/unix/hints/linux-qt4
|
-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 = ''
|
configurePhase = ''
|
||||||
@ -82,6 +89,8 @@ in stdenv.mkDerivation rec {
|
|||||||
popd
|
popd
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mkdir -p $out/games/lib/nethackuserdir
|
mkdir -p $out/games/lib/nethackuserdir
|
||||||
for i in xlogfile logfile perm record save; do
|
for i in xlogfile logfile perm record save; do
|
||||||
@ -118,6 +127,7 @@ in stdenv.mkDerivation rec {
|
|||||||
chmod +x $out/bin/nethack
|
chmod +x $out/bin/nethack
|
||||||
${lib.optionalString x11Mode "mv $out/bin/nethack $out/bin/nethack-x11"}
|
${lib.optionalString x11Mode "mv $out/bin/nethack $out/bin/nethack-x11"}
|
||||||
${lib.optionalString qtMode "mv $out/bin/nethack $out/bin/nethack-qt"}
|
${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 ''
|
postFixup = lib.optionalString qtMode ''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user