splice.nix: remove toplevel {build,host,target}Platform in __splicedPackages (#350299)

This commit is contained in:
Aleksana 2024-10-24 15:19:21 +08:00 committed by GitHub
commit af50c28579
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 34 additions and 43 deletions

View File

@ -1,7 +1,6 @@
{ stdenv, lib, fetchpatch
, recompressTarball
, buildPackages
, buildPlatform
, pkgsBuildBuild
# Channel data:
, channel, upstream-info

View File

@ -1,9 +1,9 @@
{ hostPlatform, callPackage }:
{ stdenv, callPackage }:
{
signal-desktop =
if hostPlatform.system == "aarch64-linux" then
if stdenv.hostPlatform.system == "aarch64-linux" then
callPackage ./signal-desktop-aarch64.nix { }
else if hostPlatform.isDarwin then
else if stdenv.hostPlatform.isDarwin then
callPackage ./signal-desktop-darwin.nix { }
else
callPackage ./signal-desktop.nix { };

View File

@ -1,11 +1,11 @@
{ lib
, fetchFromGitHub
, hostPlatform
, stdenv
, lld
}:
let
arch = hostPlatform.qemuArch;
arch = stdenv.hostPlatform.qemuArch;
target = ./. + "/${arch}-unknown-none.json";
@ -15,7 +15,7 @@ assert lib.assertMsg (builtins.pathExists target) "Target spec not found";
let
cross = import ../../../.. {
system = hostPlatform.system;
system = stdenv.hostPlatform.system;
crossSystem = lib.systems.examples."${arch}-embedded" // {
rust.rustcTarget = "${arch}-unknown-none";
rust.platform = lib.importJSON target;

View File

@ -1,7 +1,6 @@
{
lib,
stdenv,
targetPlatform,
fetchurl,
python312,
SDL2,
@ -30,7 +29,7 @@ let
hash = "sha256-o1Yg0C5k07NZzc9jQrHXR+kkQl8HZ55U9/fqcpe3Iyw=";
};
}
.${targetPlatform.system} or (throw "${targetPlatform.system} is unsupported.");
.${stdenv.targetPlatform.system} or (throw "${stdenv.targetPlatform.system} is unsupported.");
in
stdenv.mkDerivation (finalAttrs: {
pname = "bombsquad";

View File

@ -5,7 +5,6 @@
, dotnetCorePackages
, openssl
, zlib
, hostPlatform
, nix-update-script
}:
@ -30,7 +29,7 @@ buildDotnetModule rec {
patches = [ ./add-runtime-identifier.patch ];
postPatch = ''
substituteInPlace pupdate.csproj \
--replace @RuntimeIdentifier@ "${dotnetCorePackages.systemToDotnetRid hostPlatform.system}"
--replace @RuntimeIdentifier@ "${dotnetCorePackages.systemToDotnetRid stdenv.hostPlatform.system}"
'';
projectFile = "pupdate.csproj";

View File

@ -3,12 +3,10 @@
callPackage,
writeText,
symlinkJoin,
targetPlatform,
buildPlatform,
darwin,
clang,
llvm,
tools ? callPackage ./tools.nix { inherit buildPlatform; },
tools ? callPackage ./tools.nix { },
stdenv,
stdenvNoCC,
dart,
@ -53,7 +51,7 @@ let
expandDeps = deps: lib.flatten (map expandSingleDep deps);
constants = callPackage ./constants.nix { platform = targetPlatform; };
constants = callPackage ./constants.nix { platform = stdenv.targetPlatform; };
python3 = if lib.versionAtLeast flutterVersion "3.20" then python312 else python39;
@ -64,8 +62,6 @@ let
version
hashes
url
targetPlatform
buildPlatform
;
};
@ -253,7 +249,7 @@ stdenv.mkDerivation (finalAttrs: {
"--embedder-for-target"
"--no-goma"
]
++ lib.optionals (targetPlatform.isx86_64 == false) [
++ lib.optionals (stdenv.targetPlatform.isx86_64 == false) [
"--linux"
"--linux-cpu ${constants.alt-arch}"
]
@ -278,7 +274,7 @@ stdenv.mkDerivation (finalAttrs: {
--out-dir $out \
--target-sysroot $toolchain \
--target-dir $outName \
--target-triple ${targetPlatform.config} \
--target-triple ${stdenv.targetPlatform.config} \
--enable-fontconfig
runHook postConfigure

View File

@ -1,9 +1,7 @@
{
stdenv,
lib,
callPackage,
buildPlatform,
targetPlatform,
hostPlatform,
fetchgit,
tools ? null,
curl,
@ -19,13 +17,14 @@
url,
}@pkgs:
let
target-constants = callPackage ./constants.nix { platform = targetPlatform; };
build-constants = callPackage ./constants.nix { platform = buildPlatform; };
tools = pkgs.tools or (callPackage ./tools.nix { inherit hostPlatform buildPlatform; });
target-constants = callPackage ./constants.nix { platform = stdenv.targetPlatform; };
build-constants = callPackage ./constants.nix { platform = stdenv.buildPlatform; };
tools = pkgs.tools or (callPackage ./tools.nix { });
boolOption = value: if value then "True" else "False";
in
runCommand "flutter-engine-source-${version}-${buildPlatform.system}-${targetPlatform.system}"
runCommand
"flutter-engine-source-${version}-${stdenv.buildPlatform.system}-${stdenv.targetPlatform.system}"
{
pname = "flutter-engine-source";
inherit version;
@ -53,7 +52,7 @@ runCommand "flutter-engine-source-${version}-${buildPlatform.system}-${targetPla
"custom_vars": {
"download_fuchsia_deps": False,
"download_android_deps": False,
"download_linux_deps": ${boolOption targetPlatform.isLinux},
"download_linux_deps": ${boolOption stdenv.targetPlatform.isLinux},
"setup_githooks": False,
"download_esbuild": False,
"download_dart_sdk": False,
@ -83,8 +82,8 @@ runCommand "flutter-engine-source-${version}-${buildPlatform.system}-${targetPla
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash =
(hashes."${buildPlatform.system}" or { })."${targetPlatform.system}"
or (throw "Hash not set for ${targetPlatform.system} on ${buildPlatform.system}");
(hashes."${stdenv.buildPlatform.system}" or { })."${stdenv.targetPlatform.system}"
or (throw "Hash not set for ${stdenv.targetPlatform.system} on ${stdenv.buildPlatform.system}");
}
''
source ${../../../../build-support/fetchgit/deterministic-git}

View File

@ -5,8 +5,6 @@
fetchurl,
writeText,
runCommand,
buildPlatform,
hostPlatform,
darwin,
writeShellScriptBin,
depot_toolsCommit ? "7d95eb2eb054447592585c73a8ff7adad97ecba1",
@ -31,8 +29,8 @@
},
}:
let
constants = callPackage ./constants.nix { platform = buildPlatform; };
host-constants = callPackage ./constants.nix { platform = hostPlatform; };
constants = callPackage ./constants.nix { platform = stdenv.buildPlatform; };
host-constants = callPackage ./constants.nix { platform = stdenv.hostPlatform; };
stdenv-constants = callPackage ./constants.nix { platform = stdenv.hostPlatform; };
in
{

View File

@ -3,7 +3,7 @@
wrapCCWith,
makeWrapper,
runCommand,
targetPlatform,
stdenv,
targetPackages,
zig,
}:
@ -34,9 +34,9 @@ wrapCCWith {
nixSupport.cc-cflags =
[
"-target"
"${targetPlatform.parsed.cpu.name}-${targetPlatform.parsed.kernel.name}-${targetPlatform.parsed.abi.name}"
"${stdenv.targetPlatform.parsed.cpu.name}-${stdenv.targetPlatform.parsed.kernel.name}-${stdenv.targetPlatform.parsed.abi.name}"
]
++ lib.optional (
targetPlatform.isLinux && !(targetPackages.isStatic or false)
stdenv.targetPlatform.isLinux && !(targetPackages.isStatic or false)
) "-Wl,-dynamic-linker=${targetPackages.stdenv.cc.bintools.dynamicLinker}";
}

View File

@ -1,7 +1,7 @@
{
lib,
buildPythonPackage,
hostPlatform,
stdenv,
fetchFromGitHub,
# build dependencies
hatchling,
@ -72,7 +72,7 @@ buildPythonPackage rec {
pythonImportsCheck = [ "conda" ];
# menuinst is currently not packaged
pythonRemoveDeps = lib.optionals (!hostPlatform.isWindows) [ "menuinst" ];
pythonRemoveDeps = lib.optionals (!stdenv.hostPlatform.isWindows) [ "menuinst" ];
meta = {
description = "OS-agnostic, system-level binary package manager";

View File

@ -2,7 +2,7 @@
, fetchFromGitHub
, nixosTests
, rustPlatform
, hostPlatform
, stdenv
, installShellFiles
, cmake
, libsodium
@ -32,7 +32,7 @@ rustPlatform.buildRustPackage rec {
# nix defaults to building for aarch64 _without_ the armv8-a
# crypto extensions, but liboqs depends on these
preBuild = lib.optionalString hostPlatform.isAarch64 ''
preBuild = lib.optionalString stdenv.hostPlatform.isAarch64 ''
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -march=armv8-a+crypto"
'';

View File

@ -25962,9 +25962,11 @@ with pkgs;
fetchurl = import ../build-support/fetchurl/boot.nix {
inherit (stdenv.buildPlatform) system;
};
checkMeta = callPackage ../stdenv/generic/check-meta.nix { };
checkMeta = callPackage ../stdenv/generic/check-meta.nix { inherit (stdenv) hostPlatform; };
});
minimal-bootstrap-sources = callPackage ../os-specific/linux/minimal-bootstrap/stage0-posix/bootstrap-sources.nix { };
minimal-bootstrap-sources = callPackage ../os-specific/linux/minimal-bootstrap/stage0-posix/bootstrap-sources.nix {
inherit (stdenv) hostPlatform;
};
make-minimal-bootstrap-sources = callPackage ../os-specific/linux/minimal-bootstrap/stage0-posix/make-bootstrap-sources.nix {
inherit (stdenv) hostPlatform;
};

View File

@ -119,7 +119,6 @@ let
pkgsTargetTarget
buildPackages pkgs targetPackages
;
inherit (pkgs.stdenv) buildPlatform targetPlatform hostPlatform;
};
splicedPackagesWithXorg = splicedPackages // builtins.removeAttrs splicedPackages.xorg [