haskellPackages.haskell-language-server: Add aliases with ghc version

Needed by haskell-language-server-wrapper to discover the correct
binary. Especially useful when installing hls from multiple ghc version.
This commit is contained in:
Malte Brandy 2020-09-23 00:43:31 +02:00 committed by Peter Simons
parent 6bcfecbfa2
commit 13f22aec25

View File

@ -782,4 +782,14 @@ self: super: builtins.intersectAttrs super {
testToolDepends = [ pkgs.git pkgs.mercurial ];
});
haskell-language-server = overrideCabal super.haskell-language-server (drv: {
postInstall = let
inherit (pkgs.lib) concatStringsSep take splitString;
ghc_version = self.ghc.version;
ghc_major_version = concatStringsSep "." (take 2 (splitString "." ghc_version));
in ''
ln -s $out/bin/haskell-language-server $out/bin/haskell-language-server-${ghc_version}
ln -s $out/bin/haskell-language-server $out/bin/haskell-language-server-${ghc_major_version}
'';
});
}