diff --git a/pkgs/development/libraries/nlohmann_json/default.nix b/pkgs/development/libraries/nlohmann_json/default.nix index 59cc9438a9f1..0e9ff5d9105e 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"; diff --git a/pkgs/games/prboom/default.nix b/pkgs/games/prboom/default.nix index 4babc1caea5a..520f6503edfd 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 + ''; } diff --git a/pkgs/games/scummvm/default.nix b/pkgs/games/scummvm/default.nix index f4590081898a..b9b95a5fb4dc 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)"; diff --git a/pkgs/os-specific/gnu/hurd/default.nix b/pkgs/os-specific/gnu/hurd/default.nix index ae1c504fd19e..a0c4be0ff451 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"; diff --git a/pkgs/os-specific/gnu/mig/default.nix b/pkgs/os-specific/gnu/mig/default.nix index 2855f5b4240f..d138011d595b 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"; diff --git a/pkgs/os-specific/windows/jom/default.nix b/pkgs/os-specific/windows/jom/default.nix index 8befa51566de..1b64ad745991 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;