From 40c33cbd4e079173388dfdaf8e34b555be6b0a73 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 23 Jul 2018 15:47:09 -0400 Subject: [PATCH 1/6] nlohmann_json: No more crossAttrs --- .../development/libraries/nlohmann_json/default.nix | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/nlohmann_json/default.nix b/pkgs/development/libraries/nlohmann_json/default.nix index 59cc9438a9f..0e9ff5d9105 100644 --- a/pkgs/development/libraries/nlohmann_json/default.nix +++ b/pkgs/development/libraries/nlohmann_json/default.nix @@ -15,17 +15,16 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; - doCheck = true; + doCheck = stdenv.buildPlatform == stdenv.hostPlatform; checkTarget = "test"; enableParallelBuilding = true; - crossAttrs = { - cmakeFlags = "-DBuildTests=OFF"; - doCheck = false; - } // stdenv.lib.optionalAttrs (hostPlatform.libc == "msvcrt") { - cmakeFlags = "-DBuildTests=OFF -DCMAKE_SYSTEM_NAME=Windows"; - }; + cmakeFlags = [ + "-DBuildTests=${if doCheck then "ON" else "OFF"}" + ] ++ stdenv.lib.optionals (hostPlatform.libc == "msvcrt") [ + "-DCMAKE_SYSTEM_NAME=Windows" + ]; meta = with stdenv.lib; { description = "Header only C++ library for the JSON file format"; From 66c41943b334bb02575b04f551f056824319d767 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 23 Jul 2018 17:09:06 -0400 Subject: [PATCH 2/6] gnu mig: Remove crossAttrs --- pkgs/os-specific/gnu/mig/default.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkgs/os-specific/gnu/mig/default.nix b/pkgs/os-specific/gnu/mig/default.nix index 2855f5b4240..d138011d595 100644 --- a/pkgs/os-specific/gnu/mig/default.nix +++ b/pkgs/os-specific/gnu/mig/default.nix @@ -21,13 +21,11 @@ stdenv.mkDerivation { doCheck = true; - crossAttrs = { - postInstall = - # Fix the shebang to point to the cross-built shell. - '' sed -i "$out/bin/mig" \ - -e 's|^#!/.*|#!${bash.crossDrv}/bin/sh|g' - ''; - }; + # Fix the shebang to point to the cross-built shell. Won't be needed + # after #43833. + postInstall = '' + sed -i "$out/bin/mig" -e 's|^#!/.*|#!${bash}/bin/sh|g' + ''; meta = { description = "GNU MIG, the Mach interface generator"; From aa8944f40393a8cdbd92a247adb5ab84a3bcc8af Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 23 Jul 2018 17:11:48 -0400 Subject: [PATCH 3/6] hurd: Remove cross attrs --- pkgs/os-specific/gnu/hurd/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/gnu/hurd/default.nix b/pkgs/os-specific/gnu/hurd/default.nix index ae1c504fd19..a0c4be0ff45 100644 --- a/pkgs/os-specific/gnu/hurd/default.nix +++ b/pkgs/os-specific/gnu/hurd/default.nix @@ -52,7 +52,8 @@ stdenv.mkDerivation ({ done ''; - crossAttrs.dontPatchShebangs = true; + # Not needed after https://github.com/NixOS/nixpkgs/pull/43833 + dontPatchShebangs = stdenv.hostPlatform != stdenv.buildPlatform; meta = { description = "The GNU Hurd, GNU project's replacement for the Unix kernel"; From 3470fa196d143beab2e7fdd5ba86887126990a4f Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 23 Jul 2018 17:18:39 -0400 Subject: [PATCH 4/6] scumvm: Don't use crossAttrs --- pkgs/games/scummvm/default.nix | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/pkgs/games/scummvm/default.nix b/pkgs/games/scummvm/default.nix index f4590081898..b9b95a5fb4d 100644 --- a/pkgs/games/scummvm/default.nix +++ b/pkgs/games/scummvm/default.nix @@ -20,22 +20,16 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; + configurePlatforms = [ "host" ]; configureFlags = [ "--enable-c++11" "--enable-release" ]; - crossAttrs = { - preConfigure = '' - # Remove the --build flag set by the gcc cross wrapper setup - # hook - export configureFlags="--host=${hostPlatform.config}" - ''; - postConfigure = '' - # They use 'install -s', that calls the native strip instead of the cross - sed -i 's/-c -s/-c/' ports.mk; - ''; - }; + # They use 'install -s', that calls the native strip instead of the cross + postConfigure = '' + sed -i "s/-c -s/-c -s --strip-program=''${STRIP@Q}" ports.mk + ''; meta = with stdenv.lib; { description = "Program to run certain classic graphical point-and-click adventure games (such as Monkey Island)"; From ef93b82d433237a64ce2150ecffa46362cb4dbba Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 23 Jul 2018 17:27:03 -0400 Subject: [PATCH 5/6] prboom: Don't use crossAttrs --- pkgs/games/prboom/default.nix | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/pkgs/games/prboom/default.nix b/pkgs/games/prboom/default.nix index 4babc1caea5..520f6503edf 100644 --- a/pkgs/games/prboom/default.nix +++ b/pkgs/games/prboom/default.nix @@ -1,20 +1,31 @@ -{stdenv, fetchurl, SDL, SDL_mixer, SDL_net, libGLU_combined}: +{ stdenv, fetchurl, SDL, SDL_mixer, SDL_net +, libGLU_combined ? assert false; null +, useOpenGL ? stdenv.hostPlatform == stdenv.buildPlatform +}: -stdenv.mkDerivation { +stdenv.mkDerivation rec { name = "prboom-2.5.0"; src = fetchurl { url = mirror://sourceforge/prboom/prboom-2.5.0.tar.gz; sha256 = "1bjb04q8dk232956k30qlpq6q0hxb904yh1nflr87jcc1x3iqv12"; }; - buildInputs = [ SDL SDL_mixer SDL_net libGLU_combined ]; - crossAttrs = { - propagatedBuildInputs = [ SDL.crossDrv SDL_mixer.crossDrv SDL_net.crossDrv ]; - configureFlags = "--disable-gl --disable-cpu-opt --without-x --disable-sdltest - ac_cv_type_uid_t=yes ac_cv_type_gid_t=yes"; + buildInputs = [ SDL SDL_mixer SDL_net ] + ++ stdenv.lib.optional useOpenGL libGLU_combined; - postInstall = '' - mv $out/games/ $out/bin - ''; - }; + doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + + configureFlags = [ + (stdenv.lib.enableFeature useOpenGL "gl") + (stdenv.lib.enableFeature doCheck "sdltest") + ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "--disable-cpu-opt" + "--without-x" + "ac_cv_type_uid_t=yes" + "ac_cv_type_gid_t=yes" + ]; + + postInstall = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + mv $out/games/ $out/bin + ''; } From 1f9838ea344198e2119ed791ea52acedf1f3c6d9 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 23 Jul 2018 16:03:18 -0400 Subject: [PATCH 6/6] jom: Remove crossAttrs Untested, but I don't think this has ever built. --- pkgs/os-specific/windows/jom/default.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkgs/os-specific/windows/jom/default.nix b/pkgs/os-specific/windows/jom/default.nix index 8befa51566d..1b64ad74599 100644 --- a/pkgs/os-specific/windows/jom/default.nix +++ b/pkgs/os-specific/windows/jom/default.nix @@ -17,13 +17,11 @@ stdenv.mkDerivation { QTDIR = qt48; - crossAttrs = { - # cmakeFlags = "-DWIN32=1 -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_RC_COMPILER=${stdenv.cc.targetPrefix}windres"; - QTDIR = qt48.crossDrv; - preBuild = '' - export NIX_CROSS_CFLAGS_COMPILE=-fpermissive - ''; - }; + # cmakeFlags = "-DWIN32=1 -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_RC_COMPILER=${stdenv.cc.targetPrefix}windres"; + + preBuild = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + export NIX_CROSS_CFLAGS_COMPILE=-fpermissive + ''; meta = { homepage = http://qt-project.org/wiki/jom;