git.iko.soy/typeable/cabal2nix
on master help sign in
Enable post-process hooks for epic and Agda.
commitb1e88a90810626adfe28e008de6694ac8095d713 authorPeter Simons <simons@cryp.to> dateThu 6 Aug 2015, 15:46 (11 years ago) parentd94e0e1
1 file changed+10−18
src/Cabal2Nix/PostProcess.hs+10−18
src/Cabal2Nix/PostProcess.hs+10−18
@@ -18,7 +18,8 @@ fixGtkBuilds drv = drv & dependencies . pkgconfig %~ (`Set.difference` buildDeps
1818
1919hooks :: [(Dependency, Derivation -> Derivation)]
2020hooks = over (mapped._1) (\str -> fromMaybe (error ("invalid constraint: " ++ show str)) (simpleParse str))
21− [ ("dns", set testTarget "spec") -- don't execute tests that try to access the network
21+ [ ("Agda", set (executableDepends . tool . contains (dep "emacs")) True . set phaseOverrides agdaPostInstall)
22+ , ("dns", set testTarget "spec") -- don't execute tests that try to access the network
2223 , ("bindings-GLFW", over (libraryDepends . system) (Set.union (Set.fromList [dep "libXext", dep "libXfixes"])))
2324 , ("cabal-install", set phaseOverrides cabalInstallPostInstall)
2425 , ("darcs", set phaseOverrides darcsInstallPostInstall)
@@ -110,12 +111,17 @@ xmonadPostInstall = unlines
110111 , "'';"
111112 ]
112113
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+
113122{-
114123postProcess' :: Derivation -> Derivation
115124postProcess' 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 }
119125 | pname == "alex" && version < Version [3,1] []
120126 = deriv { buildTools = Set.insert "perl" buildTools }
121127 | pname == "alex" && version >= Version [3,1] []
@@ -127,14 +133,10 @@ postProcess' deriv@(MkDerivation {..})
127133 | pname == "Cabal" = deriv { phaseOverrides = "preCheck = \"unset GHC_PACKAGE_PATH; export HOME=$NIX_BUILD_TOP\";" }
128134 | pname == "cabal-bounds" = deriv { buildTools = Set.insert "cabal-install" buildTools }
129135 | 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− }
133136 | pname == "ghc-heap-view" = deriv { phaseOverrides = ghciPostInstall }
134137 | pname == "ghc-mod" = deriv { phaseOverrides = ghcModPostInstall pname version, buildTools = Set.insert "emacs" buildTools }
135138 | pname == "ghc-parser" = deriv { buildTools = Set.insert "cpphs" (Set.insert "happy" buildTools)
136139 , phaseOverrides = ghcParserPatchPhase }
137− | pname == "ghc-paths" = deriv { phaseOverrides = ghcPathsPatches }
138140 | pname == "ghc-vis" = deriv { phaseOverrides = ghciPostInstall }
139141 | pname == "github-backup" = deriv { buildTools = Set.insert "git" buildTools }
140142 | pname == "gloss-raster" = deriv { extraLibs = Set.insert "llvm" extraLibs }
@@ -228,9 +230,6 @@ ghciPostInstall = unlines
228230 ]
229231
230232
231−ghcPathsPatches :: String
232−ghcPathsPatches = "patches = [ ./ghc-paths-nix.patch ];"
233−
234233lhs2texPostInstall :: String
235234lhs2texPostInstall = unlines
236235 [ "postInstall = ''"
@@ -243,13 +242,6 @@ lhs2texPostInstall = unlines
243242ncursesPatchPhase :: String
244243ncursesPatchPhase = "patchPhase = \"find . -type f -exec sed -i -e 's|ncursesw/||' {} \\\\;\";"
245244
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− ]
253245
254246structuredHaskellModePostInstall :: String
255247structuredHaskellModePostInstall = unlines