Merge pull request #26884 from obsidiansystems/purge-stdenv-cross

Purge stdenv cross

authored by John Ericson and committed by GitHub e1faeb57 425e9ce4

+305 -344
-5
doc/cross-compilation.xml
··· 79 79 </listitem> 80 80 </varlistentry> 81 81 </variablelist> 82 - <note><para> 83 - If you dig around nixpkgs, you may notice there is also <varname>stdenv.cross</varname>. 84 - This field defined as <varname>hostPlatform</varname> when the host and build platforms differ, but otherwise not defined at all. 85 - This field is obsolete and will soon disappear—please do not use it. 86 - </para></note> 87 82 <para> 88 83 The exact schema these fields follow is a bit ill-defined due to a long and convoluted evolution, but this is slowly being cleaned up. 89 84 You can see examples of ones used in practice in <literal>lib.systems.examples</literal>; note how they are not all very consistent.
-3
pkgs/applications/editors/vim/default.nix
··· 36 36 "ac_cv_sizeof_int=4" 37 37 "vim_cv_memmove_handles_overlap=yes" 38 38 "vim_cv_memmove_handles_overlap=yes" 39 - 40 - # TODO(@Ericson2314): wont' be needed soon. 41 - "STRIP=${hostPlatform.config}-strip" 42 39 ]; 43 40 44 41 postInstall = ''
+4 -3
pkgs/applications/graphics/ImageMagick/7.0.nix
··· 2 2 , bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg 3 3 , lcms2, openexr, libpng, librsvg, libtiff, libxml2, openjpeg, libwebp 4 4 , ApplicationServices 5 + , buildPlatform, hostPlatform 5 6 }: 6 7 7 8 let ··· 47 48 [ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts" 48 49 "--with-gslib" 49 50 ] 50 - ++ lib.optionals (stdenv.cross.libc or null == "msvcrt") 51 + ++ lib.optionals hostPlatform.isMinGW 51 52 [ "--enable-static" "--disable-shared" ] # due to libxml2 being without DLLs ATM 52 53 ; 53 54 ··· 57 58 [ zlib fontconfig freetype ghostscript 58 59 libpng libtiff libxml2 59 60 ] 60 - ++ lib.optionals (stdenv.cross.libc or null != "msvcrt") 61 + ++ lib.optionals (!hostPlatform.isMinGW) 61 62 [ openexr librsvg openjpeg ] 62 63 ++ lib.optional stdenv.isDarwin ApplicationServices; 63 64 64 65 propagatedBuildInputs = 65 66 [ bzip2 freetype libjpeg lcms2 ] 66 - ++ lib.optionals (stdenv.cross.libc or null != "msvcrt") 67 + ++ lib.optionals (!hostPlatform.isMinGW) 67 68 [ libX11 libXext libXt libwebp ] 68 69 ; 69 70
+5 -4
pkgs/applications/graphics/ImageMagick/default.nix
··· 2 2 , bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg 3 3 , lcms2, openexr, libpng, librsvg, libtiff, libxml2, openjpeg, libwebp 4 4 , ApplicationServices 5 + , buildPlatform, hostPlatform 5 6 }: 6 7 7 8 let ··· 18 19 } 19 20 # Freeze version on mingw so we don't need to port the patch too often. 20 21 # FIXME: This version has multiple security vulnerabilities 21 - // lib.optionalAttrs (stdenv.cross.libc or null == "msvcrt") { 22 + // lib.optionalAttrs (hostPlatform.isMinGW) { 22 23 version = "6.9.2-0"; 23 24 sha256 = "17ir8bw1j7g7srqmsz3rx780sgnc21zfn0kwyj78iazrywldx8h7"; 24 25 patches = [(fetchpatch { ··· 59 60 [ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts" 60 61 "--with-gslib" 61 62 ] 62 - ++ lib.optionals (stdenv.cross.libc or null == "msvcrt") 63 + ++ lib.optionals (hostPlatform.isMinGW) 63 64 [ "--enable-static" "--disable-shared" ] # due to libxml2 being without DLLs ATM 64 65 ; 65 66 ··· 69 70 [ zlib fontconfig freetype ghostscript 70 71 libpng libtiff libxml2 71 72 ] 72 - ++ lib.optionals (stdenv.cross.libc or null != "msvcrt") 73 + ++ lib.optionals (!hostPlatform.isMinGW) 73 74 [ openexr librsvg openjpeg ] 74 75 ++ lib.optional stdenv.isDarwin ApplicationServices; 75 76 76 77 propagatedBuildInputs = 77 78 [ bzip2 freetype libjpeg lcms2 ] 78 - ++ lib.optionals (stdenv.cross.libc or null != "msvcrt") 79 + ++ lib.optionals (!hostPlatform.isMinGW) 79 80 [ libX11 libXext libXt libwebp ] 80 81 ; 81 82
-4
pkgs/applications/graphics/fbida/default.nix
··· 21 21 sed -e 's@ cpp\>@ gcc -E -@' -i GNUmakefile 22 22 ''; 23 23 24 - crossAttrs = { 25 - makeFlags = makeFlags ++ [ "CC=${stdenv.cross.config}-gcc" "STRIP=" ]; 26 - }; 27 - 28 24 meta = with stdenv.lib; { 29 25 description = "Image viewing and manipulation programs"; 30 26 homepage = https://www.kraxel.org/blog/linux/fbida/;
-1
pkgs/applications/networking/offrss/default.nix
··· 13 13 preConfigure = '' 14 14 sed 's/^PDF/#PDF/' -i Makefile 15 15 ''; 16 - makeFlags = "CC=${stdenv.cross.config}-gcc"; 17 16 }; 18 17 19 18 buildInputs = [ curl libmrss podofo ]
+1 -1
pkgs/applications/version-management/fossil/default.nix
··· 37 37 38 38 crossAttrs = { 39 39 doCheck = false; 40 - makeFlagsArray = [ "TCC=${stdenv.cross.config}-gcc" ]; 40 + makeFlags = [ "TCC=$CC" ]; 41 41 }; 42 42 43 43 meta = {
+6 -3
pkgs/applications/video/omxplayer/default.nix
··· 1 - { stdenv, fetchurl, raspberrypifw, pcre, boost, freetype, zlib }: 1 + { stdenv, fetchurl 2 + , raspberrypifw, pcre, boost, freetype, zlib 3 + , hostPlatform 4 + }: 2 5 3 6 let 4 7 ffmpeg = stdenv.mkDerivation rec { ··· 46 49 crossAttrs = { 47 50 configurePlatforms = []; 48 51 configureFlags = configureFlags ++ [ 49 - "--cross-prefix=${stdenv.cross.config}-" 52 + "--cross-prefix=${stdenv.cc.prefix}" 50 53 "--enable-cross-compile" 51 54 "--target_os=linux" 52 - "--arch=${stdenv.cross.arch}" 55 + "--arch=${hostPlatform.arch}" 53 56 ]; 54 57 }; 55 58
+1 -1
pkgs/build-support/cc-wrapper/default.nix
··· 71 71 72 72 '' + stdenv.lib.optionalString (textFile == ./setup-hook.sh) '' 73 73 cat << 'EOF' >> $out 74 - for CMD in ar as nm objcopy ranlib strip strings size ld 74 + for CMD in ar as nm objcopy ranlib strip strings size ld windres 75 75 do 76 76 # which is not part of stdenv, but compgen will do for now 77 77 if
+16 -10
pkgs/build-support/gcc-wrapper-old/default.nix
··· 8 8 { name ? "", stdenv, lib, nativeTools, nativeLibc, nativePrefix ? "" 9 9 , gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? "" 10 10 , zlib ? null 11 + , hostPlatform, targetPlatform 11 12 }: 12 13 13 14 assert nativeTools -> nativePrefix != ""; ··· 69 70 # the style in the gcc-cross-wrapper, but to keep a stable stdenv now I 70 71 # do this sufficient if/else. 71 72 dynamicLinker = 72 - (if stdenv.cross.arch == "arm" then "ld-linux.so.3" else 73 - if stdenv.cross.arch == "mips" then "ld.so.1" else 74 - if stdenv.lib.hasSuffix "pc-gnu" stdenv.cross.config then "ld.so.1" else 73 + (if hostPlatform.arch == "arm" then "ld-linux.so.3" else 74 + if hostPlatform.arch == "mips" then "ld.so.1" else 75 + if stdenv.lib.hasSuffix "pc-gnu" hostPlatform.config then "ld.so.1" else 75 76 abort "don't know the name of the dynamic linker for this platform"); 76 77 }; 77 78 ··· 85 86 + " (wrapper script)"; 86 87 }; 87 88 88 - # The dynamic linker has different names on different Linux platforms. 89 + # The dynamic linker has different names on different platforms. 89 90 dynamicLinker = 90 91 if !nativeLibc then 91 - (if stdenv.system == "i686-linux" then "ld-linux.so.2" else 92 - if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else 92 + (if targetPlatform.system == "i686-linux" then "ld-linux.so.2" else 93 + if targetPlatform.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else 93 94 # ARM with a wildcard, which can be "" or "-armhf". 94 - if stdenv.isArm then "ld-linux*.so.3" else 95 - if stdenv.system == "powerpc-linux" then "ld.so.1" else 96 - if stdenv.system == "mips64el-linux" then "ld.so.1" else 97 - abort "don't know the name of the dynamic linker for this platform") 95 + if targetPlatform.isArm32 then "ld-linux*.so.3" else 96 + if targetPlatform.system == "aarch64-linux" then "ld-linux-aarch64.so.1" else 97 + if targetPlatform.system == "powerpc-linux" then "ld.so.1" else 98 + if targetPlatform.system == "mips64el-linux" then "ld.so.1" else 99 + if targetPlatform.system == "x86_64-darwin" then "/usr/lib/dyld" else 100 + if stdenv.lib.hasSuffix "pc-gnu" targetPlatform.config then "ld.so.1" else 101 + builtins.trace 102 + "Don't know the name of the dynamic linker for platform ${targetPlatform.config}, so guessing instead." 103 + null) 98 104 else ""; 99 105 }
+5 -7
pkgs/build-support/kernel/make-initrd.nix
··· 12 12 # `contents = {object = ...; symlink = /init;}' is a typical 13 13 # argument. 14 14 15 - { stdenv, perl, cpio, contents, ubootChooser, compressor, prepend }: 15 + { stdenv, perl, cpio, contents, ubootChooser, compressor, prepend 16 + , hostPlatform 17 + }: 16 18 17 19 let 18 20 inputsFun = ubootName : [ perl cpio ] ··· 22 24 stdenv.mkDerivation { 23 25 name = "initrd"; 24 26 builder = ./make-initrd.sh; 25 - nativeBuildInputs = inputsFun stdenv.platform.uboot; 27 + nativeBuildInputs = inputsFun hostPlatform.platform.uboot; 26 28 27 - makeUInitrd = makeUInitrdFun stdenv.platform.uboot; 29 + makeUInitrd = makeUInitrdFun hostPlatform.platform.uboot; 28 30 29 31 # !!! should use XML. 30 32 objects = map (x: x.object) contents; ··· 36 38 map (x: [("closure-" + baseNameOf x.symlink) x.object]) contents; 37 39 pathsFromGraph = ./paths-from-graph.pl; 38 40 39 - crossAttrs = { 40 - nativeBuildInputs = inputsFun stdenv.cross.platform.uboot; 41 - makeUInitrd = makeUInitrdFun stdenv.cross.platform.uboot; 42 - }; 43 41 inherit compressor prepend; 44 42 }
+4 -2
pkgs/development/interpreters/guile/2.0.nix
··· 1 1 { fetchurl, stdenv, libtool, readline, gmp, pkgconfig, boehmgc, libunistring 2 - , libffi, gawk, makeWrapper, fetchpatch, coverageAnalysis ? null, gnu ? null }: 2 + , libffi, gawk, makeWrapper, fetchpatch, coverageAnalysis ? null, gnu ? null 3 + , hostPlatform 4 + }: 3 5 4 6 # Do either a coverage analysis build or a standard build. 5 7 (if coverageAnalysis != null ··· 84 86 setupHook = ./setup-hook-2.0.sh; 85 87 86 88 crossAttrs.preConfigure = 87 - stdenv.lib.optionalString (stdenv.cross.config == "i586-pc-gnu") 89 + stdenv.lib.optionalString (hostPlatform.isHurd) 88 90 # On GNU, libgc depends on libpthread, but the cross linker doesn't 89 91 # know where to find libpthread, which leads to erroneous test failures 90 92 # in `configure', where `-pthread' and `-lpthread' aren't explicitly
+4 -2
pkgs/development/interpreters/guile/default.nix
··· 1 1 { fetchurl, stdenv, libtool, readline, gmp, pkgconfig, boehmgc, libunistring 2 - , libffi, gawk, makeWrapper, fetchpatch, coverageAnalysis ? null, gnu ? null }: 2 + , libffi, gawk, makeWrapper, fetchpatch, coverageAnalysis ? null, gnu ? null 3 + , hostPlatform 4 + }: 3 5 4 6 # Do either a coverage analysis build or a standard build. 5 7 (if coverageAnalysis != null ··· 80 82 setupHook = ./setup-hook-2.2.sh; 81 83 82 84 crossAttrs.preConfigure = 83 - stdenv.lib.optionalString (stdenv.cross.config == "i586-pc-gnu") 85 + stdenv.lib.optionalString (hostPlatform.isHurd) 84 86 # On GNU, libgc depends on libpthread, but the cross linker doesn't 85 87 # know where to find libpthread, which leads to erroneous test failures 86 88 # in `configure', where `-pthread' and `-lpthread' aren't explicitly
+4 -8
pkgs/development/interpreters/lua-5/5.2.nix
··· 1 - { stdenv, fetchurl, readline, compat ? false }: 1 + { stdenv, fetchurl, readline, compat ? false 2 + , hostPlatform 3 + }: 2 4 3 5 let 4 6 dsoPatch = fetchurl { ··· 55 57 ''; 56 58 57 59 crossAttrs = let 58 - isMingw = stdenv.cross.libc == "msvcrt"; 59 - isDarwin = stdenv.cross.libc == "libSystem"; 60 + inherit (hostPlatform) isDarwin isMingw; 60 61 in { 61 62 configurePhase = '' 62 63 makeFlagsArray=( 63 64 INSTALL_TOP=$out 64 65 INSTALL_MAN=$out/share/man/man1 65 - CC=${stdenv.cross.config}-gcc 66 - STRIP=: 67 - RANLIB=${stdenv.cross.config}-ranlib 68 66 V=${luaversion} 69 67 R=${version} 70 68 ${if isMingw then "mingw" else stdenv.lib.optionalString isDarwin '' 71 - AR="${stdenv.cross.config}-ar rcu" 72 - macosx 73 69 ''} 74 70 ) 75 71 '' + stdenv.lib.optionalString isMingw ''
+4 -8
pkgs/development/interpreters/lua-5/5.3.nix
··· 1 - { stdenv, fetchurl, readline, compat ? false }: 1 + { stdenv, fetchurl, readline, compat ? false 2 + , hostPlatform 3 + }: 2 4 3 5 stdenv.mkDerivation rec { 4 6 name = "lua-${version}"; ··· 54 56 ''; 55 57 56 58 crossAttrs = let 57 - isMingw = stdenv.cross.libc == "msvcrt"; 58 - isDarwin = stdenv.cross.libc == "libSystem"; 59 + inherit (hostPlatform) isDarwin isMingw; 59 60 in { 60 61 configurePhase = '' 61 62 makeFlagsArray=( 62 63 INSTALL_TOP=$out 63 64 INSTALL_MAN=$out/share/man/man1 64 - CC=${stdenv.cross.config}-gcc 65 - STRIP=: 66 - RANLIB=${stdenv.cross.config}-ranlib 67 65 V=${luaversion} 68 66 R=${version} 69 67 ${if isMingw then "mingw" else stdenv.lib.optionalString isDarwin '' 70 - AR="${stdenv.cross.config}-ar rcu" 71 - macosx 72 68 ''} 73 69 ) 74 70 '' + stdenv.lib.optionalString isMingw ''
+6 -6
pkgs/development/libraries/SDL/default.nix
··· 1 1 { stdenv, fetchurl, fetchpatch, pkgconfig, audiofile, libcap 2 2 , openglSupport ? false, mesa_noglu, mesa_glu 3 3 , alsaSupport ? true, alsaLib 4 - , x11Support ? true, libXext, libICE, libXrandr 4 + , x11Support ? hostPlatform == buildPlatform, libXext, libICE, libXrandr 5 5 , pulseaudioSupport ? true, libpulseaudio 6 6 , OpenGL, CoreAudio, CoreServices, AudioUnit, Kernel, Cocoa 7 + , hostPlatform, buildPlatform 7 8 }: 8 9 9 10 # OSS is no longer supported, for it's much crappier than ALSA and 10 11 # PulseAudio. 11 - assert (stdenv.isLinux && !(stdenv ? cross)) -> alsaSupport || pulseaudioSupport; 12 + assert hostPlatform.isLinux -> alsaSupport || pulseaudioSupport; 12 13 13 14 let 14 15 inherit (stdenv.lib) optional optionals; ··· 37 38 optional stdenv.isDarwin Cocoa; 38 39 39 40 buildInputs = let 40 - notMingw = !(stdenv ? cross) || stdenv.cross.libc != "msvcrt"; 41 + notMingw = !hostPlatform.isMinGW; 41 42 in optional notMingw audiofile 42 43 ++ optionals stdenv.isDarwin [ OpenGL CoreAudio CoreServices AudioUnit Kernel ]; 43 44 ··· 52 53 "--enable-rpath" 53 54 "--disable-pulseaudio-shared" 54 55 "--disable-osmesa-shared" 55 - ] ++ optionals (stdenv ? cross) ([ 56 - "--without-x" 57 - ] ++ optional alsaSupport "--with-alsa-prefix=${alsaLib.out}/lib"); 56 + ] ++ optional (!x11Support) "--without-x" 57 + ++ optional (alsaSupport && hostPlatform != buildPlatform) "--with-alsa-prefix=${alsaLib.out}/lib"; 58 58 59 59 patches = [ 60 60 # Fix window resizing issues, e.g. for xmonad
+4 -2
pkgs/development/libraries/boehm-gc/default.nix
··· 1 - { lib, stdenv, fetchurl, pkgconfig, libatomic_ops, enableLargeConfig ? false }: 1 + { lib, stdenv, fetchurl, pkgconfig, libatomic_ops, enableLargeConfig ? false 2 + , buildPlatform, hostPlatform 3 + }: 2 4 3 5 stdenv.mkDerivation rec { 4 6 name = "boehm-gc-7.6.0"; ··· 20 22 doCheck = true; 21 23 22 24 # Don't run the native `strip' when cross-compiling. 23 - dontStrip = stdenv ? cross; 25 + dontStrip = hostPlatform != buildPlatform; 24 26 25 27 postInstall = 26 28 ''
+9 -8
pkgs/development/libraries/boost/generic.nix
··· 1 1 { stdenv, fetchurl, icu, expat, zlib, bzip2, python, fixDarwinDylibNames, libiconv 2 + , buildPlatform, hostPlatform 2 3 , toolset ? if stdenv.cc.isClang then "clang" else null 3 4 , enableRelease ? true 4 5 , enableDebug ? false 5 6 , enableSingleThreaded ? false 6 7 , enableMultiThreaded ? true 7 - , enableShared ? !(stdenv.cross.libc or null == "msvcrt") # problems for now 8 + , enableShared ? !(hostPlatform.libc == "msvcrt") # problems for now 8 9 , enableStatic ? !enableShared 9 10 , enablePIC ? false 10 11 , enableExceptions ? false ··· 76 77 "--user-config=user-config.jam" 77 78 "toolset=gcc-cross" 78 79 "--without-python" 79 - ] ++ optionals (stdenv.cross.libc == "msvcrt") [ 80 + ] ++ optionals (hostPlatform.libc == "msvcrt") [ 80 81 "target-os=windows" 81 82 "threadapi=win32" 82 83 "binary-format=pe" 83 - "address-model=${if hasPrefix "x86_64-" stdenv.cross.config then "64" else "32"}" 84 + "address-model=${toString hostPlatform.parsed.cpu.bits}" 84 85 "architecture=x86" 85 86 ]; 86 87 crossB2Args = concatStringsSep " " (genericB2Flags ++ crossB2Flags); ··· 110 111 find include \( -name '*.hpp' -or -name '*.h' -or -name '*.ipp' \) \ 111 112 -exec sed '1i#line 1 "{}"' -i '{}' \; 112 113 ) 113 - '' + optionalString (stdenv.cross.libc or null == "msvcrt") '' 114 - ${stdenv.cross.config}-ranlib "$out/lib/"*.a 114 + '' + optionalString (hostPlatform.libc == "msvcrt") '' 115 + ${stdenv.cc.prefix}ranlib "$out/lib/"*.a 115 116 ''; 116 117 117 118 in ··· 147 148 enableParallelBuilding = true; 148 149 149 150 buildInputs = [ expat zlib bzip2 libiconv ] 150 - ++ stdenv.lib.optionals (! stdenv ? cross) [ python icu ] 151 + ++ stdenv.lib.optionals (hostPlatform == buildPlatform) [ python icu ] 151 152 ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames; 152 153 153 154 configureScript = "./bootstrap.sh"; 154 155 configureFlags = commonConfigureFlags 155 156 ++ [ "--with-python=${python.interpreter}" ] 156 - ++ optional (! stdenv ? cross) "--with-icu=${icu.dev}" 157 + ++ optional (hostPlatform == buildPlatform) "--with-icu=${icu.dev}" 157 158 ++ optional (toolset != null) "--with-toolset=${toolset}"; 158 159 159 160 buildPhase = builder nativeB2Args; ··· 177 178 buildPhase = builder crossB2Args; 178 179 installPhase = installer crossB2Args; 179 180 postFixup = fixup; 180 - } // optionalAttrs (stdenv.cross.libc == "msvcrt") { 181 + } // optionalAttrs (hostPlatform.libc == "msvcrt") { 181 182 patches = fetchurl { 182 183 url = "https://svn.boost.org/trac/boost/raw-attachment/ticket/7262/" 183 184 + "boost-mingw.patch";
+5 -21
pkgs/development/libraries/ffmpeg-full/default.nix
··· 1 1 { stdenv, fetchurl, pkgconfig, perl, texinfo, yasm 2 + , hostPlatform 2 3 /* 3 4 * Licensing options (yes some are listed twice, filters and such are not listed) 4 5 */ ··· 428 429 429 430 /* Cross-compilation is untested, consider this an outline, more work 430 431 needs to be done to portions of the build to get it to work correctly */ 431 - crossAttrs = let 432 - os = '' 433 - if [ "${stdenv.cross.config}" = "*cygwin*" ] ; then 434 - # Probably should look for mingw too 435 - echo "cygwin" 436 - elif [ "${stdenv.cross.config}" = "*darwin*" ] ; then 437 - echo "darwin" 438 - elif [ "${stdenv.cross.config}" = "*freebsd*" ] ; then 439 - echo "freebsd" 440 - elif [ "${stdenv.cross.config}" = "*linux*" ] ; then 441 - echo "linux" 442 - elif [ "${stdenv.cross.config}" = "*netbsd*" ] ; then 443 - echo "netbsd" 444 - elif [ "${stdenv.cross.config}" = "*openbsd*" ] ; then 445 - echo "openbsd" 446 - fi 447 - ''; 448 - in { 432 + crossAttrs = { 449 433 configurePlatforms = []; 450 434 configureFlags = configureFlags ++ [ 451 - "--cross-prefix=${stdenv.cross.config}-" 435 + "--cross-prefix=${stdenv.cc.prefix}" 452 436 "--enable-cross-compile" 453 - "--target_os=${os}" 454 - "--arch=${stdenv.cross.arch}" 437 + "--target_os=${hostPlatform.parsed.kernel.name}" 438 + "--arch=${hostPlatform.arch}" 455 439 ]; 456 440 }; 457 441
+5 -21
pkgs/development/libraries/ffmpeg/generic.nix
··· 2 2 , alsaLib, bzip2, fontconfig, freetype, gnutls, libiconv, lame, libass, libogg 3 3 , libtheora, libva, libvorbis, libvpx, lzma, libpulseaudio, soxr 4 4 , x264, x265, xvidcore, zlib, libopus 5 + , hostPlatform 5 6 , openglSupport ? false, mesa ? null 6 7 # Build options 7 8 , runtimeCpuDetectBuild ? true # Detect CPU capabilities at runtime ··· 169 170 170 171 /* Cross-compilation is untested, consider this an outline, more work 171 172 needs to be done to portions of the build to get it to work correctly */ 172 - crossAttrs = let 173 - os = '' 174 - if [ "${stdenv.cross.config}" = "*cygwin*" ] ; then 175 - # Probably should look for mingw too 176 - echo "cygwin" 177 - elif [ "${stdenv.cross.config}" = "*darwin*" ] ; then 178 - echo "darwin" 179 - elif [ "${stdenv.cross.config}" = "*freebsd*" ] ; then 180 - echo "freebsd" 181 - elif [ "${stdenv.cross.config}" = "*linux*" ] ; then 182 - echo "linux" 183 - elif [ "${stdenv.cross.config}" = "*netbsd*" ] ; then 184 - echo "netbsd" 185 - elif [ "${stdenv.cross.config}" = "*openbsd*" ] ; then 186 - echo "openbsd" 187 - fi 188 - ''; 189 - in { 173 + crossAttrs = { 190 174 configurePlatforms = []; 191 175 configureFlags = configureFlags ++ [ 192 - "--cross-prefix=${stdenv.cross.config}-" 176 + "--cross-prefix=${stdenv.cc.prefix}" 193 177 "--enable-cross-compile" 194 - "--target_os=${os}" 195 - "--arch=${stdenv.cross.arch}" 178 + "--target_os=${hostPlatform.parsed.kernel}" 179 + "--arch=${hostPlatform.arch}" 196 180 ]; 197 181 }; 198 182
+4 -2
pkgs/development/libraries/fontconfig/2.10.nix
··· 1 - { stdenv, fetchurl, pkgconfig, freetype, expat }: 1 + { stdenv, fetchurl, pkgconfig, freetype, expat 2 + , hostPlatform 3 + }: 2 4 3 5 stdenv.mkDerivation rec { 4 6 name = "fontconfig-2.10.2"; ··· 21 23 ]; 22 24 23 25 # We should find a better way to access the arch reliably. 24 - crossArch = stdenv.cross.arch or null; 26 + crossArch = hostPlatform.arch or null; 25 27 26 28 preConfigure = '' 27 29 if test -n "$crossConfig"; then
+5 -3
pkgs/development/libraries/fontconfig/default.nix
··· 1 - { stdenv, fetchurl, fetchpatch, pkgconfig, freetype, expat, libxslt, dejavu_fonts 2 - , substituteAll }: 1 + { stdenv, substituteAll, fetchurl, fetchpatch 2 + , pkgconfig, freetype, expat, libxslt, dejavu_fonts 3 + , hostPlatform 4 + }: 3 5 4 6 /** Font configuration scheme 5 7 - ./config-compat.patch makes fontconfig try the following root configs, in order: ··· 53 55 ]; 54 56 55 57 # We should find a better way to access the arch reliably. 56 - crossArch = stdenv.cross.arch or null; 58 + crossArch = hostPlatform.arch or null; 57 59 58 60 preConfigure = '' 59 61 if test -n "$crossConfig"; then
+7 -7
pkgs/development/libraries/freetype/default.nix
··· 1 - { 2 - stdenv, lib, fetchurl, copyPathsToStore, 3 - pkgconfig, which, 4 - zlib, bzip2, libpng, gnumake, glib, 1 + { stdenv, lib, fetchurl, copyPathsToStore 2 + , hostPlatform 3 + , pkgconfig, which 4 + , zlib, bzip2, libpng, gnumake, glib 5 5 6 - # FreeType supports LCD filtering (colloquially referred to as sub-pixel rendering). 6 + , # FreeType supports LCD filtering (colloquially referred to as sub-pixel rendering). 7 7 # LCD filtering is also known as ClearType and covered by several Microsoft patents. 8 8 # This option allows it to be disabled. See http://www.freetype.org/patents.html. 9 - useEncumberedCode ? true, 9 + useEncumberedCode ? true 10 10 }: 11 11 12 12 let ··· 67 67 68 68 postInstall = glib.flattenInclude; 69 69 70 - crossAttrs = stdenv.lib.optionalAttrs (stdenv.cross.libc or null != "msvcrt") { 70 + crossAttrs = stdenv.lib.optionalAttrs (hostPlatform.libc or null != "msvcrt") { 71 71 # Somehow it calls the unwrapped gcc, "i686-pc-linux-gnu-gcc", instead 72 72 # of gcc. I think it's due to the unwrapped gcc being in the PATH. I don't 73 73 # know why it's on the PATH.
+7 -9
pkgs/development/libraries/glew/1.10.nix
··· 1 1 { stdenv, fetchurl, mesa_glu, x11, libXmu, libXi 2 - , AGL ? null }: 2 + , buildPlatform, hostPlatform 3 + , AGL ? null 4 + }: 3 5 4 6 with stdenv.lib; 5 7 ··· 17 19 18 20 patchPhase = '' 19 21 sed -i 's|lib64|lib|' config/Makefile.linux 20 - ${optionalString (stdenv ? cross) '' 22 + ${optionalString (hostPlatform != buildPlatform) '' 21 23 sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile 22 24 ''} 23 25 ''; ··· 36 38 cp -r README.txt LICENSE.txt doc $out/share/doc/glew 37 39 ''; 38 40 39 - crossAttrs.makeFlags = [ 40 - "CC=${stdenv.cross.config}-gcc" 41 - "LD=${stdenv.cross.config}-gcc" 42 - "AR=${stdenv.cross.config}-ar" 43 - "STRIP=" 44 - ] ++ optional (stdenv.cross.libc == "msvcrt") "SYSTEM=mingw" 45 - ++ optional (stdenv.cross.libc == "libSystem") "SYSTEM=darwin"; 41 + makeFlags = if hostPlatform == buildPlatform then null else [ 42 + "SYSTEM=${if hostPlatform.isMinGW then "mingw" else hostPlatform.parsed.kernel}" 43 + ]; 46 44 47 45 meta = with stdenv.lib; { 48 46 description = "An OpenGL extension loading library for C(++)";
+7 -9
pkgs/development/libraries/glew/default.nix
··· 1 - { stdenv, fetchurl, mesa_glu, xlibsWrapper, libXmu, libXi }: 1 + { stdenv, fetchurl, mesa_glu, xlibsWrapper, libXmu, libXi 2 + , buildPlatform, hostPlatform 3 + }: 2 4 3 5 with stdenv.lib; 4 6 ··· 17 19 18 20 patchPhase = '' 19 21 sed -i 's|lib64|lib|' config/Makefile.linux 20 - ${optionalString (stdenv ? cross) '' 22 + ${optionalString (hostPlatform != buildPlatform) '' 21 23 sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile 22 24 ''} 23 25 ''; ··· 37 39 rm $out/lib/*.a 38 40 ''; 39 41 40 - crossAttrs.makeFlags = [ 41 - "CC=${stdenv.cross.config}-gcc" 42 - "LD=${stdenv.cross.config}-gcc" 43 - "AR=${stdenv.cross.config}-ar" 44 - "STRIP=" 45 - ] ++ optional (stdenv.cross.libc == "msvcrt") "SYSTEM=mingw" 46 - ++ optional (stdenv.cross.libc == "libSystem") "SYSTEM=darwin"; 42 + makeFlags = if hostPlatform == buildPlatform then null else [ 43 + "SYSTEM=${if hostPlatform.isMinGW then "mingw" else hostPlatform.parsed.kernel}" 44 + ]; 47 45 48 46 meta = with stdenv.lib; { 49 47 description = "An OpenGL extension loading library for C(++)";
+3 -2
pkgs/development/libraries/libav/default.nix
··· 13 13 , SDL # only for avplay in $bin, adds nontrivial closure to it 14 14 , enableGPL ? true # ToDo: some additional default stuff may need GPL 15 15 , enableUnfree ? faacSupport 16 + , hostPlatform 16 17 }: 17 18 18 19 assert faacSupport -> enableUnfree; ··· 107 108 crossAttrs = { 108 109 configurePlatforms = []; 109 110 configureFlags = configureFlags ++ [ 110 - "--cross-prefix=${stdenv.cross.config}-" 111 + "--cross-prefix=${stdenv.cc.prefix}" 111 112 "--enable-cross-compile" 112 113 "--target_os=linux" 113 - "--arch=${stdenv.cross.arch}" 114 + "--arch=${hostPlatform.arch}" 114 115 ]; 115 116 }; 116 117
+4 -2
pkgs/development/libraries/libffi/default.nix
··· 1 - { fetchurl, stdenv, dejagnu, doCheck ? false }: 1 + { fetchurl, stdenv, dejagnu, doCheck ? false 2 + , buildPlatform, hostPlatform 3 + }: 2 4 3 5 stdenv.mkDerivation rec { 4 6 name = "libffi-3.2.1"; ··· 21 23 22 24 inherit doCheck; 23 25 24 - dontStrip = stdenv ? cross; # Don't run the native `strip' when cross-compiling. 26 + dontStrip = hostPlatform != buildPlatform; # Don't run the native `strip' when cross-compiling. 25 27 26 28 # Install headers and libs in the right places. 27 29 postFixup = ''
+5 -3
pkgs/development/libraries/libiconv/default.nix
··· 1 - { fetchurl, stdenv, lib }: 1 + { fetchurl, stdenv, lib 2 + , buildPlatform, hostPlatform 3 + }: 2 4 3 - assert !stdenv.isLinux || stdenv ? cross; # TODO: improve on cross 5 + assert !stdenv.isLinux || hostPlatform != buildPlatform; # TODO: improve on cross 4 6 5 7 stdenv.mkDerivation rec { 6 8 name = "libiconv-${version}"; ··· 17 19 ]; 18 20 19 21 postPatch = 20 - lib.optionalString ((stdenv ? cross && stdenv.cross.libc == "msvcrt") || stdenv.cc.nativeLibc) 22 + lib.optionalString ((hostPlatform != buildPlatform && hostPlatform.libc == "msvcrt") || stdenv.cc.nativeLibc) 21 23 '' 22 24 sed '/^_GL_WARN_ON_USE (gets/d' -i srclib/stdio.in.h 23 25 '';
+4 -2
pkgs/development/libraries/libjpeg-turbo/default.nix
··· 1 - { stdenv, fetchurl, nasm }: 1 + { stdenv, fetchurl, nasm 2 + , hostPlatform 3 + }: 2 4 3 5 stdenv.mkDerivation rec { 4 6 name = "libjpeg-turbo-${version}"; ··· 10 12 }; # github releases still need autotools, surprisingly 11 13 12 14 patches = 13 - stdenv.lib.optional (stdenv.cross.libc or null == "msvcrt") 15 + stdenv.lib.optional (hostPlatform.libc or null == "msvcrt") 14 16 ./mingw-boolean.patch; 15 17 16 18 outputs = [ "bin" "dev" "out" "doc" ];
+2 -1
pkgs/development/libraries/libmsgpack/generic.nix
··· 1 1 { stdenv, cmake 2 2 , version, src, patches ? [ ] 3 + , hostPlatform 3 4 , ... 4 5 }: 5 6 ··· 11 12 nativeBuildInputs = [ cmake ]; 12 13 13 14 crossAttrs = { 14 - } // stdenv.lib.optionalAttrs (stdenv.cross.libc == "msvcrt") { 15 + } // stdenv.lib.optionalAttrs (hostPlatform.libc == "msvcrt") { 15 16 cmakeFlags = "-DMSGPACK_BUILD_EXAMPLES=OFF -DCMAKE_SYSTEM_NAME=Windows"; 16 17 }; 17 18
+5 -3
pkgs/development/libraries/libpng/12.nix
··· 1 - { stdenv, fetchurl, zlib }: 1 + { stdenv, fetchurl, zlib 2 + , buildPlatform, hostPlatform 3 + }: 2 4 3 - assert !(stdenv ? cross) -> zlib != null; 5 + assert hostPlatform == buildPlatform -> zlib != null; 4 6 5 7 stdenv.mkDerivation rec { 6 8 name = "libpng-1.2.57"; ··· 16 18 17 19 passthru = { inherit zlib; }; 18 20 19 - crossAttrs = stdenv.lib.optionalAttrs (stdenv.cross.libc == "libSystem") { 21 + crossAttrs = stdenv.lib.optionalAttrs (hostPlatform.libc == "libSystem") { 20 22 propagatedBuildInputs = []; 21 23 passthru = {}; 22 24 };
+4 -2
pkgs/development/libraries/libpng/default.nix
··· 1 - { stdenv, fetchurl, zlib, apngSupport ? true }: 1 + { stdenv, fetchurl, zlib, apngSupport ? true 2 + , buildPlatform, hostPlatform 3 + }: 2 4 3 5 assert zlib != null; 4 6 ··· 29 31 30 32 # it's hard to cross-run tests and some check programs didn't compile anyway 31 33 makeFlags = stdenv.lib.optional (!doCheck) "check_PROGRAMS="; 32 - doCheck = ! stdenv ? cross; 34 + doCheck = hostPlatform == buildPlatform; 33 35 34 36 passthru = { inherit zlib; }; 35 37
+4 -2
pkgs/development/libraries/libssh2/default.nix
··· 1 - {stdenv, fetchurlBoot, openssl, zlib, windows}: 1 + { stdenv, fetchurlBoot, openssl, zlib, windows 2 + , hostPlatform 3 + }: 2 4 3 5 stdenv.mkDerivation rec { 4 6 name = "libssh2-1.8.0"; ··· 20 22 "--with-libz" 21 23 "--with-libz-prefix=${zlib.crossDrv}" 22 24 ]; 23 - } // stdenv.lib.optionalAttrs (stdenv.cross.libc == "msvcrt") { 25 + } // stdenv.lib.optionalAttrs (hostPlatform.libc == "msvcrt") { 24 26 # mingw needs import library of ws2_32 to build the shared library 25 27 preConfigure = '' 26 28 export LDFLAGS="-L${windows.mingw_w64}/lib $LDFLAGS"
+14 -16
pkgs/development/libraries/libvpx/default.nix
··· 1 - {stdenv, fetchFromGitHub, perl, yasm 1 + { stdenv, fetchFromGitHub, perl, yasm 2 + , hostPlatform 2 3 , vp8DecoderSupport ? true # VP8 decoder 3 4 , vp8EncoderSupport ? true # VP8 encoder 4 5 , vp9DecoderSupport ? true # VP9 decoder ··· 144 145 145 146 postInstall = ''moveToOutput bin "$bin" ''; 146 147 147 - crossAttrs = let 148 - isCygwin = stdenv.cross.libc == "msvcrt"; 149 - isDarwin = stdenv.cross.libc == "libSystem"; 150 - in { 148 + crossAttrs = { 151 149 configurePlatforms = []; 152 150 configureFlags = configureFlags ++ [ 153 151 #"--extra-cflags=" ··· 159 157 # libvpx darwin targets include darwin version (ie. ARCH-darwinXX-gcc, XX being the darwin version) 160 158 # See all_platforms: https://github.com/webmproject/libvpx/blob/master/configure 161 159 # Darwin versions: 10.4=8, 10.5=9, 10.6=10, 10.7=11, 10.8=12, 10.9=13, 10.10=14 162 - "--force-target=${stdenv.cross.config}${( 163 - if isDarwin then ( 164 - if stdenv.cross.osxMinVersion == "10.10" then "14" 165 - else if stdenv.cross.osxMinVersion == "10.9" then "13" 166 - else if stdenv.cross.osxMinVersion == "10.8" then "12" 167 - else if stdenv.cross.osxMinVersion == "10.7" then "11" 168 - else if stdenv.cross.osxMinVersion == "10.6" then "10" 169 - else if stdenv.cross.osxMinVersion == "10.5" then "9" 170 - else "8") 171 - else "")}-gcc" 172 - (if isCygwin then "--enable-static-msvcrt" else "") 160 + "--force-target=${hostPlatform.config}${ 161 + if hostPlatform.isDarwin then 162 + if hostPlatform.osxMinVersion == "10.10" then "14" 163 + else if hostPlatform.osxMinVersion == "10.9" then "13" 164 + else if hostPlatform.osxMinVersion == "10.8" then "12" 165 + else if hostPlatform.osxMinVersion == "10.7" then "11" 166 + else if hostPlatform.osxMinVersion == "10.6" then "10" 167 + else if hostPlatform.osxMinVersion == "10.5" then "9" 168 + else "8" 169 + else ""}-gcc" 170 + (if hostPlatform.isCygwin then "--enable-static-msvcrt" else "") 173 171 ]; 174 172 }; 175 173
+14 -16
pkgs/development/libraries/libvpx/git.nix
··· 1 - {stdenv, fetchgit, perl, yasm 1 + { stdenv, fetchgit, perl, yasm 2 + , hostPlatform 2 3 , vp8DecoderSupport ? true # VP8 decoder 3 4 , vp8EncoderSupport ? true # VP8 encoder 4 5 , vp9DecoderSupport ? true # VP9 decoder ··· 152 153 153 154 postInstall = ''moveToOutput bin "$bin" ''; 154 155 155 - crossAttrs = let 156 - isCygwin = stdenv.cross.libc == "msvcrt"; 157 - isDarwin = stdenv.cross.libc == "libSystem"; 158 - in { 156 + crossAttrs = { 159 157 configurePlatforms = []; 160 158 configureFlags = configureFlags ++ [ 161 159 #"--extra-cflags=" ··· 166 164 # libvpx darwin targets include darwin version (ie. ARCH-darwinXX-gcc, XX being the darwin version) 167 165 # See all_platforms: https://github.com/webmproject/libvpx/blob/master/configure 168 166 # Darwin versions: 10.4=8, 10.5=9, 10.6=10, 10.7=11, 10.8=12, 10.9=13, 10.10=14 169 - "--force-target=${stdenv.cross.config}${( 170 - if isDarwin then ( 171 - if stdenv.cross.osxMinVersion == "10.10" then "14" 172 - else if stdenv.cross.osxMinVersion == "10.9" then "13" 173 - else if stdenv.cross.osxMinVersion == "10.8" then "12" 174 - else if stdenv.cross.osxMinVersion == "10.7" then "11" 175 - else if stdenv.cross.osxMinVersion == "10.6" then "10" 176 - else if stdenv.cross.osxMinVersion == "10.5" then "9" 177 - else "8") 178 - else "")}-gcc" 179 - (if isCygwin then "--enable-static-msvcrt" else "") 167 + "--force-target=${hostPlatform.config}${ 168 + if hostPlatform.isDarwin then 169 + if hostPlatform.osxMinVersion == "10.10" then "14" 170 + else if hostPlatform.osxMinVersion == "10.9" then "13" 171 + else if hostPlatform.osxMinVersion == "10.8" then "12" 172 + else if hostPlatform.osxMinVersion == "10.7" then "11" 173 + else if hostPlatform.osxMinVersion == "10.6" then "10" 174 + else if hostPlatform.osxMinVersion == "10.5" then "9" 175 + else "8" 176 + else ""}-gcc" 177 + (if hostPlatform.isCygwin then "--enable-static-msvcrt" else "") 180 178 ]; 181 179 }; 182 180
+5 -3
pkgs/development/libraries/libxml2/default.nix
··· 1 1 { stdenv, lib, fetchurl, fetchpatch 2 2 , zlib, xz, python2, findXMLCatalogs, libiconv 3 - , pythonSupport ? (! stdenv ? cross) 4 - , icuSupport ? false, icu ? null }: 3 + , buildPlatform, hostPlatform 4 + , pythonSupport ? buildPlatform == hostPlatform 5 + , icuSupport ? false, icu ? null 6 + }: 5 7 6 8 let 7 9 python = python2; ··· 45 47 46 48 doCheck = !stdenv.isDarwin; 47 49 48 - crossAttrs = lib.optionalAttrs (stdenv.cross.libc == "msvcrt") { 50 + crossAttrs = lib.optionalAttrs (hostPlatform.libc == "msvcrt") { 49 51 # creating the DLL is broken ATM 50 52 dontDisableStatic = true; 51 53 configureFlags = configureFlags ++ [ "--disable-shared" ];
+2 -1
pkgs/development/libraries/libxslt/default.nix
··· 1 1 { stdenv, fetchurl, fetchpatch, libxml2, findXMLCatalogs, python2 2 + , buildPlatform, hostPlatform 2 3 , cryptoSupport ? false 3 - , pythonSupport ? (! stdenv ? cross) 4 + , pythonSupport ? buildPlatform == hostPlatform 4 5 }: 5 6 6 7 assert pythonSupport -> python2 != null;
+1 -1
pkgs/development/libraries/newt/default.nix
··· 17 17 NIX_LDFLAGS = "-lncurses"; 18 18 19 19 crossAttrs = { 20 - makeFlags = "CROSS_COMPILE=${stdenv.cross.config}-"; 20 + makeFlags = "CROSS_COMPILE=${stdenv.cc.prefix}"; 21 21 }; 22 22 23 23 meta = with stdenv.lib; {
+4 -2
pkgs/development/libraries/nlohmann_json/default.nix
··· 1 - { stdenv, fetchFromGitHub, cmake }: 1 + { stdenv, fetchFromGitHub, cmake 2 + , hostPlatform 3 + }: 2 4 3 5 stdenv.mkDerivation rec { 4 6 name = "nlohmann_json-${version}"; ··· 21 23 crossAttrs = { 22 24 cmakeFlags = "-DBuildTests=OFF"; 23 25 doCheck = false; 24 - } // stdenv.lib.optionalAttrs (stdenv.cross.libc == "msvcrt") { 26 + } // stdenv.lib.optionalAttrs (hostPlatform.libc == "msvcrt") { 25 27 cmakeFlags = "-DBuildTests=OFF -DCMAKE_SYSTEM_NAME=Windows"; 26 28 }; 27 29
+5 -8
pkgs/development/libraries/openssl/default.nix
··· 1 1 { stdenv, fetchurl, buildPackages, perl 2 + , hostPlatform 2 3 , withCryptodev ? false, cryptodevHeaders 3 - , enableSSL2 ? false }: 4 + , enableSSL2 ? false 5 + }: 4 6 5 7 with stdenv.lib; 6 8 7 9 let 8 10 9 - opensslCrossSystem = stdenv.cross.openssl.system or 11 + opensslCrossSystem = hostPlatform.openssl.system or 10 12 (throw "openssl needs its platform name cross building"); 11 13 12 14 common = args@{ version, sha256, patches ? [] }: stdenv.mkDerivation rec { ··· 23 25 ++ optional (versionOlder version "1.1.0") 24 26 (if stdenv.isDarwin then ./use-etc-ssl-certs-darwin.patch else ./use-etc-ssl-certs.patch) 25 27 ++ optional stdenv.isCygwin ./1.0.1-cygwin64.patch 26 - ++ optional 27 - (versionOlder version "1.0.2" && (stdenv.isDarwin || (stdenv ? cross && stdenv.cross.libc == "libSystem"))) 28 + ++ optional (versionOlder version "1.0.2" && hostPlatform.isDarwin) 28 29 ./darwin-arch.patch; 29 30 30 31 outputs = [ "bin" "dev" "out" "man" ]; ··· 89 90 preConfigure='' 90 91 # It's configure does not like --build or --host 91 92 export configureFlags="${concatStringsSep " " (configureFlags ++ [ opensslCrossSystem ])}" 92 - # WINDRES and RANLIB need to be prefixed when cross compiling; 93 - # the openssl configure script doesn't do that for us 94 - export WINDRES=${stdenv.cross.config}-windres 95 - export RANLIB=${stdenv.cross.config}-ranlib 96 93 ''; 97 94 configureScript = "./Configure"; 98 95 };
+2 -1
pkgs/development/libraries/poppler/default.nix
··· 6 6 , introspectionSupport ? false, gobjectIntrospection ? null 7 7 , utils ? false 8 8 , minimal ? false, suffix ? "glib" 9 + , hostPlatform 9 10 }: 10 11 11 12 let # beware: updates often break cups-filters build ··· 56 57 57 58 crossAttrs.postPatch = 58 59 # there are tests using `strXXX_s` functions that are missing apparently 59 - stdenv.lib.optionalString (stdenv.cross.libc or null == "msvcrt") 60 + stdenv.lib.optionalString (hostPlatform.libc or null == "msvcrt") 60 61 "sed '/^SUBDIRS =/s/ test / /' -i Makefile.in"; 61 62 62 63 meta = with lib; {
+9 -10
pkgs/development/libraries/qt-4.x/4.8/default.nix
··· 1 1 { stdenv, fetchurl, fetchpatch, substituteAll 2 + , hostPlatform 2 3 , libXrender, libXinerama, libXcursor, libXmu, libXv, libXext 3 4 , libXfixes, libXrandr, libSM, freetype, fontconfig, zlib, libjpeg, libpng 4 5 , libmng, which, mesaSupported, mesa, mesa_glu, openssl, dbus, cups, pkgconfig ··· 182 183 rm -rf $out/tests 183 184 ''; 184 185 185 - crossAttrs = let 186 - isMingw = stdenv.cross.libc == "msvcrt"; 187 - in { 186 + crossAttrs = { 188 187 # I've not tried any case other than i686-pc-mingw32. 189 188 # -nomake tools: it fails linking some asian language symbols 190 189 # -no-svg: it fails to build on mingw64 ··· 194 193 -no-svg 195 194 -make qmake -make libs -nomake tools 196 195 -nomake demos -nomake examples -nomake docs 197 - '' + optionalString isMingw " -xplatform win32-g++-4.6"; 196 + '' + optionalString hostPlatform.isMinGW " -xplatform win32-g++-4.6"; 198 197 patches = []; 199 198 preConfigure = '' 200 - sed -i -e 's/ g++/ ${stdenv.cross.config}-g++/' \ 201 - -e 's/ gcc/ ${stdenv.cross.config}-gcc/' \ 202 - -e 's/ ar/ ${stdenv.cross.config}-ar/' \ 203 - -e 's/ strip/ ${stdenv.cross.config}-strip/' \ 204 - -e 's/ windres/ ${stdenv.cross.config}-windres/' \ 199 + sed -i -e 's/ g++/ ${stdenv.cc.prefix}g++/' \ 200 + -e 's/ gcc/ ${stdenv.cc.prefix}gcc/' \ 201 + -e 's/ ar/ ${stdenv.cc.prefix}ar/' \ 202 + -e 's/ strip/ ${stdenv.cc.prefix}strip/' \ 203 + -e 's/ windres/ ${stdenv.cc.prefix}windres/' \ 205 204 mkspecs/win32-g++/qmake.conf 206 205 ''; 207 206 ··· 211 210 ''; 212 211 configurePlatforms = []; 213 212 dontStrip = true; 214 - } // optionalAttrs isMingw { 213 + } // optionalAttrs hostPlatform.isMinGW { 215 214 propagatedBuildInputs = [ ]; 216 215 }; 217 216
+4 -2
pkgs/development/libraries/readline/6.2.nix
··· 1 - { fetchurl, stdenv, ncurses }: 1 + { fetchurl, stdenv, ncurses 2 + , buildPlatform, hostPlatform 3 + }: 2 4 3 5 stdenv.mkDerivation (rec { 4 6 name = "readline-6.2"; ··· 57 59 // 58 60 59 61 # Don't run the native `strip' when cross-compiling. 60 - (if (stdenv ? cross) 62 + (if hostPlatform != buildPlatform 61 63 then { dontStrip = true; } 62 64 else { }))
+4 -2
pkgs/development/libraries/readline/6.3.nix
··· 1 - { fetchurl, stdenv, ncurses }: 1 + { fetchurl, stdenv, ncurses 2 + , buildPlatform, hostPlatform 3 + }: 2 4 3 5 stdenv.mkDerivation rec { 4 6 name = "readline-6.3p08"; ··· 29 31 import ./readline-6.3-patches.nix patch); 30 32 31 33 # Don't run the native `strip' when cross-compiling. 32 - dontStrip = stdenv ? cross; 34 + dontStrip = hostPlatform != buildPlatform; 33 35 bash_cv_func_sigsetjmp = if stdenv.isCygwin then "missing" else null; 34 36 35 37 meta = with stdenv.lib; {
+4 -2
pkgs/development/libraries/readline/7.0.nix
··· 1 - { fetchurl, stdenv, ncurses }: 1 + { fetchurl, stdenv, ncurses 2 + , buildPlatform, hostPlatform 3 + }: 2 4 3 5 stdenv.mkDerivation rec { 4 6 name = "readline-${version}"; ··· 33 35 */ 34 36 35 37 # Don't run the native `strip' when cross-compiling. 36 - dontStrip = stdenv ? cross; 38 + dontStrip = hostPlatform != buildPlatform; 37 39 bash_cv_func_sigsetjmp = if stdenv.isCygwin then "missing" else null; 38 40 39 41 meta = with stdenv.lib; {
+2 -4
pkgs/development/libraries/zlib/default.nix
··· 60 60 crossAttrs = { 61 61 dontStrip = static; 62 62 configurePlatforms = []; 63 - } // stdenv.lib.optionalAttrs (stdenv.cross.libc == "msvcrt") { 63 + } // stdenv.lib.optionalAttrs (hostPlatform.libc == "msvcrt") { 64 64 installFlags = [ 65 65 "BINARY_PATH=$(out)/bin" 66 66 "INCLUDE_PATH=$(dev)/include" ··· 68 68 ]; 69 69 makeFlags = [ 70 70 "-f" "win32/Makefile.gcc" 71 - "PREFIX=${stdenv.cross.config}-" 71 + "PREFIX=${stdenv.cc.prefix}" 72 72 ] ++ stdenv.lib.optional (!static) "SHARED_MODE=1"; 73 73 74 74 # Non-typical naming confuses libtool which then refuses to use zlib's DLL 75 75 # in some cases, e.g. when compiling libpng. 76 76 postInstall = postInstall + "ln -s zlib1.dll $out/bin/libz.dll"; 77 - } // stdenv.lib.optionalAttrs (stdenv.cross.libc == "libSystem") { 78 - makeFlags = [ "RANLIB=${stdenv.cross.config}-ranlib" ]; 79 77 }; 80 78 81 79 passthru.version = version;
+2 -1
pkgs/development/tools/build-managers/cmake/2.8.nix
··· 1 1 { stdenv, fetchurl, fetchpatch, replace, curl, expat, zlib, bzip2 2 2 , useNcurses ? false, ncurses, useQt4 ? false, qt4, wantPS ? false, ps ? null 3 + , buildPlatform, hostPlatform 3 4 }: 4 5 5 6 with stdenv.lib; ··· 35 36 })] ++ 36 37 # Don't search in non-Nix locations such as /usr, but do search in our libc. 37 38 [ ./search-path.patch ] ++ 38 - optional (stdenv ? cross) (fetchurl { 39 + optional (hostPlatform != buildPlatform) (fetchurl { 39 40 name = "fix-darwin-cross-compile.patch"; 40 41 url = "http://public.kitware.com/Bug/file_download.php?" 41 42 + "file_id=4981&type=bug";
+4 -2
pkgs/development/tools/misc/libtool/libtool2.nix
··· 1 - { stdenv, fetchurl, m4, perl, help2man }: 1 + { stdenv, fetchurl, m4, perl, help2man 2 + , buildPlatform, hostPlatform 3 + }: 2 4 3 5 stdenv.mkDerivation rec { 4 6 name = "libtool-2.4.6"; ··· 23 25 24 26 # Don't run the native `strip' when cross-compiling. This breaks at least 25 27 # with `.a' files for MinGW. 26 - dontStrip = stdenv ? cross; 28 + dontStrip = hostPlatform != buildPlatform; 27 29 28 30 meta = { 29 31 description = "GNU Libtool, a generic library support script";
+5 -2
pkgs/games/scummvm/default.nix
··· 1 - { stdenv, fetchurl, SDL, zlib, libmpeg2, libmad, libogg, libvorbis, flac, alsaLib, mesa }: 1 + { stdenv 2 + , fetchurl, SDL, zlib, libmpeg2, libmad, libogg, libvorbis, flac, alsaLib, mesa 3 + , hostPlatform 4 + }: 2 5 3 6 stdenv.mkDerivation rec { 4 7 name = "scummvm-1.9.0"; ··· 16 19 preConfigure = '' 17 20 # Remove the --build flag set by the gcc cross wrapper setup 18 21 # hook 19 - export configureFlags="--host=${stdenv.cross.config}" 22 + export configureFlags="--host=${hostPlatform.config}" 20 23 ''; 21 24 postConfigure = '' 22 25 # They use 'install -s', that calls the native strip instead of the cross
+5 -3
pkgs/misc/uboot/default.nix
··· 1 - { stdenv, fetchurl, bc, dtc, python2 }: 1 + { stdenv, fetchurl, bc, dtc, python2 2 + , hostPlatform 3 + }: 2 4 3 5 let 4 6 buildUBoot = { targetPlatforms ··· 43 45 44 46 crossAttrs = { 45 47 makeFlags = [ 46 - "ARCH=${stdenv.cross.platform.kernelArch}" 47 - "CROSS_COMPILE=${stdenv.cross.config}-" 48 + "ARCH=${hostPlatform.platform.kernelArch}" 49 + "CROSS_COMPILE=${stdenv.cc.prefix}" 48 50 ]; 49 51 }; 50 52
+4 -2
pkgs/os-specific/linux/kernel-headers/default.nix
··· 1 - { stdenv, kernel, perl }: 1 + { stdenv, kernel, perl 2 + , hostPlatform 3 + }: 2 4 3 5 let 4 6 baseBuildFlags = [ "INSTALL_HDR_PATH=$(out)" "headers_install" ]; ··· 13 15 14 16 crossAttrs = { 15 17 inherit (kernel.crossDrv) src patches; 16 - buildFlags = [ "ARCH=${stdenv.cross.platform.kernelArch}" ] ++ baseBuildFlags; 18 + buildFlags = [ "ARCH=${hostPlatform.platform.kernelArch}" ] ++ baseBuildFlags; 17 19 }; 18 20 19 21 installPhase = ''
+3 -2
pkgs/os-specific/linux/kernel/generic.nix
··· 25 25 kernelPatches ? [] 26 26 , ignoreConfigErrors ? stdenv.platform.name != "pc" 27 27 , extraMeta ? {} 28 + , hostPlatform 28 29 , ... 29 30 }: 30 31 ··· 59 60 arch = stdenv.platform.kernelArch; 60 61 61 62 crossAttrs = let 62 - cp = stdenv.cross.platform; 63 + cp = hostPlatform.platform; 63 64 in { 64 65 arch = cp.kernelArch; 65 66 platformName = cp.name; ··· 128 129 }; 129 130 130 131 config = configWithPlatform stdenv.platform; 131 - configCross = configWithPlatform stdenv.cross.platform; 132 + configCross = configWithPlatform hostPlatform.platform; 132 133 133 134 nativeDrv = lib.addPassthru kernel.nativeDrv passthru; 134 135
+1 -1
pkgs/os-specific/linux/kernel/linux-3.10.nix
··· 1 - { stdenv, fetchurl, perl, buildLinux, ... } @ args: 1 + { stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args: 2 2 3 3 import ./generic.nix (args // rec { 4 4 version = "3.10.105";
+1 -1
pkgs/os-specific/linux/kernel/linux-4.11.nix
··· 1 - { stdenv, fetchurl, perl, buildLinux, ... } @ args: 1 + { stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args: 2 2 3 3 import ./generic.nix (args // rec { 4 4 version = "4.11.7";
+1 -1
pkgs/os-specific/linux/kernel/linux-4.4.nix
··· 1 - { stdenv, fetchurl, perl, buildLinux, ... } @ args: 1 + { stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args: 2 2 3 3 import ./generic.nix (args // rec { 4 4 version = "4.4.74";
+1 -1
pkgs/os-specific/linux/kernel/linux-4.9.nix
··· 1 - { stdenv, fetchurl, perl, buildLinux, ... } @ args: 1 + { stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args: 2 2 3 3 import ./generic.nix (args // rec { 4 4 version = "4.9.34";
+1 -1
pkgs/os-specific/linux/kernel/linux-chromiumos-3.18.nix
··· 1 - { stdenv, fetchgit, perl, buildLinux, ncurses, ... } @ args: 1 + { stdenv, hostPlatform, fetchgit, perl, buildLinux, ncurses, ... } @ args: 2 2 3 3 # ChromiumOS requires a 64bit build host 4 4 assert stdenv.is64bit;
+1 -1
pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix
··· 1 - { stdenv, fetchFromGitHub, perl, buildLinux, ... } @ args: 1 + { stdenv, hostPlatform, fetchFromGitHub, perl, buildLinux, ... } @ args: 2 2 3 3 let 4 4 version = "4.11.7";
+1 -1
pkgs/os-specific/linux/kernel/linux-mptcp.nix
··· 1 - { stdenv, fetchurl, perl, buildLinux, ... } @ args: 1 + { stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args: 2 2 3 3 import ./generic.nix (args // rec { 4 4 mptcpVersion = "0.91.3";
+1 -1
pkgs/os-specific/linux/kernel/linux-rpi.nix
··· 1 - { stdenv, fetchFromGitHub, perl, buildLinux, ... } @ args: 1 + { stdenv, hostPlatform, fetchFromGitHub, perl, buildLinux, ... } @ args: 2 2 3 3 let 4 4 modDirVersion = "4.9.24";
+1 -1
pkgs/os-specific/linux/kernel/linux-testing.nix
··· 1 - { stdenv, fetchurl, perl, buildLinux, ... } @ args: 1 + { stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args: 2 2 3 3 import ./generic.nix (args // rec { 4 4 version = "4.12-rc7";
+2 -1
pkgs/os-specific/linux/kernel/manual-config.nix
··· 1 1 { stdenv, runCommand, nettools, bc, perl, gmp, libmpc, mpfr, kmod, openssl 2 2 , writeTextFile, ubootChooser 3 + , hostPlatform 3 4 }: 4 5 5 6 let ··· 232 233 233 234 karch = stdenv.platform.kernelArch; 234 235 235 - crossAttrs = let cp = stdenv.cross.platform; in 236 + crossAttrs = let cp = hostPlatform.platform; in 236 237 (drvAttrs crossConfig cp (kernelPatches ++ crossKernelPatches) crossConfigfile) // { 237 238 makeFlags = commonMakeFlags ++ [ 238 239 "ARCH=${cp.kernelArch}"
+1 -1
pkgs/os-specific/linux/kernel/perf.nix
··· 49 49 /* I don't want cross-python or cross-perl - 50 50 I don't know if cross-python even works */ 51 51 propagatedBuildInputs = [ elfutils.crossDrv newt.crossDrv ]; 52 - makeFlags = "CROSS_COMPILE=${stdenv.cross.config}-"; 52 + makeFlags = "CROSS_COMPILE=${stdenv.cc.prefix}"; 53 53 elfutils = elfutils.crossDrv; 54 54 inherit (kernel.crossDrv) src patches; 55 55 };
+8 -11
pkgs/os-specific/linux/klibc/default.nix
··· 1 - { stdenv, fetchurl, linuxHeaders, perl }: 1 + { stdenv, fetchurl, linuxHeaders, perl 2 + , buildPlatform, hostPlatform 3 + }: 2 4 3 5 let 4 6 commonMakeFlags = [ ··· 23 25 hardeningDisable = [ "format" "stackprotector" ]; 24 26 25 27 makeFlags = commonMakeFlags ++ [ 26 - "KLIBCARCH=${stdenv.platform.kernelArch}" 28 + "KLIBCARCH=${hostPlatform.platform.kernelArch}" 27 29 "KLIBCKERNELSRC=${linuxHeaders}" 28 - ] ++ stdenv.lib.optional (stdenv.platform.kernelArch == "arm") "CONFIG_AEABI=y"; 29 - 30 - crossAttrs = { 31 - makeFlags = commonMakeFlags ++ [ 32 - "KLIBCARCH=${stdenv.cross.platform.kernelArch}" 33 - "KLIBCKERNELSRC=${linuxHeaders.crossDrv}" 34 - "CROSS_COMPILE=${stdenv.cross.config}-" 35 - ] ++ stdenv.lib.optional (stdenv.cross.platform.kernelArch == "arm") "CONFIG_AEABI=y"; 36 - }; 30 + ] # TODO(@Ericson2314): We now can get the ABI from 31 + # `hostPlatform.parsed.abi`, is this still a good idea? 32 + ++ stdenv.lib.optional (hostPlatform.platform.kernelArch == "arm") "CONFIG_AEABI=y" 33 + ++ stdenv.lib.optional (hostPlatform != buildPlatform) "CROSS_COMPILE=${stdenv.cc.prefix}"; 37 34 38 35 # Install static binaries as well. 39 36 postInstall = ''
+6 -3
pkgs/os-specific/linux/mdadm/4.nix
··· 1 - { stdenv, fetchurl, groff }: 1 + { stdenv 2 + , fetchurl, groff 3 + , buildPlatform, hostPlatform 4 + }: 2 5 3 6 assert stdenv.isLinux; 4 7 ··· 19 22 makeFlags = [ 20 23 "NIXOS=1" "INSTALL=install" "INSTALL_BINDIR=$(out)/sbin" 21 24 "MANDIR=$(out)/share/man" "RUN_DIR=/dev/.mdadm" 22 - ] ++ stdenv.lib.optionals (stdenv ? cross) [ 23 - "CROSS_COMPILE=${stdenv.cross.config}-" 25 + ] ++ stdenv.lib.optionals (hostPlatform != buildPlatform) [ 26 + "CROSS_COMPILE=${stdenv.cc.prefix}" 24 27 ]; 25 28 26 29 nativeBuildInputs = [ groff ];
+6 -3
pkgs/os-specific/linux/mdadm/default.nix
··· 1 - { stdenv, fetchurl, groff }: 1 + { stdenv 2 + , fetchurl, groff 3 + , buildPlatform, hostPlatform 4 + }: 2 5 3 6 assert stdenv.isLinux; 4 7 ··· 19 22 makeFlags = [ 20 23 "NIXOS=1" "INSTALL=install" "INSTALL_BINDIR=$(out)/sbin" 21 24 "MANDIR=$(out)/share/man" "RUN_DIR=/dev/.mdadm" 22 - ] ++ stdenv.lib.optionals (stdenv ? cross) [ 23 - "CROSS_COMPILE=${stdenv.cross.config}-" 25 + ] ++ stdenv.lib.optionals (hostPlatform != buildPlatform) [ 26 + "CROSS_COMPILE=${stdenv.cc.prefix}" 24 27 ]; 25 28 26 29 nativeBuildInputs = [ groff ];
-4
pkgs/os-specific/linux/mingetty/default.nix
··· 8 8 sha256 = "05yxrp44ky2kg6qknk1ih0kvwkgbn9fbz77r3vci7agslh5wjm8g"; 9 9 }; 10 10 11 - crossAttrs = { 12 - makeFlags = "CC=${stdenv.cross.config}-gcc"; 13 - }; 14 - 15 11 preInstall = '' 16 12 mkdir -p $out/sbin $out/share/man/man8 17 13 makeFlagsArray=(SBINDIR=$out/sbin MANDIR=$out/share/man/man8)
-4
pkgs/os-specific/linux/procps-ng/default.nix
··· 15 15 16 16 enableParallelBuilding = true; 17 17 18 - crossAttrs = { 19 - CC = stdenv.cross.config + "-gcc"; 20 - }; 21 - 22 18 # Too red 23 19 configureFlags = [ "--disable-modern-top" ]; 24 20
-4
pkgs/os-specific/linux/procps/watch.nix
··· 15 15 16 16 enableParallelBuilding = true; 17 17 18 - crossAttrs = { 19 - CC = stdenv.cross.config + "-gcc"; 20 - }; 21 - 22 18 installPhase = "mkdir $out; mkdir -p $out/bin; cp -p watch $out/bin"; 23 19 24 20 meta = {
+4 -2
pkgs/os-specific/linux/shadow/default.nix
··· 1 1 { stdenv, fetchpatch, fetchFromGitHub, autoreconfHook, libxslt, libxml2 2 2 , docbook_xml_dtd_412, docbook_xsl, gnome_doc_utils, flex, bison 3 - , pam ? null, glibcCross ? null }: 3 + , pam ? null, glibcCross ? null 4 + , buildPlatform, hostPlatform 5 + }: 4 6 5 7 let 6 8 7 9 glibc = 8 - if stdenv ? cross 10 + if hostPlatform != buildPlatform 9 11 then glibcCross 10 12 else assert stdenv ? glibc; stdenv.glibc; 11 13
+1 -5
pkgs/os-specific/linux/sysvinit/default.nix
··· 15 15 sed -i -e "s,/sbin/,$out/sbin/," src/halt.c src/init.c src/paths.h 16 16 ''; 17 17 18 - makeFlags = "SULOGINLIBS=-lcrypt ROOT=$(out) MANDIR=/share/man"; 19 - 20 - crossAttrs = { 21 - makeFlags = "SULOGINLIBS=-lcrypt ROOT=$(out) MANDIR=/share/man CC=${stdenv.cross.config}-gcc"; 22 - }; 18 + makeFlags = [ "SULOGINLIBS=-lcrypt" "ROOT=$(out)" "MANDIR=/share/man" ]; 23 19 24 20 preInstall = 25 21 ''
+1 -1
pkgs/os-specific/windows/jom/default.nix
··· 18 18 QTDIR = qt48; 19 19 20 20 crossAttrs = { 21 - # cmakeFlags = "-DWIN32=1 -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_RC_COMPILER=${stdenv.cross.config}-windres"; 21 + # cmakeFlags = "-DWIN32=1 -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_RC_COMPILER=${stdenv.cc.prefix}windres"; 22 22 QTDIR = qt48.crossDrv; 23 23 preBuild = '' 24 24 export NIX_CROSS_CFLAGS_COMPILE=-fpermissive
+1 -1
pkgs/os-specific/windows/pthread-w32/default.nix
··· 1 1 { fetchurl, stdenv, mingw_headers }: 2 2 3 3 # This file is tweaked for cross-compilation only. 4 - assert stdenv ? cross; 4 + assert hostPlatform != buildPlatform; 5 5 6 6 stdenv.mkDerivation { 7 7 name = "pthread-w32-1.10.0";
+2 -7
pkgs/os-specific/windows/wxMSW-2.8/default.nix
··· 1 1 { stdenv, fetchurl, compat24 ? false, compat26 ? true, unicode ? true, 2 + , hostPlatform 2 3 }: 3 4 4 - assert stdenv ? cross -> stdenv.cross.libc == "msvcrt"; 5 + assert hostPlatform.isWindows; 5 6 6 7 stdenv.mkDerivation { 7 8 name = "wxMSW-2.8.11"; ··· 18 19 (if unicode then "--enable-unicode" else "") 19 20 "--with-opengl" 20 21 ]; 21 - 22 - # Cross build only tested for mingw32 23 - checkCross = throw "This package can only be cross-built" false; 24 - crossAttrs = { 25 - checkCross = true; 26 - }; 27 22 28 23 preConfigure = " 29 24 substituteInPlace configure --replace /usr /no-such-path
-4
pkgs/tools/filesystems/mtdutils/default.nix
··· 15 15 16 16 buildInputs = [ libuuid lzo zlib acl ]; 17 17 18 - crossAttrs = { 19 - makeFlags = "CC=${stdenv.cross.config}-gcc"; 20 - }; 21 - 22 18 meta = { 23 19 description = "Tools for MTD filesystems"; 24 20 license = stdenv.lib.licenses.gpl2Plus;
+12 -14
pkgs/tools/graphics/optipng/default.nix
··· 1 - { stdenv, fetchurl, libpng, static ? false }: 1 + { stdenv, fetchurl, libpng, static ? false 2 + , buildPlatform, hostPlatform 3 + }: 2 4 3 5 # This package comes with its own copy of zlib, libpng and pngxtern 4 6 ··· 15 17 buildInputs = [ libpng ]; 16 18 17 19 LDFLAGS = optional static "-static"; 18 - configureFlags = "--with-system-zlib --with-system-libpng"; 20 + configureFlags = [ 21 + "--with-system-zlib" 22 + "--with-system-libpng" 23 + ] ++ stdenv.lib.optionals (hostPlatform != buildPlatform) [ 24 + #"-prefix=$out" 25 + ]; 19 26 20 - crossAttrs = { 21 - CC="${stdenv.cross.config}-gcc"; 22 - LD="${stdenv.cross.config}-gcc"; 23 - AR="${stdenv.cross.config}-ar"; 24 - RANLIB="${stdenv.cross.config}-ranlib"; 25 - configurePhase = '' 26 - ./configure -prefix="$out" --with-system-zlib --with-system-libpng 27 - ''; 28 - postInstall = optional (stdenv.cross.libc == "msvcrt") '' 29 - mv "$out"/bin/optipng "$out"/bin/optipng.exe 30 - ''; 31 - }; 27 + postInstall = if hostPlatform != buildPlatform && hostPlatform.isWindows then '' 28 + mv "$out"/bin/optipng{,.exe} 29 + '' else null; 32 30 33 31 meta = with stdenv.lib; { 34 32 homepage = http://optipng.sourceforge.net/;
+4 -2
pkgs/tools/networking/tcpdump/default.nix
··· 1 - { stdenv, fetchurl, libpcap, enableStatic ? false }: 1 + { stdenv, fetchurl, libpcap, enableStatic ? false 2 + , hostPlatform 3 + }: 2 4 3 5 stdenv.mkDerivation rec { 4 6 name = "tcpdump-${version}"; ··· 15 17 crossAttrs = { 16 18 LDFLAGS = if enableStatic then "-static" else ""; 17 19 configureFlags = [ "ac_cv_linux_vers=2" ] ++ (stdenv.lib.optional 18 - (stdenv.cross.platform.kernelMajor == "2.4") "--disable-ipv6"); 20 + (hostPlatform.platform.kernelMajor == "2.4") "--disable-ipv6"); 19 21 }; 20 22 21 23 meta = {
+3 -2
pkgs/tools/package-management/nix/default.nix
··· 2 2 , pkgconfig, boehmgc, perlPackages, libsodium, aws-sdk-cpp, brotli, readline 3 3 , autoreconfHook, autoconf-archive, bison, flex, libxml2, libxslt, docbook5, docbook5_xsl 4 4 , libseccomp, busybox 5 + , hostPlatform 5 6 , storeDir ? "/nix/store" 6 7 , stateDir ? "/nix/var" 7 8 , confDir ? "/etc" ··· 95 96 --disable-init-state 96 97 --enable-gc 97 98 '' + stdenv.lib.optionalString ( 98 - stdenv.cross ? nix && stdenv.cross.nix ? system 99 - ) ''--with-system=${stdenv.cross.nix.system}''; 99 + hostPlatform ? nix && hostPlatform.nix ? system 100 + ) ''--with-system=${hostPlatform.nix.system}''; 100 101 101 102 doInstallCheck = false; 102 103 };
-4
pkgs/tools/system/tm/default.nix
··· 10 10 sed -i 's@/usr/bin/install@install@g ; s/gcc/cc/g' Makefile 11 11 ''; 12 12 13 - crossAttrs = { 14 - makeFlags = "CC=${stdenv.cross.config}-gcc"; 15 - }; 16 - 17 13 src = fetchurl { 18 14 url = http://vicerveza.homeunix.net/~viric/soft/tm/tm-0.4.1.tar.gz; 19 15 sha256 = "3b389bc03b6964ad5ffa57a344b891fdbcf7c9b2604adda723a863f83657c4a0";
+3 -6
pkgs/tools/system/ts/default.nix
··· 1 - {stdenv, fetchurl, 2 - sendmailPath ? "/run/wrappers/bin/sendmail" }: 1 + { stdenv, fetchurl 2 + , sendmailPath ? "/run/wrappers/bin/sendmail" 3 + }: 3 4 4 5 stdenv.mkDerivation rec { 5 6 6 7 name = "ts-0.7.6"; 7 8 8 9 installPhase=''make install "PREFIX=$out"''; 9 - 10 - crossAttrs = { 11 - makeFlags = "CC=${stdenv.cross.config}-gcc"; 12 - }; 13 10 14 11 patchPhase = '' 15 12 sed -i s,/usr/sbin/sendmail,${sendmailPath}, mail.c ts.1
+4 -2
pkgs/tools/text/html-tidy/default.nix
··· 1 - { stdenv, fetchFromGitHub, cmake, libxslt }: 1 + { stdenv, fetchFromGitHub, cmake, libxslt 2 + , hostPlatform 3 + }: 2 4 3 5 stdenv.mkDerivation rec { 4 6 name = "html-tidy-${version}"; ··· 14 16 nativeBuildInputs = [ cmake libxslt/*manpage*/ ]; 15 17 16 18 cmakeFlags = stdenv.lib.optional 17 - (stdenv.cross.libc or null == "msvcrt") "-DCMAKE_SYSTEM_NAME=Windows"; 19 + (hostPlatform.libc or null == "msvcrt") "-DCMAKE_SYSTEM_NAME=Windows"; 18 20 19 21 # ATM bin/tidy is statically linked, as upstream provides no other option yet. 20 22 # https://github.com/htacg/tidy-html5/issues/326#issuecomment-160322107
+1 -5
pkgs/tools/text/replace/default.nix
··· 1 - {stdenv, fetchurl}: 1 + { stdenv, fetchurl }: 2 2 3 3 stdenv.mkDerivation { 4 4 name = "replace-2.24"; ··· 9 9 }; 10 10 11 11 makeFlags = "TREE=\$(out) MANTREE=\$(TREE)/share/man"; 12 - 13 - crossAttrs = { 14 - makeFlags = "TREE=\$(out) MANTREE=\$(TREE)/share/man CC=${stdenv.cross.config}-gcc"; 15 - }; 16 12 17 13 preBuild = '' 18 14 sed -e "s@/bin/mv@$(type -P mv)@" -i replace.h
-2
pkgs/top-level/stage.nix
··· 110 110 in { 111 111 stdenv = super.stdenv // { 112 112 inherit (buildPlatform) platform; 113 - } // lib.optionalAttrs (hostPlatform != buildPlatform) { 114 - cross = hostPlatform; 115 113 }; 116 114 inherit (buildPlatform) system platform; 117 115 };