mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-06 22:07:19 +02:00
testing/code-oss: new aport
https://github.com/microsoft/vscode Visual Studio Code (OSS, with VSX)
This commit is contained in:
parent
234d8d8542
commit
6aef24e433
108
testing/code-oss/APKBUILD
Normal file
108
testing/code-oss/APKBUILD
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
# Maintainer: psykose <alice@ayaya.dev>
|
||||||
|
pkgname=code-oss
|
||||||
|
pkgver=1.69.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="
|
||||||
|
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
|
||||||
|
electron-version.patch
|
||||||
|
enable-extensions.patch
|
||||||
|
launcher.patch
|
||||||
|
no-git.patch
|
||||||
|
"
|
||||||
|
builddir="$srcdir/vscode-$pkgver"
|
||||||
|
options="!check" # no tests
|
||||||
|
|
||||||
|
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
|
||||||
|
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
default_prepare
|
||||||
|
# block husky
|
||||||
|
git init .
|
||||||
|
|
||||||
|
yarn config set python python3
|
||||||
|
yarn install --frozen-lockfile
|
||||||
|
}
|
||||||
|
|
||||||
|
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/pixmaps/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/
|
||||||
|
|
||||||
|
# link to system rg
|
||||||
|
ln -sfv /usr/bin/rg \
|
||||||
|
"$pkgdir"/usr/lib/code-oss/resources/app/node_modules.asar.unpacked/@vscode/ripgrep/bin/rg
|
||||||
|
|
||||||
|
mkdir -p "$pkgdir"/usr/bin
|
||||||
|
sed \
|
||||||
|
-e "s|VSCODE_PATH=/usr/share/vscode|VSCODE_PATH=/usr/lib/code-oss|g" \
|
||||||
|
-e "s|ELECTRON=.*|ELECTRON=/usr/lib/electron/electron|g" \
|
||||||
|
-e 's|"$CLI"|"$CLI" --app="${VSCODE_PATH}/resources/app"|g' \
|
||||||
|
../VSCode-linux-x64/bin/code-oss > "$pkgdir"/usr/bin/code-oss
|
||||||
|
chmod +x "$pkgdir"/usr/bin/code-oss
|
||||||
|
}
|
||||||
|
|
||||||
|
sha512sums="
|
||||||
|
415418d382123478596801ef83a8b3644e276da984c5d49d3536687da01c80db770977de371bc7840c677c9f776d3f47e4883b25d0529c5621f459ee15caa7ce code-oss-1.69.0.tar.gz
|
||||||
|
e7c8fc4fcca4e4b38c4dd87989da38fb114e62df3de2444a638d76a5db87371af1d3c933edcad757c6df7b7dfc5bf2e08ea5660af704df9a08b9c864b4482b81 electron-version.patch
|
||||||
|
c8c16511a8cb45f389bd8847d801a6c92d2be443a1a6de383acac575bbcdfd9e97af894d388803627a0cf0552ab46e85234f206db9bd720d8f2ce8443db92a66 enable-extensions.patch
|
||||||
|
445fde371eab1df87a74024cb624bf8f89cf7dd2c50c912de2ab9f6fa05546b2fbb1595dd316e7febca959c5c671c554faf8fef499de520811ea91b48bd1ee15 launcher.patch
|
||||||
|
b91c35bed74da482d63137f43529ec38dc10a293f52a4d1d1c0d6955d84d5f19e61512147302eaa0901152632bf148bf7b99775315e8e0c00bcf2a2e9e585a0a no-git.patch
|
||||||
|
"
|
10
testing/code-oss/code-oss.post-install
Executable file
10
testing/code-oss/code-oss.post-install
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cat <<EOF
|
||||||
|
*
|
||||||
|
* This package uses the OpenVSX registry for extensions, not the regular vscode
|
||||||
|
* registry. As such, some things may be missing or out of date, and this is not
|
||||||
|
* a bug.
|
||||||
|
* https://open-vsx.org/
|
||||||
|
*
|
||||||
|
EOF
|
71
testing/code-oss/electron-version.patch
Normal file
71
testing/code-oss/electron-version.patch
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
--- a/.yarnrc
|
||||||
|
+++ b/.yarnrc
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
disturl "https://electronjs.org/headers"
|
||||||
|
-target "18.3.5"
|
||||||
|
+target "19.0.8"
|
||||||
|
runtime "electron"
|
||||||
|
build_from_source "true"
|
||||||
|
--- a/package.json
|
||||||
|
+++ b/package.json
|
||||||
|
@@ -138,7 +138,7 @@
|
||||||
|
"cssnano": "^4.1.11",
|
||||||
|
"debounce": "^1.0.0",
|
||||||
|
"deemon": "^1.4.0",
|
||||||
|
- "electron": "18.3.5",
|
||||||
|
+ "electron": "^19.0.8",
|
||||||
|
"eslint": "8.7.0",
|
||||||
|
"eslint-plugin-header": "3.1.1",
|
||||||
|
"eslint-plugin-jsdoc": "^39.3.2",
|
||||||
|
--- a/yarn.lock
|
||||||
|
+++ b/yarn.lock
|
||||||
|
@@ -716,7 +716,7 @@
|
||||||
|
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.3.tgz#90420f9f9c6d3987f176a19a7d8e764271a2f55d"
|
||||||
|
integrity sha512-Fxt+AfXgjMoin2maPIYzFZnQjAXjAL0PHscM5pRTtatFqB+vZxAM9tLp2Optnuw3QOQC40jTNeGYFOMvyf7v9g==
|
||||||
|
|
||||||
|
-"@electron/get@^1.12.4":
|
||||||
|
+"@electron/get@^1.12.4", "@electron/get@^1.14.1":
|
||||||
|
version "1.14.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/@electron/get/-/get-1.14.1.tgz#16ba75f02dffb74c23965e72d617adc721d27f40"
|
||||||
|
integrity sha512-BrZYyL/6m0ZXz/lDxy/nlVhQz+WF+iPS6qXolEU8atw7h6v1aYkjwJZ63m+bJMBTxDE66X+r2tPS4a/8C82sZw==
|
||||||
|
@@ -732,22 +732,6 @@
|
||||||
|
global-agent "^3.0.0"
|
||||||
|
global-tunnel-ng "^2.7.1"
|
||||||
|
|
||||||
|
-"@electron/get@^1.13.0":
|
||||||
|
- version "1.13.1"
|
||||||
|
- resolved "https://registry.yarnpkg.com/@electron/get/-/get-1.13.1.tgz#42a0aa62fd1189638bd966e23effaebb16108368"
|
||||||
|
- integrity sha512-U5vkXDZ9DwXtkPqlB45tfYnnYBN8PePp1z/XDCupnSpdrxT8/ThCv9WCwPLf9oqiSGZTkH6dx2jDUPuoXpjkcA==
|
||||||
|
- dependencies:
|
||||||
|
- debug "^4.1.1"
|
||||||
|
- env-paths "^2.2.0"
|
||||||
|
- fs-extra "^8.1.0"
|
||||||
|
- got "^9.6.0"
|
||||||
|
- progress "^2.0.3"
|
||||||
|
- semver "^6.2.0"
|
||||||
|
- sumchecker "^3.0.1"
|
||||||
|
- optionalDependencies:
|
||||||
|
- global-agent "^3.0.0"
|
||||||
|
- global-tunnel-ng "^2.7.1"
|
||||||
|
-
|
||||||
|
"@es-joy/jsdoccomment@~0.31.0":
|
||||||
|
version "0.31.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@es-joy/jsdoccomment/-/jsdoccomment-0.31.0.tgz#dbc342cc38eb6878c12727985e693eaef34302bc"
|
||||||
|
@@ -4335,12 +4319,12 @@
|
||||||
|
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.45.tgz#cf1144091d6683cbd45a231954a745f02fb24598"
|
||||||
|
integrity sha512-czF9eYVuOmlY/vxyMQz2rGlNSjZpxNQYBe1gmQv7al171qOIhgyO9k7D5AKlgeTCSPKk+LHhj5ZyIdmEub9oNg==
|
||||||
|
|
||||||
|
-electron@18.3.5:
|
||||||
|
- version "18.3.5"
|
||||||
|
- resolved "https://registry.yarnpkg.com/electron/-/electron-18.3.5.tgz#a589c2bfa3fe807914a055f54f665999329b739b"
|
||||||
|
- integrity sha512-/GJ39X3ijpyZiOtYQ1ha5Ly0hWiIzF19CGEapM9euaM2AZrmt79x+MckQDXqJxOaVA9YHXju5Ho6b9pB9a/2pQ==
|
||||||
|
+electron@^19.0.8:
|
||||||
|
+ version "19.0.8"
|
||||||
|
+ resolved "https://registry.yarnpkg.com/electron/-/electron-19.0.8.tgz#c4d4ba915de554f2926261eb37d3527d2b092d4c"
|
||||||
|
+ integrity sha512-OWK3P/NbDFfBUv+wbYv1/OV4jehY5DQPT7n1maQJfN9hsnrWTMktXS/bmS05eSUAjNAzHmKPKfiKH2c1Yr7nGw==
|
||||||
|
dependencies:
|
||||||
|
- "@electron/get" "^1.13.0"
|
||||||
|
+ "@electron/get" "^1.14.1"
|
||||||
|
"@types/node" "^16.11.26"
|
||||||
|
extract-zip "^1.0.3"
|
||||||
|
|
13
testing/code-oss/enable-extensions.patch
Normal file
13
testing/code-oss/enable-extensions.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
--- a/product.json
|
||||||
|
+++ b/product.json
|
||||||
|
@@ -28,6 +28,10 @@
|
||||||
|
"reportIssueUrl": "https://github.com/microsoft/vscode/issues/new",
|
||||||
|
"urlProtocol": "code-oss",
|
||||||
|
"webviewContentExternalBaseUrlTemplate": "https://{{uuid}}.vscode-cdn.net/insider/3c8520fab514b9f56070214496b26ff68d1b1cb5/out/vs/workbench/contrib/webview/browser/pre/",
|
||||||
|
+ "extensionsGallery": {
|
||||||
|
+ "serviceUrl": "https://open-vsx.org/vscode/gallery",
|
||||||
|
+ "itemUrl": "https://open-vsx.org/vscode/item"
|
||||||
|
+ },
|
||||||
|
"builtInExtensions": [
|
||||||
|
{
|
||||||
|
"name": "ms-vscode.js-debug-companion",
|
25
testing/code-oss/launcher.patch
Normal file
25
testing/code-oss/launcher.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
--- a/resources/linux/bin/code.sh
|
||||||
|
+++ b/resources/linux/bin/code.sh
|
||||||
|
@@ -44,20 +44,9 @@
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
-if [ ! -L "$0" ]; then
|
||||||
|
- # if path is not a symlink, find relatively
|
||||||
|
- VSCODE_PATH="$(dirname "$0")/.."
|
||||||
|
-else
|
||||||
|
- if command -v readlink >/dev/null; then
|
||||||
|
- # if readlink exists, follow the symlink and find relatively
|
||||||
|
- VSCODE_PATH="$(dirname "$(readlink -f "$0")")/.."
|
||||||
|
- else
|
||||||
|
- # else use the standard install location
|
||||||
|
- VSCODE_PATH="/usr/share/@@APPNAME@@"
|
||||||
|
- fi
|
||||||
|
-fi
|
||||||
|
+VSCODE_PATH="/usr/lib/code-oss"
|
||||||
|
|
||||||
|
-ELECTRON="$VSCODE_PATH/@@APPNAME@@"
|
||||||
|
+ELECTRON="/usr/bin/electron"
|
||||||
|
CLI="$VSCODE_PATH/resources/app/out/cli.js"
|
||||||
|
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node "$@"
|
||||||
|
exit $?
|
9
testing/code-oss/no-git.patch
Normal file
9
testing/code-oss/no-git.patch
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
--- a/build/npm/postinstall.js
|
||||||
|
+++ b/build/npm/postinstall.js
|
||||||
|
@@ -72,6 +72,3 @@
|
||||||
|
|
||||||
|
yarnInstall(dir, opts);
|
||||||
|
}
|
||||||
|
-
|
||||||
|
-cp.execSync('git config pull.rebase merges');
|
||||||
|
-cp.execSync('git config blame.ignoreRevsFile .git-blame-ignore');
|
Loading…
Reference in New Issue
Block a user