File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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]
You can’t perform that action at this time.
0 commit comments