about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-08-20 14:43:41 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-08-30 17:20:32 -0400
commit0828e2d8c369604c56219bd7085256b984087280 (patch)
tree507e0429674ad3a42bf5dcd11413d3c834f95c74 /pkgs/build-support
parent2c2f1e37d4374ea61caefd9389927ea03df4ce31 (diff)
downloadnixlib-0828e2d8c369604c56219bd7085256b984087280.tar
nixlib-0828e2d8c369604c56219bd7085256b984087280.tar.gz
nixlib-0828e2d8c369604c56219bd7085256b984087280.tar.bz2
nixlib-0828e2d8c369604c56219bd7085256b984087280.tar.lz
nixlib-0828e2d8c369604c56219bd7085256b984087280.tar.xz
nixlib-0828e2d8c369604c56219bd7085256b984087280.tar.zst
nixlib-0828e2d8c369604c56219bd7085256b984087280.zip
treewide: Remove usage of remaining redundant platform compatability stuff
Want to get this out of here for 18.09, so it can be deprecated
thereafter.
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/kernel/make-initrd.nix3
-rw-r--r--pkgs/build-support/rust/build-rust-crate.nix24
-rw-r--r--pkgs/build-support/rust/cargo-vendor/cargo-vendor.nix6
-rw-r--r--pkgs/build-support/rust/carnix.nix6
4 files changed, 19 insertions, 20 deletions
diff --git a/pkgs/build-support/kernel/make-initrd.nix b/pkgs/build-support/kernel/make-initrd.nix
index 262bee608edd..22761af158af 100644
--- a/pkgs/build-support/kernel/make-initrd.nix
+++ b/pkgs/build-support/kernel/make-initrd.nix
@@ -13,14 +13,13 @@
 # argument.
 
 { stdenv, perl, cpio, contents, compressor, prepend, ubootTools
-, hostPlatform
 }:
 
 stdenv.mkDerivation rec {
   name = "initrd";
   builder = ./make-initrd.sh;
 
-  makeUInitrd = hostPlatform.platform.kernelTarget == "uImage";
+  makeUInitrd = stdenv.hostPlatform.platform.kernelTarget == "uImage";
 
   nativeBuildInputs = [ perl cpio ]
     ++ stdenv.lib.optional makeUInitrd ubootTools;
diff --git a/pkgs/build-support/rust/build-rust-crate.nix b/pkgs/build-support/rust/build-rust-crate.nix
index 6c7dd67c4002..6605aa27b21e 100644
--- a/pkgs/build-support/rust/build-rust-crate.nix
+++ b/pkgs/build-support/rust/build-rust-crate.nix
@@ -4,7 +4,7 @@
 # This can be useful for deploying packages with NixOps, and to share
 # binary dependencies between projects.
 
-{ lib, buildPlatform, stdenv, defaultCrateOverrides, fetchCrate, ncurses, rustc  }:
+{ lib, stdenv, defaultCrateOverrides, fetchCrate, ncurses, rustc  }:
 
 let makeDeps = dependencies:
       (lib.concatMapStringsSep " " (dep:
@@ -12,14 +12,14 @@ let makeDeps = dependencies:
         (if dep.crateType == "lib" then
            " --extern ${extern}=${dep.out}/lib/lib${extern}-${dep.metadata}.rlib"
          else
-           " --extern ${extern}=${dep.out}/lib/lib${extern}-${dep.metadata}${buildPlatform.extensions.sharedLibrary}")
+           " --extern ${extern}=${dep.out}/lib/lib${extern}-${dep.metadata}${stdenv.hostPlatform.extensions.sharedLibrary}")
       ) dependencies);
 
     # This doesn't appear to be officially documented anywhere yet.
     # See https://github.com/rust-lang-nursery/rust-forge/issues/101.
-    target_os = if buildPlatform.isDarwin
+    target_os = if stdenv.hostPlatform.isDarwin
       then "macos"
