diff options
author | Benno Fünfstück <benno.fuenfstueck@gmail.com> | 2013-11-17 13:09:01 +0100 |
---|---|---|
committer | Peter Simons <simons@cryp.to> | 2013-12-10 20:41:36 +0100 |
commit | ebdff3841aa5d2fe145b2ff5074c0a23f2657ca9 (patch) | |
tree | cad02678bb6fcee624fe740319e561cb46801e48 /pkgs/build-support | |
parent | ea20904aefbb7a5bd865abd23b850ccb82e36342 (diff) | |
download | nixlib-ebdff3841aa5d2fe145b2ff5074c0a23f2657ca9.tar nixlib-ebdff3841aa5d2fe145b2ff5074c0a23f2657ca9.tar.gz nixlib-ebdff3841aa5d2fe145b2ff5074c0a23f2657ca9.tar.bz2 nixlib-ebdff3841aa5d2fe145b2ff5074c0a23f2657ca9.tar.lz nixlib-ebdff3841aa5d2fe145b2ff5074c0a23f2657ca9.tar.xz nixlib-ebdff3841aa5d2fe145b2ff5074c0a23f2657ca9.tar.zst nixlib-ebdff3841aa5d2fe145b2ff5074c0a23f2657ca9.zip |
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.
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/cabal/default.nix | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkgs/build-support/cabal/default.nix b/pkgs/build-support/cabal/default.nix index 14bd01c7346e..b17f720e5618 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 = []; |