From 4da51ec63766742a51d81f1451894d9dcb7e4cfa Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Mon, 12 Sep 2016 10:13:01 +0200 Subject: [PATCH] structured-haskell-mode: link Haskell libraries statically into this executable It's my understanding that Emacs runs the "structured-haskell-mode" binary virtually every time you press a key in an Haskell buffer, and since dynamically linked Haskell binaries take *much* longer to start up, switching this particular package to statically linked libraries ought to result in a performance boost. --- pkgs/development/haskell-modules/configuration-common.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 1b02e464c3ba..42734e08cd34 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -764,8 +764,12 @@ self: super: { ''; }); - # Byte-compile elisp code for Emacs. + # Fine-tune the build. structured-haskell-mode = overrideCabal super.structured-haskell-mode (drv: { + # Statically linked Haskell libraries make the tool start-up much faster, + # which is important for use in Emacs. + enableSharedExecutables = false; + # Byte-compile elisp code for Emacs. executableToolDepends = drv.executableToolDepends or [] ++ [pkgs.emacs]; postInstall = '' local lispdir=( "$out/share/"*"-${self.ghc.name}/${drv.pname}-${drv.version}/elisp" )