diff options
author | Sainnhe Park | 2021-04-06 08:46:22 +0800 |
---|---|---|
committer | Sainnhe Park | 2021-04-06 08:46:22 +0800 |
commit | d35bd6be1223aa8fe2bf00f82446012bb7d2accc (patch) | |
tree | c706b2626b63aeb113038d07daef1fe7d24950d1 | |
download | aur-d35bd6be1223aa8fe2bf00f82446012bb7d2accc.tar.gz |
init
-rw-r--r-- | .SRCINFO | 17 | ||||
-rw-r--r-- | PKGBUILD | 19 | ||||
-rw-r--r-- | code-features.hook | 10 | ||||
-rw-r--r-- | code-features.install | 15 | ||||
-rwxr-xr-x | patch.sh | 11 |
5 files changed, 72 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..41a4341c78d2 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = code-features + pkgdesc = Unblock some features in Code OSS + pkgver = 1.54.3 + pkgrel = 1 + url = https://github.com/microsoft/vscode + install = code-features.install + arch = any + license = unknown + depends = code + depends = sed + source = code-features.hook + source = patch.sh + md5sums = 5d5bd889095a60ffbf1918d5a2a08bdb + md5sums = ce2b2c47777f18bb8842b7ff5dd530a2 + +pkgname = code-features + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..72722325c3ec --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,19 @@ +# Maintainer: Sainnhe Park <sainnhe@gmail.com> +pkgname=code-features +pkgver=1.54.3 +pkgrel=1 +pkgdesc='Unblock some features in Code OSS' +arch=('any') +url='https://github.com/microsoft/vscode' +license=('unknown') +depends=('code' 'sed') +install="${pkgname}.install" +source=("${pkgname}.hook" + 'patch.sh') +md5sums=('5d5bd889095a60ffbf1918d5a2a08bdb' + 'ce2b2c47777f18bb8842b7ff5dd530a2') + +package() { + install -Dm 644 "${srcdir}/${pkgname}.hook" "${pkgdir}/usr/share/libalpm/hooks/${pkgname}.hook" + install -Dm 755 "${srcdir}/patch.sh" "${pkgdir}/usr/share/${pkgname}/patch.sh" +} diff --git a/code-features.hook b/code-features.hook new file mode 100644 index 000000000000..cb5e79011ba9 --- /dev/null +++ b/code-features.hook @@ -0,0 +1,10 @@ +[Trigger] +Operation = Install +Operation = Upgrade +Type = Path +Target = usr/lib/code/product.json + +[Action] +Description = [code-features] Patching product.json... +Exec = /usr/share/code-features/patch.sh +When = PostTransaction diff --git a/code-features.install b/code-features.install new file mode 100644 index 000000000000..585977fba0f6 --- /dev/null +++ b/code-features.install @@ -0,0 +1,15 @@ +post_install() { + /usr/share/code-features/patch.sh +} + +pre_upgrade() { + /usr/share/code-features/patch.sh -R +} + +post_upgrade() { + /usr/share/code-features/patch.sh +} + +pre_remove() { + /usr/share/code-features/patch.sh -R +} diff --git a/patch.sh b/patch.sh new file mode 100755 index 000000000000..07effc093b46 --- /dev/null +++ b/patch.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env sh + +if [ "${1}" = "-R" ]; then + sed -i -e 's/^[[:blank:]]*"nameLong":.*/\t"nameLong": "Code - OSS",/' \ + -e 's/^[[:blank:]]*"extensionAllowedProposedApi":.*/\t"extensionAllowedProposedApi": ["ms-vscode.vscode-js-profile-flame", "ms-vscode.vscode-js-profile-table", "ms-vscode.github-browser", "ms-vscode.github-richnav"],/' \ + /usr/lib/code/product.json +else + sed -i -e 's/^[[:blank:]]*"nameLong":.*/\t"nameLong": "Visual Studio Code",/' \ + -e 's/^[[:blank:]]*"extensionAllowedProposedApi":.*/\t"extensionAllowedProposedApi": ["GitHub.codespaces", "GitHub.vscode-pull-request-github-insiders", "GitHub.vscode-pull-request-github", "Microsoft.vscode-nmake-tools", "ms-ai-tools.notebook-renderers", "ms-dotnettools.dotnet-interactive-vscode", "ms-python.gather", "ms-python.python", "ms-toolsai.jupyter", "ms-toolsai.vscode-ai", "ms-toolsai.vscode-ai-remote", "ms-vscode-remote.remote-containers-nightly", "ms-vscode-remote.remote-containers", "ms-vscode-remote.remote-ssh-edit-nightly", "ms-vscode-remote.remote-ssh-edit", "ms-vscode-remote.remote-ssh-nightly", "ms-vscode-remote.remote-ssh", "ms-vscode-remote.remote-wsl-nightly", "ms-vscode-remote.remote-wsl", "ms-vscode-remote.remote-wsl-recommender", "ms-vscode-remote.vscode-remote-extensionpack-nightly", "ms-vscode-remote.vscode-remote-extensionpack", "ms-vscode.azure-account", "ms-vscode.azure-sphere-tools-ui", "ms-vscode.azure-sphere-tools", "ms-vscode.github-browser", "ms-vscode.github-richnav", "ms-vscode.js-debug-nightly", "ms-vscode.js-debug", "ms-vscode.lsif-browser", "ms-vscode.vscode-js-profile-flame", "ms-vscode.vscode-js-profile-table", "ms-vscode.vscode-selfhost-test-provider", "ms-vsliveshare.cloudenv-explorer", "ms-vsliveshare.cloudenv", "ms-vsliveshare.vsliveshare", "ms-vsonline.vsonline", "dbaeumer.vscode-eslint"],/' \ + /usr/lib/code/product.json +fi |