Skip to content

Commit

Permalink
code-server: bump to 4.90.2
Browse files Browse the repository at this point in the history
  • Loading branch information
licy183 committed Sep 1, 2024
1 parent f0fc35c commit 34d27e2
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions tur/code-server/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ TERMUX_PKG_HOMEPAGE=https://github.com/coder/code-server
TERMUX_PKG_DESCRIPTION="Run VS Code on any machine anywhere and access it in the browser"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux-user-repository"
TERMUX_PKG_VERSION="4.89.1"
TERMUX_PKG_VERSION="4.90.2"
TERMUX_PKG_SRCURL=git+https://github.com/coder/code-server
TERMUX_PKG_DEPENDS="libandroid-spawn, libsecret, krb5, nodejs-18, ripgrep"
TERMUX_PKG_DEPENDS="libandroid-spawn, libsecret, krb5, nodejs-20, ripgrep"
TERMUX_PKG_ANTI_DEPENDS="nodejs-20"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_HOSTBUILD=true
TERMUX_PKG_NO_STATICSPLIT=true
Expand All @@ -18,34 +19,34 @@ termux_step_post_get_source() {
patch -d . -p1 < "./patches/$f";
done

# Ensure that code-server supports node 18
# Ensure that code-server supports node 20
local _node_version=$(cat .node-version | cut -d. -f1 -)
if [ "$_node_version" != 18 ]; then
termux_error_exit "Version mismatch: Expected 18, got $_node_version."
if [ "$_node_version" != 20 ]; then
termux_error_exit "Version mismatch: Expected 20, got $_node_version."
fi
}

_setup_nodejs_18() {
local NODEJS_VERSION=18.18.0
_setup_nodejs_20() {
local NODEJS_VERSION=20.17.0
local NODEJS_FOLDER=${TERMUX_PKG_CACHEDIR}/build-tools/nodejs-${NODEJS_VERSION}

if [ ! -x "$NODEJS_FOLDER/bin/node" ]; then
mkdir -p "$NODEJS_FOLDER"
local NODEJS_TAR_FILE=$TERMUX_PKG_TMPDIR/nodejs-$NODEJS_VERSION.tar.xz
termux_download https://nodejs.org/dist/v${NODEJS_VERSION}/node-v${NODEJS_VERSION}-linux-x64.tar.xz \
"$NODEJS_TAR_FILE" \
3008408e9098f2462f7b1a0f6a48b8a46079beb1c92b6ec43b04713265c96978
a24db3dcd151a52e75965dba04cf1b3cd579ff30d6e0af9da1aede4d0f17486b
tar -xf "$NODEJS_TAR_FILE" -C "$NODEJS_FOLDER" --strip-components=1
fi
export PATH=$NODEJS_FOLDER/bin:$PATH
export PATH="$NODEJS_FOLDER/bin:$PATH"
}

termux_step_host_build() {
export VERSION=$TERMUX_PKG_VERSION
mv $TERMUX_PREFIX/bin $TERMUX_PREFIX/bin.bp
env -i PATH="$PATH" sudo apt update
env -i PATH="$PATH" sudo apt install -yq libxkbfile-dev libsecret-1-dev libkrb5-dev
_setup_nodejs_18
_setup_nodejs_20
npm install yarn
export PATH="$TERMUX_PKG_HOSTBUILD_DIR/node_modules/.bin:$PATH"
cd $TERMUX_PKG_SRCDIR
Expand All @@ -61,7 +62,7 @@ termux_step_configure() {
# Remove this marker all the time
rm -rf $TERMUX_HOSTBUILD_MARKER

_setup_nodejs_18
_setup_nodejs_20
export PATH="$TERMUX_PKG_HOSTBUILD_DIR/node_modules/.bin:$PATH"
}

Expand Down Expand Up @@ -103,7 +104,7 @@ termux_step_make_install() {
cp -Rf ./release-standalone/* $TERMUX_PREFIX/lib/code-server/

# Replace nodejs
ln -sf $TERMUX_PREFIX/opt/nodejs-18/bin/node $TERMUX_PREFIX/lib/code-server/lib/node
ln -sf $TERMUX_PREFIX/opt/nodejs-20/bin/node $TERMUX_PREFIX/lib/code-server/lib/node

# Replace ripgrep
ln -sf $TERMUX_PREFIX/bin/rg $TERMUX_PREFIX/lib/code-server/lib/vscode/node_modules/@vscode/ripgrep/bin/rg
Expand Down

0 comments on commit 34d27e2

Please sign in to comment.