code-oss: new ptrcport

This commit is contained in:
psykose 2022-06-12 01:28:23 +00:00
parent 1ac98cc080
commit 24ac7e5dd0
Signed by: psykose
SSH key fingerprint: SHA256:HwlGVJNLZqHoOvMtkshyGaXLkcdbEJahYMlepHFL+Uk
6 changed files with 301 additions and 0 deletions

107
code-oss/APKBUILD Normal file
View file

@ -0,0 +1,107 @@
# Maintainer: psykose <alice@ayaya.dev>
pkgname=code-oss
pkgver=1.68.0
pkgrel=0
pkgdesc="Visual Studio Code"
url="https://github.com/microsoft/vscode"
arch="x86_64"
license="haha"
depends="electron ripgrep"
makedepends="
libsecret-dev
libxkbfile-dev
nodejs
npm
python3
yarn
"
subpackages="
$pkgname-bash-completion
$pkgname-zsh-completion
"
source="$pkgname-$pkgver.tar.gz::https://github.com/microsoft/vscode/archive/refs/tags/$pkgver.tar.gz
electron-version.patch
electron19.patch
enable-extensions.patch
launcher.patch
no-git.patch
"
builddir="$srcdir/vscode-$pkgver"
options="!check"
export GIT_DIR="$srcdir"
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
prepare() {
default_prepare
yarn config set python python3
yarn install --frozen-lockfile
}
build() {
node --max_old_space_size=4095 ./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/
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="
2761995f71c336eb82e0ff461898d9616e352ae32314a3dd10caaf3a578f3ac3dea44eaa1f03247aec64461bd5488b02fd68c3306e54e36b65942036272471bd code-oss-1.68.0.tar.gz
f92a6960012ebe280673b7a2d2ff7aedcc6d4404f5ff2e237d07847f8faf4d00ca99c1d84108607fa56399e221707da06dd97faf72e6a95f340e9f61ef8ae128 electron-version.patch
211345de4d34be2a14df69dc027e8440627363aa9937010146211317cf4c1cd699e7085305cfc197680db6ccdeabfccd36797064c416857d9c4156da6b581e29 electron19.patch
062778032c1f29f000fd66143af4d489152c381fce38e95a143d0fa25cf810abd1ec8c17b5b8c5598eaba1d5fb573244cf0aa2bc8256dcaab151538ed07b6545 enable-extensions.patch
445fde371eab1df87a74024cb624bf8f89cf7dd2c50c912de2ab9f6fa05546b2fbb1595dd316e7febca959c5c671c554faf8fef499de520811ea91b48bd1ee15 launcher.patch
b91c35bed74da482d63137f43529ec38dc10a293f52a4d1d1c0d6955d84d5f19e61512147302eaa0901152632bf148bf7b99775315e8e0c00bcf2a2e9e585a0a no-git.patch
"

View file

@ -0,0 +1,88 @@
--- 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"
-
"@eslint/eslintrc@^1.0.5":
version "1.0.5"
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.5.tgz#33f1b838dbf1f923bfa517e008362b78ddbbf318"
@@ -1346,10 +1330,10 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e"
integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ==
-"@types/node@^14.6.2":
- version "14.14.37"
- resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.37.tgz#a3dd8da4eb84a996c36e331df98d82abd76b516e"
- integrity sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==
+"@types/node@^16.11.26":
+ version "16.11.39"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.39.tgz#07223cd2bc332ad9d92135e3a522eebdee3b060e"
+ integrity sha512-K0MsdV42vPwm9L6UwhIxMAOmcvH/1OoVkZyCgEtVu4Wx7sElGloy/W7kMBNe/oJ7V/jW9BVt1F6RahH6e7tPXw==
"@types/q@^1.5.1":
version "1.5.4"
@@ -4287,13 +4271,13 @@
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.45.tgz#cf1144091d6683cbd45a231954a745f02fb24598"
integrity sha512-czF9eYVuOmlY/vxyMQz2rGlNSjZpxNQYBe1gmQv7al171qOIhgyO9k7D5AKlgeTCSPKk+LHhj5ZyIdmEub9oNg==
-electron@17.4.7:
- version "17.4.7"
- resolved "https://registry.yarnpkg.com/electron/-/electron-17.4.7.tgz#5ae9105f2ee28e6405c79c7101f0c956676da697"
- integrity sha512-CMdUpd6oEwqbF7wcXwy9VNNXfTTbaeRg+zrGZciPzyzsEmJ9vzWcR1WpOxIQ4sIMjUyo1pFbvaD0VOgI2t4x3A==
+electron@19.0.4:
+ version "19.0.4"
+ resolved "https://registry.yarnpkg.com/electron/-/electron-19.0.4.tgz#a88d5e542868c4abd7704228ec62c553605605a0"
+ integrity sha512-roRYr1VNAWIhjD9n8qZdmhROtrzsFpuZEXrjWAw+GqPbZlrUInmvFCviRDC2Lt+VBsTNRpTfPpfzXSlLL4reEw==
dependencies:
- "@electron/get" "^1.13.0"
- "@types/node" "^14.6.2"
+ "@electron/get" "^1.14.1"
+ "@types/node" "^16.11.26"
extract-zip "^1.0.3"
elliptic@^6.5.3:
--- a/package.json
+++ b/package.json
@@ -136,7 +136,7 @@
"cssnano": "^4.1.11",
"debounce": "^1.0.0",
"deemon": "^1.4.0",
- "electron": "17.4.7",
+ "electron": "19.0.4",
"eslint": "8.7.0",
"eslint-plugin-header": "3.1.1",
"eslint-plugin-jsdoc": "^19.1.0",
--- a/.yarnrc
+++ b/.yarnrc
@@ -1,4 +1,4 @@
disturl "https://electronjs.org/headers"
-target "17.4.7"
+target "19.0.4"
runtime "electron"
build_from_source "true"

20
code-oss/electron19.patch Normal file
View file

@ -0,0 +1,20 @@
--- a/src/vs/platform/sharedProcess/electron-main/sharedProcess.ts
+++ b/src/vs/platform/sharedProcess/electron-main/sharedProcess.ts
@@ -228,7 +228,6 @@
contextIsolation: false,
enableWebSQL: false,
spellcheck: false,
- nativeWindowOpen: true,
images: false,
webgl: false
}
--- a/src/vs/platform/windows/electron-main/window.ts
+++ b/src/vs/platform/windows/electron-main/window.ts
@@ -195,7 +195,6 @@
v8CacheOptions: this.environmentMainService.useCodeCache ? 'bypassHeatCheck' : 'none',
enableWebSQL: false,
spellcheck: false,
- nativeWindowOpen: true,
zoomFactor: zoomLevelToZoomFactor(windowSettings?.zoomLevel),
// Enable experimental css highlight api https://chromestatus.com/feature/5436441440026624
// Refs https://github.com/microsoft/vscode/issues/140098

