From ebdff3841aa5d2fe145b2ff5074c0a23f2657ca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benno=20F=C3=BCnfst=C3=BCck?= Date: Sun, 17 Nov 2013 13:09:01 +0100 Subject: [PATCH] haskell: Propagate cabal dependencies to user env Before this commit, if a haskell library X depends on Y, and X was added to systemPackages, only X would be available in the user environment. Y would not be avialable, which causes X to be broken. This commit solves the issue by setting propagatedUserEnvPkgs to all packages X depends on when X is a library. --- pkgs/build-support/cabal/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/build-support/cabal/default.nix b/pkgs/build-support/cabal/default.nix index 14bd01c7346..b17f720e561 100644 --- a/pkgs/build-support/cabal/default.nix +++ b/pkgs/build-support/cabal/default.nix @@ -46,6 +46,7 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version; x : (removeAttrs x internalAttrs) // { buildInputs = filter (y : ! (y == null)) x.buildInputs; propagatedBuildInputs = filter (y : ! (y == null)) x.propagatedBuildInputs; + propagatedUserEnvPkgs = filter (y : ! (y == null)) x.propagatedUserEnvPkgs; doCheck = enableCheckPhase && x.doCheck; }; @@ -96,6 +97,10 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version; # have to check for its existence propagatedBuildInputs = if self.isLibrary then self.buildDepends ++ self.extraLibraries ++ self.pkgconfigDepends else []; + # By default, also propagate all dependencies to the user environment. This is required, otherwise packages would be broken, because + # GHC also needs all dependencies to be available. + propagatedUserEnvPkgs = if self.isLibrary then self.buildDepends else []; + # library directories that have to be added to the Cabal files extraLibDirs = [];