1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

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.
This commit is contained in:
Benno Fünfstück 2013-11-17 13:09:01 +01:00 committed by Peter Simons
parent ea20904aef
commit ebdff3841a

View file

@ -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 = [];