treewide: {build,host,target}Platform -> stdenv.{build,host,target}Platform

Artturin 2eeb34c2 ecab3ede

+39 -45
+2 -2
nixos/modules/programs/steam.nix
··· 12 type = types.package; 13 default = pkgs.steam.override { 14 extraLibraries = pkgs: with config.hardware.opengl; 15 - if pkgs.hostPlatform.is64bit 16 then [ package ] ++ extraPackages 17 else [ package32 ] ++ extraPackages32; 18 }; 19 defaultText = literalExpression '' 20 pkgs.steam.override { 21 extraLibraries = pkgs: with config.hardware.opengl; 22 - if pkgs.hostPlatform.is64bit 23 then [ package ] ++ extraPackages 24 else [ package32 ] ++ extraPackages32; 25 }
··· 12 type = types.package; 13 default = pkgs.steam.override { 14 extraLibraries = pkgs: with config.hardware.opengl; 15 + if pkgs.stdenv.hostPlatform.is64bit 16 then [ package ] ++ extraPackages 17 else [ package32 ] ++ extraPackages32; 18 }; 19 defaultText = literalExpression '' 20 pkgs.steam.override { 21 extraLibraries = pkgs: with config.hardware.opengl; 22 + if pkgs.stdenv.hostPlatform.is64bit 23 then [ package ] ++ extraPackages 24 else [ package32 ] ++ extraPackages32; 25 }
+3 -3
nixos/modules/services/misc/nix-daemon.nix
··· 819 820 system-features = mkDefault ( 821 [ "nixos-test" "benchmark" "big-parallel" "kvm" ] ++ 822 - optionals (pkgs.hostPlatform ? gcc.arch) ( 823 # a builder can run code for `gcc.arch` and inferior architectures 824 - [ "gccarch-${pkgs.hostPlatform.gcc.arch}" ] ++ 825 - map (x: "gccarch-${x}") (systems.architectures.inferiors.${pkgs.hostPlatform.gcc.arch} or []) 826 ) 827 ); 828 }
··· 819 820 system-features = mkDefault ( 821 [ "nixos-test" "benchmark" "big-parallel" "kvm" ] ++ 822 + optionals (pkgs.stdenv.hostPlatform ? gcc.arch) ( 823 # a builder can run code for `gcc.arch` and inferior architectures 824 + [ "gccarch-${pkgs.stdenv.hostPlatform.gcc.arch}" ] ++ 825 + map (x: "gccarch-${x}") (systems.architectures.inferiors.${pkgs.stdenv.hostPlatform.gcc.arch} or []) 826 ) 827 ); 828 }
+1 -1
nixos/tests/libvirtd.nix
··· 21 }; 22 23 testScript = let 24 - nixosInstallISO = (import ../release.nix {}).iso_minimal.${pkgs.hostPlatform.system}; 25 virshShutdownCmd = if pkgs.stdenv.isx86_64 then "shutdown" else "destroy"; 26 in '' 27 start_all()
··· 21 }; 22 23 testScript = let 24 + nixosInstallISO = (import ../release.nix {}).iso_minimal.${pkgs.stdenv.hostPlatform.system}; 25 virshShutdownCmd = if pkgs.stdenv.isx86_64 then "shutdown" else "destroy"; 26 in '' 27 start_all()
+2 -2
pkgs/applications/blockchains/zcash/default.nix
··· 1 { autoreconfHook, boost180, cargo, coreutils, curl, cxx-rs, db62, fetchFromGitHub 2 - , hexdump, hostPlatform, lib, libevent, libsodium, makeWrapper, rust, rustPlatform 3 , pkg-config, Security, stdenv, testers, utf8cpp, util-linux, zcash, zeromq 4 }: 5 ··· 82 license = licenses.mit; 83 84 # https://github.com/zcash/zcash/issues/4405 85 - broken = hostPlatform.isAarch64 && hostPlatform.isDarwin; 86 }; 87 }
··· 1 { autoreconfHook, boost180, cargo, coreutils, curl, cxx-rs, db62, fetchFromGitHub 2 + , hexdump, lib, libevent, libsodium, makeWrapper, rust, rustPlatform 3 , pkg-config, Security, stdenv, testers, utf8cpp, util-linux, zcash, zeromq 4 }: 5 ··· 82 license = licenses.mit; 83 84 # https://github.com/zcash/zcash/issues/4405 85 + broken = stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isDarwin; 86 }; 87 }
+1 -1
pkgs/applications/editors/emacs/generic.nix
··· 13 , alsa-lib, cairo, acl, gpm, m17n_lib, libotf 14 , sigtool, jansson, harfbuzz, sqlite, nixosTests 15 , recurseIntoAttrs, emacsPackagesFor 16 - , libgccjit, targetPlatform, makeWrapper # native-comp params 17 , fetchFromSavannah, fetchFromBitbucket 18 19 # macOS dependencies for NS and macPort
··· 13 , alsa-lib, cairo, acl, gpm, m17n_lib, libotf 14 , sigtool, jansson, harfbuzz, sqlite, nixosTests 15 , recurseIntoAttrs, emacsPackagesFor 16 + , libgccjit, makeWrapper # native-comp params 17 , fetchFromSavannah, fetchFromBitbucket 18 19 # macOS dependencies for NS and macPort
+1 -2
pkgs/applications/misc/HentaiAtHome/default.nix
··· 1 { buildPackages 2 - , buildPlatform 3 , fetchzip 4 , javaOpts ? "-XX:+UseZGC" 5 , jdk ··· 23 nativeBuildInputs = [ jdk makeWrapper ]; 24 25 LANG = "en_US.UTF-8"; 26 - LOCALE_ARCHIVE = lib.optionalString (buildPlatform.libc == "glibc") 27 "${buildPackages.glibcLocales}/lib/locale/locale-archive"; 28 29 buildPhase = ''
··· 1 { buildPackages 2 , fetchzip 3 , javaOpts ? "-XX:+UseZGC" 4 , jdk ··· 22 nativeBuildInputs = [ jdk makeWrapper ]; 23 24 LANG = "en_US.UTF-8"; 25 + LOCALE_ARCHIVE = lib.optionalString (stdenvNoCC.buildPlatform.libc == "glibc") 26 "${buildPackages.glibcLocales}/lib/locale/locale-archive"; 27 28 buildPhase = ''
+1 -2
pkgs/applications/science/logic/cedille/default.nix
··· 4 , alex 5 , happy 6 , Agda 7 - , buildPlatform 8 , buildPackages 9 , ghcWithPackages 10 }: ··· 30 31 LANG = "en_US.UTF-8"; 32 LOCALE_ARCHIVE = 33 - lib.optionalString (buildPlatform.libc == "glibc") 34 "${buildPackages.glibcLocales}/lib/locale/locale-archive"; 35 36 postPatch = ''
··· 4 , alex 5 , happy 6 , Agda 7 , buildPackages 8 , ghcWithPackages 9 }: ··· 29 30 LANG = "en_US.UTF-8"; 31 LOCALE_ARCHIVE = 32 + lib.optionalString (stdenv.buildPlatform.libc == "glibc") 33 "${buildPackages.glibcLocales}/lib/locale/locale-archive"; 34 35 postPatch = ''
+1 -2
pkgs/applications/video/davinci-resolve/default.nix
··· 3 , cacert 4 , curl 5 , runCommandLocal 6 - , targetPlatform 7 , unzip 8 , appimage-run 9 , addOpenGLRunpath ··· 49 SITEURL = "https://www.blackmagicdesign.com/api/register/us/download/${DOWNLOADID}"; 50 51 USERAGENT = builtins.concatStringsSep " " [ 52 - "User-Agent: Mozilla/5.0 (X11; Linux ${targetPlatform.linuxArch})" 53 "AppleWebKit/537.36 (KHTML, like Gecko)" 54 "Chrome/77.0.3865.75" 55 "Safari/537.36"
··· 3 , cacert 4 , curl 5 , runCommandLocal 6 , unzip 7 , appimage-run 8 , addOpenGLRunpath ··· 48 SITEURL = "https://www.blackmagicdesign.com/api/register/us/download/${DOWNLOADID}"; 49 50 USERAGENT = builtins.concatStringsSep " " [ 51 + "User-Agent: Mozilla/5.0 (X11; Linux ${stdenv.targetPlatform.linuxArch})" 52 "AppleWebKit/537.36 (KHTML, like Gecko)" 53 "Chrome/77.0.3865.75" 54 "Safari/537.36"
+4 -4
pkgs/applications/video/losslesscut-bin/default.nix
··· 1 { lib 2 , callPackage 3 , buildPackages 4 - , hostPlatform 5 }: 6 7 let ··· 34 }; 35 in 36 ( 37 - if hostPlatform.system == "aarch64-darwin" then aarch64-dmg 38 - else if hostPlatform.isDarwin then x86_64-dmg 39 - else if hostPlatform.isCygwin then x86_64-windows 40 else x86_64-appimage 41 ).overrideAttrs 42 (oldAttrs: {
··· 1 { lib 2 + , stdenv 3 , callPackage 4 , buildPackages 5 }: 6 7 let ··· 34 }; 35 in 36 ( 37 + if stdenv.hostPlatform.system == "aarch64-darwin" then aarch64-dmg 38 + else if stdenv.hostPlatform.isDarwin then x86_64-dmg 39 + else if stdenv.hostPlatform.isCygwin then x86_64-windows 40 else x86_64-appimage 41 ).overrideAttrs 42 (oldAttrs: {
+1 -2
pkgs/build-support/flutter/default.nix
··· 26 , git 27 , dart 28 , nukeReferences 29 - , targetPlatform 30 , bash 31 , curl 32 , unzip ··· 57 self = 58 (self: llvmPackages_13.stdenv.mkDerivation (args // { 59 deps = stdenvNoCC.mkDerivation (lib.recursiveUpdate (getAttrsOrNull fetchAttrs args) { 60 - name = "${self.name}-deps-flutter-v${flutter.unwrapped.version}-${targetPlatform.system}.tar.gz"; 61 62 nativeBuildInputs = flutterDeps ++ [ 63 nukeReferences
··· 26 , git 27 , dart 28 , nukeReferences 29 , bash 30 , curl 31 , unzip ··· 56 self = 57 (self: llvmPackages_13.stdenv.mkDerivation (args // { 58 deps = stdenvNoCC.mkDerivation (lib.recursiveUpdate (getAttrsOrNull fetchAttrs args) { 59 + name = "${self.name}-deps-flutter-v${flutter.unwrapped.version}-${stdenvNoCC.targetPlatform.system}.tar.gz"; 60 61 nativeBuildInputs = flutterDeps ++ [ 62 nukeReferences
+3 -3
pkgs/build-support/rust/build-rust-crate/test/brotli-crates.nix
··· 1 - { lib, buildPlatform, buildRustCrate, fetchgit }: 2 - let kernel = buildPlatform.parsed.kernel.name; 3 - abi = buildPlatform.parsed.abi.name; 4 include = includedFiles: src: builtins.filterSource (path: type: 5 lib.lists.any (f: 6 let p = toString (src + ("/" + f)); in
··· 1 + { lib, stdenv, buildRustCrate, fetchgit }: 2 + let kernel = stdenv.buildPlatform.parsed.kernel.name; 3 + abi = stdenv.buildPlatform.parsed.abi.name; 4 include = includedFiles: src: builtins.filterSource (path: type: 5 lib.lists.any (f: 6 let p = toString (src + ("/" + f)); in
+1 -1
pkgs/development/haskell-modules/configuration-common.nix
··· 452 # 453 # # Depends on itself for testing 454 # doctest-discover = addBuildTool super.doctest-discover 455 - # (if pkgs.buildPlatform != pkgs.hostPlatform 456 # then self.buildHaskellPackages.doctest-discover 457 # else dontCheck super.doctest-discover); 458 doctest-discover = dontCheck super.doctest-discover;
··· 452 # 453 # # Depends on itself for testing 454 # doctest-discover = addBuildTool super.doctest-discover 455 + # (if pkgs.stdenv.buildPlatform != pkgs.stdenv.hostPlatform 456 # then self.buildHaskellPackages.doctest-discover 457 # else dontCheck super.doctest-discover); 458 doctest-discover = dontCheck super.doctest-discover;
+1 -2
pkgs/development/libraries/science/math/tensorflow-lite/default.nix
··· 6 , fetchpatch 7 , fetchurl 8 , flatbuffers 9 - , hostPlatform 10 , lib 11 , zlib 12 }: ··· 160 mkdir "$out" 161 162 # copy the static lib and binaries into the output dir 163 - cp -r ./tensorflow/lite/tools/make/gen/linux_${hostPlatform.uname.processor}/{bin,lib} "$out" 164 165 find ./tensorflow/lite -type f -name '*.h' | while read f; do 166 path="$out/include/''${f/.\//}"
··· 6 , fetchpatch 7 , fetchurl 8 , flatbuffers 9 , lib 10 , zlib 11 }: ··· 159 mkdir "$out" 160 161 # copy the static lib and binaries into the output dir 162 + cp -r ./tensorflow/lite/tools/make/gen/linux_${stdenv.hostPlatform.uname.processor}/{bin,lib} "$out" 163 164 find ./tensorflow/lite -type f -name '*.h' | while read f; do 165 path="$out/include/''${f/.\//}"
+2 -2
pkgs/development/python-modules/rfcat/default.nix
··· 1 { lib 2 , buildPythonPackage 3 , fetchFromGitHub 4 , future ··· 6 , numpy 7 , pyserial 8 , pyusb 9 - , hostPlatform 10 , pytestCheckHook 11 , pythonOlder 12 }: ··· 33 pyusb 34 ]; 35 36 - postInstall = lib.optionalString hostPlatform.isLinux '' 37 mkdir -p $out/etc/udev/rules.d 38 cp etc/udev/rules.d/20-rfcat.rules $out/etc/udev/rules.d 39 '';
··· 1 { lib 2 + , stdenv 3 , buildPythonPackage 4 , fetchFromGitHub 5 , future ··· 7 , numpy 8 , pyserial 9 , pyusb 10 , pytestCheckHook 11 , pythonOlder 12 }: ··· 33 pyusb 34 ]; 35 36 + postInstall = lib.optionalString stdenv.hostPlatform.isLinux '' 37 mkdir -p $out/etc/udev/rules.d 38 cp etc/udev/rules.d/20-rfcat.rules $out/etc/udev/rules.d 39 '';
+2 -2
pkgs/games/BeatSaberModManager/default.nix
··· 1 { 2 lib, 3 dotnet-sdk, 4 - targetPlatform, 5 substituteAll, 6 7 buildDotnetModule, ··· 34 patches = [ 35 (substituteAll { 36 src = ./add-runtime-identifier.patch; 37 - runtimeIdentifier = dotnetCorePackages.systemToDotnetRid targetPlatform.system; 38 }) 39 ]; 40
··· 1 { 2 lib, 3 dotnet-sdk, 4 + stdenv, 5 substituteAll, 6 7 buildDotnetModule, ··· 34 patches = [ 35 (substituteAll { 36 src = ./add-runtime-identifier.patch; 37 + runtimeIdentifier = dotnetCorePackages.systemToDotnetRid stdenv.targetPlatform.system; 38 }) 39 ]; 40
+1 -2
pkgs/misc/dxvk/default.nix
··· 1 { lib 2 , pkgs 3 - , hostPlatform 4 , stdenvNoCC 5 , fetchFromGitHub 6 , pkgsCross ··· 8 9 stdenvNoCC.mkDerivation (finalAttrs: 10 let 11 - inherit (hostPlatform.uname) system; 12 # DXVK needs to be a separate derivation because it’s actually a set of DLLs for Windows that 13 # needs to be built with a cross-compiler. 14 dxvk32 = pkgsCross.mingw32.callPackage ./dxvk.nix {
··· 1 { lib 2 , pkgs 3 , stdenvNoCC 4 , fetchFromGitHub 5 , pkgsCross ··· 7 8 stdenvNoCC.mkDerivation (finalAttrs: 9 let 10 + inherit (stdenvNoCC.hostPlatform.uname) system; 11 # DXVK needs to be a separate derivation because it’s actually a set of DLLs for Windows that 12 # needs to be built with a cross-compiler. 13 dxvk32 = pkgsCross.mingw32.callPackage ./dxvk.nix {
+3 -3
pkgs/os-specific/darwin/xcode/default.nix
··· 1 - { buildPlatform, requireFile, targetPlatform, lib }: 2 3 let requireXcode = version: sha256: 4 let 5 xip = "Xcode_" + version + ".xip"; 6 # TODO(alexfmpe): Find out how to validate the .xip signature in Linux 7 - unxip = if buildPlatform.isDarwin 8 then '' 9 open -W ${xip} 10 rm -rf ${xip} ··· 66 xcode_12_1 = requireXcode "12.1" "1widy74dk43wx8iqgd7arzf6q4kzdmaz8pfwymzs8chnq9dqr3wp"; 67 xcode_12_2 = requireXcode "12.2" "17i0wf4pwrxwfgjw7rpw9mcd59nkmys1k5h2rqsw81snzyxy9j0v"; 68 xcode_12_3 = requireXcode "12.3" "0kwf1y4llysf1p0nsbqyzccn7d77my0ldagr5fi3by4k0xy3d189"; 69 - xcode = self."xcode_${lib.replaceStrings ["."] ["_"] (if (targetPlatform ? xcodeVer) then targetPlatform.xcodeVer else "12.3")}"; 70 }) 71
··· 1 + { stdenv, requireFile, lib }: 2 3 let requireXcode = version: sha256: 4 let 5 xip = "Xcode_" + version + ".xip"; 6 # TODO(alexfmpe): Find out how to validate the .xip signature in Linux 7 + unxip = if stdenv.buildPlatform.isDarwin 8 then '' 9 open -W ${xip} 10 rm -rf ${xip} ··· 66 xcode_12_1 = requireXcode "12.1" "1widy74dk43wx8iqgd7arzf6q4kzdmaz8pfwymzs8chnq9dqr3wp"; 67 xcode_12_2 = requireXcode "12.2" "17i0wf4pwrxwfgjw7rpw9mcd59nkmys1k5h2rqsw81snzyxy9j0v"; 68 xcode_12_3 = requireXcode "12.3" "0kwf1y4llysf1p0nsbqyzccn7d77my0ldagr5fi3by4k0xy3d189"; 69 + xcode = self."xcode_${lib.replaceStrings ["."] ["_"] (if (stdenv.targetPlatform ? xcodeVer) then stdenv.targetPlatform.xcodeVer else "12.3")}"; 70 }) 71
+5 -5
pkgs/os-specific/darwin/xcode/sdk-pkgs.nix
··· 1 - { targetPlatform 2 , clang-unwrapped 3 , binutils-unwrapped 4 , runCommand ··· 12 13 let 14 15 - minSdkVersion = targetPlatform.minSdkVersion or "9.0"; 16 17 in 18 ··· 22 type = "derivation"; 23 outPath = xcode + "/Contents/Developer/Platforms/${platform}.platform/Developer/SDKs/${platform}${version}.sdk"; 24 25 - platform = targetPlatform.xcodePlatform; 26 - version = targetPlatform.sdkVer; 27 }; 28 29 binutils = wrapBintoolsWith { ··· 39 extraBuildCommands = '' 40 tr '\n' ' ' < $out/nix-support/cc-cflags > cc-cflags.tmp 41 mv cc-cflags.tmp $out/nix-support/cc-cflags 42 - echo "-target ${targetPlatform.config}" >> $out/nix-support/cc-cflags 43 echo "-isystem ${sdk}/usr/include${lib.optionalString (lib.versionAtLeast "10" sdk.version) " -isystem ${sdk}/usr/include/c++/4.2.1/ -stdlib=libstdc++"}" >> $out/nix-support/cc-cflags 44 ${lib.optionalString (lib.versionAtLeast sdk.version "14") "echo -isystem ${xcode}/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 >> $out/nix-support/cc-cflags"} 45 '';
··· 1 + { stdenv 2 , clang-unwrapped 3 , binutils-unwrapped 4 , runCommand ··· 12 13 let 14 15 + minSdkVersion = stdenv.targetPlatform.minSdkVersion or "9.0"; 16 17 in 18 ··· 22 type = "derivation"; 23 outPath = xcode + "/Contents/Developer/Platforms/${platform}.platform/Developer/SDKs/${platform}${version}.sdk"; 24 25 + platform = stdenv.targetPlatform.xcodePlatform; 26 + version = stdenv.targetPlatform.sdkVer; 27 }; 28 29 binutils = wrapBintoolsWith { ··· 39 extraBuildCommands = '' 40 tr '\n' ' ' < $out/nix-support/cc-cflags > cc-cflags.tmp 41 mv cc-cflags.tmp $out/nix-support/cc-cflags 42 + echo "-target ${stdenv.targetPlatform.config}" >> $out/nix-support/cc-cflags 43 echo "-isystem ${sdk}/usr/include${lib.optionalString (lib.versionAtLeast "10" sdk.version) " -isystem ${sdk}/usr/include/c++/4.2.1/ -stdlib=libstdc++"}" >> $out/nix-support/cc-cflags 44 ${lib.optionalString (lib.versionAtLeast sdk.version "14") "echo -isystem ${xcode}/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 >> $out/nix-support/cc-cflags"} 45 '';
+2 -2
pkgs/test/cross/default.nix
··· 8 ) lib.systems.examples; 9 10 getExecutable = pkgs: pkgFun: exec: 11 - "${pkgFun pkgs}${exec}${pkgs.hostPlatform.extensions.executable}"; 12 13 compareTest = { emulator, pkgFun, hostPkgs, crossPkgs, exec, args ? [] }: let 14 pkgName = (pkgFun hostPkgs).name; ··· 55 56 mapMultiPlatformTest = crossSystemFun: test: lib.mapAttrs (name: system: test rec { 57 crossPkgs = import pkgs.path { 58 - localSystem = { inherit (pkgs.hostPlatform) config; }; 59 crossSystem = crossSystemFun system; 60 }; 61
··· 8 ) lib.systems.examples; 9 10 getExecutable = pkgs: pkgFun: exec: 11 + "${pkgFun pkgs}${exec}${pkgs.stdenv.hostPlatform.extensions.executable}"; 12 13 compareTest = { emulator, pkgFun, hostPkgs, crossPkgs, exec, args ? [] }: let 14 pkgName = (pkgFun hostPkgs).name; ··· 55 56 mapMultiPlatformTest = crossSystemFun: test: lib.mapAttrs (name: system: test rec { 57 crossPkgs = import pkgs.path { 58 + localSystem = { inherit (pkgs.stdenv.hostPlatform) config; }; 59 crossSystem = crossSystemFun system; 60 }; 61
+2 -2
pkgs/tools/compression/zfp/default.nix
··· 1 - { cmake, cudatoolkit, fetchFromGitHub, gfortran, lib, llvmPackages, python3Packages, stdenv, targetPlatform 2 , enableCfp ? true 3 , enableCuda ? false 4 - , enableFortran ? builtins.elem targetPlatform.system gfortran.meta.platforms 5 , enableOpenMP ? true 6 , enablePython ? true 7 , enableUtilities ? true }:
··· 1 + { cmake, cudatoolkit, fetchFromGitHub, gfortran, lib, llvmPackages, python3Packages, stdenv 2 , enableCfp ? true 3 , enableCuda ? false 4 + , enableFortran ? builtins.elem stdenv.targetPlatform.system gfortran.meta.platforms 5 , enableOpenMP ? true 6 , enablePython ? true 7 , enableUtilities ? true }: