summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Hansen2018-09-13 19:43:44 -0700
committerMichael Hansen2018-09-13 19:44:14 -0700
commit2ac8e9559aff86b5dc453d37bb6622e82bdaa2c6 (patch)
tree6135024ffcf53c270543ce8545139faf05e4fa54
parente204a494baeb4bc8d90cf69fbe3deb6ceeb93720 (diff)
downloadaur-2ac8e9559aff86b5dc453d37bb6622e82bdaa2c6.tar.gz
Backport fixes from community-adopted code and fix product.json patches
-rw-r--r--.SRCINFO27
-rw-r--r--PKGBUILD78
-rw-r--r--code-git.desktop29
-rw-r--r--code-git.js23
-rw-r--r--code-git.sh3
-rw-r--r--code-liveshare.patch18
-rw-r--r--product_json.patch24
-rw-r--r--startup_script.patch23
8 files changed, 99 insertions, 126 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 649450a194d0..e034385027bf 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,8 @@
# Generated by mksrcinfo v8
-# Thu Jul 26 16:59:28 UTC 2018
+# Fri Sep 14 02:43:51 UTC 2018
pkgbase = code-git
pkgdesc = Microsoft Code for Linux, Open Source version from git (vscode)
- pkgver = 1.16.0.r14403.gc7ab363b37
+ pkgver = 1.16.0.r16653.g6bc165d47c
pkgrel = 1
url = https://github.com/Microsoft/vscode
arch = i686
@@ -10,31 +10,26 @@ pkgbase = code-git
arch = armv7h
license = MIT
makedepends = npm
- makedepends = nodejs-lts-carbon
makedepends = gulp
makedepends = python2
makedepends = git
makedepends = yarn
- depends = gtk3
- depends = gconf
- depends = libnotify
- depends = libxss
- depends = libxtst
+ depends = electron
+ depends = libsecret
depends = libxkbfile
- depends = nss
depends = alsa-lib
provides = visual-studio-code-git
conflicts = visual-studio-code-git
source = git+https://github.com/Microsoft/vscode
- source = code-git.desktop
- source = startup_script.patch
- source = product_json.patch
+ source = code-git.js
+ source = code-git.sh
source = code-liveshare.patch
+ source = product_json.patch
sha256sums = SKIP
- sha256sums = dd212d343a02466f04bd9def162428ac997b53c4c839cea220ab61382d01f538
- sha256sums = 7447807230c09b80529e5cde4a1abfbb687937b16790b77a227ae39ba4c603ce
- sha256sums = 9b0629c7fbec7b7769b285694018cbbd8204a27cfaa576d3e7884377441e5743
- sha256sums = 90b8915d8195546088e845f3205fb965e941561d309c8b462bb0b22a159e041c
+ sha256sums = 64aca444a714dd67da6d5b71ab8d0255e767cb265918d556b3bf8194fca0a7ef
+ sha256sums = df452e6f64f62081aa4a8da69a071b2c122095eea48dca409a7a851243b9ff36
+ sha256sums = 90bd7da0af12f1ecd775ebf300350ed67f9ae08e7ea956269629a275ce05835c
+ sha256sums = eb639e59c4075220d42390a165e2eef55c3eaa180050989c346ebcec64a0aca4
pkgname = code-git
diff --git a/PKGBUILD b/PKGBUILD
index cd80940a8c95..8402c5ea3152 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,29 +1,29 @@
# Maintainer: Michael Hansen <zrax0111 gmail com>
# Contributor: Francisco Magalhães <franmagneto gmail com>
+# Contributor: Filipe Laíns (FFY00) <lains@archlinux.org>
pkgname=code-git
pkgdesc='Microsoft Code for Linux, Open Source version from git (vscode)'
-pkgver=1.16.0.r14403.gc7ab363b37
+pkgver=1.16.0.r16653.g6bc165d47c
pkgrel=1
arch=('i686' 'x86_64' 'armv7h')
url='https://github.com/Microsoft/vscode'
license=('MIT')
-makedepends=('npm' 'nodejs-lts-carbon' 'gulp' 'python2' 'git' 'yarn')
-depends=('gtk3' 'gconf' 'libnotify' 'libxss' 'libxtst' 'libxkbfile' 'nss'
- 'alsa-lib')
+makedepends=('npm' 'gulp' 'python2' 'git' 'yarn')
+depends=('electron' 'libsecret' 'libxkbfile' 'alsa-lib')
conflicts=('visual-studio-code-git')
provides=('visual-studio-code-git')
source=("git+https://github.com/Microsoft/vscode"
- "${pkgname}.desktop"
- "startup_script.patch"
- "product_json.patch"
- "code-liveshare.patch")
+ "${pkgname}.js"
+ "${pkgname}.sh"
+ "code-liveshare.patch"
+ "product_json.patch")
sha256sums=('SKIP'
- 'dd212d343a02466f04bd9def162428ac997b53c4c839cea220ab61382d01f538'
- '7447807230c09b80529e5cde4a1abfbb687937b16790b77a227ae39ba4c603ce'
- '9b0629c7fbec7b7769b285694018cbbd8204a27cfaa576d3e7884377441e5743'
- '90b8915d8195546088e845f3205fb965e941561d309c8b462bb0b22a159e041c')
+ '64aca444a714dd67da6d5b71ab8d0255e767cb265918d556b3bf8194fca0a7ef'
+ 'df452e6f64f62081aa4a8da69a071b2c122095eea48dca409a7a851243b9ff36'
+ '90bd7da0af12f1ecd775ebf300350ed67f9ae08e7ea956269629a275ce05835c'
+ 'eb639e59c4075220d42390a165e2eef55c3eaa180050989c346ebcec64a0aca4')
case "$CARCH" in
i686)
@@ -59,6 +59,19 @@ prepare() {
# See https://github.com/MicrosoftDocs/live-share/issues/262 for details
patch -p1 -i "${srcdir}/code-liveshare.patch"
+
+ # Build native modules for system electron
+ local _target=$(</usr/lib/electron/version)
+ sed -i "s/^target .*/target \"${_target//v/}\"/" .yarnrc
+
+ # Patch appdata and desktop file
+ sed -i 's|/usr/share/@@NAME@@/@@NAME@@|@@NAME@@|g
+ s|@@NAME_SHORT@@|Code - Git|g
+ s|@@NAME_LONG@@|Code - Git|g
+ s|@@NAME@@|code-git|g
+ s|@@ICON@@|code-git|g
+ s|@@LICENSE@@|MIT|g
+ s|inode/directory;||' resources/linux/code.{appdata.xml,desktop}
}
build() {
@@ -76,38 +89,33 @@ build() {
echo
echo "*** NOTE: If the build failed due to running out of file handles (EMFILE),"
echo "*** you will need to raise your max open file limit."
- echo "*** This can be done by:"
- echo "*** 1) Set a higher 'nofile' limit (at least 10000) in either"
- echo "*** /etc/systemd/system.conf.d/limits.conf (for systemd systems)"
- echo "*** /etc/security/limits.conf (for non-systemd systems)"
- echo "*** 2) Reboot (or log out and back in)"
- echo "*** 3) Run 'ulimit -n' and ensure the value set above is shown before"
- echo "*** re-attempting to build this package."
- echo
+ echo "*** You can check this for more information on how to increase this limit:"
+ echo "*** https://ro-che.info/articles/2017-03-26-increase-open-files-limit"
exit 1
fi
-
- # Patch the startup script to know where the app is installed, rather
- # than guessing...
- ( cd "${srcdir}/VSCode-linux-${_vscode_arch}" && \
- patch -p1 -i "${srcdir}/startup_script.patch" )
}
package() {
- install -m 0755 -d "${pkgdir}/usr/share/code-git"
- cp -r "${srcdir}/VSCode-linux-${_vscode_arch}"/* "${pkgdir}/usr/share/code-git"
+ install -dm 755 "${pkgdir}/usr/lib/${pkgname}"
+ cp -r --no-preserve=ownership --preserve=mode \
+ VSCode-linux-${_vscode_arch}/resources/app/* \
+ "${pkgdir}/usr/lib/${pkgname}"
# Put the startup script in /usr/bin
- mv "${pkgdir}/usr/share/code-git/bin" "${pkgdir}/usr"
-
- # Avoid conflicting with the stable OSS build
- mv "${pkgdir}/usr/bin/code-oss" "${pkgdir}/usr/bin/code-git"
+ install -Dm 755 ${pkgname}.sh "${pkgdir}/usr/bin/${pkgname}"
+ install -Dm 755 ${pkgname}.js "${pkgdir}/usr/lib/${pkgname}/${pkgname}.js"
- # Add .desktop file
- install -D -m644 "${srcdir}/${pkgname}.desktop" \
+ # Install appdata and desktop file
+ install -Dm 644 vscode/resources/linux/code.appdata.xml \
+ "${pkgdir}/usr/share/metainfo/${pkgname}.appdata.xml"
+ install -Dm 644 vscode/resources/linux/code.desktop \
"${pkgdir}/usr/share/applications/${pkgname}.desktop"
+ install -Dm 644 VSCode-linux-${_vscode_arch}/resources/app/resources/linux/code.png \
+ "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
- # Install license file
- install -D -m644 "${srcdir}/VSCode-linux-${_vscode_arch}/resources/app/LICENSE.txt" \
+ # Install license files
+ install -Dm 644 "${srcdir}/VSCode-linux-${_vscode_arch}/resources/app/LICENSE.txt" \
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ install -Dm 644 "${srcdir}/VSCode-linux-${_vscode_arch}/resources/app/ThirdPartyNotices.txt" \
+ "${pkgdir}/usr/share/licenses/${pkgname}/ThirdPartyNotices.txt"
}
diff --git a/code-git.desktop b/code-git.desktop
deleted file mode 100644
index c553857b2b5b..000000000000
--- a/code-git.desktop
+++ /dev/null
@@ -1,29 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Name=Microsoft Code (Open Source - Git)
-Comment=Code Editing. Redefined.
-GenericName=Text Editor
-Exec=/usr/bin/code-git --unity-launch %F
-Icon=/usr/share/code-git/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-git --new-window %F
-Icon=/usr/share/code-git/resources/app/resources/linux/code.png
diff --git a/code-git.js b/code-git.js
new file mode 100644
index 000000000000..639fde578477
--- /dev/null
+++ b/code-git.js
@@ -0,0 +1,23 @@
+#!/usr/bin/electron
+
+const name = 'code-git';
+
+const app = require('electron').app;
+const path = require('path');
+
+// Remove first command line argument (/usr/lib/code-git/code-git.js). - We call the CLI file first
+process.argv.splice(0, 1);
+
+// Set application paths.
+const appPath = __dirname;
+const packageJson = require(path.join(appPath, 'package.json'));
+app.setAppPath(appPath);
+app.setDesktopName(name + '.desktop');
+app.setName(name);
+app.setPath('userCache', path.join(app.getPath('cache'), name));
+app.setPath('userData', path.join(app.getPath('appData'), name));
+app.setVersion(packageJson.version);
+
+// Run the application.
+require('module')._load(appPath, module, true);
+
diff --git a/code-git.sh b/code-git.sh
new file mode 100644
index 000000000000..d29e58ade455
--- /dev/null
+++ b/code-git.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+exec electron /usr/lib/code-git/out/cli.js /usr/lib/code-git/code-git.js "$@"
diff --git a/code-liveshare.patch b/code-liveshare.patch
index 2654bc75fc44..eb4cb27955e0 100644
--- a/code-liveshare.patch
+++ b/code-liveshare.patch
@@ -1,11 +1,15 @@
diff -rupN a/product.json b/product.json
---- a/product.json 2018-05-08 09:26:25.618099994 -0700
-+++ b/product.json 2018-05-08 09:26:47.388338276 -0700
-@@ -17,6 +17,7 @@
+--- a/product.json 2018-09-13 19:02:44.091846898 -0700
++++ b/product.json 2018-09-13 19:03:39.132442073 -0700
+@@ -18,6 +18,11 @@
+ "darwinBundleIdentifier": "com.visualstudio.code.oss",
"reportIssueUrl": "https://github.com/Microsoft/vscode/issues/new",
"urlProtocol": "code-oss",
- "extensionAllowedProposedApi": [
++ "extensionAllowedProposedApi": [
+ "ms-vsliveshare.vsliveshare",
- "ms-vscode.node-debug",
- "ms-vscode.node-debug2"
- ],
++ "ms-vscode.node-debug",
++ "ms-vscode.node-debug2"
++ ],
+ "quality": "stable",
+ "extensionsGallery": {
+ "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
diff --git a/product_json.patch b/product_json.patch
index 320922c1598b..29ab615b8cd9 100644
--- a/product_json.patch
+++ b/product_json.patch
@@ -1,20 +1,12 @@
diff -rupN a/product.json b/product.json
---- a/product.json 2018-07-26 09:10:58.795826355 -0700
-+++ b/product.json 2018-07-26 09:12:22.936763299 -0700
-@@ -1,6 +1,6 @@
- {
- "nameShort": "Code - OSS",
-- "nameLong": "Code - OSS",
-+ "nameLong": "Code - OSS (Git)",
- "applicationName": "code-oss",
- "dataFolderName": ".vscode-oss",
- "win32MutexName": "vscodeoss",
-@@ -22,5 +22,15 @@
- "extensionAllowedProposedApi": [
- "ms-vscode.node-debug",
- "ms-vscode.node-debug2"
-- ]
-+ ],
+--- a/product.json 2018-09-13 18:58:04.308823247 -0700
++++ b/product.json 2018-09-13 19:02:18.881574329 -0700
+@@ -17,5 +17,15 @@
+ "win32ShellNameShort": "C&ode - OSS",
+ "darwinBundleIdentifier": "com.visualstudio.code.oss",
+ "reportIssueUrl": "https://github.com/Microsoft/vscode/issues/new",
+- "urlProtocol": "code-oss"
++ "urlProtocol": "code-oss",
+ "quality": "stable",
+ "extensionsGallery": {
+ "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
diff --git a/startup_script.patch b/startup_script.patch
deleted file mode 100644
index cc4b200de646..000000000000
--- a/startup_script.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff -rupN a/bin/code-oss b/bin/code-oss
---- a/bin/code-oss 2017-04-10 14:45:30.501186879 -0700
-+++ b/bin/code-oss 2017-04-11 09:02:09.934505159 -0700
-@@ -17,18 +17,7 @@ if [ "$(id -u)" = "0" ]; then
- fi
- fi
-
--if [ ! -L $0 ]; then
-- # if path is not a symlink, find relatively
-- VSCODE_PATH="$(dirname $0)/.."
--else
-- if which 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/code-oss"
-- fi
--fi
-+VSCODE_PATH="/usr/share/code-git"
-
- ELECTRON="$VSCODE_PATH/code-oss"
- CLI="$VSCODE_PATH/resources/app/out/cli.js"