vscode: update to 1.29.1

This commit is contained in:
shizonic 2018-11-16 16:06:06 +01:00 committed by Toyam Cox
parent 2f69443fc7
commit a85406806e
10 changed files with 114 additions and 91 deletions

View File

@ -0,0 +1,2 @@
To use always software rendering create the file
${HOME}/.config/Code - OSS/.libgl_always_software

9
srcpkgs/vscode/REMOVE Normal file
View File

@ -0,0 +1,9 @@
if [ "$UPDATE" = "no" ]; then
case "$ACTION" in
post)
if [ -d usr/share/code-oss ]; then
rm -rf usr/share/code-oss
fi
;;
esac
fi

View File

@ -1,22 +0,0 @@
#!/usr/bin/env bash
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# If root, ensure that --user-data-dir or --file-write is specified
if [ "$(id -u)" = "0" ]; then
for i in $@
do
if [[ $i == --user-data-dir || $i == --user-data-dir=* || $i == --file-write ]]; then
CAN_LAUNCH_AS_ROOT=1
fi
done
if [ -z $CAN_LAUNCH_AS_ROOT ]; then
echo "You are trying to start vscode as a super user which is not recommended. If you really want to, you must specify an alternate user data directory using the --user-data-dir argument." 1>&2
exit 1
fi
fi
VSCODE_PATH="/usr/lib/code-oss"
ELECTRON="$VSCODE_PATH/code-oss"
CLI="$VSCODE_PATH/resources/app/out/cli.js"
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
exit $?

View File

@ -1,30 +0,0 @@
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Name=Microsoft Code
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/bin/code --unity-launch %F
Icon=/usr/share/code-oss/resources/app/resources/linux/code.png
Type=Application
StartupNotify=true
StartupWMClass=Code - OSS
Categories=Utility;TextEditor;Development;IDE;
MimeType=text/plain;inode/directory;
Actions=new-window;
Keywords=vscode;
[Desktop Action new-window]
Name=New Window
Name[de]=Neues Fenster
Name[es]=Nueva ventana
Name[fr]=Nouvelle fenêtre
Name[it]=Nuova finestra
Name[ja]=
Name[ko]=
Name[ru]=Новое окно
Name[zh_CN]=
Name[zh_TW]=
Exec=/usr/bin/code --new-window %F
Icon=/usr/share/code-oss/resources/app/resources/linux/code.png

View File

@ -1,11 +0,0 @@
--- build/gulpfile.vscode.js 2018-07-11 06:48:42.000000000 -0700
+++ build/gulpfile.vscode.js 2018-07-14 22:18:48.706459639 -0700
@@ -265,7 +265,7 @@ function packageTask(platform, arch, opt
const packageJsonStream = gulp.src(['package.json'], { base: '.' })
.pipe(json({ name, version }));
- const settingsSearchBuildId = getSettingsSearchBuildId(packageJson);
+ const settingsSearchBuildId = 'BuildId';
const date = new Date().toISOString();
const productJsonStream = gulp.src(['product.json'], { base: '.' })
.pipe(json({ commit, date, checksums, settingsSearchBuildId }));

View File

@ -0,0 +1,21 @@
diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
index 090db00ffebb..0c54098d2601 100644
--- a/build/gulpfile.vscode.js
+++ b/build/gulpfile.vscode.js
@@ -323,7 +323,15 @@ function packageTask(platform, arch, opts) {
if (platform === 'win32') {
all = es.merge(all, gulp.src(['resources/win32/code_file.ico', 'resources/win32/code_70x70.png', 'resources/win32/code_150x150.png'], { base: '.' }));
} else if (platform === 'linux') {
- all = es.merge(all, gulp.src('resources/linux/code.png', { base: '.' }));
+ const icon = gulp.src('resources/linux/code.png', { base: '.' });
+
+ const desktop = gulp.src('resources/linux/code.desktop', { base: '.' })
+ .pipe(replace('@@NAME_LONG@@', product.nameLong))
+ .pipe(replace('@@NAME_SHORT@@', product.nameShort))
+ .pipe(replace('@@NAME@@', product.applicationName))
+ .pipe(replace('@@ICON@@', `/usr/share/pixmaps/${product.applicationName}.png`));
+
+ all = es.merge(all, icon, desktop);
} else if (platform === 'darwin') {
const shortcut = gulp.src('resources/darwin/bin/code.sh')
.pipe(rename('bin/code'));

View File

@ -0,0 +1,35 @@
diff --git a/resources/linux/bin/code.sh b/resources/linux/bin/code.sh
index 55f50b6f1c14..f03839c66095 100755
--- a/resources/linux/bin/code.sh
+++ b/resources/linux/bin/code.sh
@@ -30,6 +30,10 @@ else
fi
fi
+if [ -e "${HOME}/.config/Code - OSS/.libgl_always_software" ]; then
+ export LIBGL_ALWAYS_SOFTWARE=1
+fi
+
ELECTRON="$VSCODE_PATH/@@NAME@@"
CLI="$VSCODE_PATH/resources/app/out/cli.js"
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
diff --git a/resources/linux/code.desktop b/resources/linux/code.desktop
index f93060d565bd..d511dd86489d 100644
--- a/resources/linux/code.desktop
+++ b/resources/linux/code.desktop
@@ -2,7 +2,7 @@
Name=@@NAME_LONG@@
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=/usr/share/@@NAME@@/@@NAME@@ --unity-launch %F
+Exec=/usr/bin/sh -c '[ -e "${HOME}/.config/Code - OSS/.libgl_always_software" ] && export LIBGL_ALWAYS_SOFTWARE=1; /usr/share/@@NAME@@/@@NAME@@ --unity-launch %F'
Icon=@@ICON@@
Type=Application
StartupNotify=true
@@ -14,5 +14,5 @@ Keywords=vscode;
[Desktop Action new-empty-window]
Name=New Empty Window
-Exec=/usr/share/@@NAME@@/@@NAME@@ --new-window %F
+Exec=/usr/bin/sh -c '[ -e "${HOME}/.config/Code - OSS/.libgl_always_software" ] && export LIBGL_ALWAYS_SOFTWARE=1; /usr/share/@@NAME@@/@@NAME@@ --new-window %F'
Icon=@@ICON@@

View File

@ -1,16 +0,0 @@
diff --git product.json product.json
index ed3ced1c1be3..27bf557b1d71 100644
--- product.json
+++ product.json
@@ -21,5 +21,10 @@
"extensionAllowedProposedApi": [
"ms-vscode.node-debug",
"ms-vscode.node-debug2"
- ]
+ ],
+ "extensionsGallery": {
+ "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
+ "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
+ "itemUrl": "https://marketplace.visualstudio.com/items"
+ }
}

View File

@ -0,0 +1,21 @@
diff --git a/product.json b/product.json
index eb6526c2d8f6..2d7088359f0b 100644
--- a/product.json
+++ b/product.json
@@ -18,7 +18,15 @@
"darwinBundleIdentifier": "com.visualstudio.code.oss",
"reportIssueUrl": "https://github.com/Microsoft/vscode/issues/new",
"urlProtocol": "code-oss",
+ "quality": "stable",
"extensionAllowedProposedApi": [
"ms-vscode.references-view"
- ]
+ ],
+ "extensionsGallery": {
+ "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
+ "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
+ "itemUrl": "https://marketplace.visualstudio.com/items"
+ },
+ "documentationUrl": "https://github.com/microsoft/vscode-docs",
+ "requestFeatureUrl": "https://github.com/Microsoft/vscode/issues"
}

