about summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/linux/kernel-headers/default.nix6
-rw-r--r--pkgs/os-specific/linux/kernel/generic.nix5
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.10.nix2
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.11.nix2
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.4.nix2
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.9.nix2
-rw-r--r--pkgs/os-specific/linux/kernel/linux-chromiumos-3.18.nix2
-rw-r--r--pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix2
-rw-r--r--pkgs/os-specific/linux/kernel/linux-mptcp.nix2
-rw-r--r--pkgs/os-specific/linux/kernel/linux-rpi.nix2
-rw-r--r--pkgs/os-specific/linux/kernel/linux-testing.nix2
-rw-r--r--pkgs/os-specific/linux/kernel/manual-config.nix3
-rw-r--r--pkgs/os-specific/linux/kernel/perf.nix2
-rw-r--r--pkgs/os-specific/linux/klibc/default.nix19
-rw-r--r--pkgs/os-specific/linux/mdadm/4.nix9
-rw-r--r--pkgs/os-specific/linux/mdadm/default.nix9
-rw-r--r--pkgs/os-specific/linux/mingetty/default.nix4
-rw-r--r--pkgs/os-specific/linux/procps-ng/default.nix4
-rw-r--r--pkgs/os-specific/linux/procps/watch.nix4
-rw-r--r--pkgs/os-specific/linux/shadow/default.nix6
-rw-r--r--pkgs/os-specific/linux/sysvinit/default.nix6
-rw-r--r--pkgs/os-specific/windows/jom/default.nix2
-rw-r--r--pkgs/os-specific/windows/pthread-w32/default.nix2
-rw-r--r--pkgs/os-specific/windows/wxMSW-2.8/default.nix11
24 files changed, 49 insertions, 61 deletions
diff --git a/pkgs/os-specific/linux/kernel-headers/default.nix b/pkgs/os-specific/linux/kernel-headers/default.nix
index a33d24fc847ba..da67747b8b249 100644
--- a/pkgs/os-specific/linux/kernel-headers/default.nix
+++ b/pkgs/os-specific/linux/kernel-headers/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, kernel, perl }:
+{ stdenv, kernel, perl
+, hostPlatform
+}:
 
 let
   baseBuildFlags = [ "INSTALL_HDR_PATH=$(out)" "headers_install" ];
@@ -13,7 +15,7 @@ in stdenv.mkDerivation {
 
   crossAttrs = {
     inherit (kernel.crossDrv) src patches;
-    buildFlags = [ "ARCH=${stdenv.cross.platform.kernelArch}" ] ++ baseBuildFlags;
+    buildFlags = [ "ARCH=${hostPlatform.platform.kernelArch}" ] ++ baseBuildFlags;
   };
 
   installPhase = ''
diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix
index 16b35e9aa3e24..bbe8679269272 100644
--- a/pkgs/os-specific/linux/kernel/generic.nix
+++ b/pkgs/os-specific/linux/kernel/generic.nix
@@ -25,6 +25,7 @@
   kernelPatches ? []
 , ignoreConfigErrors ? stdenv.platform.name != "pc"
 , extraMeta ? {}
+, hostPlatform
 , ...
 }:
 
@@ -59,7 +60,7 @@ let
     arch = stdenv.platform.kernelArch;
 
     crossAttrs = let
-        cp = stdenv.cross.platform;
+        cp = hostPlatform.platform;
       in {
         arch = cp.kernelArch;
         platformName = cp.name;
@@ -128,7 +129,7 @@ let
     };
 
   config = configWithPlatform stdenv.platform;
-  configCross = configWithPlatform stdenv.cross.platform;
+  configCross = configWithPlatform hostPlatform.platform;
 
   nativeDrv = lib.addPassthru kernel.nativeDrv passthru;
 
