pkgs/build-support/cabal: add 'testDepends' field to specify build-time dependencies that are required only for running the test suites

This commit is contained in:
Peter Simons 2013-02-24 21:15:25 +01:00
parent 26b192edcc
commit bf5ac53073

View File

@ -8,7 +8,7 @@
# environment overly, but also to keep hash-backwards-compatible with the old cabal.nix.
internalAttrs = [
"internalAttrs" "buildDepends" "buildTools" "extraLibraries" "pkgconfigDepends"
"isLibrary" "isExecutable"
"isLibrary" "isExecutable" "testDepends"
];
# Stuff happening after the user preferences have been processed. We remove
@ -55,6 +55,7 @@
# but often propagatedBuildInputs is preferable anyway
buildInputs = [ghc Cabal] ++ self.extraBuildInputs;
extraBuildInputs = self.buildTools ++
(stdenv.lib.optionals self.doCheck self.testDepends) ++
(if self.pkgconfigDepends == [] then [] else [pkgconfig]) ++
(if self.isLibrary then [] else self.buildDepends ++ self.extraLibraries ++ self.pkgconfigDepends);
@ -68,6 +69,9 @@
# build-depends Cabal field
buildDepends = [];
# build-depends Cabal fields stated in test-suite stanzas
testDepends = [];
# build-tools Cabal field
buildTools = [];