diff options
author | John Ericson <Ericson2314@yahoo.com> | 2018-06-19 20:12:20 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-19 20:12:20 -0400 |
commit | 142a2289ff72af59220d6a47a85c6fae81848984 (patch) | |
tree | 90d73aa3de7c50b684a43ba82913991c427e0616 /pkgs | |
parent | 843a1cdcae20228f05423ab747a6c0ed37336ff0 (diff) | |
parent | 37eca93aab86a132d5c29f2d4cbe37f6493f03b7 (diff) | |
download | nixlib-142a2289ff72af59220d6a47a85c6fae81848984.tar nixlib-142a2289ff72af59220d6a47a85c6fae81848984.tar.gz nixlib-142a2289ff72af59220d6a47a85c6fae81848984.tar.bz2 nixlib-142a2289ff72af59220d6a47a85c6fae81848984.tar.lz nixlib-142a2289ff72af59220d6a47a85c6fae81848984.tar.xz nixlib-142a2289ff72af59220d6a47a85c6fae81848984.tar.zst nixlib-142a2289ff72af59220d6a47a85c6fae81848984.zip |
Merge pull request #42247 from obsidiansystems/yet-more-haskell-cross
haskell generic-builder: Yet more cross fixes
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/development/haskell-modules/generic-builder.nix | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index 7f3ddc48103b..52128d3fc5d1 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -179,7 +179,8 @@ let allPkgconfigDepends = pkgconfigDepends ++ libraryPkgconfigDepends ++ executablePkgconfigDepends ++ optionals doCheck testPkgconfigDepends ++ optionals doBenchmark benchmarkPkgconfigDepends; - nativeBuildInputs = [ ghc nativeGhc removeReferencesTo ] ++ optional (allPkgconfigDepends != []) pkgconfig ++ + depsBuildBuild = [ nativeGhc ]; + nativeBuildInputs = [ ghc removeReferencesTo ] ++ optional (allPkgconfigDepends != []) pkgconfig ++ setupHaskellDepends ++ buildTools ++ libraryToolDepends ++ executableToolDepends; propagatedBuildInputs = buildDepends ++ libraryHaskellDepends ++ executableHaskellDepends ++ libraryFrameworkDepends; @@ -210,18 +211,6 @@ let cp -f "$p/lib/${ghcName}/package.conf.d/"*.conf ${packageConfDir}/ continue fi - if [ -d "$p/include" ]; then - configureFlags+=" --extra-include-dirs=$p/include" - fi - if [ -d "$p/lib" ]; then - configureFlags+=" --extra-lib-dirs=$p/lib" - fi - '' - # It is not clear why --extra-framework-dirs does work fine on Linux - + optionalString (!buildPlatform.isDarwin || versionAtLeast nativeGhc.version "8.0") '' - if [[ -d "$p/Library/Frameworks" ]]; then - configureFlags+=" --extra-framework-dirs=$p/Library/Frameworks" - fi ''; in @@ -242,7 +231,7 @@ stdenv.mkDerivation ({ inherit src; - inherit nativeBuildInputs; + inherit depsBuildBuild nativeBuildInputs; buildInputs = otherBuildInputs ++ optionals (!hasActiveLibrary) propagatedBuildInputs; propagatedBuildInputs = optionals hasActiveLibrary propagatedBuildInputs; @@ -286,6 +275,19 @@ stdenv.mkDerivation ({ + '' for p in "''${pkgsHostHost[@]}" "''${pkgsHostTarget[@]}"; do ${buildPkgDb ghc.name "$packageConfDir"} + if [ -d "$p/include" ]; then + configureFlags+=" --extra-include-dirs=$p/include" + fi + if [ -d "$p/lib" ]; then + configureFlags+=" --extra-lib-dirs=$p/lib" + fi + '' + # It is not clear why --extra-framework-dirs does work fine on Linux + + optionalString (!buildPlatform.isDarwin || versionAtLeast nativeGhc.version "8.0") '' + if [[ -d "$p/Library/Frameworks" ]]; then + configureFlags+=" --extra-framework-dirs=$p/Library/Frameworks" + fi + '' + '' done '' # only use the links hack if we're actually building dylibs. otherwise, the |