git.iko.soy/typeable/cabal2nix
on master help sign in
Build hslua with lua 5.1 instead of the default 5.2.
commit1eb24875435d9814cea270985a87d2ffc6280454 authorPeter Simons <simons@cryp.to> dateWed 16 Sep 2015, 10:41 (11 years ago) parenteb3ae9b
1 file changed+5−2
distribution-nixpkgs/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs+5−2
distribution-nixpkgs/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs+5−2
@@ -48,10 +48,10 @@ hooks =
4848 , ("haddock", set phaseOverrides "preCheck = \"unset GHC_PACKAGE_PATH\";")
4949 , ("HFuse", set phaseOverrides hfusePreConfigure)
5050 , ("hmatrix", set phaseOverrides "preConfigure = \"sed -i hmatrix.cabal -e 's@/usr/@/dont/hardcode/paths/@'\";")
51− , ("hslua", over (libraryDepends . pkgconfig) (Set.insert (pkg "lua5_1") . Set.delete (pkg "lua")))
51+ , ("hslua", over (libraryDepends . each) (replace (pkg "lua") (pkg "lua5_1")))
5252 , ("imagemagick", set (libraryDepends . pkgconfig . contains (pkg "imagemagick")) True) -- https://github.com/NixOS/cabal2nix/issues/136
5353 , ("jsaddle", set (dependencies . haskell . contains (bind "self.ghcjs-base")) False)
54− , ("libconfig", over (libraryDepends . system) (Set.insert (pkg "libconfig") . Set.delete (binding # ("config", path # ["null"]))))
54+ , ("libconfig", over (libraryDepends . system) (replace (binding # ("config", path # ["null"])) (pkg "libconfig")))
5555 , ("liquid-fixpoint", set (executableDepends . system . contains (pkg "ocaml")) True . set (testDepends . system . contains (pkg "z3")) True)
5656 , ("liquidhaskell", set (testDepends . system . contains (pkg "z3")) True)
5757 , ("mysql", set (libraryDepends . system . contains (pkg "mysql")) True)
@@ -79,6 +79,9 @@ bind s = binding # (i, path # is)
7979 is = map (review ident) (splitOn "." s)
8080 i = last is
8181
82+replace :: Binding -> Binding -> Set Binding -> Set Binding
83+replace old new bs = if old `Set.member` bs then Set.insert new (Set.delete old bs) else bs
84+
8285-- TODO: I need to figure out how to conveniently replace a binding in a set.
8386gtk3Hook :: Derivation -> Derivation -- https://github.com/NixOS/cabal2nix/issues/145
8487gtk3Hook = set (libraryDepends . pkgconfig . contains (pkg "gtk3")) True