Skip to content

Commit 4f603d1

Browse files
committed
Implement a wacky work-around for #136.
The post-process hook filters any package from pkgconfigDepends that is also part of buildDepends. In other words, if some package depends on the Haskell library "glib", then we filter "glib" from pkgconfigDepends. As a result, the bogus resolver in "hackage2nix" won't fire. Of course, this means that the system library is now missing from those builds that had their pkgconfigDepends stripped. We counter this by adding the appropriate system package to the propagatedBuildInputs field of the their corresponding Haskell library. For example, the Haskell package "glib" exports the system library "glib" to all its users -- so these users don't have to depend on it anymore. The real solution is to fix the resolver, of course, but this change will hopefully fix a number of builds *right now* without much of an effort to do the right thing(tm).
1 parent ab89769 commit 4f603d1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Cabal2Nix/PostProcess.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ import Distribution.NixOS.Derivation.Cabal
77
import Distribution.Text ( display )
88

99
postProcess :: Derivation -> Derivation
10-
postProcess deriv@(MkDerivation {..})
10+
postProcess = postProcess' . fixGtkBuilds
11+
12+
fixGtkBuilds :: Derivation -> Derivation
13+
fixGtkBuilds deriv@(MkDerivation {..}) = deriv { pkgConfDeps = pkgConfDeps \\ buildDepends }
14+
15+
postProcess' :: Derivation -> Derivation
16+
postProcess' deriv@(MkDerivation {..})
1117
| pname == "aeson" && version > Version [0,7] []
1218
= deriv { buildDepends = "blaze-builder":buildDepends }
1319
| pname == "Agda" = deriv { buildTools = "emacs":buildTools, phaseOverrides = agdaPostInstall }

0 commit comments

Comments
 (0)