mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-12-26 03:42:37 +01:00
126 lines
4.8 KiB
Plaintext
126 lines
4.8 KiB
Plaintext
# Maintainer: psykose <alice@ayaya.dev>
|
|
pkgname=code-oss
|
|
pkgver=1.73.0
|
|
pkgrel=0
|
|
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"
|
|
_productjson=10582b3c86c800f43dbe7836203420dde9862c60
|
|
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 .
|
|
|
|
# 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/appdata
|
|
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/appdata/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="
|
|
6d4035ddc87087a72bc7ca57ca5be7f94a65818fb257175b9f97a393a3ccb323968e01ff7cc75965749f5811d6ad44c5586d6ade920f9a2ea3aff27e2180a258 code-oss-1.73.0.tar.gz
|
|
ea68dc3848f20fee7e38e454f6be18fdc70cdbf29c36b01a587473a6b6301b6b77704f847dd5406333a8337c5ad7d241a5af0b5695084d999bd8c70b6e042968 product-10582b3c86c800f43dbe7836203420dde9862c60.json
|
|
124ed128dc0a59dcf6be9be6fdb9a7d84a71538a31bf0d225fb4885629c5e37cca80fc18b7c07b2e87d5183d752467d9eaff24625bd0d8871ce3d3db9397a6cc enable-extensions.patch
|
|
cf36ed3da55086da31ec9b748620a6d3524e7d58a19b4b0309577ae67f8064b95d52c874cb4481260017a32a09ecdc014d4adea01a1c956992358e58d20a57a2 launcher
|
|
b91c35bed74da482d63137f43529ec38dc10a293f52a4d1d1c0d6955d84d5f19e61512147302eaa0901152632bf148bf7b99775315e8e0c00bcf2a2e9e585a0a no-git.patch
|
|
22a616454f5e9ad89a54d20692e573ce5c9a85f9a1e89303c2ea5b8d743cc343f5a5df13c69bdbb212f78255b680258acaa3b33102650115f757687b2f44b41d electron21.patch
|
|
0939ed0e39883b27ac13cdde2e1dbce506043997b6b52610d1f75560db58bac646d6f8fd6b909e8ad595aab6ed9f3777206e33d7fa5a58e0a7acc4c530b5d6b0 webpack-hash.patch.noauto
|
|
"
|