haskell-language-server: fix reference logic

If we are linking dynamically, it's practically no use removing
references, as we depend on GHC either way via linking.

I've also elected to keep the references to the data outputs in all
cases — they are a bit arcane (there's no easy way to tell they
definitely are not necessary) and don't contribute too much to the
overall closure size.
This commit is contained in:
sternenseemann 2022-02-10 13:02:13 +01:00 committed by sterni
parent 288f2ad360
commit 70bddadaee

View file

@ -21,14 +21,10 @@ let
lib.pipe hsPkgs.haskell-language-server ([
(haskell.lib.compose.overrideCabal (old: {
enableSharedExecutables = dynamic;
postInstall = ''
${if !dynamic then "postInstall" else null} = ''
${old.postInstall or ""}
remove-references-to -t ${hsPkgs.ghc} $out/bin/haskell-language-server
remove-references-to -t ${hsPkgs.shake.data} $out/bin/haskell-language-server
remove-references-to -t ${hsPkgs.js-jquery.data} $out/bin/haskell-language-server
remove-references-to -t ${hsPkgs.js-dgtable.data} $out/bin/haskell-language-server
remove-references-to -t ${hsPkgs.js-flot.data} $out/bin/haskell-language-server
'';
}))
((if dynamic then enableCabalFlag else disableCabalFlag) "dynamic")