summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorn0k0m32022-02-03 10:39:50 -0500
committerD. Can Celasun2022-02-03 15:43:50 +0000
commita0595836467bb205fcabb7e6d44ad7da82b29ed2 (patch)
tree51b9b7d336dd24a21a8f11ba7fd17b93e4b0a6ea
parent832576b3e899336ef7c58fcfa62600080a8cf9c6 (diff)
downloadaur-a0595836467bb205fcabb7e6d44ad7da82b29ed2.tar.gz
[visual-studio-code-bin] Add wrapper for custom flags
This allows per-user configuration for native Wayland support.
-rw-r--r--.SRCINFO9
-rw-r--r--PKGBUILD16
-rw-r--r--visual-studio-code-bin.install21
-rw-r--r--visual-studio-code-bin.sh11
-rw-r--r--visual-studio-code-url-handler.desktop2
-rw-r--r--visual-studio-code.desktop4
6 files changed, 51 insertions, 12 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 51df55ebfa3a..50a614d70a09 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,9 @@
pkgbase = visual-studio-code-bin
pkgdesc = Visual Studio Code (vscode): Editor for building and debugging modern web and cloud applications (official binary version)
pkgver = 1.63.2
- pkgrel = 1
+ pkgrel = 2
url = https://code.visualstudio.com/
+ install = visual-studio-code-bin.install
arch = x86_64
arch = i686
arch = aarch64
@@ -29,9 +30,11 @@ pkgbase = visual-studio-code-bin
source = visual-studio-code.desktop
source = visual-studio-code-url-handler.desktop
source = visual-studio-code-workspace.xml
- sha256sums = 07909803b0ce5e3412a92a2303e546c970ab48db505d6bf25fbd55dbb8466982
- sha256sums = be3d123aacd575d8f836728266eb421ea70399d713d1fc30378dbc5602b519fb
+ source = visual-studio-code-bin.sh
+ sha256sums = f0be273247878b66c7d10500718220e3e24abce29f7be94b4e875c3cf21b8a3b
+ sha256sums = 730b9d57a6d5cd91611b01ad2f1f26b1b61c344a72e7d05fb7e27329c5234d4e
sha256sums = 24ba09a6398c9781ed7cb6f1a9f6f38ec204899ba1f33db92638bf6d3cb0aed6
+ sha256sums = fb23f8716b87efadf0e4dc2ab60a96b03af90ef944b4475e103b68ebf8f66126
source_x86_64 = code_x64_1.63.2.tar.gz::https://update.code.visualstudio.com/1.63.2/linux-x64/stable
sha256sums_x86_64 = a45264bc2757d763ee3833ae2eb572cced0aba6d2e04346fda9097855470f4ad
source_i686 = code_ia32_1.63.2.tar.gz::https://update.code.visualstudio.com/latest/linux-ia32/stable
diff --git a/PKGBUILD b/PKGBUILD
index ed9bd13f095e..3bce75899c27 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,20 +3,21 @@
pkgname=visual-studio-code-bin
_pkgname=visual-studio-code
pkgver=1.63.2
-pkgrel=1
+pkgrel=2
pkgdesc="Visual Studio Code (vscode): Editor for building and debugging modern web and cloud applications (official binary version)"
arch=('x86_64' 'i686' 'aarch64' 'armv7h')
url="https://code.visualstudio.com/"
license=('custom: commercial')
provides=('code' 'vscode')
conflicts=('code')
+install=$pkgname.install
# lsof: needed for terminal splitting, see https://github.com/Microsoft/vscode/issues/62991
# xdg-utils: needed for opening web links with xdg-open
depends=(libxkbfile gnupg gtk3 libsecret nss gcc-libs libnotify libxss glibc lsof shared-mime-info xdg-utils)
optdepends=('glib2: Needed for move to trash functionality'
'libdbusmenu-glib: Needed for KDE global menu'
'org.freedesktop.secrets: Needed for settings sync')
-source=(${_pkgname}.desktop ${_pkgname}-url-handler.desktop ${_pkgname}-workspace.xml)
+source=(${_pkgname}.desktop ${_pkgname}-url-handler.desktop ${_pkgname}-workspace.xml ${_pkgname}-bin.sh)
source_x86_64=(code_x64_${pkgver}.tar.gz::https://update.code.visualstudio.com/${pkgver}/linux-x64/stable)
source_aarch64=(code_arm64_${pkgver}.tar.gz::https://update.code.visualstudio.com/${pkgver}/linux-arm64/stable)
source_armv7h=(code_armhf_${pkgver}.tar.gz::https://update.code.visualstudio.com/${pkgver}/linux-armhf/stable)
@@ -24,9 +25,10 @@ source_armv7h=(code_armhf_${pkgver}.tar.gz::https://update.code.visualstudio.com
# i686 uses "latest" instead of a specific version as it's not always updated in a timely manner
source_i686=(code_ia32_${pkgver}.tar.gz::https://update.code.visualstudio.com/latest/linux-ia32/stable)
# This generates cleaner checksums
-sha256sums=('07909803b0ce5e3412a92a2303e546c970ab48db505d6bf25fbd55dbb8466982'
- 'be3d123aacd575d8f836728266eb421ea70399d713d1fc30378dbc5602b519fb'
- '24ba09a6398c9781ed7cb6f1a9f6f38ec204899ba1f33db92638bf6d3cb0aed6')
+sha256sums=('f0be273247878b66c7d10500718220e3e24abce29f7be94b4e875c3cf21b8a3b'
+ '730b9d57a6d5cd91611b01ad2f1f26b1b61c344a72e7d05fb7e27329c5234d4e'
+ '24ba09a6398c9781ed7cb6f1a9f6f38ec204899ba1f33db92638bf6d3cb0aed6'
+ 'fb23f8716b87efadf0e4dc2ab60a96b03af90ef944b4475e103b68ebf8f66126')
sha256sums_x86_64=('a45264bc2757d763ee3833ae2eb572cced0aba6d2e04346fda9097855470f4ad')
sha256sums_i686=('64360439cc2fa596838062f7e6f9757b79d4b775a564f18bad6cbad154bf850c')
sha256sums_aarch64=('4240df14ac90568a8cfeb8577982e32855a731baa5efd6897e6e135ce4d5efc9')
@@ -62,6 +64,8 @@ package() {
install -Dm 644 "${srcdir}/${_pkg}/resources/completions/zsh/_code" "${pkgdir}/usr/share/zsh/site-functions/_code"
cp -r "${srcdir}/${_pkg}/"* "${pkgdir}/opt/${_pkgname}" -R
- ln -s /opt/${_pkgname}/bin/code "${pkgdir}"/usr/bin/code
+
+ # Launcher
+ install -m755 "${srcdir}/${_pkgname}-bin.sh" "${pkgdir}/usr/bin/code"
}
diff --git a/visual-studio-code-bin.install b/visual-studio-code-bin.install
new file mode 100644
index 000000000000..f7b11b341cd2
--- /dev/null
+++ b/visual-studio-code-bin.install
@@ -0,0 +1,21 @@
+# Colored makepkg-like functions
+msg_blue() {
+ printf "${blue}==>${bold} $1${all_off}\n"
+}
+
+note() {
+ printf "${blue}==>${yellow} NOTE:${bold} $1${all_off}\n"
+}
+
+all_off="$(tput sgr0)"
+bold="${all_off}$(tput bold)"
+blue="${bold}$(tput setaf 4)"
+yellow="${bold}$(tput setaf 3)"
+
+post_install() {
+ note "Custom flags should be put directly in: ~/.config/code-flags.conf"
+}
+
+post_upgrade() {
+ post_install
+} \ No newline at end of file
diff --git a/visual-studio-code-bin.sh b/visual-studio-code-bin.sh
new file mode 100644
index 000000000000..5019ae3cbe6a
--- /dev/null
+++ b/visual-studio-code-bin.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config}
+
+# Allow users to override command-line options
+if [[ -f $XDG_CONFIG_HOME/code-flags.conf ]]; then
+ CODE_USER_FLAGS="$(cat $XDG_CONFIG_HOME/code-flags.conf)"
+fi
+
+# Launch
+exec /opt/visual-studio-code/bin/code $CODE_USER_FLAGS "$@"
diff --git a/visual-studio-code-url-handler.desktop b/visual-studio-code-url-handler.desktop
index 916ceaa83039..30ecb71dc2d5 100644
--- a/visual-studio-code-url-handler.desktop
+++ b/visual-studio-code-url-handler.desktop
@@ -2,7 +2,7 @@
Name=Visual Studio Code - URL Handler
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=/opt/visual-studio-code/code --no-sandbox --open-url %U
+Exec=/usr/bin/code --no-sandbox --open-url %U
Icon=visual-studio-code
Type=Application
NoDisplay=true
diff --git a/visual-studio-code.desktop b/visual-studio-code.desktop
index 2d4f180329e5..1e75118201cc 100644
--- a/visual-studio-code.desktop
+++ b/visual-studio-code.desktop
@@ -2,7 +2,7 @@
Name=Visual Studio Code
Comment=Code Editing. Refined.
GenericName=Text Editor
-Exec=/opt/visual-studio-code/code --no-sandbox --unity-launch %F
+Exec=/usr/bin/code --no-sandbox --unity-launch %F
Icon=visual-studio-code
Type=Application
StartupNotify=false
@@ -14,5 +14,5 @@ Keywords=vscode;
[Desktop Action new-empty-window]
Name=New Empty Window
-Exec=/opt/visual-studio-code/code --no-sandbox --new-window %F
+Exec=/usr/bin/code --no-sandbox --new-window %F
Icon=visual-studio-code