From 2af1a92a28875c06b5bb620ce6961067e0a7b882 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sat, 23 Aug 2014 17:02:44 -0500 Subject: [PATCH] haskell-ghc-mod-5.0.1: use wrapProgram Use wrapProgram from makeWrapper to wrap ghc-mod and ghc-modi like haddock. The wrapper code is clearer and hopefully more maintainable. As a side-effect, the bug where emacs would hang while loading ghc-modi is fixed. --- .../libraries/haskell/ghc-mod/5.0.1.nix | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/pkgs/development/libraries/haskell/ghc-mod/5.0.1.nix b/pkgs/development/libraries/haskell/ghc-mod/5.0.1.nix index ad920721451..1151cdfa51d 100644 --- a/pkgs/development/libraries/haskell/ghc-mod/5.0.1.nix +++ b/pkgs/development/libraries/haskell/ghc-mod/5.0.1.nix @@ -3,7 +3,7 @@ { cabal, Cabal, convertible, deepseq, djinnGhc, doctest, emacs , filepath, ghcPaths, ghcSybUtils, haskellSrcExts, hlint, hspec , ioChoice, monadControl, monadJournal, mtl, split, syb, text, time -, transformers, transformersBase +, transformers, transformersBase, makeWrapper }: cabal.mkDerivation (self: { @@ -22,9 +22,11 @@ cabal.mkDerivation (self: { ghcSybUtils haskellSrcExts hlint hspec ioChoice monadControl monadJournal mtl split syb text time transformers transformersBase ]; - buildTools = [ emacs ]; + buildTools = [ emacs makeWrapper ]; doCheck = false; configureFlags = "--datasubdir=${self.pname}-${self.version}"; + # The method used below to wrap ghc-mod and ghc-modi was borrowed from the + # wrapper for haddock. postInstall = '' cd $out/share/$pname-$version make @@ -32,20 +34,11 @@ cabal.mkDerivation (self: { cd .. ensureDir "$out/share/emacs" mv $pname-$version emacs/site-lisp - mv $out/bin/ghc-mod $out/bin/.ghc-mod-wrapped - cat - > $out/bin/ghc-mod < $out/bin/ghc-modi <