git.iko.soy/typeable/cabal2nix
on master help sign in
Enable post-process hooks for epic and Agda.
b1e88a9Peter Simons
src/Cabal2Nix/PostProcess.hs+10−18
@@ -18,7 +18,8 @@ fixGtkBuilds drv = drv & dependencies . pkgconfig %~ (`Set.difference` buildDeps
18
18
19hooks :: [(Dependency, Derivation -> Derivation)]
19hooks :: [(Dependency, Derivation -> Derivation)]
20hooks = over (mapped._1) (\str -> fromMaybe (error ("invalid constraint: " ++ show str)) (simpleParse str))
20hooks = over (mapped._1) (\str -> fromMaybe (error ("invalid constraint: " ++ show str)) (simpleParse str))
21+ [ ("Agda", set (executableDepends . tool . contains (dep "emacs")) True . set phaseOverrides agdaPostInstall)
21− [ ("dns", set testTarget "spec") -- don't execute tests that try to access the network
22+ , ("dns", set testTarget "spec") -- don't execute tests that try to access the network
22 , ("bindings-GLFW", over (libraryDepends . system) (Set.union (Set.fromList [dep "libXext", dep "libXfixes"])))
23 , ("bindings-GLFW", over (libraryDepends . system) (Set.union (Set.fromList [dep "libXext", dep "libXfixes"])))
23 , ("cabal-install", set phaseOverrides cabalInstallPostInstall)
24 , ("cabal-install", set phaseOverrides cabalInstallPostInstall)
24 , ("darcs", set phaseOverrides darcsInstallPostInstall)
25 , ("darcs", set phaseOverrides darcsInstallPostInstall)
@@ -110,12 +111,17 @@ xmonadPostInstall = unlines
110 , "'';"
111 , "'';"
111 ]
112 ]
112
113
114+agdaPostInstall :: String
115+agdaPostInstall = unlines
116+ [ "postInstall = ''"
117+ , " $out/bin/agda -c --no-main $(find $out/share -name Primitive.agda)"
118+ , " $out/bin/agda-mode compile"
119+ , "'';"
120+ ]
121+
113{-
122{-
114postProcess' :: Derivation -> Derivation
123postProcess' :: Derivation -> Derivation
115postProcess' deriv@(MkDerivation {..})
124postProcess' deriv@(MkDerivation {..})
116− | pname == "aeson" && version > Version [0,7] []
117− = deriv { buildDepends = Set.insert "blaze-builder" buildDepends }
118− | pname == "Agda" = deriv { buildTools = Set.insert "emacs" buildTools, phaseOverrides = agdaPostInstall }
119 | pname == "alex" && version < Version [3,1] []
125 | pname == "alex" && version < Version [3,1] []
120 = deriv { buildTools = Set.insert "perl" buildTools }
126 = deriv { buildTools = Set.insert "perl" buildTools }
121 | pname == "alex" && version >= Version [3,1] []
127 | pname == "alex" && version >= Version [3,1] []
@@ -127,14 +133,10 @@ postProcess' deriv@(MkDerivation {..})
127 | pname == "Cabal" = deriv { phaseOverrides = "preCheck = \"unset GHC_PACKAGE_PATH; export HOME=$NIX_BUILD_TOP\";" }
133 | pname == "Cabal" = deriv { phaseOverrides = "preCheck = \"unset GHC_PACKAGE_PATH; export HOME=$NIX_BUILD_TOP\";" }
128 | pname == "cabal-bounds" = deriv { buildTools = Set.insert "cabal-install" buildTools }
134 | pname == "cabal-bounds" = deriv { buildTools = Set.insert "cabal-install" buildTools }
129 | pname == "editline" = deriv { extraLibs = Set.insert "libedit" extraLibs }
135 | pname == "editline" = deriv { extraLibs = Set.insert "libedit" extraLibs }
130− | pname == "epic" = deriv { extraLibs = Set.insert "gmp" (Set.insert "boehmgc" extraLibs)
131− , buildTools = Set.insert "happy" buildTools
132− }
133 | pname == "ghc-heap-view" = deriv { phaseOverrides = ghciPostInstall }
136 | pname == "ghc-heap-view" = deriv { phaseOverrides = ghciPostInstall }
134 | pname == "ghc-mod" = deriv { phaseOverrides = ghcModPostInstall pname version, buildTools = Set.insert "emacs" buildTools }
137 | pname == "ghc-mod" = deriv { phaseOverrides = ghcModPostInstall pname version, buildTools = Set.insert "emacs" buildTools }
135 | pname == "ghc-parser" = deriv { buildTools = Set.insert "cpphs" (Set.insert "happy" buildTools)
138 | pname == "ghc-parser" = deriv { buildTools = Set.insert "cpphs" (Set.insert "happy" buildTools)
136 , phaseOverrides = ghcParserPatchPhase }
139 , phaseOverrides = ghcParserPatchPhase }
137− | pname == "ghc-paths" = deriv { phaseOverrides = ghcPathsPatches }
138 | pname == "ghc-vis" = deriv { phaseOverrides = ghciPostInstall }
140 | pname == "ghc-vis" = deriv { phaseOverrides = ghciPostInstall }
139 | pname == "github-backup" = deriv { buildTools = Set.insert "git" buildTools }
141 | pname == "github-backup" = deriv { buildTools = Set.insert "git" buildTools }
140 | pname == "gloss-raster" = deriv { extraLibs = Set.insert "llvm" extraLibs }
142 | pname == "gloss-raster" = deriv { extraLibs = Set.insert "llvm" extraLibs }
@@ -228,9 +230,6 @@ ghciPostInstall = unlines
228 ]
230 ]
229
231
230
232
231−ghcPathsPatches :: String
232−ghcPathsPatches = "patches = [ ./ghc-paths-nix.patch ];"
233−
234lhs2texPostInstall :: String
233lhs2texPostInstall :: String
235lhs2texPostInstall = unlines
234lhs2texPostInstall = unlines
236 [ "postInstall = ''"
235 [ "postInstall = ''"
@@ -243,13 +242,6 @@ lhs2texPostInstall = unlines
243ncursesPatchPhase :: String
242ncursesPatchPhase :: String
244ncursesPatchPhase = "patchPhase = \"find . -type f -exec sed -i -e 's|ncursesw/||' {} \\\\;\";"
243ncursesPatchPhase = "patchPhase = \"find . -type f -exec sed -i -e 's|ncursesw/||' {} \\\\;\";"
245
244
246−agdaPostInstall :: String
247−agdaPostInstall = unlines
248− [ "postInstall = ''"
249− , " $out/bin/agda -c --no-main $(find $out/share -name Primitive.agda)"
250− , " $out/bin/agda-mode compile"
251− , "'';"
252− ]
253
245
254structuredHaskellModePostInstall :: String
246structuredHaskellModePostInstall :: String
255structuredHaskellModePostInstall = unlines
247structuredHaskellModePostInstall = unlines