mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-16 04:35:13 +03:00
128 lines
4.9 KiB
Text
128 lines
4.9 KiB
Text
# Maintainer: psykose <alice@ayaya.dev>
|
|
pkgname=code-oss
|
|
pkgver=1.76.1
|
|
pkgrel=1
|
|
# get this from vscodium
|
|
_productjson=41b949f19e788cfb441e8c376cf5cc4dbe2e4c45
|
|
pkgdesc="Visual Studio Code (OSS, with VSX)"
|
|
url="https://github.com/microsoft/vscode"
|
|
arch="aarch64 x86_64" # electron
|
|
license="MIT"
|
|
depends="electron ripgrep"
|
|
makedepends="
|
|
jq
|
|
libsecret-dev
|
|
libxkbfile-dev
|
|
nodejs
|
|
npm
|
|
python3
|
|
yarn
|
|
"
|
|
subpackages="
|
|
$pkgname-bash-completion
|
|
$pkgname-zsh-completion
|
|
"
|
|
install="$pkgname.post-install"
|
|
source="$pkgname-$pkgver.tar.gz::https://github.com/microsoft/vscode/archive/refs/tags/$pkgver.tar.gz
|
|
product-$_productjson.json::https://github.com/VSCodium/vscodium/raw/$_productjson/product.json
|
|
enable-extensions.patch
|
|
launcher
|
|
no-git.patch
|
|
electron21.patch
|
|
webpack-hash.patch.noauto
|
|
"
|
|
builddir="$srcdir/vscode-$pkgver"
|
|
options="!check net" # no tests (that make sense to run..)
|
|
|
|
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
|
|
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
|
|
|
prepare() {
|
|
default_prepare
|
|
# block husky
|
|
git init .
|
|
|
|
echo 'ignore-engines true' >> .yarnrc
|
|
|
|
# electron 20+ workaround for bad gyp usage
|
|
export CXXFLAGS="$CXXFLAGS -std=c++17"
|
|
|
|
yarn install --frozen-lockfile
|
|
|
|
patch -Np1 < "$srcdir"/webpack-hash.patch.noauto
|
|
|
|
# patch out telemetry
|
|
# backported from https://github.com/VSCodium/vscodium/blob/master/undo_telemetry.sh
|
|
rg --no-ignore -l "\.data\.microsoft\.com" . \
|
|
| xargs sed -i -E "s|//[^/]+\.data\.microsoft\.com|//0\.0\.0\.0|g"
|
|
|
|
# merge the product.json from the repo with one from vscodium repo
|
|
# this fixes some extensions, including python
|
|
cp product.json original_product.json
|
|
jq -s '.[0] * .[1]' original_product.json "$srcdir"/product-$_productjson.json > product.json
|
|
}
|
|
|
|
build() {
|
|
node --max_old_space_size=4096 ./node_modules/.bin/gulp vscode-linux-x64-min
|
|
}
|
|
|
|
package() {
|
|
mkdir -p "$pkgdir"/usr/share/applications
|
|
sed -e "s|@@NAME_LONG@@|Code - OSS|g" \
|
|
-e "s|@@NAME_SHORT@@|Code - OSS|g" \
|
|
-e "s|@@NAME@@|code-oss|g" \
|
|
-e "s|@@EXEC@@|/usr/bin/code-oss|g" \
|
|
-e "s|@@ICON@@|com.visualstudio.code.oss|g" \
|
|
-e "s|@@URLPROTOCOL@@|code-oss|g" \
|
|
resources/linux/code.desktop > "$pkgdir"/usr/share/applications/code-oss.desktop
|
|
sed -e "s|@@NAME_LONG@@|Code - OSS|g" \
|
|
-e "s|@@NAME_SHORT@@|Code - OSS|g" \
|
|
-e "s|@@NAME@@|code-oss|g" \
|
|
-e "s|@@EXEC@@|/usr/bin/code-oss|g" \
|
|
-e "s|@@ICON@@|com.visualstudio.code.oss|g" \
|
|
-e "s|@@URLPROTOCOL@@|code-oss|g" \
|
|
resources/linux/code-url-handler.desktop > "$pkgdir"/usr/share/applications/code-oss-url-handler.desktop
|
|
|
|
install -Dm644 resources/linux/code.png "$pkgdir"/usr/share/icons/hicolor/1024x1024/apps/com.visualstudio.code.oss.png
|
|
|
|
mkdir -p "$pkgdir"/usr/share/metainfo
|
|
sed -e "s|@@NAME_LONG@@|Code - OSS|g" \
|
|
-e "s|@@NAME@@|code-oss|g" \
|
|
-e "s|@@LICENSE@@|MIT|g" \
|
|
resources/linux/code.appdata.xml > "$pkgdir"/usr/share/metainfo/code-oss.appdata.xml
|
|
|
|
mkdir -p "$pkgdir"/usr/share/mime/packages
|
|
sed -e "s|@@NAME_LONG@@|Code - OSS|g" \
|
|
-e "s|@@NAME@@|code-oss|g" \
|
|
resources/linux/code-workspace.xml > "$pkgdir"/usr/share/mime/packages/code-oss-workspace.xml
|
|
|
|
mkdir -p "$pkgdir"/usr/share/bash-completion/completions
|
|
sed -e "s|@@APPNAME@@|code-oss|g" \
|
|
resources/completions/bash/code > "$pkgdir"/usr/share/bash-completion/completions/code-oss
|
|
|
|
mkdir -p "$pkgdir"/usr/share/zsh/site-functions
|
|
sed -e "s|@@APPNAME@@|code-oss|g" \
|
|
resources/completions/zsh/_code > "$pkgdir"/usr/share/zsh/site-functions/_code-oss
|
|
|
|
mkdir -p "$pkgdir"/usr/lib/code-oss/resources
|
|
cp -a ../VSCode-linux-x64/resources/app "$pkgdir"/usr/lib/code-oss/resources/
|
|
|
|
# disable update server
|
|
sed -i "/updateUrl/d" "$pkgdir"/usr/lib/code-oss/resources/app/product.json
|
|
|
|
# link to system rg
|
|
ln -sfv /usr/bin/rg \
|
|
"$pkgdir"/usr/lib/code-oss/resources/app/node_modules.asar.unpacked/@vscode/ripgrep/bin/rg
|
|
|
|
install -Dm755 "$srcdir"/launcher "$pkgdir"/usr/bin/code-oss
|
|
}
|
|
|
|
sha512sums="
|
|
a33dcfdccf1c220888e5f5db744854c4dc012c8d121a3d8fe7bc781606e8ec90a2f624d47a51358ba58e157fc8fbcab98f50b48593263f68339017cb9ca3e5a9 code-oss-1.76.1.tar.gz
|
|
206b8689559ba464deeaf9d76347a617b6b15b98e74c79f309ca1f41b87ffa482ea80e4f76d0ab9a96844875605c505604d76db59e43783cde9f28942b646109 product-41b949f19e788cfb441e8c376cf5cc4dbe2e4c45.json
|
|
9f36c7fa6f0fd6a516f8e22c47f53013337985e59085bf1ea70165d42a513a92aa2a7a99ef0715e752c7190fd39ba703d405838e61bcfb60cabe47c421781eb4 enable-extensions.patch
|
|
cf36ed3da55086da31ec9b748620a6d3524e7d58a19b4b0309577ae67f8064b95d52c874cb4481260017a32a09ecdc014d4adea01a1c956992358e58d20a57a2 launcher
|
|
f8d744ed29d4fa57bd00b916e689ea0f5ac5590910e369fa26c76bd2bc6ba2dd692c06f11342f8517667fb818caab7b4e349cd30c629be225bc9cea4e02ed3b9 no-git.patch
|
|
753c3dd34441108d6cfbd5d42ba27c0babe844f931a2f402378d80f446ce2aa6640bd7406a58c29a952b29326d330b9a49d03e0ff0cb511e34dae8d267578722 electron21.patch
|
|
0939ed0e39883b27ac13cdde2e1dbce506043997b6b52610d1f75560db58bac646d6f8fd6b909e8ad595aab6ed9f3777206e33d7fa5a58e0a7acc4c530b5d6b0 webpack-hash.patch.noauto
|
|
"
|