View file

@ -0,0 +1,52 @@
--- a/product.json
+++ b/product.json
@@ -28,6 +28,49 @@
"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/",
+ "quality": "stable",
+ "extensionsGallery": {
+ "nlsBaseUrl": "https://www.vscode-unpkg.net/_nls/",
+ "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
+ "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
+ "itemUrl": "https://marketplace.visualstudio.com/items",
+ "publisherUrl": "https://marketplace.visualstudio.com/publishers",
+ "resourceUrlTemplate": "https://{publisher}.vscode-unpkg.net/{publisher}/{name}/{version}/{path}",
+ "controlUrl": "https://az764295.vo.msecnd.net/extensions/marketplace.json",
+ "recommendationsUrl": "https://az764295.vo.msecnd.net/extensions/workspaceRecommendations.json.gz"
+ },
+ "extensionEnabledApiProposals": {
+ "ms-vscode.vscode-selfhost-test-provider": ["testObserver"],
+ "VisualStudioExptTeam.vscodeintellicode-completions": ["inlineCompletionsNew", "inlineCompletionsAdditions"],
+ "ms-vsliveshare.vsliveshare": ["contribMenuBarHome", "diffCommand", "documentFiltersExclusive", "fileSearchProvider", "findTextInFiles", "notebookCellExecutionState", "notebookContentProvider", "notebookEditor", "notebookEditorEdit", "notebookLiveShare", "notebookWorkspaceEdit", "terminalDimensions", "terminalDataWriteEvent", "textSearchProvider"],
+ "ms-vscode.js-debug": ["portsAttributes", "findTextInFiles", "workspaceTrust", "resolvers"],
+ "ms-toolsai.vscode-ai-remote": ["resolvers", "notebookEditor"],
+ "ms-python.python": ["quickPickSortByLabel", "testObserver", "notebookEditor"],
+ "ms-dotnettools.dotnet-interactive-vscode": ["notebookCellExecutionState", "notebookControllerKind", "notebookDebugOptions", "notebookEditor", "notebookEditorEdit", "notebookLiveShare", "notebookMessaging", "notebookMime", "notebookWorkspaceEdit"],
+ "GitHub.codespaces": ["contribMenuBarHome", "contribRemoteHelp", "contribViewsRemote", "notebookEditor", "resolvers", "terminalDataWriteEvent", "treeViewReveal"],
+ "ms-vscode.azure-repos": ["extensionRuntime", "fileSearchProvider", "textSearchProvider"],
+ "ms-vscode.remote-repositories": ["contribRemoteHelp", "contribMenuBarHome", "contribViewsRemote", "contribViewsWelcome", "documentFiltersExclusive", "extensionRuntime", "fileSearchProvider", "quickPickSortByLabel", "workspaceTrust", "scmSelectedProvider", "scmValidation", "textSearchProvider", "timeline", "notebookEditor"],
+ "tanhakabir.rest-book": ["notebookEditor"],
+ "ms-vscode.remote-server": ["resolvers"],
+ "ms-vscode-remote.remote-wsl": ["resolvers", "contribViewsRemote", "telemetry"],
+ "ms-vscode-remote.remote-ssh": ["resolvers", "terminalDataWriteEvent", "contribViewsRemote", "telemetry"],
+ "ms-vscode-remote.remote-containers": ["resolvers", "workspaceTrust", "terminalDimensions", "contribViewsRemote"],
+ "ms-vscode.js-debug-nightly": ["portsAttributes", "findTextInFiles", "workspaceTrust", "resolvers"],
+ "ms-vscode.lsif-browser": ["documentFiltersExclusive"],
+ "GitHub.vscode-pull-request-github": ["tokenInformation", "commentsResolvedState"],
+ "GitHub.copilot": ["inlineCompletionsNew", "inlineCompletionsAdditions"],
+ "GitHub.copilot-nightly": ["inlineCompletionsNew", "inlineCompletionsAdditions"],
+ "GitHub.remotehub": ["contribRemoteHelp", "contribMenuBarHome", "contribViewsRemote", "contribViewsWelcome", "documentFiltersExclusive", "extensionRuntime", "fileSearchProvider", "quickPickSortByLabel", "workspaceTrust", "scmSelectedProvider", "scmValidation", "textSearchProvider", "timeline", "notebookEditor"],
+ "GitHub.remotehub-insiders": ["contribRemoteHelp", "contribMenuBarHome", "contribViewsRemote", "contribViewsWelcome", "documentFiltersExclusive", "extensionRuntime", "fileSearchProvider", "quickPickSortByLabel", "workspaceTrust", "scmSelectedProvider", "scmValidation", "textSearchProvider", "timeline", "notebookEditor"],
+ "ms-python.gather": ["notebookEditor", "notebookCellExecutionState"],
+ "ms-python.vscode-pylance": ["notebookEditor", "notebookCellExecutionState"],
+ "ms-toolsai.jupyter": ["notebookControllerKind", "notebookDebugOptions", "notebookDeprecated", "notebookEditor", "notebookEditorDecorationType", "notebookWorkspaceEdit", "notebookMessaging", "notebookMime", "notebookCellExecutionState", "portsAttributes", "quickPickSortByLabel"],
+ "ms-toolsai.vscode-jupyter-powertoys": ["notebookEditor", "notebookEditorEdit", "notebookWorkspaceEdit"],
+ "dbaeumer.vscode-eslint": ["notebookEditor", "notebookCellExecutionState"],
+ "ms-vscode.azure-sphere-tools-ui": ["resolvers"],
+ "ms-azuretools.vscode-azureappservice": ["terminalDataWriteEvent"],
+ "ms-vscode.anycode": ["extensionsAny"]
+ },
"builtInExtensions": [
{
"name": "ms-vscode.js-debug-companion",

25
code-oss/launcher.patch Normal file
View 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
code-oss/no-git.patch Normal file
View 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');