git.iko.soy/typeable/nixpkgs
on master help sign in
generic-builder: use buildInputs for Haskell dependencies

This actually will matter when I (soon) land cross-compilation support, and native deps are compiled for the build, instead of host, platform. But even now, it's good style do this, and one less thing to review later. The use of `$nativePkgs` is unfortunate, as it will need to be swapped out for `$crossPkgs` for build != host builds. This will just a temporarily cause pain, however, as eventually I will change stdenv to use a `$runPkgs` (or moral equivalent) in both case. Closes https://github.com/NixOS/nixpkgs/pull/26480.

commit8a8f0408cd9b7fdda1095718107c800057658c44 authorJohn Ericson <Ericson2314@Yahoo.com> dateThu 8 Jun 2017, 10:55 (9 years ago) parent7bcfdc1
1 file changed+7−9
pkgs/development/haskell-modules/generic-builder.nix+7−9
pkgs/development/haskell-modules/generic-builder.nix+7−9
@@ -144,9 +144,9 @@ let
144144 allPkgconfigDepends = pkgconfigDepends ++ libraryPkgconfigDepends ++ executablePkgconfigDepends ++
145145 optionals doCheck testPkgconfigDepends ++ optionals withBenchmarkDepends benchmarkPkgconfigDepends;
146146
147+ nativeBuildInputs = setupHaskellDepends ++ buildTools ++ libraryToolDepends ++ executableToolDepends;
147148 propagatedBuildInputs = buildDepends ++ libraryHaskellDepends ++ executableHaskellDepends;
148− otherBuildInputs = extraLibraries ++ librarySystemDepends ++ executableSystemDepends ++ setupHaskellDepends ++
149− buildTools ++ libraryToolDepends ++ executableToolDepends ++
149+ otherBuildInputs = extraLibraries ++ librarySystemDepends ++ executableSystemDepends ++
150150 optionals (allPkgconfigDepends != []) ([pkgconfig] ++ allPkgconfigDepends) ++
151151 optionals doCheck (testDepends ++ testHaskellDepends ++ testSystemDepends ++ testToolDepends) ++
152152 # ghcjs's hsc2hs calls out to the native hsc2hs
@@ -181,8 +181,9 @@ stdenv.mkDerivation ({
181181
182182 inherit src;
183183
184− nativeBuildInputs = otherBuildInputs ++ optionals (!hasActiveLibrary) propagatedBuildInputs;
185− propagatedNativeBuildInputs = optionals hasActiveLibrary propagatedBuildInputs;
184+ inherit nativeBuildInputs;
185+ buildInputs = otherBuildInputs ++ optionals (!hasActiveLibrary) propagatedBuildInputs;
186+ propagatedBuildInputs = optionals hasActiveLibrary propagatedBuildInputs;
186187
187188 LANG = "en_US.UTF-8"; # GHC needs the locale configured during the Haddock phase.
188189
@@ -209,11 +210,8 @@ stdenv.mkDerivation ({
209210 setupCompileFlags="${concatStringsSep " " setupCompileFlags}"
210211 configureFlags="${concatStringsSep " " defaultConfigureFlags} $configureFlags"
211212
212− local inputClosure=""
213− for i in $propagatedNativeBuildInputs $nativeBuildInputs; do
214− findInputs $i inputClosure propagated-native-build-inputs
215− done
216− for p in $inputClosure; do
213+ # nativePkgs defined in stdenv/setup.hs
214+ for p in $nativePkgs; do
217215 if [ -d "$p/lib/${ghc.name}/package.conf.d" ]; then
218216 cp -f "$p/lib/${ghc.name}/package.conf.d/"*.conf $packageConfDir/
219217 continue