forked from mirrors/nixpkgs
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:
parent
ea20904aef
commit
ebdff3841a
|
@ -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 = [];
|
||||
|
||||
|
|
Loading…
Reference in a new issue