git.iko.soy/typeable/cabal2nix
on master help sign in
PostProcess.hs: configure postInstall for ghc-mod
commit93b11fd08b29bf38b90cb65e711edeecb3ed5928 authorPeter Simons <simons@cryp.to> dateSun 25 Mar 2012, 20:58 (15 years ago) parentd75a8d6
1 file changed+13
src/Cabal2Nix/PostProcess.hs+13
src/Cabal2Nix/PostProcess.hs+13
@@ -11,6 +11,7 @@ postProcess deriv@(MkDerivation {..})
1111 | pname == "cairo" = deriv { extraLibs = "pkgconfig":"libc":"cairo":"zlib":extraLibs }
1212 | pname == "editline" = deriv { extraLibs = "libedit":extraLibs }
1313 | pname == "epic" = deriv { extraLibs = "gmp":"boehmgc":extraLibs, buildTools = "happy":buildTools }
14+ | pname == "ghc-mod" = deriv { postInstall = ghcModPostInstall, buildTools = "emacs":buildTools }
1415 | pname == "glade" = deriv { extraLibs = "pkgconfig":"libc":extraLibs, pkgConfDeps = "gtkC":delete "gtk" pkgConfDeps }
1516 | pname == "glib" = deriv { extraLibs = "pkgconfig":"libc":extraLibs }
1617 | pname == "GLUT" = deriv { extraLibs = "glut":"libSM":"libICE":"libXmu":"libXi":"mesa":extraLibs }
@@ -42,3 +43,15 @@ postProcess deriv@(MkDerivation {..})
4243 , configureFlags = "--extra-include-dirs=${freetype}/include/freetype2":configureFlags
4344 }
4445 | otherwise = deriv
46+
47+ghcModPostInstall :: String
48+ghcModPostInstall = unlines
49+ [ "postInstall = ''"
50+ , " cd $out/share/$pname-$version"
51+ , " make"
52+ , " rm Makefile"
53+ , " cd .."
54+ , " ensureDir \"$out/share/emacs\""
55+ , " mv $pname-$version emacs/site-lisp"
56+ , " '';"
57+ ]