-      else buildPlatform.parsed.kernel.name;
+      else stdenv.hostPlatform.parsed.kernel.name;
 
     echo_build_heading = colors: ''
       echo_build_heading() {
@@ -106,20 +106,20 @@ let makeDeps = dependencies:
       export CARGO_PKG_VERSION=${crateVersion}
       export CARGO_PKG_AUTHORS="${authors}"
 
-      export CARGO_CFG_TARGET_ARCH=${buildPlatform.parsed.cpu.name}
+      export CARGO_CFG_TARGET_ARCH=${stdenv.hostPlatform.parsed.cpu.name}
       export CARGO_CFG_TARGET_OS=${target_os}
       export CARGO_CFG_TARGET_FAMILY="unix"
       export CARGO_CFG_UNIX=1
       export CARGO_CFG_TARGET_ENV="gnu"
-      export CARGO_CFG_TARGET_ENDIAN=${if buildPlatform.parsed.cpu.significantByte.name == "littleEndian" then "little" else "big"}
-      export CARGO_CFG_TARGET_POINTER_WIDTH=${toString buildPlatform.parsed.cpu.bits}
-      export CARGO_CFG_TARGET_VENDOR=${buildPlatform.parsed.vendor.name}
+      export CARGO_CFG_TARGET_ENDIAN=${if stdenv.hostPlatform.parsed.cpu.significantByte.name == "littleEndian" then "little" else "big"}
+      export CARGO_CFG_TARGET_POINTER_WIDTH=${toString stdenv.hostPlatform.parsed.cpu.bits}
+      export CARGO_CFG_TARGET_VENDOR=${stdenv.hostPlatform.parsed.vendor.name}
 
       export CARGO_MANIFEST_DIR="."
       export DEBUG="${toString (!release)}"
       export OPT_LEVEL="${toString optLevel}"
-      export TARGET="${buildPlatform.config}"
-      export HOST="${buildPlatform.config}"
+      export TARGET="${stdenv.hostPlatform.config}"
+      export HOST="${stdenv.hostPlatform.config}"
       export PROFILE=${if release then "release" else "debug"}
       export OUT_DIR=$(pwd)/target/build/${crateName}.out
       export CARGO_PKG_VERSION_MAJOR=${builtins.elemAt version 0}
@@ -218,8 +218,8 @@ let makeDeps = dependencies:
            $BUILD_OUT_DIR $EXTRA_BUILD $EXTRA_FEATURES --color ${colors}
 
          EXTRA_LIB=" --extern $CRATE_NAME=target/lib/lib$CRATE_NAME-${metadata}.rlib"
-         if [ -e target/deps/lib$CRATE_NAME-${metadata}${buildPlatform.extensions.sharedLibrary} ]; then
-            EXTRA_LIB="$EXTRA_LIB --extern $CRATE_NAME=target/lib/lib$CRATE_NAME-${metadata}${buildPlatform.extensions.sharedLibrary}"
+         if [ -e target/deps/lib$CRATE_NAME-${metadata}${stdenv.hostPlatform.extensions.sharedLibrary} ]; then
+            EXTRA_LIB="$EXTRA_LIB --extern $CRATE_NAME=target/lib/lib$CRATE_NAME-${metadata}${stdenv.hostPlatform.extensions.sharedLibrary}"
          fi
       }
 
diff --git a/pkgs/build-support/rust/cargo-vendor/cargo-vendor.nix b/pkgs/build-support/rust/cargo-vendor/cargo-vendor.nix
index 486f365f78ac..0779ac0537f6 100644
--- a/pkgs/build-support/rust/cargo-vendor/cargo-vendor.nix
+++ b/pkgs/build-support/rust/cargo-vendor/cargo-vendor.nix
@@ -1,7 +1,7 @@
 # Generated by carnix 0.5.2: carnix Cargo.lock -o cargo-vendor.nix
-{ lib, buildPlatform, buildRustCrate }:
-let kernel = buildPlatform.parsed.kernel.name;
-    abi = buildPlatform.parsed.abi.name;
+{ lib, stdenv, buildRustCrate }:
+let kernel = stdenv.hostPlatform.parsed.kernel.name;
+    abi = stdenv.hostPlatform.parsed.abi.name;
     hasFeature = feature:
       lib.lists.any
         (originName: feature.${originName})
diff --git a/pkgs/build-support/rust/carnix.nix b/pkgs/build-support/rust/carnix.nix
index 22d3fcd0c1fa..0b8b3d60b6c9 100644
--- a/pkgs/build-support/rust/carnix.nix
+++ b/pkgs/build-support/rust/carnix.nix
@@ -1,7 +1,7 @@
 # Generated by carnix 0.7.2: carnix nix
-{ lib, buildPlatform, buildRustCrate, fetchgit }:
-let kernel = buildPlatform.parsed.kernel.name;
-    abi = buildPlatform.parsed.abi.name;
+{ lib, stdenv, buildRustCrate, fetchgit }:
+let kernel = stdenv.hostPlatform.parsed.kernel.name;
+    abi = stdenv.hostPlatform.parsed.abi.name;
     updateFeatures = f: up: functions: builtins.deepSeq f (lib.lists.foldl' (features: fun: fun features) (lib.attrsets.recursiveUpdate f up) functions);
     mapFeatures = features: map (fun: fun { features = features; });
     mkFeatures = feat: lib.lists.foldl (features: featureName: