summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Hansen2017-07-24 11:57:00 -0700
committerMichael Hansen2017-07-24 11:57:00 -0700
commit9e15c8fc1d6e7e93d4431890d5f70ba6e7eca08e (patch)
tree996ac2a45fc89bd5d2d7417508e2d512e3b150f6
parent2e3371a7cf3bf6add38bb80dee344775813b2020 (diff)
downloadaur-9e15c8fc1d6e7e93d4431890d5f70ba6e7eca08e.tar.gz
Backport fixes and updates from stable package
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD84
-rw-r--r--startup_script.patch23
-rw-r--r--visual-studio-code-git.desktop6
4 files changed, 99 insertions, 31 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 76d2e3da9a94..d3a7d80db75b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,24 +1,25 @@
# Generated by mksrcinfo v8
-# Tue Nov 15 21:05:04 UTC 2016
+# Mon Jul 24 17:55:19 UTC 2017
pkgbase = visual-studio-code-git
pkgdesc = Visual Studio Code for Linux, Open Source version from git
- pkgver = 1.1.0.insider.r6983.gd3171a3
+ pkgver = 1.1.0.insider.r10766.gd41c48d46
pkgrel = 1
url = https://code.visualstudio.com/
- install = visual-studio-code-git.nonfree.install
arch = i686
arch = x86_64
+ arch = armv7h
license = MIT
- license = proprietary
makedepends = npm
makedepends = nodejs>=6.8.0
makedepends = gulp
makedepends = python2
+ makedepends = git
depends = gtk2
depends = gconf
depends = libnotify
depends = libxss
depends = libxtst
+ depends = libxkbfile
depends = nss
depends = alsa-lib
provides = vscode-oss
@@ -26,11 +27,11 @@ pkgbase = visual-studio-code-git
conflicts = vscode-oss
conflicts = visual-studio-code-oss
source = git+https://github.com/Microsoft/vscode
+ source = startup_script.patch
source = visual-studio-code-git.desktop
- source = product_json.patch
- sha1sums = SKIP
- sha1sums = a42e461ed586ef0fd31ff911ad662135f4f602aa
- sha1sums = ba8febe936932080610d899fdb57294fc2f9f614
+ sha256sums = SKIP
+ sha256sums = 8b2feded3382e5bf6b5b292c14083bfc536c05cd00f3235dd22b75b67fba134d
+ sha256sums = f853d7d998251223b0516928a2189e1e68a312bd732f18dc8d59892659beeae9
pkgname = visual-studio-code-git
diff --git a/PKGBUILD b/PKGBUILD
index c3f9c43216f2..310acd0741d9 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,30 +1,34 @@
# Maintainer: Michael Hansen <zrax0111 gmail com>
+# Contributor: Francisco Magalhães <franmagneto gmail com>
-# Set this to 0 if you want to include only the open-source Visual Studio Code
-# components. This will cause the extension manager to work in a local-only
-# mode (you'll have to download and install extensions manually).
-[[ -z "$VSCODE_NONFREE" ]] && VSCODE_NONFREE=1
+# Set this to 1 if you want to enable the proprietary Visual Studio Code
+# features. Leaving this at 0 will cause the extension manager to work in
+# a local-only mode (you'll have to download and install extensions manually).
+[[ -z "$VSCODE_NONFREE" ]] && VSCODE_NONFREE=0
pkgname=visual-studio-code-git
pkgdesc='Visual Studio Code for Linux, Open Source version from git'
-pkgver=1.1.0.insider.r6983.gd3171a3
+pkgver=1.1.0.insider.r16716.g37c73f0c71
pkgrel=1
-arch=('i686' 'x86_64')
+arch=('i686' 'x86_64' 'armv7h')
url='https://code.visualstudio.com/'
license=('MIT')
-makedepends=('npm' 'nodejs>=6.8.0' 'gulp' 'python2')
-depends=('gtk2' 'gconf' 'libnotify' 'libxss' 'libxtst' 'nss' 'alsa-lib')
+makedepends=('npm' 'nodejs>=6.8.0' 'gulp' 'python2' 'git')
+depends=('gtk2' 'gconf' 'libnotify' 'libxss' 'libxtst' 'libxkbfile' 'nss'
+ 'alsa-lib')
conflicts=('vscode-oss' 'visual-studio-code-oss')
provides=('vscode-oss' 'visual-studio-code-oss')
source=("git+https://github.com/Microsoft/vscode"
+ "startup_script.patch"
"${pkgname}.desktop")
-sha1sums=('SKIP'
- 'a42e461ed586ef0fd31ff911ad662135f4f602aa')
+sha256sums=('SKIP'
+ '8b2feded3382e5bf6b5b292c14083bfc536c05cd00f3235dd22b75b67fba134d'
+ 'f853d7d998251223b0516928a2189e1e68a312bd732f18dc8d59892659beeae9')
if (( VSCODE_NONFREE )); then
source+=('product_json.patch')
- sha1sums+=('ba8febe936932080610d899fdb57294fc2f9f614')
+ sha256sums+=('e90f9d69bd42c0d9fc5f081d3bf7ca307df53e3553efadf00d62ced66b1bb070')
install="${pkgname}.nonfree.install"
license+=('proprietary')
fi
@@ -36,6 +40,9 @@ case "$CARCH" in
x86_64)
_vscode_arch=x64
;;
+ armv7h)
+ _vscode_arch=arm
+ ;;
*)
# Needed for mksrcinfo
_vscode_arch=DUMMY
@@ -59,24 +66,59 @@ prepare() {
fi
}
+# npm.sh wrapper puts things in the user's home directory...
+# To avoid that, we perform its environment setup manually instead
+npm_wrap() {
+ (
+ ROOT="${srcdir}/vscode"
+ ELECTRON_VERSION=$(
+ cat "$ROOT"/package.json |
+ grep electronVersion |
+ sed -e 's/[[:space:]]*"electronVersion":[[:space:]]*"\([0-9.]*\)"\(,\)*/\1/'
+ )
+
+ ELECTRON_GYP_HOME="${srcdir}/electron-gyp"
+ mkdir -p $ELECTRON_GYP_HOME
+
+ npm_config_disturl=https://atom.io/download/electron \
+ npm_config_target=$ELECTRON_VERSION \
+ npm_config_runtime=electron \
+ HOME=$ELECTRON_GYP_HOME \
+ npm $*
+ )
+}
+
build() {
cd "${srcdir}/vscode"
- ./scripts/npm.sh install --arch=${_vscode_arch}
+ # The provided shrinkwrap file doesn't work correctly with npm 5.x
+ # Therefore, we install an older version and use that for the build
+ ( cd "${srcdir}" && /usr/bin/npm install 'npm@4.6.1' )
+ PATH="${srcdir}/node_modules/.bin":$PATH
+
+ npm_wrap install --arch=${_vscode_arch}
- # The default memory limit is too low for current versions of node to
- # successfully build vscode. This will set it to 2GB -- change it if
- # this number still doesn't work for your system.
- node --max_old_space_size=2048 /usr/bin/gulp vscode-linux-${_vscode_arch}
+ # The default memory limit may be too low for current versions of node
+ # to successfully build vscode. Uncomment this to set it to 2GB, or
+ # change it if this number still doesn't work for your system.
+ #mem_limit="--max_old_space_size=2048"
+ /usr/bin/node $mem_limit /usr/bin/gulp vscode-linux-${_vscode_arch}
+
+ # 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}/opt/VSCode-OSS"
- cp -r "${srcdir}/VSCode-linux-${_vscode_arch}"/* "${pkgdir}/opt/VSCode-OSS"
+ install -m 0755 -d "${pkgdir}/usr/share/code-oss"
+ cp -r "${srcdir}/VSCode-linux-${_vscode_arch}"/* "${pkgdir}/usr/share/code-oss"
+
+ # Put the startup script in /usr/bin
+ mv "${pkgdir}/usr/share/code-oss/bin" "${pkgdir}/usr"
- # Include symlink in system bin directory
- install -m 0755 -d "${pkgdir}/usr/bin"
- ln -s '/opt/VSCode-OSS/bin/code-oss' "${pkgdir}/usr/bin/${pkgname}"
+ # Add symlink to the name we provided in older versions of this package
+ ln -s code-oss "${pkgdir}/usr/bin/${pkgname}"
# Add .desktop file
install -D -m644 "${srcdir}/${pkgname}.desktop" \
diff --git a/startup_script.patch b/startup_script.patch
new file mode 100644
index 000000000000..a88aee3b27c6
--- /dev/null
+++ b/startup_script.patch
@@ -0,0 +1,23 @@
+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-oss"
+
+ ELECTRON="$VSCODE_PATH/code-oss"
+ CLI="$VSCODE_PATH/resources/app/out/cli.js"
diff --git a/visual-studio-code-git.desktop b/visual-studio-code-git.desktop
index b49a8df1568c..76dd9c926c80 100644
--- a/visual-studio-code-git.desktop
+++ b/visual-studio-code-git.desktop
@@ -1,7 +1,9 @@
[Desktop Entry]
Encoding=UTF-8
Name=Visual Studio Code (Open Source)
-Exec="/opt/VSCode-OSS/code-oss" %F
-Icon=/opt/VSCode-OSS/resources/app/resources/linux/code.png
+Comment=Source code editor and debugger for modern web and cloud applications
+Version=1.0
+Exec="/usr/bin/code-oss" %F
+Icon=/usr/share/code-oss/resources/app/resources/linux/code.png
Type=Application
Categories=Development;