haskell.lib.getBuildInputs: Use generic builder passthru to implement

This commit is contained in:
Silvan Mosberger
2018-09-17 23:11:59 +02:00
committed by Peter Simons
parent 1951aea6a5
commit 7c5c3fceff
2 changed files with 13 additions and 58 deletions

View File

@@ -174,8 +174,7 @@ let
(optionalString (versionOlder "7.10" ghc.version && !isHaLVM) "-threaded")
];
isHaskellPkg = x: (x ? pname) && (x ? version) && (x ? env);
isSystemPkg = x: !isHaskellPkg x;
isHaskellPkg = x: x ? isHaskellLibrary;
allPkgconfigDepends = pkgconfigDepends ++ libraryPkgconfigDepends ++ executablePkgconfigDepends ++
optionals doCheck testPkgconfigDepends ++ optionals doBenchmark benchmarkPkgconfigDepends;
@@ -192,7 +191,10 @@ let
optionals doCheck (testDepends ++ testHaskellDepends ++ testSystemDepends ++ testFrameworkDepends) ++
optionals doBenchmark (benchmarkDepends ++ benchmarkHaskellDepends ++ benchmarkSystemDepends ++ benchmarkFrameworkDepends);
allBuildInputs = propagatedBuildInputs ++ otherBuildInputs;
allBuildInputs = propagatedBuildInputs ++ otherBuildInputs ++ depsBuildBuild;
isHaskellPartition =
stdenv.lib.partition isHaskellPkg allBuildInputs;
haskellBuildInputs = stdenv.lib.filter isHaskellPkg allBuildInputs;
systemBuildInputs = stdenv.lib.filter isSystemPkg allBuildInputs;
@@ -429,6 +431,13 @@ stdenv.mkDerivation ({
compiler = ghc;
getBuildInputs = {
inherit propagatedBuildInputs otherBuildInputs allPkgconfigDepends;
haskellBuildInputs = isHaskellPartition.right;
systemBuildInputs = isHaskellPartition.wrong;
};
isHaskellLibrary = isLibrary;
# TODO: ask why the split outputs are configurable at all?