From 907ee6168f10d94d3dc1514bf248f36bb18e4cf0 Mon Sep 17 00:00:00 2001 From: madomado Date: Wed, 3 Jul 2024 12:04:06 +0800 Subject: [PATCH] add: codium-marketplace (#1410) (cherry picked from commit fe3a5a9df25add1b6f2c370d241c659d93a3af25) --- anda/devs/codium-marketplace/anda.hcl | 6 +++ .../codium-marketplace.spec | 40 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 anda/devs/codium-marketplace/anda.hcl create mode 100644 anda/devs/codium-marketplace/codium-marketplace.spec diff --git a/anda/devs/codium-marketplace/anda.hcl b/anda/devs/codium-marketplace/anda.hcl new file mode 100644 index 0000000000..119f7784c2 --- /dev/null +++ b/anda/devs/codium-marketplace/anda.hcl @@ -0,0 +1,6 @@ +project pkg { + arches = ["x86_64"] + rpm { + spec = "codium-marketplace.spec" + } +} diff --git a/anda/devs/codium-marketplace/codium-marketplace.spec b/anda/devs/codium-marketplace/codium-marketplace.spec new file mode 100644 index 0000000000..bf33068b8e --- /dev/null +++ b/anda/devs/codium-marketplace/codium-marketplace.spec @@ -0,0 +1,40 @@ +# ref: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vscodium-marketplace + +Name: codium-marketplace +Version: 1.65.0 +Release: 1%?dist +Summary: Enable vscode marketplace in vscodium +License: MIT +BuildArch: noarch +URL: https://marketplace.visualstudio.com/vscode +Requires: codium sed + +%description +This package replaces the default marketplace (https://open-vsx.org/) +to the official one used by vscode. + +%posttrans +if [ $1 -gt 1 ]; then # update/install + sed -i -e 's/^[[:blank:]]*"serviceUrl":.*/ "serviceUrl": "https:\/\/marketplace.visualstudio.com\/_apis\/public\/gallery",/' \ + -e '/^[[:blank:]]*"cacheUrl/d' \ + -e '/^[[:blank:]]*"serviceUrl/a\ "cacheUrl": "https:\/\/vscode.blob.core.windows.net\/gallery\/index",' \ + -e 's/^[[:blank:]]*"itemUrl":.*/ "itemUrl": "https:\/\/marketplace.visualstudio.com\/items"/' \ + -e '/^[[:blank:]]*"linkProtectionTrustedDomains/d' \ + /usr/share/codium/resources/app/product.json || true +fi + +%preun +sed -i -e 's/^[[:blank:]]*"serviceUrl":.*/ "serviceUrl": "https:\/\/open-vsx.org\/vscode\/gallery",/' \ + -e '/^[[:blank:]]*"cacheUrl/d' \ + -e 's/^[[:blank:]]*"itemUrl":.*/ "itemUrl": "https:\/\/open-vsx.org\/vscode\/item"/' \ + -e '/^[[:blank:]]*"linkProtectionTrustedDomains/d' \ + -e '/^[[:blank:]]*"documentationUrl/i\ "linkProtectionTrustedDomains": ["https://open-vsx.org"],' \ + /usr/share/codium/resources/app/product.json || true + +%triggerin -- codium +sed -i -e 's/^[[:blank:]]*"serviceUrl":.*/ "serviceUrl": "https:\/\/marketplace.visualstudio.com\/_apis\/public\/gallery",/' \ + -e '/^[[:blank:]]*"cacheUrl/d' \ + -e '/^[[:blank:]]*"serviceUrl/a\ "cacheUrl": "https:\/\/vscode.blob.core.windows.net\/gallery\/index",' \ + -e 's/^[[:blank:]]*"itemUrl":.*/ "itemUrl": "https:\/\/marketplace.visualstudio.com\/items"/' \ + -e '/^[[:blank:]]*"linkProtectionTrustedDomains/d' \ + /usr/share/codium/resources/app/product.json || true