diff --git a/pkgs/os-specific/linux/kernel/linux-3.10.nix b/pkgs/os-specific/linux/kernel/linux-3.10.nix
index 8ab879f7b00e3..9587ba356ff5d 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.10.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.10.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, buildLinux, ... } @ args:
+{ stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args:
 
 import ./generic.nix (args // rec {
   version = "3.10.105";
diff --git a/pkgs/os-specific/linux/kernel/linux-4.11.nix b/pkgs/os-specific/linux/kernel/linux-4.11.nix
index f74b8f62120de..3019c6fcb964c 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.11.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.11.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, buildLinux, ... } @ args:
+{ stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args:
 
 import ./generic.nix (args // rec {
   version = "4.11.7";
diff --git a/pkgs/os-specific/linux/kernel/linux-4.4.nix b/pkgs/os-specific/linux/kernel/linux-4.4.nix
index 5328bb9a04325..4f272c2e43ff7 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.4.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.4.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, buildLinux, ... } @ args:
+{ stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args:
 
 import ./generic.nix (args // rec {
   version = "4.4.73";
diff --git a/pkgs/os-specific/linux/kernel/linux-4.9.nix b/pkgs/os-specific/linux/kernel/linux-4.9.nix
index 38d63a22f70de..a45ba31c0a936 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.9.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.9.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, buildLinux, ... } @ args:
+{ stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args:
 
 import ./generic.nix (args // rec {
   version = "4.9.34";
diff --git a/pkgs/os-specific/linux/kernel/linux-chromiumos-3.18.nix b/pkgs/os-specific/linux/kernel/linux-chromiumos-3.18.nix
index b80c9acd659e9..e27b2afb200e2 100644
--- a/pkgs/os-specific/linux/kernel/linux-chromiumos-3.18.nix
+++ b/pkgs/os-specific/linux/kernel/linux-chromiumos-3.18.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, perl, buildLinux, ncurses, ... } @ args:
+{ stdenv, hostPlatform, fetchgit, perl, buildLinux, ncurses, ... } @ args:
 
 # ChromiumOS requires a 64bit build host
 assert stdenv.is64bit;
diff --git a/pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix b/pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix
index 36a019215124c..7f4a89dc51e2d 100644
--- a/pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix
+++ b/pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, perl, buildLinux, ... } @ args:
+{ stdenv, hostPlatform, fetchFromGitHub, perl, buildLinux, ... } @ args:
 
 let
   version = "4.11.7";
diff --git a/pkgs/os-specific/linux/kernel/linux-mptcp.nix b/pkgs/os-specific/linux/kernel/linux-mptcp.nix
index 3d244b794e940..7e6110bf4a399 100644
--- a/pkgs/os-specific/linux/kernel/linux-mptcp.nix
+++ b/pkgs/os-specific/linux/kernel/linux-mptcp.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, buildLinux, ... } @ args:
+{ stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args:
 
 import ./generic.nix (args // rec {
   mptcpVersion = "0.91.3";
diff --git a/pkgs/os-specific/linux/kernel/linux-rpi.nix b/pkgs/os-specific/linux/kernel/linux-rpi.nix
index 9bc6feb3de228..0e7f332e61771 100644
--- a/pkgs/os-specific/linux/kernel/linux-rpi.nix
+++ b/pkgs/os-specific/linux/kernel/linux-rpi.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, perl, buildLinux, ... } @ args:
+{ stdenv, hostPlatform, fetchFromGitHub, perl, buildLinux, ... } @ args:
 
 let
   modDirVersion = "4.9.24";
diff --git a/pkgs/os-specific/linux/kernel/linux-testing.nix b/pkgs/os-specific/linux/kernel/linux-testing.nix
index 6bde598c47ab7..45c6a5bf0e888 100644
--- a/pkgs/os-specific/linux/kernel/linux-testing.nix
+++ b/pkgs/os-specific/linux/kernel/linux-testing.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, buildLinux, ... } @ args:
+{ stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args:
 
 import ./generic.nix (args // rec {
   version = "4.12-rc6";
diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix
index 3466cafa26604..c295293fa2cca 100644
--- a/pkgs/os-specific/linux/kernel/manual-config.nix
+++ b/pkgs/os-specific/linux/kernel/manual-config.nix
@@ -1,5 +1,6 @@
 { stdenv, runCommand, nettools, bc, perl, gmp, libmpc, mpfr, kmod, openssl
 , writeTextFile, ubootChooser
+, hostPlatform
 }:
 
 let
@@ -232,7 +233,7 @@ stdenv.mkDerivation ((drvAttrs config stdenv.platform (kernelPatches ++ nativeKe
 
   karch = stdenv.platform.kernelArch;
 
-  crossAttrs = let cp = stdenv.cross.platform; in
+  crossAttrs = let cp = hostPlatform.platform; in
     (drvAttrs crossConfig cp (kernelPatches ++ crossKernelPatches) crossConfigfile) // {
       makeFlags = commonMakeFlags ++ [
         "ARCH=${cp.kernelArch}"
diff --git a/pkgs/os-specific/linux/kernel/perf.nix b/pkgs/os-specific/linux/kernel/perf.nix
index 0a3b4070be17d..3fbad924568f7 100644
--- a/pkgs/os-specific/linux/kernel/perf.nix
+++ b/pkgs/os-specific/linux/kernel/perf.nix
@@ -49,7 +49,7 @@ stdenv.mkDerivation {
     /* I don't want cross-python or cross-perl -
        I don't know if cross-python even works */
     propagatedBuildInputs = [ elfutils.crossDrv newt.crossDrv ];
-    makeFlags = "CROSS_COMPILE=${stdenv.cross.config}-";
+    makeFlags = "CROSS_COMPILE=${stdenv.cc.prefix}";
     elfutils = elfutils.crossDrv;
     inherit (kernel.crossDrv) src patches;
   };
diff --git a/pkgs/os-specific/linux/klibc/default.nix b/pkgs/os-specific/linux/klibc/default.nix
index 84b66ac0d9c76..92ac1a77898ca 100644
--- a/pkgs/os-specific/linux/klibc/default.nix
+++ b/pkgs/os-specific/linux/klibc/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchurl, linuxHeaders, perl }:
+{ stdenv, fetchurl, linuxHeaders, perl
+, buildPlatform, hostPlatform
+}:
 
 let
   commonMakeFlags = [
@@ -23,17 +25,12 @@ stdenv.mkDerivation rec {
   hardeningDisable = [ "format" "stackprotector" ];
 
   makeFlags = commonMakeFlags ++ [
-    "KLIBCARCH=${stdenv.platform.kernelArch}"
+    "KLIBCARCH=${hostPlatform.platform.kernelArch}"
     "KLIBCKERNELSRC=${linuxHeaders}"
-  ] ++ stdenv.lib.optional (stdenv.platform.kernelArch == "arm") "CONFIG_AEABI=y";
-
-  crossAttrs = {
-    makeFlags = commonMakeFlags ++ [
-      "KLIBCARCH=${stdenv.cross.platform.kernelArch}"
-      "KLIBCKERNELSRC=${linuxHeaders.crossDrv}"
-      "CROSS_COMPILE=${stdenv.cross.config}-"
-    ] ++ stdenv.lib.optional (stdenv.cross.platform.kernelArch == "arm") "CONFIG_AEABI=y";
-  };
+  ] # TODO(@Ericson2314): We now can get the ABI from
+    # `hostPlatform.parsed.abi`, is this still a good idea?
+    ++ stdenv.lib.optional (hostPlatform.platform.kernelArch == "arm") "CONFIG_AEABI=y"
+    ++ stdenv.lib.optional (hostPlatform != buildPlatform) "CROSS_COMPILE=${stdenv.cc.prefix}";
 
   # Install static binaries as well.
   postInstall = ''
diff --git a/pkgs/os-specific/linux/mdadm/4.nix b/pkgs/os-specific/linux/mdadm/4.nix
index 05d98de0b234b..a83e7c852ee21 100644
--- a/pkgs/os-specific/linux/mdadm/4.nix
+++ b/pkgs/os-specific/linux/mdadm/4.nix
@@ -1,4 +1,7 @@
-{ stdenv, fetchurl, groff }:
+{ stdenv
+, fetchurl, groff
+, buildPlatform, hostPlatform
+}:
 
 assert stdenv.isLinux;
 
@@ -19,8 +22,8 @@ stdenv.mkDerivation rec {
   makeFlags = [
     "NIXOS=1" "INSTALL=install" "INSTALL_BINDIR=$(out)/sbin"
     "MANDIR=$(out)/share/man" "RUN_DIR=/dev/.mdadm"
-  ] ++ stdenv.lib.optionals (stdenv ? cross) [
-    "CROSS_COMPILE=${stdenv.cross.config}-"
+  ] ++ stdenv.lib.optionals (hostPlatform != buildPlatform) [
+    "CROSS_COMPILE=${stdenv.cc.prefix}"
   ];
 
   nativeBuildInputs = [ groff ];
diff --git a/pkgs/os-specific/linux/mdadm/default.nix b/pkgs/os-specific/linux/mdadm/default.nix
index e0109791ef22d..589099c911cf0 100644
--- a/pkgs/os-specific/linux/mdadm/default.nix
+++ b/pkgs/os-specific/linux/mdadm/default.nix
@@ -1,4 +1,7 @@
-{ stdenv, fetchurl, groff }:
+{ stdenv
+, fetchurl, groff
+, buildPlatform, hostPlatform
+}:
 
 assert stdenv.isLinux;
 
@@ -19,8 +22,8 @@ stdenv.mkDerivation rec {
   makeFlags = [
     "NIXOS=1" "INSTALL=install" "INSTALL_BINDIR=$(out)/sbin"
     "MANDIR=$(out)/share/man" "RUN_DIR=/dev/.mdadm"
-  ] ++ stdenv.lib.optionals (stdenv ? cross) [
-    "CROSS_COMPILE=${stdenv.cross.config}-"
+  ] ++ stdenv.lib.optionals (hostPlatform != buildPlatform) [
+    "CROSS_COMPILE=${stdenv.cc.prefix}"
   ];
 
   nativeBuildInputs = [ groff ];
diff --git a/pkgs/os-specific/linux/mingetty/default.nix b/pkgs/os-specific/linux/mingetty/default.nix
index 4e2888fa942a7..a8348acd5d76e 100644
--- a/pkgs/os-specific/linux/mingetty/default.nix
+++ b/pkgs/os-specific/linux/mingetty/default.nix
@@ -8,10 +8,6 @@ stdenv.mkDerivation {
     sha256 = "05yxrp44ky2kg6qknk1ih0kvwkgbn9fbz77r3vci7agslh5wjm8g";
   };
 
-  crossAttrs = {
-    makeFlags = "CC=${stdenv.cross.config}-gcc";
-  };
-
   preInstall = ''
     mkdir -p $out/sbin $out/share/man/man8
     makeFlagsArray=(SBINDIR=$out/sbin MANDIR=$out/share/man/man8)
diff --git a/pkgs/os-specific/linux/procps-ng/default.nix b/pkgs/os-specific/linux/procps-ng/default.nix
index 36f623f38b3a7..2fcf6dbf3c00c 100644
--- a/pkgs/os-specific/linux/procps-ng/default.nix
+++ b/pkgs/os-specific/linux/procps-ng/default.nix
@@ -15,10 +15,6 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  crossAttrs = {
-    CC = stdenv.cross.config + "-gcc";
-  };
-
   # Too red
   configureFlags = [ "--disable-modern-top" ];
 
diff --git a/pkgs/os-specific/linux/procps/watch.nix b/pkgs/os-specific/linux/procps/watch.nix
index 2547e26def4bf..5fdd1287a647d 100644
--- a/pkgs/os-specific/linux/procps/watch.nix
+++ b/pkgs/os-specific/linux/procps/watch.nix
@@ -15,10 +15,6 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  crossAttrs = {
-    CC = stdenv.cross.config + "-gcc";
-  };
-
   installPhase = "mkdir $out; mkdir -p $out/bin; cp -p watch $out/bin";
 
   meta = {
diff --git a/pkgs/os-specific/linux/shadow/default.nix b/pkgs/os-specific/linux/shadow/default.nix
index 6d83c98a422e6..0c0edde05e22a 100644
--- a/pkgs/os-specific/linux/shadow/default.nix
+++ b/pkgs/os-specific/linux/shadow/default.nix
@@ -1,11 +1,13 @@
 { stdenv, fetchpatch, fetchFromGitHub, autoreconfHook, libxslt, libxml2
 , docbook_xml_dtd_412, docbook_xsl, gnome_doc_utils, flex, bison
-, pam ? null, glibcCross ? null }:
+, pam ? null, glibcCross ? null
+, buildPlatform, hostPlatform
+}:
 
 let
 
   glibc =
-    if stdenv ? cross
+    if hostPlatform != buildPlatform
     then glibcCross
     else assert stdenv ? glibc; stdenv.glibc;
 
diff --git a/pkgs/os-specific/linux/sysvinit/default.nix b/pkgs/os-specific/linux/sysvinit/default.nix
index 042e601ec14f3..6ec8abdc1760f 100644
--- a/pkgs/os-specific/linux/sysvinit/default.nix
+++ b/pkgs/os-specific/linux/sysvinit/default.nix
@@ -15,11 +15,7 @@ stdenv.mkDerivation {
     sed -i -e "s,/sbin/,$out/sbin/," src/halt.c src/init.c src/paths.h
   '';
 
-  makeFlags = "SULOGINLIBS=-lcrypt ROOT=$(out) MANDIR=/share/man";
-
-  crossAttrs = {
-    makeFlags = "SULOGINLIBS=-lcrypt ROOT=$(out) MANDIR=/share/man CC=${stdenv.cross.config}-gcc";
-  };
+  makeFlags = [ "SULOGINLIBS=-lcrypt" "ROOT=$(out)" "MANDIR=/share/man" ];
 
   preInstall =
     ''
diff --git a/pkgs/os-specific/windows/jom/default.nix b/pkgs/os-specific/windows/jom/default.nix
index 6537503add8f6..b2b23f2004558 100644
--- a/pkgs/os-specific/windows/jom/default.nix
+++ b/pkgs/os-specific/windows/jom/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
   QTDIR = qt48;
   
   crossAttrs = {
-    # cmakeFlags = "-DWIN32=1 -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_RC_COMPILER=${stdenv.cross.config}-windres";
+    # cmakeFlags = "-DWIN32=1 -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_RC_COMPILER=${stdenv.cc.prefix}windres";
     QTDIR = qt48.crossDrv;
     preBuild = ''
       export NIX_CROSS_CFLAGS_COMPILE=-fpermissive
diff --git a/pkgs/os-specific/windows/pthread-w32/default.nix b/pkgs/os-specific/windows/pthread-w32/default.nix
index dde4f5d73711d..f0b6852d5bf9e 100644
--- a/pkgs/os-specific/windows/pthread-w32/default.nix
+++ b/pkgs/os-specific/windows/pthread-w32/default.nix
@@ -1,7 +1,7 @@
 { fetchurl, stdenv, mingw_headers }:
 
 # This file is tweaked for cross-compilation only.
-assert stdenv ? cross;
+assert hostPlatform != buildPlatform;
 
 stdenv.mkDerivation {
   name = "pthread-w32-1.10.0";
diff --git a/pkgs/os-specific/windows/wxMSW-2.8/default.nix b/pkgs/os-specific/windows/wxMSW-2.8/default.nix
index 5c79460060ad3..8770140cc6335 100644
--- a/pkgs/os-specific/windows/wxMSW-2.8/default.nix
+++ b/pkgs/os-specific/windows/wxMSW-2.8/default.nix
@@ -1,7 +1,8 @@
-{ stdenv, fetchurl, compat24 ? false, compat26 ? true, unicode ? true,
+{ stdenv, fetchurl, compat24 ? false, compat26 ? true, unicode ? true
+, hostPlatform
 }:
 
-assert stdenv ? cross -> stdenv.cross.libc == "msvcrt";
+assert hostPlatform.isWindows;
 
 stdenv.mkDerivation {
   name = "wxMSW-2.8.11";
@@ -19,12 +20,6 @@ stdenv.mkDerivation {
     "--with-opengl"
   ];
 
-  # Cross build only tested for mingw32
-  checkCross = throw "This package can only be cross-built" false;
-  crossAttrs = {
-    checkCross = true;
-  };
-
   preConfigure = "
     substituteInPlace configure --replace /usr /no-such-path
   ";