From a85406806ea02a0e517700080745554b69503e84 Mon Sep 17 00:00:00 2001 From: shizonic Date: Fri, 16 Nov 2018 16:06:06 +0100 Subject: [PATCH] vscode: update to 1.29.1 --- srcpkgs/vscode/INSTALL.msg | 2 ++ srcpkgs/vscode/REMOVE | 9 ++++++ srcpkgs/vscode/files/code | 22 -------------- srcpkgs/vscode/files/code.desktop | 30 ------------------- srcpkgs/vscode/patches/buildid.patch | 11 ------- srcpkgs/vscode/patches/gulp.patch | 21 +++++++++++++ srcpkgs/vscode/patches/libgl.patch | 35 ++++++++++++++++++++++ srcpkgs/vscode/patches/marketplace.patch | 16 ---------- srcpkgs/vscode/patches/product.patch | 21 +++++++++++++ srcpkgs/vscode/template | 38 ++++++++++++++++-------- 10 files changed, 114 insertions(+), 91 deletions(-) create mode 100644 srcpkgs/vscode/INSTALL.msg create mode 100644 srcpkgs/vscode/REMOVE delete mode 100644 srcpkgs/vscode/files/code delete mode 100644 srcpkgs/vscode/files/code.desktop delete mode 100644 srcpkgs/vscode/patches/buildid.patch create mode 100644 srcpkgs/vscode/patches/gulp.patch create mode 100644 srcpkgs/vscode/patches/libgl.patch delete mode 100644 srcpkgs/vscode/patches/marketplace.patch create mode 100644 srcpkgs/vscode/patches/product.patch diff --git a/srcpkgs/vscode/INSTALL.msg b/srcpkgs/vscode/INSTALL.msg new file mode 100644 index 00000000000..5db338c335a --- /dev/null +++ b/srcpkgs/vscode/INSTALL.msg @@ -0,0 +1,2 @@ +To use always software rendering create the file +${HOME}/.config/Code - OSS/.libgl_always_software diff --git a/srcpkgs/vscode/REMOVE b/srcpkgs/vscode/REMOVE new file mode 100644 index 00000000000..c5d09bf6ad3 --- /dev/null +++ b/srcpkgs/vscode/REMOVE @@ -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 diff --git a/srcpkgs/vscode/files/code b/srcpkgs/vscode/files/code deleted file mode 100644 index f53c780abfd..00000000000 --- a/srcpkgs/vscode/files/code +++ /dev/null @@ -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 $? \ No newline at end of file diff --git a/srcpkgs/vscode/files/code.desktop b/srcpkgs/vscode/files/code.desktop deleted file mode 100644 index 858abaeb363..00000000000 --- a/srcpkgs/vscode/files/code.desktop +++ /dev/null @@ -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 - diff --git a/srcpkgs/vscode/patches/buildid.patch b/srcpkgs/vscode/patches/buildid.patch deleted file mode 100644 index 7595f46b7bd..00000000000 --- a/srcpkgs/vscode/patches/buildid.patch +++ /dev/null @@ -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 })); diff --git a/srcpkgs/vscode/patches/gulp.patch b/srcpkgs/vscode/patches/gulp.patch new file mode 100644 index 00000000000..0a1f1c8e09d --- /dev/null +++ b/srcpkgs/vscode/patches/gulp.patch @@ -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')); diff --git a/srcpkgs/vscode/patches/libgl.patch b/srcpkgs/vscode/patches/libgl.patch new file mode 100644 index 00000000000..27ef54dfebc --- /dev/null +++ b/srcpkgs/vscode/patches/libgl.patch @@ -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@@ diff --git a/srcpkgs/vscode/patches/marketplace.patch b/srcpkgs/vscode/patches/marketplace.patch deleted file mode 100644 index c2453c9690b..00000000000 --- a/srcpkgs/vscode/patches/marketplace.patch +++ /dev/null @@ -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" -+ } - } diff --git a/srcpkgs/vscode/patches/product.patch b/srcpkgs/vscode/patches/product.patch new file mode 100644 index 00000000000..58c7e9d6327 --- /dev/null +++ b/srcpkgs/vscode/patches/product.patch @@ -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" + } diff --git a/srcpkgs/vscode/template b/srcpkgs/vscode/template index 9d1af8a2691..8fbade98276 100644 --- a/srcpkgs/vscode/template +++ b/srcpkgs/vscode/template @@ -1,38 +1,52 @@ # Template file for 'vscode' pkgname=vscode -version=1.25.1 -revision=2 +version=1.29.1 +revision=1 hostmakedepends="pkg-config python nodejs-lts yarn" -makedepends="libX11-devel libxkbfile-devel libsecret-devel" +makedepends="libxkbfile-devel libsecret-devel" depends="GConf libXtst libxkbfile nss" short_desc="Microsoft Code for Linux" -maintainer="Julio Galvan " +maintainer="shizonic " license="MIT" homepage="https://code.visualstudio.com/" distfiles="https://github.com/Microsoft/vscode/archive/${version}.tar.gz" -checksum=af95547a64647d4097c1b45902fc53f45d323f053a7558bfa42e1900621d972c +checksum=3ba8131949f40931d9eb5153f353377ea7f5c079dd688b16c804eab55b3c5407 +patch_args="-Np1" + # Due to electron only_for_archs="i686 x86_64" 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 i686) broken="https://build.voidlinux.eu/builders/i686_builder/builds/10486/steps/shell_3/logs/stdio" _ARCH="ia32";; x86_64) _ARCH="x64";; esac +pre_build() { + # Use yarn to install dependencies + echo "" > build/npm/preinstall.js +} + do_build() { - sed -i 's/\"enableTelemetry\":.*/\"enableTelemetry\": false,/g' product.json - echo > build/npm/preinstall.js + export NODE_OPTIONS="${_mem_limit}" yarn install --ignore-engines --arch=${_ARCH} - yarn run gulp vscode-linux-${_ARCH} + yarn run gulp vscode-linux-${_ARCH}-min } 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 - vcopy ${FILESDIR}/code.desktop usr/share/applications/ - mv ../VSCode-linux-${_ARCH} ${DESTDIR}/usr/lib/code-oss - vbin ${FILESDIR}/code + ln -sf /usr/share/code-oss/resources/app/resources/linux/code.desktop ${DESTDIR}/usr/share/applications/code-oss.desktop + vmkdir usr/share/pixmaps + ln -sf /usr/share/code-oss/resources/app/resources/linux/code.png ${DESTDIR}/usr/share/pixmaps/code-oss.png vlicense LICENSE.txt }