chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / ba / bash-language-server / package.nix
blob4b045a8fde4357d745c91900c50147dd9800d67f
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , pnpm_8
5 , nodejs
6 , makeBinaryWrapper
7 , shellcheck
8 , versionCheckHook
9 }:
11 stdenv.mkDerivation (finalAttrs: {
12   pname = "bash-language-server";
13   version = "5.4.0";
15   src = fetchFromGitHub {
16     owner = "bash-lsp";
17     repo = "bash-language-server";
18     rev = "server-${finalAttrs.version}";
19     hash = "sha256-yJ81oGd9aNsWQMLvDSgMVVH1//Mw/SVFYFIPsJTQYzE=";
20   };
22   pnpmWorkspace = "bash-language-server";
23   pnpmDeps = pnpm_8.fetchDeps {
24     inherit (finalAttrs) pname version src pnpmWorkspace;
25     hash = "sha256-W25xehcxncBs9QgQBt17F5YHK0b+GDEmt27XzTkyYWg=";
26   };
28   nativeBuildInputs = [
29     nodejs
30     pnpm_8.configHook
31     makeBinaryWrapper
32     versionCheckHook
33   ];
34   buildPhase = ''
35     runHook preBuild
37     pnpm compile server
39     runHook postBuild
40   '';
42   installPhase = ''
43     runHook preInstall
45     pnpm --offline \
46       --frozen-lockfile --ignore-script \
47       --filter=bash-language-server \
48       deploy $out/lib/bash-language-server
49     # Cleanup directory a bit, to save space, and make fixup phase a bit faster
50     rm -r $out/lib/bash-language-server/src
51     find $out/lib/bash-language-server -name '*.ts' -delete
52     rm -r \
53       $out/lib/bash-language-server/node_modules/.bin \
54       $out/lib/bash-language-server/node_modules/*/bin
56     # Create the executable, based upon what happens in npmHooks.npmInstallHook
57     makeWrapper ${lib.getExe nodejs} $out/bin/bash-language-server \
58       --suffix PATH : ${lib.makeBinPath [ shellcheck ]} \
59       --inherit-argv0 \
60       --add-flags $out/lib/bash-language-server/out/cli.js
62     runHook postInstall
63   '';
65   doInstallCheck = true;
67   meta = with lib; {
68     description = "A language server for Bash";
69     homepage = "https://github.com/bash-lsp/bash-language-server";
70     license = licenses.mit;
71     maintainers = with maintainers; [ doronbehar ];
72     mainProgram = "bash-language-server";
73     platforms = platforms.all;
74   };