@@ -78,7 +78,7 @@ let
7878 # A function that builds a "native" stdenv (one that uses tools in
7979 # /usr etc.).
8080 makeStdenv =
81− { cc, fetchurl, extraPath ? [], overrides ? (self: super: { }) }:
81+ { cc, fetchurl, extraPath ? [], overrides ? (self: super: { }), extraNativeBuildInputs ? [] }:
8282
8383 import ../generic {
8484 buildPlatform = localSystem;
@@ -94,10 +94,10 @@ let
9494 if system == "x86_64-cygwin" then prehookCygwin else
9595 prehookBase;
9696
97− extraNativeBuildInputs =
98− if system == "i686-cygwin" then extraNativeBuildInputsCygwin else
97+ extraNativeBuildInputs = extraNativeBuildInputs ++
98+ (if system == "i686-cygwin" then extraNativeBuildInputsCygwin else
9999 if system == "x86_64-cygwin" then extraNativeBuildInputsCygwin else
100− [];
100+ []);
101101
102102 initialPath = extraPath ++ path;
103103
@@ -163,6 +163,7 @@ in
163163 inherit (prevStage.stdenv) cc fetchurl;
164164 extraPath = [ prevStage.xz ];
165165 overrides = self: super: { inherit (prevStage) xz; };
166+ extraNativeBuildInputs = if localSystem.isLinux then [ prevStage.patchelf ] else [];
166167 };
167168 })
168169