Merge pull request #44065 from Ericson2314/no-crossAttrs-master

treewide: Remove some crossAttrs
This commit is contained in:
John Ericson 2018-07-24 18:30:14 -04:00 committed by GitHub
commit d4f5ee8199
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 45 additions and 44 deletions

View File

@ -15,17 +15,16 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake ];
doCheck = true; doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
checkTarget = "test"; checkTarget = "test";
enableParallelBuilding = true; enableParallelBuilding = true;
crossAttrs = { cmakeFlags = [
cmakeFlags = "-DBuildTests=OFF"; "-DBuildTests=${if doCheck then "ON" else "OFF"}"
doCheck = false; ] ++ stdenv.lib.optionals (hostPlatform.libc == "msvcrt") [
} // stdenv.lib.optionalAttrs (hostPlatform.libc == "msvcrt") { "-DCMAKE_SYSTEM_NAME=Windows"
cmakeFlags = "-DBuildTests=OFF -DCMAKE_SYSTEM_NAME=Windows"; ];
};
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Header only C++ library for the JSON file format"; description = "Header only C++ library for the JSON file format";

View File

@ -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"; name = "prboom-2.5.0";
src = fetchurl { src = fetchurl {
url = mirror://sourceforge/prboom/prboom-2.5.0.tar.gz; url = mirror://sourceforge/prboom/prboom-2.5.0.tar.gz;
sha256 = "1bjb04q8dk232956k30qlpq6q0hxb904yh1nflr87jcc1x3iqv12"; sha256 = "1bjb04q8dk232956k30qlpq6q0hxb904yh1nflr87jcc1x3iqv12";
}; };
buildInputs = [ SDL SDL_mixer SDL_net libGLU_combined ]; buildInputs = [ SDL SDL_mixer SDL_net ]
crossAttrs = { ++ stdenv.lib.optional useOpenGL libGLU_combined;
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";
postInstall = '' doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
mv $out/games/ $out/bin
''; 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
'';
} }

View File

@ -20,22 +20,16 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true; enableParallelBuilding = true;
configurePlatforms = [ "host" ];
configureFlags = [ configureFlags = [
"--enable-c++11" "--enable-c++11"
"--enable-release" "--enable-release"
]; ];
crossAttrs = { # They use 'install -s', that calls the native strip instead of the cross
preConfigure = '' postConfigure = ''
# Remove the --build flag set by the gcc cross wrapper setup sed -i "s/-c -s/-c -s --strip-program=''${STRIP@Q}" ports.mk
# 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;
'';
};
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Program to run certain classic graphical point-and-click adventure games (such as Monkey Island)"; description = "Program to run certain classic graphical point-and-click adventure games (such as Monkey Island)";

View File

@ -52,7 +52,8 @@ stdenv.mkDerivation ({
done done
''; '';
crossAttrs.dontPatchShebangs = true; # Not needed after https://github.com/NixOS/nixpkgs/pull/43833
dontPatchShebangs = stdenv.hostPlatform != stdenv.buildPlatform;
meta = { meta = {
description = "The GNU Hurd, GNU project's replacement for the Unix kernel"; description = "The GNU Hurd, GNU project's replacement for the Unix kernel";

View File

@ -21,13 +21,11 @@ stdenv.mkDerivation {
doCheck = true; doCheck = true;
crossAttrs = { # Fix the shebang to point to the cross-built shell. Won't be needed
postInstall = # after #43833.
# Fix the shebang to point to the cross-built shell. postInstall = ''
'' sed -i "$out/bin/mig" \ sed -i "$out/bin/mig" -e 's|^#!/.*|#!${bash}/bin/sh|g'
-e 's|^#!/.*|#!${bash.crossDrv}/bin/sh|g' '';
'';
};
meta = { meta = {
description = "GNU MIG, the Mach interface generator"; description = "GNU MIG, the Mach interface generator";

View File

@ -17,13 +17,11 @@ stdenv.mkDerivation {
QTDIR = qt48; QTDIR = qt48;
crossAttrs = { # cmakeFlags = "-DWIN32=1 -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_RC_COMPILER=${stdenv.cc.targetPrefix}windres";
# cmakeFlags = "-DWIN32=1 -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_RC_COMPILER=${stdenv.cc.targetPrefix}windres";
QTDIR = qt48.crossDrv; preBuild = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
preBuild = '' export NIX_CROSS_CFLAGS_COMPILE=-fpermissive
export NIX_CROSS_CFLAGS_COMPILE=-fpermissive '';
'';
};
meta = { meta = {
homepage = http://qt-project.org/wiki/jom; homepage = http://qt-project.org/wiki/jom;