@@ -1,3 +1,5 @@
1+{-# LANGUAGE OverloadedStrings #-}
2+
13module Cabal2Nix.PostProcess ( postProcess ) where
24
35import Control.Lens
@@ -18,28 +20,28 @@ fixGtkBuilds drv = drv & dependencies . pkgconfig %~ (`Set.difference` buildDeps
1820
1921hooks :: [(Dependency, Derivation -> Derivation)]
2022hooks = over (mapped._1) (\str -> fromMaybe (error ("invalid constraint: " ++ show str)) (simpleParse str))
21− [ ("Agda", set (executableDepends . tool . contains (dep "emacs")) True . set phaseOverrides agdaPostInstall)
23+ [ ("Agda", set (executableDepends . tool . contains "emacs") True . set phaseOverrides agdaPostInstall)
2224 , ("dns", set testTarget "spec") -- don't execute tests that try to access the network
23− , ("bindings-GLFW", over (libraryDepends . system) (Set.union (Set.fromList [dep "libXext", dep "libXfixes"])))
25+ , ("bindings-GLFW", over (libraryDepends . system) (Set.union (Set.fromList ["libXext", "libXfixes"])))
2426 , ("cabal-install", set phaseOverrides cabalInstallPostInstall)
2527 , ("darcs", set phaseOverrides darcsInstallPostInstall)
2628 , ("git-annex", gitAnnexHook)
2729 , ("haddock", set phaseOverrides "preCheck = \"unset GHC_PACKAGE_PATH\";")
2830 , ("HFuse", set phaseOverrides hfusePreConfigure)
2931 , ("gf", set phaseOverrides gfPhaseOverrides . set doCheck False)
30− , ("github-backup", set (executableDepends . tool . contains (dep "git")) True)
31− , ("GlomeVec", set (libraryDepends . pkgconfig . contains (dep "llvm")) True)
32− , ("gtk3", set (libraryDepends . pkgconfig . contains (dep "gtk3")) True) -- https://github.com/NixOS/cabal2nix/issues/145
33− , ("imagemagick", set (libraryDepends . pkgconfig . contains (dep "imagemagick")) True) -- https://github.com/NixOS/cabal2nix/issues/136
34− , ("jsaddle", set (dependencies . haskell . contains (dep "ghcjs-base")) False)
35− , ("mysql", set (libraryDepends . system . contains (dep "mysql")) True)
36− , ("pango", set (libraryDepends . haskell . contains (dep "cairo")) True)
37− , ("readline", over (libraryDepends . system) (Set.union (Set.fromList [dep "readline", dep "ncurses"])))
38− , ("terminfo", set (libraryDepends . system . contains (dep "ncurses")) True)
39− , ("thyme", set (libraryDepends . tool . contains (dep "cpphs")) True) -- required on Darwin
32+ , ("github-backup", set (executableDepends . tool . contains "git") True)
33+ , ("GlomeVec", set (libraryDepends . pkgconfig . contains "llvm") True)
34+ , ("gtk3", set (libraryDepends . pkgconfig . contains "gtk3") True) -- https://github.com/NixOS/cabal2nix/issues/145
35+ , ("imagemagick", set (libraryDepends . pkgconfig . contains "imagemagick") True) -- https://github.com/NixOS/cabal2nix/issues/136
36+ , ("jsaddle", set (dependencies . haskell . contains "ghcjs-base") False)
37+ , ("mysql", set (libraryDepends . system . contains "mysql") True)
38+ , ("pango", set (libraryDepends . haskell . contains "cairo") True)
39+ , ("readline", over (libraryDepends . system) (Set.union (Set.fromList ["readline", "ncurses"])))
40+ , ("terminfo", set (libraryDepends . system . contains "ncurses") True)
41+ , ("thyme", set (libraryDepends . tool . contains "cpphs") True) -- required on Darwin
4042 , ("monad", set phaseOverrides xmonadPostInstall)
4143 , ("wxc", wxcHook)
42− , ("wxcore", set (libraryDepends . pkgconfig . contains (dep "wxGTK")) True)
44+ , ("wxcore", set (libraryDepends . pkgconfig . contains "wxGTK") True)
4345 ]
4446
4547gitAnnexHook :: Derivation -> Derivation
@@ -52,7 +54,7 @@ gitAnnexHook = set phaseOverrides gitAnnexOverrides . over (executableDepends .
5254 , " ./git-annex test"
5355 , "'';"
5456 ]
55− buildInputs = Set.map dep $ Set.fromList ["git","rsync","gnupg","curl","wget","lsof","openssh","which","bup","perl"]
57+ buildInputs = Set.fromList ["git","rsync","gnupg","curl","wget","lsof","openssh","which","bup","perl"]
5658
5759hfusePreConfigure :: String
5860hfusePreConfigure = unlines
@@ -76,8 +78,8 @@ gfPhaseOverrides = unlines
7678 ]
7779
7880wxcHook :: Derivation -> Derivation
79−wxcHook drv = drv & libraryDepends . system %~ Set.union (Set.fromList [dep "mesa", dep "libX11"])
80− & libraryDepends . pkgconfig . contains (dep "wxGTK") .~ True
81+wxcHook drv = drv & libraryDepends . system %~ Set.union (Set.fromList ["mesa", "libX11"])
82+ & libraryDepends . pkgconfig . contains "wxGTK" .~ True
8183 & phaseOverrides .~ wxcPostInstall (packageVersion drv)
8284 & runHaddock .~ False
8385 where