From 3191d1e14dd06b283fcb1c3e76b6773548884dda Mon Sep 17 00:00:00 2001 From: Malo Bourgon Date: Tue, 20 Jun 2023 12:56:45 -0700 Subject: [PATCH] vscode-langservers-extracted: fix Darwin build --- .../vscode-langservers-extracted/default.nix | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/pkgs/development/tools/language-servers/vscode-langservers-extracted/default.nix b/pkgs/development/tools/language-servers/vscode-langservers-extracted/default.nix index fdaa503c77af..723e56810e7e 100644 --- a/pkgs/development/tools/language-servers/vscode-langservers-extracted/default.nix +++ b/pkgs/development/tools/language-servers/vscode-langservers-extracted/default.nix @@ -1,4 +1,4 @@ -{ lib, buildNpmPackage, fetchFromGitHub, vscode }: +{ lib, stdenv, buildNpmPackage, fetchFromGitHub, vscode }: buildNpmPackage rec { pname = "vscode-langservers-extracted"; @@ -19,15 +19,24 @@ buildNpmPackage rec { sed -i '/^\s*"vscode-eslint-language-server":.*bin\//d' package.json package-lock.json ''; - buildPhase = let - extensions = "${vscode}/lib/vscode/resources/app/extensions"; - in '' - npx babel ${extensions}/css-language-features/server/dist/* --out-dir lib/css-language-server/node/ - npx babel ${extensions}/html-language-features/server/dist/* --out-dir lib/html-language-server/node/ - npx babel ${extensions}/json-language-features/server/dist/* --out-dir lib/json-language-server/node/ - npx babel ${extensions}/markdown-language-features/server/dist/* --out-dir lib/markdown-language-server/node/ - mv lib/markdown-language-server/node/workerMain.js lib/markdown-language-server/node/main.js - ''; + buildPhase = + let + extensions = + if stdenv.isDarwin + then "${vscode}/Applications/Visual\\ Studio\\ Code.app/Contents/Resources/app/extensions" + else "${vscode}/lib/vscode/resources/app/extensions"; + in + '' + npx babel ${extensions}/css-language-features/server/dist/node \ + --out-dir lib/css-language-server/node/ + npx babel ${extensions}/html-language-features/server/dist/node \ + --out-dir lib/html-language-server/node/ + npx babel ${extensions}/json-language-features/server/dist/node \ + --out-dir lib/json-language-server/node/ + npx babel ${extensions}/markdown-language-features/server/dist/node \ + --out-dir lib/markdown-language-server/node/ + mv lib/markdown-language-server/node/workerMain.js lib/markdown-language-server/node/main.js + ''; meta = with lib; { description = "HTML/CSS/JSON/ESLint language servers extracted from vscode.";