summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorD. Can Celasun2024-09-02 09:21:43 +0100
committerD. Can Celasun2024-09-02 09:21:43 +0100
commitb76a4a3dd94674313e557e17af963b2c6237d746 (patch)
tree935da4865edbb8bd133f0fc761e0fdb6c86a1615
parent6cb97833cf3dc3362c75e92e43bb309a71d83762 (diff)
downloadaur-b76a4a3dd94674313e557e17af963b2c6237d746.tar.gz
[visual-studio-code-bin] Use upstream desktop and workspace files
Hat tip to marmis [0] on AUR for the idea. [0] https://aur.archlinux.org/account/marmis
-rw-r--r--.SRCINFO14
-rw-r--r--.gitignore2
-rw-r--r--PKGBUILD49
-rw-r--r--code.desktop2
4 files changed, 48 insertions, 19 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3bbca44f5236..799d04fcc5ac 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
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.92.2
- pkgrel = 2
+ pkgrel = 3
url = https://code.visualstudio.com/
install = visual-studio-code-bin.install
arch = x86_64
@@ -28,13 +28,13 @@ pkgbase = visual-studio-code-bin
provides = code
provides = vscode
conflicts = code
- source = code.desktop
- source = code-url-handler.desktop
- source = visual-studio-code-workspace.xml
+ source = code.desktop.in::https://raw.githubusercontent.com/microsoft/vscode/1.92.2/resources/linux/code.desktop
+ source = code-url-handler.desktop.in::https://raw.githubusercontent.com/microsoft/vscode/1.92.2/resources/linux/code-url-handler.desktop
+ source = code-workspace.xml.in::https://raw.githubusercontent.com/microsoft/vscode/1.92.2/resources/linux/code-workspace.xml
source = visual-studio-code-bin.sh
- sha256sums = e1b10973dc29432fe331dfe5e043db538cf181417743452d7d34b497fd53fa2b
- sha256sums = 204a91ea6c8c13cdf6b83d001d5c1ce04b38a23a61145ab04da8737dbe823bfc
- sha256sums = 17540366bffa99df1f1d7312309880cbd2211a9b83a6056b17c014a72024f951
+ sha256sums = dc64d1c6bb4a0cb2aae24dcd2d742178428f2849dab60074194e5603d32be745
+ sha256sums = c361efa7e02fcad759ed80d2fbab67877f33219b981578af6fffaf18aeb12d9b
+ sha256sums = 3af748dd6578a1775e8eb7248ba397b7e11840df2ea6ee234ff76fee3dc306cf
sha256sums = 8257a5ad82fa1f7dec11dfa064217b80df4cfec24f50cec7ca0ad62cf8295bfe
source_x86_64 = code_x64_1.92.2.tar.gz::https://update.code.visualstudio.com/1.92.2/linux-x64/stable
sha256sums_x86_64 = 736eb24f77f47d4173c094e2314b04527bbc0ad73928c488341413a200b1d34d
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..fdf96acd2c0a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+*.in
+.xml
diff --git a/PKGBUILD b/PKGBUILD
index 86c770917b44..bc97b816e764 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
pkgname=visual-studio-code-bin
_pkgname=visual-studio-code
pkgver=1.92.2
-pkgrel=2
+pkgrel=3
pkgdesc="Visual Studio Code (vscode): Editor for building and debugging modern web and cloud applications (official binary version)"
arch=('x86_64' 'aarch64' 'armv7h')
url="https://code.visualstudio.com/"
@@ -19,21 +19,48 @@ optdepends=('glib2: Needed for move to trash functionality'
'org.freedesktop.secrets: Needed for settings sync'
# See https://github.com/MicrosoftDocs/live-share/issues/4650
'icu69: Needed for live share' )
-source=(code.desktop code-url-handler.desktop ${_pkgname}-workspace.xml ${_pkgname}-bin.sh)
+source=(code.desktop.in::https://raw.githubusercontent.com/microsoft/vscode/${pkgver}/resources/linux/code.desktop
+ code-url-handler.desktop.in::https://raw.githubusercontent.com/microsoft/vscode/${pkgver}/resources/linux/code-url-handler.desktop
+ code-workspace.xml.in::https://raw.githubusercontent.com/microsoft/vscode/${pkgver}/resources/linux/code-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)
-# This generates cleaner checksums
-sha256sums=('e1b10973dc29432fe331dfe5e043db538cf181417743452d7d34b497fd53fa2b'
- '204a91ea6c8c13cdf6b83d001d5c1ce04b38a23a61145ab04da8737dbe823bfc'
- '17540366bffa99df1f1d7312309880cbd2211a9b83a6056b17c014a72024f951'
+sha256sums=('dc64d1c6bb4a0cb2aae24dcd2d742178428f2849dab60074194e5603d32be745'
+ 'c361efa7e02fcad759ed80d2fbab67877f33219b981578af6fffaf18aeb12d9b'
+ '3af748dd6578a1775e8eb7248ba397b7e11840df2ea6ee234ff76fee3dc306cf'
'8257a5ad82fa1f7dec11dfa064217b80df4cfec24f50cec7ca0ad62cf8295bfe')
sha256sums_x86_64=('736eb24f77f47d4173c094e2314b04527bbc0ad73928c488341413a200b1d34d')
sha256sums_aarch64=('f2132815e9f74cb829799c1c92478b9244dabdf01383e8bb38c9b1630ef5280b')
sha256sums_armv7h=('92f7855f1ae13f7879e196845fe24e38e76cdf5869e2d1881f58ab2350044565')
+_set_meta_info() {
+ sed 's/@@NAME_LONG@@/Visual Studio Code/g' "$1" |\
+ sed 's/@@NAME_SHORT@@/Code/g' |\
+ sed 's/@@NAME@@/code/g' |\
+ sed 's#@@EXEC@@#/usr/bin/code#g' |\
+ sed 's/@@ICON@@/visual-studio-code/g' |\
+ sed 's/@@URLPROTOCOL@@/vscode/g'
+}
+
+_pkg() {
+ if [ "${CARCH}" = "aarch64" ]; then
+ echo 'VSCode-linux-arm64'
+ elif [ "${CARCH}" = "armv7h" ]; then
+ echo 'VSCode-linux-armhf'
+ elif [ "${CARCH}" = "i686" ]; then
+ echo 'VSCode-linux-ia32'
+ else
+ echo 'VSCode-linux-x64'
+ fi
+}
+prepare() {
+ _set_meta_info "${srcdir}/code.desktop.in" > "${srcdir}/code.desktop"
+ _set_meta_info "${srcdir}/code-url-handler.desktop.in" > "${srcdir}/code-url-handler.desktop"
+ _set_meta_info "${srcdir}/code-workspace.xml.in" > "${srcdir}/code-workspace.xml"
+}
package() {
_pkg=VSCode-linux-x64
@@ -54,15 +81,15 @@ package() {
install -d "${pkgdir}/usr/share/icons"
install -d "${pkgdir}/usr/share/mime/packages"
- install -m644 "${srcdir}/${_pkg}/resources/app/LICENSE.rtf" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE.rtf"
- install -m644 "${srcdir}/${_pkg}/resources/app/resources/linux/code.png" "${pkgdir}/usr/share/icons/${_pkgname}.png"
+ install -m644 "${srcdir}/$(_pkg)/resources/app/LICENSE.rtf" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE.rtf"
+ install -m644 "${srcdir}/$(_pkg)/resources/app/resources/linux/code.png" "${pkgdir}/usr/share/icons/${_pkgname}.png"
install -m644 "${srcdir}/code.desktop" "${pkgdir}/usr/share/applications/code.desktop"
install -m644 "${srcdir}/code-url-handler.desktop" "${pkgdir}/usr/share/applications/code-url-handler.desktop"
install -m644 "${srcdir}/${_pkgname}-workspace.xml" "${pkgdir}/usr/share/mime/packages/${pkgname}-workspace.xml"
- install -Dm 644 "${srcdir}/${_pkg}/resources/completions/bash/code" "${pkgdir}/usr/share/bash-completion/completions/code"
- install -Dm 644 "${srcdir}/${_pkg}/resources/completions/zsh/_code" "${pkgdir}/usr/share/zsh/site-functions/_code"
+ install -Dm 644 "${srcdir}/$(_pkg)/resources/completions/bash/code" "${pkgdir}/usr/share/bash-completion/completions/code"
+ install -Dm 644 "${srcdir}/$(_pkg)/resources/completions/zsh/_code" "${pkgdir}/usr/share/zsh/site-functions/_code"
- cp -r "${srcdir}/${_pkg}/"* "${pkgdir}/opt/${_pkgname}"
+ cp -r "${srcdir}/$(_pkg)/"* "${pkgdir}/opt/${_pkgname}"
# Launcher
install -m755 "${srcdir}/${_pkgname}-bin.sh" "${pkgdir}/usr/bin/code"
diff --git a/code.desktop b/code.desktop
index 9d32b1771502..bae676be00fd 100644
--- a/code.desktop
+++ b/code.desktop
@@ -1,6 +1,6 @@
[Desktop Entry]
Name=Visual Studio Code
-Comment=Code Editing. Refined.
+Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/bin/code %F
Icon=visual-studio-code