haskell-hindent: byte-compile installed elisp code

This commit is contained in:
Peter Simons 2015-08-18 12:59:36 +02:00
parent 6d0fee82c5
commit 1fc3e769e3

View File

@ -969,4 +969,21 @@ self: super: {
'';
});
# Byte-compile elisp code for Emacs.
hindent = overrideCabal super.hindent (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
'';
});
}