From 6d0fee82c505ba8e684ca6c08b15e3cd312fe0ed Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Tue, 18 Aug 2015 01:21:53 +0200 Subject: [PATCH] haskell-structured-haskell-mode: byte-compile installed elisp code --- .../haskell-modules/configuration-common.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index e2edcde9efe..e38318ada51 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -952,4 +952,21 @@ self: super: { ''; }); + # Byte-compile elisp code for Emacs. + structured-haskell-mode = overrideCabal super.structured-haskell-mode (drv: { + executableToolDepends = drv.executableToolDepends or [] ++ [pkgs.emacs]; + postInstall = '' + local lispdir=( "$out/share/"*"-${self.ghc.name}/${drv.pname}-${drv.version}/elisp" ) + pushd >/dev/null $lispdir + for i in *.el; do + emacs -Q -L . -L ${pkgs.emacs24Packages.haskellMode}/share/emacs/site-lisp \ + --batch --eval "(byte-compile-disable-warning 'cl-functions)" \ + -f batch-byte-compile $i + done + popd >/dev/null + mkdir -p $out/share/emacs + ln -s $lispdir $out/share/emacs/site-lisp + ''; + }); + }