Skip to content

Commit b81ee9d

Browse files
committed
makeStdenvCross: Remove
It is inlined into the cross stdenv, which is its last use-case after the previous commit.
1 parent 839f96a commit b81ee9d

2 files changed

Lines changed: 17 additions & 32 deletions

File tree

pkgs/stdenv/adapters.nix

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -53,35 +53,6 @@ rec {
5353
});
5454
};
5555

56-
57-
# Return a modified stdenv that adds a cross compiler to the
58-
# builds.
59-
makeStdenvCross = { stdenv
60-
, cc
61-
, buildPlatform, hostPlatform, targetPlatform
62-
, # Prior overrides are surely not valid as packages built
63-
# with this run on a different platform, so disable by
64-
# default.
65-
overrides ? _: _: {}
66-
} @ overrideArgs:
67-
overrideArgs.stdenv.override (old: {
68-
inherit
69-
buildPlatform hostPlatform targetPlatform
70-
cc overrides;
71-
72-
allowedRequisites = null;
73-
extraNativeBuildInputs = old.extraNativeBuildInputs
74-
# without proper `file` command, libtool sometimes fails
75-
# to recognize 64-bit DLLs
76-
++ stdenv.lib.optional (hostPlatform.config == "x86_64-w64-mingw32") pkgs.file
77-
++ stdenv.lib.optional
78-
(hostPlatform.isAarch64 || hostPlatform.isMips || hostPlatform.libc == "musl")
79-
pkgs.updateAutotoolsGnuConfigScriptsHook
80-
;
81-
82-
extraBuildInputs = [ ]; # Old ones run on wrong platform
83-
});
84-
8556
/* Modify a stdenv so that the specified attributes are added to
8657
every derivation returned by its mkDerivation function.
8758

pkgs/stdenv/cross/default.nix

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,31 @@ in lib.init bootStages ++ [
3434
(buildPackages: {
3535
inherit config overlays;
3636
selfBuild = false;
37-
stdenv = buildPackages.makeStdenvCross {
38-
inherit (buildPackages) stdenv;
37+
stdenv = buildPackages.stdenv.override (old: rec {
3938
buildPlatform = localSystem;
4039
hostPlatform = crossSystem;
4140
targetPlatform = crossSystem;
41+
42+
# Prior overrides are surely not valid as packages built with this run on
43+
# a different platform, and so are disabled.
44+
overrides = _: _: {};
45+
extraBuildInputs = [ ]; # Old ones run on wrong platform
46+
4247
cc = if crossSystem.useiOSPrebuilt or false
4348
then buildPackages.darwin.iosSdkPkgs.clang
4449
else if crossSystem.useAndroidPrebuilt
4550
then buildPackages.androidenv."androidndkPkgs_${crossSystem.ndkVer}".gcc
4651
else buildPackages.gcc;
47-
};
52+
53+
extraNativeBuildInputs = old.extraNativeBuildInputs
54+
# without proper `file` command, libtool sometimes fails
55+
# to recognize 64-bit DLLs
56+
++ lib.optional (hostPlatform.config == "x86_64-w64-mingw32") buildPackages.file
57+
++ lib.optional
58+
(hostPlatform.isAarch64 || hostPlatform.isMips || hostPlatform.libc == "musl")
59+
buildPackages.updateAutotoolsGnuConfigScriptsHook
60+
;
61+
});
4862
})
4963

5064
]

0 commit comments

Comments
 (0)