Merge pull request #42247 from obsidiansystems/yet-more-haskell-cross

haskell generic-builder: Yet more cross fixes
This commit is contained in:
John Ericson 2018-06-19 20:12:20 -04:00 committed by GitHub
commit 142a2289ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 14 deletions

View File

@ -179,7 +179,8 @@ let
allPkgconfigDepends = pkgconfigDepends ++ libraryPkgconfigDepends ++ executablePkgconfigDepends ++ allPkgconfigDepends = pkgconfigDepends ++ libraryPkgconfigDepends ++ executablePkgconfigDepends ++
optionals doCheck testPkgconfigDepends ++ optionals doBenchmark benchmarkPkgconfigDepends; optionals doCheck testPkgconfigDepends ++ optionals doBenchmark benchmarkPkgconfigDepends;
nativeBuildInputs = [ ghc nativeGhc removeReferencesTo ] ++ optional (allPkgconfigDepends != []) pkgconfig ++ depsBuildBuild = [ nativeGhc ];
nativeBuildInputs = [ ghc removeReferencesTo ] ++ optional (allPkgconfigDepends != []) pkgconfig ++
setupHaskellDepends ++ setupHaskellDepends ++
buildTools ++ libraryToolDepends ++ executableToolDepends; buildTools ++ libraryToolDepends ++ executableToolDepends;
propagatedBuildInputs = buildDepends ++ libraryHaskellDepends ++ executableHaskellDepends ++ libraryFrameworkDepends; propagatedBuildInputs = buildDepends ++ libraryHaskellDepends ++ executableHaskellDepends ++ libraryFrameworkDepends;
@ -210,18 +211,6 @@ let
cp -f "$p/lib/${ghcName}/package.conf.d/"*.conf ${packageConfDir}/ cp -f "$p/lib/${ghcName}/package.conf.d/"*.conf ${packageConfDir}/
continue continue
fi 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 in
@ -242,7 +231,7 @@ stdenv.mkDerivation ({
inherit src; inherit src;
inherit nativeBuildInputs; inherit depsBuildBuild nativeBuildInputs;
buildInputs = otherBuildInputs ++ optionals (!hasActiveLibrary) propagatedBuildInputs; buildInputs = otherBuildInputs ++ optionals (!hasActiveLibrary) propagatedBuildInputs;
propagatedBuildInputs = optionals hasActiveLibrary propagatedBuildInputs; propagatedBuildInputs = optionals hasActiveLibrary propagatedBuildInputs;
@ -286,6 +275,19 @@ stdenv.mkDerivation ({
+ '' + ''
for p in "''${pkgsHostHost[@]}" "''${pkgsHostTarget[@]}"; do for p in "''${pkgsHostHost[@]}" "''${pkgsHostTarget[@]}"; do
${buildPkgDb ghc.name "$packageConfDir"} ${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 done
'' ''
# only use the links hack if we're actually building dylibs. otherwise, the # only use the links hack if we're actually building dylibs. otherwise, the