View File

@ -1,38 +1,52 @@
# Template file for 'vscode' # Template file for 'vscode'
pkgname=vscode pkgname=vscode
version=1.25.1 version=1.29.1
revision=2 revision=1
hostmakedepends="pkg-config python nodejs-lts yarn" hostmakedepends="pkg-config python nodejs-lts yarn"
makedepends="libX11-devel libxkbfile-devel libsecret-devel" makedepends="libxkbfile-devel libsecret-devel"
depends="GConf libXtst libxkbfile nss" depends="GConf libXtst libxkbfile nss"
short_desc="Microsoft Code for Linux" short_desc="Microsoft Code for Linux"
maintainer="Julio Galvan <juliogalvan@protonmail.com>" maintainer="shizonic <realtiaz@gmail.com>"
license="MIT" license="MIT"
homepage="https://code.visualstudio.com/" homepage="https://code.visualstudio.com/"
distfiles="https://github.com/Microsoft/vscode/archive/${version}.tar.gz" distfiles="https://github.com/Microsoft/vscode/archive/${version}.tar.gz"
checksum=af95547a64647d4097c1b45902fc53f45d323f053a7558bfa42e1900621d972c checksum=3ba8131949f40931d9eb5153f353377ea7f5c079dd688b16c804eab55b3c5407
patch_args="-Np1"
# Due to electron # Due to electron
only_for_archs="i686 x86_64" only_for_archs="i686 x86_64"
nostrip_files="code-oss" nostrip_files="code-oss"
# The default memory limit may be too low for current versions of node
# to successfully build vscode. This sets it to 4GB, but
# change this number if it still doesn't work for your system.
_mem_limit="--max_old_space_size=4095"
case "$XBPS_TARGET_MACHINE" in case "$XBPS_TARGET_MACHINE" in
i686) broken="https://build.voidlinux.eu/builders/i686_builder/builds/10486/steps/shell_3/logs/stdio" i686) broken="https://build.voidlinux.eu/builders/i686_builder/builds/10486/steps/shell_3/logs/stdio"
_ARCH="ia32";; _ARCH="ia32";;
x86_64) _ARCH="x64";; x86_64) _ARCH="x64";;
esac esac
pre_build() {
# Use yarn to install dependencies
echo "" > build/npm/preinstall.js
}
do_build() { do_build() {
sed -i 's/\"enableTelemetry\":.*/\"enableTelemetry\": false,/g' product.json export NODE_OPTIONS="${_mem_limit}"
echo > build/npm/preinstall.js
yarn install --ignore-engines --arch=${_ARCH} yarn install --ignore-engines --arch=${_ARCH}
yarn run gulp vscode-linux-${_ARCH} yarn run gulp vscode-linux-${_ARCH}-min
} }
do_install() { do_install() {
vmkdir usr/lib vmkdir usr/share/code-oss
vcopy ../VSCode-linux-${_ARCH}/* usr/share/code-oss
vmkdir usr/bin
ln -sf /usr/share/code-oss/bin/code-oss ${DESTDIR}/usr/bin/
vmkdir usr/share/applications vmkdir usr/share/applications
vcopy ${FILESDIR}/code.desktop usr/share/applications/ ln -sf /usr/share/code-oss/resources/app/resources/linux/code.desktop ${DESTDIR}/usr/share/applications/code-oss.desktop
mv ../VSCode-linux-${_ARCH} ${DESTDIR}/usr/lib/code-oss vmkdir usr/share/pixmaps
vbin ${FILESDIR}/code ln -sf /usr/share/code-oss/resources/app/resources/linux/code.png ${DESTDIR}/usr/share/pixmaps/code-oss.png
vlicense LICENSE.txt vlicense LICENSE.txt
} }