4f23e42cfd
Update to code-server 4.129.0, which bundles VS Code 1.129.0.
VS Code 1.129 changed how the built-in GitHub Copilot extension is
handled: it is now built from source during the reh-web build instead
of being fetched as a prebuilt VSIX. This requires a few build-time
workarounds:
- The copilot extension postinstall expects a platform package for the
host. A Copilot CLI SDK distfile is provided and placed as
@github/copilot-freebsd-x64 so the postinstall passes. GitHub Copilot
is closed-source and not usable on FreeBSD; this only lets the build
complete.
- The reh-web build calls ensureCopilotPlatformPackage(), which runs
"npm pack" and thus needs network access (unavailable in poudriere).
Providing @github/copilot-linux-x64 in remote/node_modules makes the
function find it locally and skip the network fetch.
- Copilot bundles prebuilt Linux rg/tgrep binaries. These are replaced
with native FreeBSD binaries from textproc/ripgrep and textproc/tgrep
so that no Linux ELF binaries ship in the package.
Additional changes:
- Add ONLY_FOR_ARCHS=amd64; only a linux-x64 vscode-reh-web distfile is
provided.
- Drop test/* entries from VSCODE_NODE_MODULES; test suites do not
belong in the server package.
- Add a code_server_shell rc variable (default /bin/sh) so the built-in
terminal works when the service runs as nobody, whose login shell is
/usr/sbin/nologin.
- Fix ${PREFIX} expansion in pkg-message.
Sponsored by: Netzkommune GmbH
67 lines
2.0 KiB
Makefile
67 lines
2.0 KiB
Makefile
PORTNAME= code-server
|
|
DISTVERSION= 4.129.0
|
|
CATEGORIES= www
|
|
MASTER_SITES= https://github.com/joneum/FreeBSD-CodeServer/releases/download/code-server-${DISTVERSION}/:code_server \
|
|
https://github.com/github/copilot-cli/releases/download/v${COPILOT_CLI_VERSION}/:copilot_cli
|
|
DISTFILES= vscode-node-modules-${VSCODE_VERSION}${EXTRACT_SUFX}:code_server \
|
|
vscode-reh-web-linux-x64-${DISTVERSION}${EXTRACT_SUFX}:code_server
|
|
.if !defined(BOOTSTRAP_NODE_MODULES)
|
|
DISTFILES+= code-server-node-modules-${DISTVERSION}${EXTRACT_SUFX}:code_server
|
|
.endif
|
|
DISTFILES+= github-copilot-${COPILOT_CLI_VERSION}-linux-x64.tgz:copilot_cli
|
|
|
|
MAINTAINER= joneum@FreeBSD.org
|
|
COMMENT= Run VS Code on a remote server and access it through a browser
|
|
WWW= https://github.com/coder/code-server
|
|
|
|
LICENSE= MIT
|
|
LICENSE_FILE= ${WRKSRC}/LICENSE
|
|
|
|
EXTRACT_DEPENDS= jq:textproc/jq
|
|
BUILD_DEPENDS= npm-node22>0:www/npm-node22 \
|
|
bash:shells/bash \
|
|
pkgconf:devel/pkgconf \
|
|
rg:textproc/ripgrep \
|
|
tgrep:textproc/tgrep
|
|
LIB_DEPENDS= libinotify.so:devel/libinotify \
|
|
libsecret-1.so:security/libsecret \
|
|
libuv.so:devel/libuv \
|
|
libxkbfile.so:x11/libxkbfile \
|
|
libX11.so:x11/libX11
|
|
RUN_DEPENDS= node:www/node22
|
|
|
|
# Only a linux-x64 (amd64) vscode-reh-web distfile is provided.
|
|
ONLY_FOR_ARCHS= amd64
|
|
ONLY_FOR_ARCHS_REASON= only the vscode-reh-web-linux-x64 distfile is provided
|
|
|
|
USES= nodejs:22 perl5 pkgconfig python:build ssl
|
|
|
|
USE_GITHUB= yes
|
|
GH_ACCOUNT= coder
|
|
GH_PROJECT= code-server
|
|
GH_TAGNAME= v${DISTVERSION}
|
|
GH_TUPLE= microsoft:vscode:${VSCODE_VERSION}:vscode
|
|
|
|
USE_RC_SUBR= code-server
|
|
|
|
SUB_FILES= code-server-wrapper
|
|
|
|
OPTIONS_DEFINE= DOCS
|
|
PORTDOCS= README.md
|
|
|
|
NO_CCACHE= yes
|
|
|
|
VSCODE_VERSION= 1.129.0
|
|
# Copilot CLI SDK, only needed so the VS Code extension build passes.
|
|
# GitHub Copilot is closed-source and not usable on FreeBSD.
|
|
COPILOT_CLI_VERSION= 1.0.70
|
|
|
|
MAKE_ENV+= NODE_OPTIONS=--max-old-space-size=6144 \
|
|
ESBUILD_WORKER_THREADS=1
|
|
|
|
.include "${.CURDIR}/Makefile.vscode"
|
|
.include "${.CURDIR}/Makefile.build"
|
|
.include "${.CURDIR}/Makefile.install"
|
|
|
|
.include <bsd.port.mk>
|