8000 node language-servers: private-libexec install + symlink launchers by bryan-minimal · Pull Request #438 · gominimal/pkgs · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/bash-language-server/build.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let version = "5.4.3" in

outputs = {
bash-language-server = { glob = "usr/bin/bash-language-server" } | OutputBin,
libexec = { glob = "usr/lib/node_modules/**" } | OutputData,
libexec = { glob = "usr/libexec/bash-language-server/**", allow_executable = true } | OutputData,
},

attrs =
Expand Down
13 changes: 12 additions & 1 deletion packages/bash-language-server/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
#!/bin/sh
set -ex

npm install -g --prefix=$OUTPUT_DIR/usr bash-language-server@$MINIMAL_ARG_VERSION
# Install into a package-PRIVATE prefix (NOT the shared usr/lib/node_modules, which
# the node/node-lts runtime owns) so the tool can't collide with it; expose thin
# symlinks on PATH. The inner `#!/usr/bin/env node` shebang is served by
# coreutils(env)+node, so no shell is needed. (twitchyliquid64 review on #370.)
npm install -g --prefix="$OUTPUT_DIR/usr/libexec/bash-language-server" bash-language-server@$MINIMAL_ARG_VERSION

mkdir -p "$OUTPUT_DIR/usr/bin"
for _bin in "$OUTPUT_DIR/usr/libexec/bash-language-server/bin/"*; do
[ -e "$_bin" ] || continue
_tool=${_bin##*/}
ln -s "../libexec/bash-language-server/bin/$_tool" "$OUTPUT_DIR/usr/bin/$_tool"
done
2 changes: 1 addition & 1 deletion packages/pyright/build.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let version = "1.1.398" in
outputs = {
pyright = { glob = "usr/bin/pyright" } | OutputBin,
pyright-langserver = { glob = "usr/bin/pyright-langserver" } | OutputBin,
libexec = { glob = "usr/lib/node_modules/**" } | OutputData,
libexec = { glob = "usr/libexec/pyright/**", allow_executable = true } | OutputData,
},

attrs =
Expand Down
13 changes: 12 additions & 1 deletion packages/pyright/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
#!/bin/sh
set -ex

npm install -g --prefix=$OUTPUT_DIR/usr pyright@$MINIMAL_ARG_VERSION
# Install into a package-PRIVATE prefix (NOT the shared usr/lib/node_modules, which
# the node/node-lts runtime owns); expose thin symlinks on PATH (pyright ships two
# bins: pyright + pyright-langserver). The inner `#!/usr/bin/env node` shebang is
# served by coreutils(env)+node, so no shell is needed. (twitchyliquid64 on #370.)
npm install -g --prefix="$OUTPUT_DIR/usr/libexec/pyright" pyright@$MINIMAL_ARG_VERSION

mkdir -p "$OUTPUT_DIR/usr/bin"
for _bin in "$OUTPUT_DIR/usr/libexec/pyright/bin/"*; do
[ -e "$_bin" ] || continue
_tool=${_bin##*/}
ln -s "../libexec/pyright/bin/$_tool" "$OUTPUT_DIR/usr/bin/$_tool"
done
2 changes: 1 addition & 1 deletion packages/typescript-language-server/build.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let version = "4.3.3" in
typescript-language-server = { glob = "usr/bin/typescript-language-server" } | OutputBin,
tsserver = { glob = "usr/bin/tsserver" } | OutputBin,
tsc = { glob = "usr/bin/tsc" } | OutputBin,
libexec = { glob = "usr/lib/node_modules/**" } | OutputData,
libexec = { glob = "usr/libexec/typescript-language-server/**", allow_executable = true } | OutputData,
},

attrs =
Expand Down
14 changes: 13 additions & 1 deletion packages/typescript-language-server/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ set -ex
# 5.9.3 is the latest 5.x, still ships tsserver, and is what
# typescript-language-server 4.3.3 targets. Pinning also makes this
# internet-fetching build deterministic instead of tracking npm's `latest`.
npm install -g --prefix=$OUTPUT_DIR/usr \
#
# Install 59C2 into a package-PRIVATE prefix (NOT the shared usr/lib/node_modules, which
# node/node-lts own); expose thin symlinks on PATH. Both npm packages land in the
# one prefix, so all three bins (typescript-language-server, tsc, tsserver) get a
# launcher. The inner `#!/usr/bin/env node` shebang is served by coreutils+node.
npm install -g --prefix="$OUTPUT_DIR/usr/libexec/typescript-language-server" \
typescript-language-server@$MINIMAL_ARG_VERSION \
typescript@5.9.3

mkdir -p "$OUTPUT_DIR/usr/bin"
for _bin in "$OUTPUT_DIR/usr/libexec/typescript-language-server/bin/"*; do
[ -e "$_bin" ] || continue
_tool=${_bin##*/}
ln -s "../libexec/typescript-language-server/bin/$_tool" "$OUTPUT_DIR/usr/bin/$_tool"
done
0