From bf5ac530737cd6591dd2c9e590e4b07d907043e1 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Sun, 24 Feb 2013 21:15:25 +0100 Subject: [PATCH] pkgs/build-support/cabal: add 'testDepends' field to specify build-time dependencies that are required only for running the test suites --- pkgs/build-support/cabal/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/cabal/default.nix b/pkgs/build-support/cabal/default.nix index 051da9dc2f8d..26100c98ad7c 100644 --- a/pkgs/build-support/cabal/default.nix +++ b/pkgs/build-support/cabal/default.nix @@ -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 = [];