@@ -48,10 +48,10 @@ hooks =
48 , ("haddock", set phaseOverrides "preCheck = \"unset GHC_PACKAGE_PATH\";")
48 , ("haddock", set phaseOverrides "preCheck = \"unset GHC_PACKAGE_PATH\";")
49 , ("HFuse", set phaseOverrides hfusePreConfigure)
49 , ("HFuse", set phaseOverrides hfusePreConfigure)
50 , ("hmatrix", set phaseOverrides "preConfigure = \"sed -i hmatrix.cabal -e 's@/usr/@/dont/hardcode/paths/@'\";")
50 , ("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")))
52 , ("imagemagick", set (libraryDepends . pkgconfig . contains (pkg "imagemagick")) True) -- https://github.com/NixOS/cabal2nix/issues/136
52 , ("imagemagick", set (libraryDepends . pkgconfig . contains (pkg "imagemagick")) True) -- https://github.com/NixOS/cabal2nix/issues/136
53 , ("jsaddle", set (dependencies . haskell . contains (bind "self.ghcjs-base")) False)
53 , ("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")))
55 , ("liquid-fixpoint", set (executableDepends . system . contains (pkg "ocaml")) True . set (testDepends . system . contains (pkg "z3")) True)
55 , ("liquid-fixpoint", set (executableDepends . system . contains (pkg "ocaml")) True . set (testDepends . system . contains (pkg "z3")) True)
56 , ("liquidhaskell", set (testDepends . system . contains (pkg "z3")) True)
56 , ("liquidhaskell", set (testDepends . system . contains (pkg "z3")) True)
57 , ("mysql", set (libraryDepends . system . contains (pkg "mysql")) True)
57 , ("mysql", set (libraryDepends . system . contains (pkg "mysql")) True)
@@ -79,6 +79,9 @@ bind s = binding # (i, path # is)
79 is = map (review ident) (splitOn "." s)
79 is = map (review ident) (splitOn "." s)
80 i = last is
80 i = last is
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
82-- TODO: I need to figure out how to conveniently replace a binding in a set.
85-- TODO: I need to figure out how to conveniently replace a binding in a set.
83gtk3Hook :: Derivation -> Derivation -- https://github.com/NixOS/cabal2nix/issues/145
86gtk3Hook :: Derivation -> Derivation -- https://github.com/NixOS/cabal2nix/issues/145
84gtk3Hook = set (libraryDepends . pkgconfig . contains (pkg "gtk3")) True
87gtk3Hook = set (libraryDepends . pkgconfig . contains (pkg "gtk3")) True