git.iko.soy/typeable/cabal2nix
on master help sign in
Configure post-process hook for HFuse.
commitcda7e8ca37c616554ee5518c7c0711a85b857b0b authorPeter Simons <simons@cryp.to> dateSat 17 Aug 2013, 11:29 (13 years ago) parentf810f16
1 file changed+13
src/Cabal2Nix/PostProcess.hs+13
src/Cabal2Nix/PostProcess.hs+13
@@ -30,6 +30,7 @@ postProcess deriv@(MkDerivation {..})
3030 | pname == "haskell-src" = deriv { buildTools = "happy":buildTools }
3131 | pname == "haskell-src-meta" = deriv { buildDepends = "uniplate":buildDepends }
3232 | pname == "hflags" = deriv { metaSection = metaSection { license = Unknown (Just "Apache-2.0") } }
33+ | pname == "HFuse" = deriv { phaseOverrides = hfusePreConfigure }
3334 | pname == "highlighting-kate"= highlightingKatePostProcessing deriv
3435 | pname == "hmatrix" = deriv { extraLibs = "gsl":"liblapack":"blas":extraLibs }
3536 | pname == "hspec" = deriv { doCheck = False }
@@ -161,3 +162,15 @@ ghciPostInstall = unlines
161162 , " ln -s \"$out/share/$pname-$version/ghci\" \"$out/share/ghci/$pname\""
162163 , "'';"
163164 ]
165+
166+hfusePreConfigure :: String
167+hfusePreConfigure = unlines
168+ [ "preConfigure = ''"
169+ , " sed -i -e \"s@ Extra-Lib-Dirs: /usr/local/lib@ Extra-Lib-Dirs: ${fuse}/lib@\" HFuse.cabal"
170+ , " sed -i -e \"s/LANGUAGE FlexibleContexts/LANGUAGE FlexibleContexts, RankNTypes/\" System/Fuse.hsc"
171+ , " sed -i -e \"s/E(Exception/E(catch, Exception, IOException/\" System/Fuse.hsc"
172+ , " sed -i -e \"s/IO(catch,/IO(/\" System/Fuse.hsc"
173+ , " sed -i -e \"s/IO.catch/ E.catch/\" System/Fuse.hsc"
174+ , " sed -i -e \"s/const exitFailure/\\\\\\\\(_ :: IOException) -> exitFailure/\" System/Fuse.hsc"
175+ , "'';"
176+ ]