@@ -51,6 +51,8 @@ postProcess' deriv@(MkDerivation {..})
5151 | pname == "gtk2hs-buildtools"= deriv { buildDepends = Set.insert "hashtables" buildDepends }
5252 | pname == "haddock" && version < Version [2,14] []
5353 = deriv { buildTools = Set.insert "alex" (Set.insert "happy" buildTools) }
54+ | pname == "gf" = deriv { phaseOverrides = gfPhaseOverrides
55+ , doCheck = False }
5456 | pname == "GlomeVec" = deriv { buildTools = Set.insert "llvm" buildTools }
5557 | pname == "haddock" = deriv { phaseOverrides = haddockPreCheck }
5658 | pname == "happy" = deriv { buildTools = Set.insert "perl" buildTools }
@@ -242,3 +244,17 @@ ghcParserPatchPhase = unlines
242244 , " substituteInPlace build-parser.sh --replace \"/bin/bash\" \"$SHELL\""
243245 , "'';"
244246 ]
247+
248+gfPhaseOverrides :: String
249+gfPhaseOverrides = unlines
250+ [ "postPatch = ''"
251+ , " sed -i \"s|\\\"-s\\\"|\\\"\\\"|\" ./Setup.hs"
252+ -- Disable silent compilation. Compiling takes long, it is best to see some
253+ -- output, otherwise it looks like the build step has stalled.
254+ , " sed -i \"s|numJobs (bf bi)++||\" ./Setup.hs"
255+ -- Parallel compilation fails. Disable it.
256+ , "'';"
257+ , "preBuild = ''export LD_LIBRARY_PATH=`pwd`/dist/build:$LD_LIBRARY_PATH'';"
258+ -- The build step itself, after having built the library, needs to be able
259+ -- to find the library it just built in order to compile grammar files.
260+ ]