summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSainnhepark2020-12-04 16:17:40 +0800
committerSainnhepark2020-12-04 16:17:40 +0800
commit66791c2d916b21affc120703e943a0c5542c5152 (patch)
treeee733ec2875dbf5923d1d0fff963df0ef22537af
parentb44ee5632b06f736bf605fd94b35ccf9f80fd27b (diff)
downloadaur-66791c2.tar.gz
support vscodium-bin
-rw-r--r--.SRCINFO11
-rw-r--r--PKGBUILD16
-rw-r--r--code-marketplace.hook3
-rw-r--r--code-marketplace.install24
-rw-r--r--code-product.json.patch (renamed from product_json.patch)0
-rw-r--r--vscodium-bin-product.json.patch25
6 files changed, 64 insertions, 15 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 713ca9907c0..c9031c58f71 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,16 +1,19 @@
pkgbase = code-marketplace
- pkgdesc = Enable vscode marketplace in Code OSS
+ pkgdesc = Enable vscode marketplace in Code OSS and VSCodium
pkgver = 1.50.1
pkgrel = 1
url = https://marketplace.visualstudio.com/vscode
install = code-marketplace.install
arch = any
license = unknown
- depends = code>=1.50.1
+ optdepends = code: for Code OSS
+ optdepends = vscodium-bin: for VSCodium
source = code-marketplace.hook
- source = product_json.patch
- md5sums = 8a5cbd751ee2762d40f1e43e9e6e69e0
+ source = code-product.json.patch
+ source = vscodium-bin-product.json.patch
+ md5sums = dc1b0dedb41767bf2511bbeee3715a02
md5sums = 9e476c8aae4243010d6a1c18e56ac402
+ md5sums = 26be4c7916e72598198d9b3b19945311
pkgname = code-marketplace
diff --git a/PKGBUILD b/PKGBUILD
index 6eb722b5737..50493eb5769 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,18 +2,22 @@
pkgname=code-marketplace
pkgver=1.50.1
pkgrel=1
-pkgdesc='Enable vscode marketplace in Code OSS'
+pkgdesc='Enable vscode marketplace in Code OSS and VSCodium'
arch=('any')
url='https://marketplace.visualstudio.com/vscode'
license=('unknown')
-depends=('code>=1.50.1')
+optdepends=('code: for Code OSS'
+ 'vscodium-bin: for VSCodium')
install="${pkgname}.install"
source=('code-marketplace.hook'
- 'product_json.patch')
-md5sums=('8a5cbd751ee2762d40f1e43e9e6e69e0'
- '9e476c8aae4243010d6a1c18e56ac402')
+ 'code-product.json.patch'
+ 'vscodium-bin-product.json.patch')
+md5sums=('dc1b0dedb41767bf2511bbeee3715a02'
+ '9e476c8aae4243010d6a1c18e56ac402'
+ '26be4c7916e72598198d9b3b19945311')
package() {
install -Dm 644 "${srcdir}"/code-marketplace.hook "${pkgdir}"/usr/share/libalpm/hooks/code-marketplace.hook
- install -Dm 644 "${srcdir}"/product_json.patch "${pkgdir}"/usr/lib/code/product_json.patch
+ install -Dm 644 "${srcdir}"/code-product.json.patch "${pkgdir}"/usr/share/code-marketplace/code-product.json.patch
+ install -Dm 644 "${srcdir}"/vscodium-bin-product.json.patch "${pkgdir}"/usr/share/code-marketplace/vscodium-bin-product.json.patch
}
diff --git a/code-marketplace.hook b/code-marketplace.hook
index 5e685e15dd8..b3048ed2578 100644
--- a/code-marketplace.hook
+++ b/code-marketplace.hook
@@ -3,8 +3,9 @@ Operation = Install
Operation = Upgrade
Type = Path
Target = usr/lib/code/product.json
+Target = usr/share/vscodium-bin/resources/app/product.json
[Action]
Description = Patching product.json...
-Exec = /usr/bin/bash -c "/usr/bin/patch /usr/lib/code/product.json < /usr/lib/code/product_json.patch"
+Exec = /usr/bin/bash -c "if [ -f /usr/lib/code/product.json ]; then /usr/bin/patch /usr/lib/code/product.json < /usr/share/code-marketplace/code-product.json.patch; elif [ -f /usr/share/vscodium-bin/resources/app/product.json ]; then /usr/bin/patch /usr/share/vscodium-bin/resources/app/product.json < /usr/share/code-marketplace/vscodium-bin-product.json.patch; fi"
When = PostTransaction
diff --git a/code-marketplace.install b/code-marketplace.install
index 7cf2ebcd3c3..796eed8aad5 100644
--- a/code-marketplace.install
+++ b/code-marketplace.install
@@ -1,15 +1,31 @@
post_install() {
- patch /usr/lib/code/product.json < /usr/lib/code/product_json.patch
+ if [ -f /usr/lib/code/product.json ]; then
+ patch /usr/lib/code/product.json < /usr/share/code-marketplace/code-product.json.patch
+ elif [ -f /usr/share/vscodium-bin/resources/app/product.json ]; then
+ patch /usr/share/vscodium-bin/resources/app/product.json < /usr/share/code-marketplace/vscodium-bin-product.json.patch
+ fi
}
pre_upgrade() {
- patch -R /usr/lib/code/product.json < /usr/lib/code/product_json.patch
+ if [ -f /usr/lib/code/product.json ]; then
+ patch -R /usr/lib/code/product.json < /usr/share/code-marketplace/code-product.json.patch
+ elif [ -f /usr/share/vscodium-bin/resources/app/product.json ]; then
+ patch -R /usr/share/vscodium-bin/resources/app/product.json < /usr/share/code-marketplace/vscodium-bin-product.json.patch
+ fi
}
post_upgrade() {
- patch /usr/lib/code/product.json < /usr/lib/code/product_json.patch
+ if [ -f /usr/lib/code/product.json ]; then
+ patch /usr/lib/code/product.json < /usr/share/code-marketplace/code-product.json.patch
+ elif [ -f /usr/share/vscodium-bin/resources/app/product.json ]; then
+ patch /usr/share/vscodium-bin/resources/app/product.json < /usr/share/code-marketplace/vscodium-bin-product.json.patch
+ fi
}
pre_remove() {
- patch -R /usr/lib/code/product.json < /usr/lib/code/product_json.patch
+ if [ -f /usr/lib/code/product.json ]; then
+ patch -R /usr/lib/code/product.json < /usr/share/code-marketplace/code-product.json.patch
+ elif [ -f /usr/share/vscodium-bin/resources/app/product.json ]; then
+ patch -R /usr/share/vscodium-bin/resources/app/product.json < /usr/share/code-marketplace/vscodium-bin-product.json.patch
+ fi
}
diff --git a/product_json.patch b/code-product.json.patch
index ff3b8ec1854..ff3b8ec1854 100644
--- a/product_json.patch
+++ b/code-product.json.patch
diff --git a/vscodium-bin-product.json.patch b/vscodium-bin-product.json.patch
new file mode 100644
index 00000000000..c0664d92a13
--- /dev/null
+++ b/vscodium-bin-product.json.patch
@@ -0,0 +1,25 @@
+--- ./pkg/vscodium-bin/usr/share/vscodium-bin/resources/app/product.json 2020-12-04 15:56:10.000000000 +0800
++++ /home/sainnhe/Downloads/product.json 2020-12-04 16:03:53.732183038 +0800
+@@ -1,10 +1,10 @@
+ {
+ "serverDataFolderName": ".vscode-server-oss",
+- "linkProtectionTrustedDomains": ["https://open-vsx.org"],
+- "extensionsGallery": {
+- "itemUrl": "https://open-vsx.org/vscode/item",
+- "serviceUrl": "https://open-vsx.org/vscode/gallery"
+- },
++ "extensionsGallery": {
++ "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
++ "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
++ "itemUrl": "https://marketplace.visualstudio.com/items"
++ },
+ "quality": "stable",
+ "keyboardShortcutsUrlWin": "https://go.microsoft.com/fwlink/?linkid=832145",
+ "keyboardShortcutsUrlLinux": "https://go.microsoft.com/fwlink/?linkid=832144",
+@@ -152,4 +152,4 @@
+ "vs/code/electron-browser/workbench/workbench.html": "DCAx76TE79oJvbVEouBCXQ",
+ "vs/code/electron-browser/workbench/workbench.js": "QmbzxZoyrJnqFRW9jKugHQ"
+ }
+-}
+\ No newline at end of file
++}