git.iko.soy/typeable/cabal2nix
on master help sign in
Implement a wacky work-around for https://github.com/NixOS/cabal2nix/issues/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).

commit4f603d1ca0e0da77b72f4efb70f9658a434f84cb authorPeter Simons <simons@cryp.to> dateThu 22 Jan 2015, 18:25 (12 years ago) parentab89769
1 file changed+7−1
src/Cabal2Nix/PostProcess.hs+7−1
src/Cabal2Nix/PostProcess.hs+7−1
@@ -7,7 +7,13 @@ import Distribution.NixOS.Derivation.Cabal
77import Distribution.Text ( display )
88
99postProcess :: 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 }