From 0828e2d8c369604c56219bd7085256b984087280 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 20 Aug 2018 14:43:41 -0400 Subject: 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. --- pkgs/os-specific/bsd/netbsd/default.nix | 8 ++++---- .../apple-source-releases/libiconv/default.nix | 6 +++--- pkgs/os-specific/darwin/cctools/port.nix | 13 ++++++------ pkgs/os-specific/darwin/xcode/default.nix | 4 ++-- pkgs/os-specific/linux/busybox/sandbox-shell.nix | 4 ++-- pkgs/os-specific/linux/kernel-headers/default.nix | 7 +++---- pkgs/os-specific/linux/kernel/generic.nix | 23 +++++++++++----------- pkgs/os-specific/linux/kernel/linux-4.14.nix | 2 +- pkgs/os-specific/linux/kernel/linux-4.17.nix | 2 +- pkgs/os-specific/linux/kernel/linux-4.18.nix | 2 +- pkgs/os-specific/linux/kernel/linux-4.4.nix | 2 +- pkgs/os-specific/linux/kernel/linux-4.9.nix | 2 +- .../os-specific/linux/kernel/linux-beagleboard.nix | 2 +- .../linux/kernel/linux-copperhead-lts.nix | 2 +- .../linux/kernel/linux-hardkernel-4.14.nix | 2 +- pkgs/os-specific/linux/kernel/linux-mptcp-93.nix | 2 +- pkgs/os-specific/linux/kernel/linux-mptcp.nix | 2 +- pkgs/os-specific/linux/kernel/linux-riscv.nix | 2 +- pkgs/os-specific/linux/kernel/linux-rpi.nix | 2 +- pkgs/os-specific/linux/kernel/linux-samus-4.12.nix | 2 +- .../linux/kernel/linux-testing-bcachefs.nix | 2 +- pkgs/os-specific/linux/kernel/linux-testing.nix | 2 +- pkgs/os-specific/linux/kernel/manual-config.nix | 10 ++++------ pkgs/os-specific/linux/klibc/default.nix | 12 +++++------ pkgs/os-specific/linux/mdadm/default.nix | 3 +-- pkgs/os-specific/linux/musl/default.nix | 4 ++-- pkgs/os-specific/linux/pam/default.nix | 6 +++--- pkgs/os-specific/linux/shadow/default.nix | 9 ++++----- pkgs/os-specific/linux/systemd/default.nix | 3 +-- pkgs/os-specific/linux/uclibc/default.nix | 7 +++---- pkgs/os-specific/windows/pthread-w32/default.nix | 4 ++-- pkgs/os-specific/windows/wxMSW-2.8/default.nix | 4 +--- 32 files changed, 72 insertions(+), 85 deletions(-) (limited to 'pkgs/os-specific') diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index e31d6fea378..2d1909547b6 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -1,4 +1,4 @@ -{ stdenv, hostPlatform, fetchcvs, lib, groff, mandoc, zlib, buildPackages +{ stdenv, fetchcvs, lib, groff, mandoc, zlib, buildPackages , yacc, flex, libressl, bash, less, writeText }: let @@ -32,8 +32,8 @@ let MKUNPRIVED = "yes"; HOST_SH = "${bash}/bin/sh"; OBJCOPY = if stdenv.isDarwin then "true" else "objcopy"; - MACHINE_ARCH = hostPlatform.parsed.cpu.name; - MACHINE_CPU = hostPlatform.parsed.cpu.name; + MACHINE_ARCH = stdenv.hostPlatform.parsed.cpu.name; + MACHINE_CPU = stdenv.hostPlatform.parsed.cpu.name; INSTALL_FILE = "install -U -c"; INSTALL_DIR = "xinstall -U -d"; @@ -478,7 +478,7 @@ in rec { "-DOXTABS=XTABS" "-DRANDOM_MAX=RAND_MAX" "-DINFTIM=-1" - (lib.optionalString hostPlatform.isMusl "-include sys/ttydefaults.h -include sys/file.h") + (lib.optionalString stdenv.hostPlatform.isMusl "-include sys/ttydefaults.h -include sys/file.h") "-DBE32TOH(x)=((void)0)" "-DBE64TOH(x)=((void)0)" "-D__c99inline=__inline" diff --git a/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix index 3d62c396122..ea5a5953606 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix @@ -1,6 +1,6 @@ -{ stdenv, appleDerivation, lib, targetPlatform -, enableStatic ? targetPlatform.isiOS -, enableShared ? !targetPlatform.isiOS +{ stdenv, appleDerivation, lib +, enableStatic ? stdenv.targetPlatform.isiOS +, enableShared ? !stdenv.targetPlatform.isiOS }: appleDerivation { diff --git a/pkgs/os-specific/darwin/cctools/port.nix b/pkgs/os-specific/darwin/cctools/port.nix index 995e9af38cb..fff6eaaa5c1 100644 --- a/pkgs/os-specific/darwin/cctools/port.nix +++ b/pkgs/os-specific/darwin/cctools/port.nix @@ -1,7 +1,6 @@ { stdenv, fetchFromGitHub, autoconf, automake, libtool_2, autoreconfHook , libcxxabi, libuuid , libobjc ? null, maloader ? null -, hostPlatform, targetPlatform , enableDumpNormalizedLibArgs ? false }: @@ -12,17 +11,17 @@ let # 10.x. For 11.0 and higher we will need to upgrade to a newer cctools than the # default version here, which can support the new TBD format via Apple's # libtapi. - useOld = targetPlatform.isiOS; + useOld = stdenv.targetPlatform.isiOS; # The targetPrefix prepended to binary names to allow multiple binuntils on the # PATH to both be usable. targetPrefix = stdenv.lib.optionalString - (targetPlatform != hostPlatform) - "${targetPlatform.config}-"; + (stdenv.targetPlatform != stdenv.hostPlatform) + "${stdenv.targetPlatform.config}-"; in # Non-Darwin alternatives -assert (!hostPlatform.isDarwin) -> maloader != null; +assert (!stdenv.hostPlatform.isDarwin) -> maloader != null; assert enableDumpNormalizedLibArgs -> (!useOld); @@ -77,7 +76,7 @@ let enableParallelBuilding = true; # TODO(@Ericson2314): Always pass "--target" and always targetPrefix. - configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; + configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (stdenv.targetPlatform != stdenv.hostPlatform) "target"; postPatch = '' sed -i -e 's/addStandardLibraryDirectories = true/addStandardLibraryDirectories = false/' cctools/ld64/src/ld/Options.cpp @@ -131,7 +130,7 @@ let }; meta = { - broken = !targetPlatform.isDarwin; # Only supports darwin targets + broken = !stdenv.targetPlatform.isDarwin; # Only supports darwin targets homepage = http://www.opensource.apple.com/source/cctools/; description = "MacOS Compiler Tools (cross-platform port)"; license = stdenv.lib.licenses.apsl20; diff --git a/pkgs/os-specific/darwin/xcode/default.nix b/pkgs/os-specific/darwin/xcode/default.nix index 910f1b91c21..369529d7167 100644 --- a/pkgs/os-specific/darwin/xcode/default.nix +++ b/pkgs/os-specific/darwin/xcode/default.nix @@ -1,4 +1,4 @@ -{ stdenv, requireFile, targetPlatform, lib }: +{ stdenv, requireFile, lib }: let requireXcode = version: sha256: let @@ -46,5 +46,5 @@ in lib.makeExtensible (self: { xcode_9_1 = requireXcode "9.1" "0ab1403wy84ys3yn26fj78cazhpnslmh3nzzp1wxib3mr1afjvic"; xcode_9_2 = requireXcode "9.2" "1bgfgdp266cbbqf2axcflz92frzvhi0qw0jdkcw6r85kdpc8dj4c"; xcode_9_4 = requireXcode "9.4" "6731381785075602a52489f7ea47ece8f6daf225007ba3ffae1fd59b1c0b5f01"; - xcode = self."xcode_${lib.replaceStrings ["."] ["_"] (if targetPlatform.useiOSPrebuilt then targetPlatform.xcodeVer else "8.2")}"; + xcode = self."xcode_${lib.replaceStrings ["."] ["_"] (if stdenv.targetPlatform.useiOSPrebuilt then stdenv.targetPlatform.xcodeVer else "8.2")}"; }) diff --git a/pkgs/os-specific/linux/busybox/sandbox-shell.nix b/pkgs/os-specific/linux/busybox/sandbox-shell.nix index b94fae7f787..de8865ba3ac 100644 --- a/pkgs/os-specific/linux/busybox/sandbox-shell.nix +++ b/pkgs/os-specific/linux/busybox/sandbox-shell.nix @@ -1,9 +1,9 @@ -{ busybox, hostPlatform }: +{ busybox, stdenv}: # Minimal shell for use as basic /bin/sh in sandbox builds busybox.override { # musl roadmap has RISC-V support projected for 1.1.20 - useMusl = !hostPlatform.isRiscV; + useMusl = !stdenv.hostPlatform.isRiscV; enableStatic = true; enableMinimal = true; extraConfig = '' diff --git a/pkgs/os-specific/linux/kernel-headers/default.nix b/pkgs/os-specific/linux/kernel-headers/default.nix index 677bb076b0c..e82b785f624 100644 --- a/pkgs/os-specific/linux/kernel-headers/default.nix +++ b/pkgs/os-specific/linux/kernel-headers/default.nix @@ -1,9 +1,8 @@ { stdenvNoCC, lib, buildPackages -, hostPlatform , fetchurl, perl }: -assert hostPlatform.isLinux; +assert stdenvNoCC.hostPlatform.isLinux; let common = { version, sha256, patches ? null }: stdenvNoCC.mkDerivation { @@ -14,14 +13,14 @@ let inherit sha256; }; - ARCH = hostPlatform.platform.kernelArch; + ARCH = stdenvNoCC.hostPlatform.platform.kernelArch; # It may look odd that we use `stdenvNoCC`, and yet explicit depend on a cc. # We do this so we have a build->build, not build->host, C compiler. depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ perl ]; - extraIncludeDirs = lib.optional hostPlatform.isPowerPC ["ppc"]; + extraIncludeDirs = lib.optional stdenvNoCC.hostPlatform.isPowerPC ["ppc"]; # "patches" array defaults to 'null' to avoid changing hash # and causing mass rebuild diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index 4af5e80a655..e424dff596d 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -35,15 +35,14 @@ # symbolic name and `patch' is the actual patch. The patch may # optionally be compressed with gzip or bzip2. kernelPatches ? [] -, ignoreConfigErrors ? hostPlatform.platform.name != "pc" || - hostPlatform != stdenv.buildPlatform +, ignoreConfigErrors ? stdenv.hostPlatform.platform.name != "pc" || + stdenv.hostPlatform != stdenv.buildPlatform , extraMeta ? {} -, hostPlatform -# easy overrides to hostPlatform.platform members -, autoModules ? hostPlatform.platform.kernelAutoModules -, preferBuiltin ? hostPlatform.platform.kernelPreferBuiltin or false -, kernelArch ? hostPlatform.platform.kernelArch +# easy overrides to stdenv.hostPlatform.platform members +, autoModules ? stdenv.hostPlatform.platform.kernelAutoModules +, preferBuiltin ? stdenv.hostPlatform.platform.kernelPreferBuiltin or false +, kernelArch ? stdenv.hostPlatform.platform.kernelArch , mkValueOverride ? null , ... @@ -69,7 +68,7 @@ let inherit stdenv version structuredExtraConfig mkValueOverride; # append extraConfig for backwards compatibility but also means the user can't override the kernelExtraConfig part - extraConfig = extraConfig + lib.optionalString (hostPlatform.platform ? kernelExtraConfig) hostPlatform.platform.kernelExtraConfig; + extraConfig = extraConfig + lib.optionalString (stdenv.hostPlatform.platform ? kernelExtraConfig) stdenv.hostPlatform.platform.kernelExtraConfig; features = kernelFeatures; # Ensure we know of all extra patches, etc. }; @@ -93,11 +92,11 @@ let nativeBuildInputs = [ perl ] ++ lib.optionals (stdenv.lib.versionAtLeast version "4.16") [ bison flex ]; - platformName = hostPlatform.platform.name; + platformName = stdenv.hostPlatform.platform.name; # e.g. "defconfig" - kernelBaseConfig = if defconfig != null then defconfig else hostPlatform.platform.kernelBaseConfig; + kernelBaseConfig = if defconfig != null then defconfig else stdenv.hostPlatform.platform.kernelBaseConfig; # e.g. "bzImage" - kernelTarget = hostPlatform.platform.kernelTarget; + kernelTarget = stdenv.hostPlatform.platform.kernelTarget; prePatch = kernel.prePatch + '' # Patch kconfig to print "###" after every question so that @@ -128,7 +127,7 @@ let }; kernel = (callPackage ./manual-config.nix {}) { - inherit version modDirVersion src kernelPatches stdenv extraMeta configfile hostPlatform; + inherit version modDirVersion src kernelPatches stdenv extraMeta configfile; config = { CONFIG_MODULES = "y"; CONFIG_FW_LOADER = "m"; }; }; diff --git a/pkgs/os-specific/linux/kernel/linux-4.14.nix b/pkgs/os-specific/linux/kernel/linux-4.14.nix index bbc98592503..000764eca9b 100644 --- a/pkgs/os-specific/linux/kernel/linux-4.14.nix +++ b/pkgs/os-specific/linux/kernel/linux-4.14.nix @@ -1,4 +1,4 @@ -{ stdenv, buildPackages, hostPlatform, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args: +{ stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args: with stdenv.lib; diff --git a/pkgs/os-specific/linux/kernel/linux-4.17.nix b/pkgs/os-specific/linux/kernel/linux-4.17.nix index c9a79fd23cb..5c13f366221 100644 --- a/pkgs/os-specific/linux/kernel/linux-4.17.nix +++ b/pkgs/os-specific/linux/kernel/linux-4.17.nix @@ -1,4 +1,4 @@ -{ stdenv, buildPackages, hostPlatform, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args: +{ stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args: with stdenv.lib; diff --git a/pkgs/os-specific/linux/kernel/linux-4.18.nix b/pkgs/os-specific/linux/kernel/linux-4.18.nix index bbd0bbfbb21..e76beadc27b 100644 --- a/pkgs/os-specific/linux/kernel/linux-4.18.nix +++ b/pkgs/os-specific/linux/kernel/linux-4.18.nix @@ -1,4 +1,4 @@ -{ stdenv, buildPackages, hostPlatform, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args: +{ stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args: with stdenv.lib; diff --git a/pkgs/os-specific/linux/kernel/linux-4.4.nix b/pkgs/os-specific/linux/kernel/linux-4.4.nix index a4433cc434c..7c5f345e340 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, buildPackages, hostPlatform, fetchurl, perl, buildLinux, ... } @ args: +{ stdenv, buildPackages, fetchurl, perl, buildLinux, ... } @ args: buildLinux (args // rec { version = "4.4.153"; diff --git a/pkgs/os-specific/linux/kernel/linux-4.9.nix b/pkgs/os-specific/linux/kernel/linux-4.9.nix index 8fa710a0e46..ed0075b7876 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, buildPackages, hostPlatform, fetchurl, perl, buildLinux, ... } @ args: +{ stdenv, buildPackages, fetchurl, perl, buildLinux, ... } @ args: buildLinux (args // rec { version = "4.9.124"; diff --git a/pkgs/os-specific/linux/kernel/linux-beagleboard.nix b/pkgs/os-specific/linux/kernel/linux-beagleboard.nix index 4f0ff53c59c..e98104f11ca 100644 --- a/pkgs/os-specific/linux/kernel/linux-beagleboard.nix +++ b/pkgs/os-specific/linux/kernel/linux-beagleboard.nix @@ -1,4 +1,4 @@ -{ stdenv, buildPackages, hostPlatform, fetchFromGitHub, perl, buildLinux, ubootTools, dtc, ... } @ args: +{ stdenv, buildPackages, fetchFromGitHub, perl, buildLinux, ubootTools, dtc, ... } @ args: let modDirVersion = "4.14.12"; diff --git a/pkgs/os-specific/linux/kernel/linux-copperhead-lts.nix b/pkgs/os-specific/linux/kernel/linux-copperhead-lts.nix index 85ad00efcd6..366cfd39e4a 100644 --- a/pkgs/os-specific/linux/kernel/linux-copperhead-lts.nix +++ b/pkgs/os-specific/linux/kernel/linux-copperhead-lts.nix @@ -1,4 +1,4 @@ -{ stdenv, buildPackages, hostPlatform, fetchFromGitHub, perl, buildLinux, ... } @ args: +{ stdenv, buildPackages, fetchFromGitHub, perl, buildLinux, ... } @ args: with stdenv.lib; diff --git a/pkgs/os-specific/linux/kernel/linux-hardkernel-4.14.nix b/pkgs/os-specific/linux/kernel/linux-hardkernel-4.14.nix index 2bce56e1e52..d1d7d240cce 100644 --- a/pkgs/os-specific/linux/kernel/linux-hardkernel-4.14.nix +++ b/pkgs/os-specific/linux/kernel/linux-hardkernel-4.14.nix @@ -1,4 +1,4 @@ -{ stdenv, buildPackages, hostPlatform, fetchFromGitHub, perl, buildLinux, libelf, utillinux, ... } @ args: +{ stdenv, buildPackages, fetchFromGitHub, perl, buildLinux, libelf, utillinux, ... } @ args: buildLinux (args // rec { version = "4.14.66-147"; diff --git a/pkgs/os-specific/linux/kernel/linux-mptcp-93.nix b/pkgs/os-specific/linux/kernel/linux-mptcp-93.nix index 2efe357cbd6..8be59fbea90 100644 --- a/pkgs/os-specific/linux/kernel/linux-mptcp-93.nix +++ b/pkgs/os-specific/linux/kernel/linux-mptcp-93.nix @@ -1,4 +1,4 @@ -{ stdenv, buildPackages, hostPlatform, fetchFromGitHub, perl, buildLinux, ... } @ args: +{ stdenv, buildPackages, fetchFromGitHub, perl, buildLinux, ... } @ args: buildLinux (rec { mptcpVersion = "0.93"; diff --git a/pkgs/os-specific/linux/kernel/linux-mptcp.nix b/pkgs/os-specific/linux/kernel/linux-mptcp.nix index a439fd0a6ec..8014cb56526 100644 --- a/pkgs/os-specific/linux/kernel/linux-mptcp.nix +++ b/pkgs/os-specific/linux/kernel/linux-mptcp.nix @@ -1,4 +1,4 @@ -{ stdenv, buildPackages, hostPlatform, fetchFromGitHub, perl, buildLinux, ... } @ args: +{ stdenv, buildPackages, fetchFromGitHub, perl, buildLinux, ... } @ args: buildLinux (rec { mptcpVersion = "0.94"; diff --git a/pkgs/os-specific/linux/kernel/linux-riscv.nix b/pkgs/os-specific/linux/kernel/linux-riscv.nix index 60370311865..dbc69144c4d 100644 --- a/pkgs/os-specific/linux/kernel/linux-riscv.nix +++ b/pkgs/os-specific/linux/kernel/linux-riscv.nix @@ -1,4 +1,4 @@ -{ stdenv, buildPackages, hostPlatform, fetchFromGitHub, perl, buildLinux, libelf, utillinux, ... } @ args: +{ stdenv, buildPackages, fetchFromGitHub, perl, buildLinux, libelf, utillinux, ... } @ args: buildLinux (args // rec { version = "4.16-rc6"; diff --git a/pkgs/os-specific/linux/kernel/linux-rpi.nix b/pkgs/os-specific/linux/kernel/linux-rpi.nix index 203faed0544..e6d7b1cee9d 100644 --- a/pkgs/os-specific/linux/kernel/linux-rpi.nix +++ b/pkgs/os-specific/linux/kernel/linux-rpi.nix @@ -1,4 +1,4 @@ -{ stdenv, buildPackages, hostPlatform, fetchFromGitHub, perl, buildLinux, ... } @ args: +{ stdenv, buildPackages, fetchFromGitHub, perl, buildLinux, ... } @ args: let modDirVersion = "4.14.50"; diff --git a/pkgs/os-specific/linux/kernel/linux-samus-4.12.nix b/pkgs/os-specific/linux/kernel/linux-samus-4.12.nix index 442c8967511..0a936c6c053 100644 --- a/pkgs/os-specific/linux/kernel/linux-samus-4.12.nix +++ b/pkgs/os-specific/linux/kernel/linux-samus-4.12.nix @@ -1,4 +1,4 @@ -{ stdenv, buildPackages, hostPlatform, fetchFromGitHub, perl, buildLinux, ncurses, ... } @ args: +{ stdenv, buildPackages, fetchFromGitHub, perl, buildLinux, ncurses, ... } @ args: buildLinux (args // rec { version = "4.12.2"; diff --git a/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix b/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix index 1fb9866f4e9..f9d2bd11813 100644 --- a/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix +++ b/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix @@ -1,4 +1,4 @@ -{ stdenv, buildPackages, hostPlatform, fetchgit, perl, buildLinux, ... } @ args: +{ stdenv, buildPackages, fetchgit, perl, buildLinux, ... } @ args: buildLinux (args // rec { version = "4.16.2018.08.03"; diff --git a/pkgs/os-specific/linux/kernel/linux-testing.nix b/pkgs/os-specific/linux/kernel/linux-testing.nix index c2feeceb072..44f267bf715 100644 --- a/pkgs/os-specific/linux/kernel/linux-testing.nix +++ b/pkgs/os-specific/linux/kernel/linux-testing.nix @@ -1,4 +1,4 @@ -{ stdenv, buildPackages, hostPlatform, fetchurl, perl, buildLinux, libelf, utillinux, ... } @ args: +{ stdenv, buildPackages, fetchurl, perl, buildLinux, libelf, utillinux, ... } @ args: buildLinux (args // rec { version = "4.19-rc1"; diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 33aa22abaf2..2cc83e62d11 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -36,8 +36,6 @@ in { allowImportFromDerivation ? false, # ignored features ? null, - - hostPlatform }: let @@ -56,8 +54,8 @@ let commonMakeFlags = [ "O=$(buildRoot)" - ] ++ stdenv.lib.optionals (hostPlatform.platform ? kernelMakeFlags) - hostPlatform.platform.kernelMakeFlags; + ] ++ stdenv.lib.optionals (stdenv.hostPlatform.platform ? kernelMakeFlags) + stdenv.hostPlatform.platform.kernelMakeFlags; drvAttrs = config_: platform: kernelPatches: configfile: let @@ -255,7 +253,7 @@ in assert stdenv.lib.versionAtLeast version "4.14" -> libelf != null; assert stdenv.lib.versionAtLeast version "4.15" -> utillinux != null; -stdenv.mkDerivation ((drvAttrs config hostPlatform.platform kernelPatches configfile) // { +stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.platform kernelPatches configfile) // { name = "linux-${version}"; enableParallelBuilding = true; @@ -279,5 +277,5 @@ stdenv.mkDerivation ((drvAttrs config hostPlatform.platform kernelPatches config "CROSS_COMPILE=${stdenv.cc.targetPrefix}" ]; - karch = hostPlatform.platform.kernelArch; + karch = stdenv.hostPlatform.platform.kernelArch; }) diff --git a/pkgs/os-specific/linux/klibc/default.nix b/pkgs/os-specific/linux/klibc/default.nix index c503b982aa2..8cae61d56a9 100644 --- a/pkgs/os-specific/linux/klibc/default.nix +++ b/pkgs/os-specific/linux/klibc/default.nix @@ -1,6 +1,4 @@ -{ stdenv, fetchurl, linuxHeaders, perl -, buildPlatform, hostPlatform -}: +{ stdenv, fetchurl, linuxHeaders, perl }: let commonMakeFlags = [ @@ -25,12 +23,12 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" "stackprotector" ]; makeFlags = commonMakeFlags ++ [ - "KLIBCARCH=${hostPlatform.platform.kernelArch}" + "KLIBCARCH=${stdenv.hostPlatform.platform.kernelArch}" "KLIBCKERNELSRC=${linuxHeaders}" ] # 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.targetPrefix}"; + # `stdenv.hostPlatform.parsed.abi`, is this still a good idea? + ++ stdenv.lib.optional (stdenv.hostPlatform.platform.kernelArch == "arm") "CONFIG_AEABI=y" + ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "CROSS_COMPILE=${stdenv.cc.targetPrefix}"; # Install static binaries as well. postInstall = '' diff --git a/pkgs/os-specific/linux/mdadm/default.nix b/pkgs/os-specific/linux/mdadm/default.nix index 6de666630bb..52a5f16bc52 100644 --- a/pkgs/os-specific/linux/mdadm/default.nix +++ b/pkgs/os-specific/linux/mdadm/default.nix @@ -1,6 +1,5 @@ { stdenv, writeScript , fetchurl, groff -, buildPlatform, hostPlatform }: let @@ -32,7 +31,7 @@ stdenv.mkDerivation rec { "NIXOS=1" "INSTALL=install" "INSTALL_BINDIR=$(out)/sbin" "MANDIR=$(out)/share/man" "RUN_DIR=/dev/.mdadm" "STRIP=" - ] ++ stdenv.lib.optionals (hostPlatform != buildPlatform) [ + ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "CROSS_COMPILE=${stdenv.cc.targetPrefix}" ]; diff --git a/pkgs/os-specific/linux/musl/default.nix b/pkgs/os-specific/linux/musl/default.nix index e586539db08..9628ec51676 100644 --- a/pkgs/os-specific/linux/musl/default.nix +++ b/pkgs/os-specific/linux/musl/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchurl, hostPlatform +{ stdenv, lib, fetchurl , linuxHeaders ? null , useBSDCompatHeaders ? true }: @@ -61,7 +61,7 @@ stdenv.mkDerivation rec { configureFlagsArray+=("--syslibdir=$out/lib") ''; - CFLAGS="-fstack-protector-strong" + lib.optionalString hostPlatform.isPower " -mlong-double-64"; + CFLAGS="-fstack-protector-strong" + lib.optionalString stdenv.hostPlatform.isPower " -mlong-double-64"; configureFlags = [ "--enable-shared" diff --git a/pkgs/os-specific/linux/pam/default.nix b/pkgs/os-specific/linux/pam/default.nix index 0e703397249..9db581ad527 100644 --- a/pkgs/os-specific/linux/pam/default.nix +++ b/pkgs/os-specific/linux/pam/default.nix @@ -1,4 +1,4 @@ -{ stdenv, buildPackages, hostPlatform, fetchurl, fetchpatch, flex, cracklib, db4 }: +{ stdenv, buildPackages, fetchurl, fetchpatch, flex, cracklib, db4 }: stdenv.mkDerivation rec { name = "linux-pam-${version}"; @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4"; }; - patches = stdenv.lib.optionals (hostPlatform.libc == "musl") [ + patches = stdenv.lib.optionals (stdenv.hostPlatform.libc == "musl") [ (fetchpatch { url = "https://git.alpinelinux.org/cgit/aports/plain/main/linux-pam/fix-compat.patch?id=05a62bda8ec255d7049a2bd4cf0fdc4b32bdb2cc"; sha256 = "1h5yp5h2mqp1fcwiwwklyfpa69a3i03ya32pivs60fd7g5bqa7sf"; @@ -47,7 +47,7 @@ stdenv.mkDerivation rec { preConfigure = '' configureFlags="$configureFlags --includedir=$out/include/security" - '' + stdenv.lib.optionalString (hostPlatform.libc == "musl") '' + '' + stdenv.lib.optionalString (stdenv.hostPlatform.libc == "musl") '' # export ac_cv_search_crypt=no # (taken from Alpine linux, apparently insecure but also doesn't build O:)) # disable insecure modules diff --git a/pkgs/os-specific/linux/shadow/default.nix b/pkgs/os-specific/linux/shadow/default.nix index 885ea3421f6..8c778e72b70 100644 --- a/pkgs/os-specific/linux/shadow/default.nix +++ b/pkgs/os-specific/linux/shadow/default.nix @@ -1,15 +1,14 @@ { stdenv, fetchpatch, fetchFromGitHub, autoreconfHook, libxslt, libxml2 , docbook_xml_dtd_412, docbook_xsl, gnome-doc-utils, flex, bison , pam ? null, glibcCross ? null -, buildPlatform, hostPlatform }: let glibc = - if hostPlatform != buildPlatform + if stdenv.hostPlatform != stdenv.buildPlatform then glibcCross - else assert hostPlatform.libc == "glibc"; stdenv.cc.libc; + else assert stdenv.hostPlatform.libc == "glibc"; stdenv.cc.libc; dots_in_usernames = fetchpatch { url = http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-apps/shadow/files/shadow-4.1.3-dots-in-usernames.patch; @@ -63,9 +62,9 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-man" "--with-group-name-max-length=32" - ] ++ stdenv.lib.optional (hostPlatform.libc != "glibc") "--disable-nscd"; + ] ++ stdenv.lib.optional (stdenv.hostPlatform.libc != "glibc") "--disable-nscd"; - preBuild = stdenv.lib.optionalString (hostPlatform.libc == "glibc") + preBuild = stdenv.lib.optionalString (stdenv.hostPlatform.libc == "glibc") '' substituteInPlace lib/nscd.c --replace /usr/sbin/nscd ${glibc.bin}/bin/nscd ''; diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 912ba5b5e0e..b4caa63799c 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -8,7 +8,6 @@ , ninja, meson, python3Packages, glibcLocales , patchelf , getent -, hostPlatform , buildPackages , withSelinux ? false, libselinux , withLibseccomp ? libseccomp.meta.available, libseccomp @@ -79,7 +78,7 @@ in stdenv.mkDerivation rec { "-Dsystem-gid-max=499" # "-Dtime-epoch=1" - (if stdenv.isAarch32 || stdenv.isAarch64 || !hostPlatform.isEfi then "-Dgnu-efi=false" else "-Dgnu-efi=true") + (if stdenv.isAarch32 || stdenv.isAarch64 || !stdenv.hostPlatform.isEfi then "-Dgnu-efi=false" else "-Dgnu-efi=true") "-Defi-libdir=${toString gnu-efi}/lib" "-Defi-includedir=${toString gnu-efi}/include/efi" "-Defi-ldsdir=${toString gnu-efi}/lib" diff --git a/pkgs/os-specific/linux/uclibc/default.nix b/pkgs/os-specific/linux/uclibc/default.nix index 3da12c41dc1..de1e47faf66 100644 --- a/pkgs/os-specific/linux/uclibc/default.nix +++ b/pkgs/os-specific/linux/uclibc/default.nix @@ -1,6 +1,5 @@ { stdenv, buildPackages , fetchurl, linuxHeaders, libiconvReal -, buildPlatform, hostPlatform , extraConfig ? "" }: @@ -40,7 +39,7 @@ let UCLIBC_SUSV4_LEGACY y UCLIBC_HAS_THREADS_NATIVE y KERNEL_HEADERS "${linuxHeaders}/include" - '' + stdenv.lib.optionalString (stdenv.isAarch32 && buildPlatform != hostPlatform) '' + '' + stdenv.lib.optionalString (stdenv.isAarch32 && stdenv.buildPlatform != stdenv.hostPlatform) '' CONFIG_ARM_EABI y ARCH_WANTS_BIG_ENDIAN n ARCH_BIG_ENDIAN n @@ -69,7 +68,7 @@ stdenv.mkDerivation { cat << EOF | parseconfig ${nixConfig} ${extraConfig} - ${hostPlatform.platform.uclibc.extraConfig or ""} + ${stdenv.hostPlatform.platform.uclibc.extraConfig or ""} EOF ( set +o pipefail; yes "" | make oldconfig ) ''; @@ -82,7 +81,7 @@ stdenv.mkDerivation { depsBuildBuild = [ buildPackages.stdenv.cc ]; makeFlags = [ - "ARCH=${hostPlatform.parsed.cpu.name}" + "ARCH=${stdenv.hostPlatform.parsed.cpu.name}" "VERBOSE=1" ] ++ stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "CROSS=${stdenv.cc.targetPrefix}" diff --git a/pkgs/os-specific/windows/pthread-w32/default.nix b/pkgs/os-specific/windows/pthread-w32/default.nix index e84270270f8..226bbfb16df 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, hostPlatform, buildPlatform, mingwrt }: +{ fetchurl, stdenv, mingwrt }: # This file is tweaked for cross-compilation only. -assert hostPlatform != buildPlatform; +assert stdenv.hostPlatform != stdenv.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 748bf39a1f2..65690af9869 100644 --- a/pkgs/os-specific/windows/wxMSW-2.8/default.nix +++ b/pkgs/os-specific/windows/wxMSW-2.8/default.nix @@ -1,6 +1,4 @@ -{ stdenv, fetchurl, compat24 ? false, compat26 ? true, unicode ? true -, hostPlatform -}: +{ stdenv, fetchurl, compat24 ? false, compat26 ? true, unicode ? true }: stdenv.mkDerivation { name = "wxMSW-2.8.11"; -- cgit 1.4.1