diff options
author | Michael Hansen | 2021-01-28 10:06:22 -0800 |
---|---|---|
committer | Michael Hansen | 2021-01-28 10:06:22 -0800 |
commit | 20f54066c497a10f294cf534f739dec550bcab30 (patch) | |
tree | b49a9e252739184d3f0894eec3c9697b3249a181 | |
parent | 76dcd09ad4cf8bb689467bebcb6528fdf810f010 (diff) | |
download | aur-20f54066c497a10f294cf534f739dec550bcab30.tar.gz |
Update package:
* Pull in updates from `code` package, including bash and zsh completion
support and url-handler registration.
* Update build to use nodejs v14 (fermium).
* Update pkgver to use the version in package.json.
-rw-r--r-- | .SRCINFO | 9 | ||||
-rw-r--r-- | PKGBUILD | 46 | ||||
-rw-r--r-- | product_json.diff | 10 |
3 files changed, 48 insertions, 17 deletions
@@ -1,6 +1,6 @@ pkgbase = code-git pkgdesc = The Open Source build of Visual Studio Code (vscode) editor - git latest - pkgver = 1.38.0.r14618.g676ee1c945a + pkgver = 1.53.0.r76027.gd045bc6ed1d pkgrel = 1 url = https://github.com/microsoft/vscode arch = i686 @@ -12,12 +12,15 @@ pkgbase = code-git makedepends = npm makedepends = python2 makedepends = yarn - makedepends = nodejs-lts-erbium + makedepends = nodejs-lts-fermium depends = electron depends = libsecret depends = libx11 depends = libxkbfile depends = ripgrep + optdepends = bash-completion: Bash completions + optdepends = zsh-completions: ZSH completitons + optdepends = x11-ssh-askpass: SSH authentication provides = visual-studio-code-git conflicts = visual-studio-code-git source = git+https://github.com/Microsoft/vscode @@ -28,7 +31,7 @@ pkgbase = code-git sha512sums = SKIP sha512sums = a97cbc79d76d2dad2ced74d66fa57b9a0aa3d82767d420b520bbaaf007c03ac60d61134668895ab4a8bd38951974c42afc59c03105ccc892742b34fee9b2c509 sha512sums = 9bd93ec7ba946c005d3a12ea71ae2903593d17d3e4dcf55b4a5b612ebc82237338f0aaec59613eb77f355b0116aeb31320d0d32cd993233f140479ced44dfdbf - sha512sums = 8ec47e497287d67f37e7b669af416f43d5cdbd4574892867d7b95996ef5de53640b5bc919b06b177e1fd91cb005579d6ed0c17325117b9914ba7cf28f5f06e40 + sha512sums = b1aa0d7c5b3e3e8ba1172822d75ea38e90efc431b270e0b4ca9e45bf9c0be0f60922c8618969ef071b5b6dbd9ac9f030294f1bf49bcc28c187b46d113dca63a7 sha512sums = a9f2f3e07f8ffe9def036cb2aa6d587444ea1cf9d9e1b29637b3d86ccf98e3ee2c50d219405155449c06654f753a296a820b11bdab48928baf25043217f149a0 pkgname = code-git @@ -4,13 +4,17 @@ pkgname=code-git pkgdesc='The Open Source build of Visual Studio Code (vscode) editor - git latest' -pkgver=1.38.0.r14618.g676ee1c945a +_electron=electron +pkgver=1.53.0.r76027.gd045bc6ed1d pkgrel=1 arch=('i686' 'x86_64' 'armv7h') url='https://github.com/microsoft/vscode' license=('MIT') -depends=('electron' 'libsecret' 'libx11' 'libxkbfile' 'ripgrep') -makedepends=('git' 'gulp' 'npm' 'python2' 'yarn' 'nodejs-lts-erbium') +depends=("$_electron" 'libsecret' 'libx11' 'libxkbfile' 'ripgrep') +optdepends=('bash-completion: Bash completions' + 'zsh-completions: ZSH completitons' + 'x11-ssh-askpass: SSH authentication') +makedepends=('git' 'gulp' 'npm' 'python2' 'yarn' 'nodejs-lts-fermium') conflicts=('visual-studio-code-git') provides=('visual-studio-code-git') @@ -22,7 +26,7 @@ source=("git+https://github.com/Microsoft/vscode" sha512sums=('SKIP' 'a97cbc79d76d2dad2ced74d66fa57b9a0aa3d82767d420b520bbaaf007c03ac60d61134668895ab4a8bd38951974c42afc59c03105ccc892742b34fee9b2c509' '9bd93ec7ba946c005d3a12ea71ae2903593d17d3e4dcf55b4a5b612ebc82237338f0aaec59613eb77f355b0116aeb31320d0d32cd993233f140479ced44dfdbf' - '8ec47e497287d67f37e7b669af416f43d5cdbd4574892867d7b95996ef5de53640b5bc919b06b177e1fd91cb005579d6ed0c17325117b9914ba7cf28f5f06e40' + 'b1aa0d7c5b3e3e8ba1172822d75ea38e90efc431b270e0b4ca9e45bf9c0be0f60922c8618969ef071b5b6dbd9ac9f030294f1bf49bcc28c187b46d113dca63a7' 'a9f2f3e07f8ffe9def036cb2aa6d587444ea1cf9d9e1b29637b3d86ccf98e3ee2c50d219405155449c06654f753a296a820b11bdab48928baf25043217f149a0') case "$CARCH" in @@ -47,12 +51,21 @@ fi pkgver() { cd "${srcdir}/vscode" - git describe --tags --match '?.*' | sed 's/\([^-]*-g\)/r\1/;s/-/./g' + # People love to complain, so here's a complex version that still + # increases monotonically by commit but also has the package.json + # version instead of the most recent tag... + printf "%s.r%s.g%s" \ + "$(awk 'match($0,/"version":\s*"([^"]+)"/,v) {print v[1]}' package.json)" \ + "$(git rev-list --count HEAD)" \ + "$(git rev-parse --short HEAD)" } prepare() { cd "${srcdir}/vscode" + # Change electron binary name to the target electron + sed -i "s|exec electron |exec $_electron |" ../code-git.sh + # This patch no longer contains proprietary modifications. # See https://github.com/Microsoft/vscode/issues/31168 for details. patch -p0 -i "${srcdir}/product_json.diff" @@ -67,7 +80,7 @@ prepare() { patch -p1 -i "${srcdir}/code-liveshare.diff" # Build native modules for system electron - local _target=$(</usr/lib/electron/version) + local _target=$(</usr/lib/$_electron/version) sed -i "s/^target .*/target \"${_target//v/}\"/" .yarnrc # Patch appdata and desktop file @@ -76,13 +89,18 @@ prepare() { s|@@NAME_LONG@@|Code - Git|g s|@@NAME@@|code-git|g s|@@ICON@@|code-git|g + s|@@EXEC@@|/usr/bin/code-git|g s|@@LICENSE@@|MIT|g s|@@URLPROTOCOL@@|vscode|g - s|inode/directory;||' resources/linux/code.{appdata.xml,desktop} + s|inode/directory;||' resources/linux/code{.appdata.xml,.desktop,-url-handler.desktop} + + sed -i 's|MimeType=.*|MimeType=x-scheme-handler/code-git;|' resources/linux/code-url-handler.desktop + # Patch completitions with correct names + sed -i 's|@@APPNAME@@|code-git|g' resources/completions/{bash/code,zsh/_code} # Fix bin path - sed -i "s|return path.join(path.dirname(execPath), 'bin', \`\${product.applicationName}\`);|return '/usr/bin/${pkgname}';|g - s|return path.join(appRoot, 'scripts', 'code-cli.sh');|return '/usr/bin/${pkgname}';|g" \ + sed -i "s|return path.join(path.dirname(execPath), 'bin', \`\${product.applicationName}\`);|return '/usr/bin/code-git';|g + s|return path.join(appRoot, 'scripts', 'code-cli.sh');|return '/usr/bin/code-git';|g" \ src/vs/platform/environment/node/environmentService.ts } @@ -118,7 +136,7 @@ package() { VSCode-linux-${_vscode_arch}/resources/app/* \ "${pkgdir}/usr/lib/${pkgname}" - # Replace statically included binary with system version + # Replace statically included binary with system copy ln -sf /usr/bin/rg \ "${pkgdir}/usr/lib/${pkgname}/node_modules.asar.unpacked/vscode-ripgrep/bin/rg" @@ -131,9 +149,17 @@ package() { "${pkgdir}/usr/share/metainfo/${pkgname}.appdata.xml" install -Dm 644 vscode/resources/linux/code.desktop \ "${pkgdir}/usr/share/applications/${pkgname}.desktop" + install -Dm 644 vscode/resources/linux/code-url-handler.desktop \ + "${pkgdir}/usr/share/applications/${pkgname}-url-handler.desktop" install -Dm 644 VSCode-linux-${_vscode_arch}/resources/app/resources/linux/code.png \ "${pkgdir}/usr/share/pixmaps/${pkgname}.png" + # Install bash and zsh completions + install -Dm 644 vscode/resources/completions/bash/code \ + "${pkgdir}/usr/share/bash-completion/completions/${pkgname}" + install -Dm 644 vscode/resources/completions/zsh/_code \ + "${pkgdir}/usr/share/zsh/site-functions/_${pkgname}" + # Install license files install -Dm 644 "${srcdir}/VSCode-linux-${_vscode_arch}/resources/app/LICENSE.txt" \ "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" diff --git a/product_json.diff b/product_json.diff index 173b26efb61d..00ddbae005e1 100644 --- a/product_json.diff +++ b/product_json.diff @@ -1,13 +1,15 @@ --- product.json 2019-04-06 13:26:49.879655883 +0100 +++ product.json 2019-04-06 13:26:37.399656243 +0100 -@@ -1,4 +1,17 @@ +@@ -1,4 +1,19 @@ { + "quality": "stable", + "extensionsGallery": { -+ "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery", -+ "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index", -+ "itemUrl": "https://marketplace.visualstudio.com/items" ++ "serviceUrl": "https://open-vsx.org/vscode/gallery", ++ "itemUrl": "https://open-vsx.org/vscode/item" + }, ++ "linkProtectionTrustedDomains": [ ++ "https://open-vsx.org" ++ ], + "documentationUrl": "https://code.visualstudio.com/docs", + "requestFeatureUrl": "https://github.com/Microsoft/vscode/issues", + "introductoryVideosUrl": "https://go.microsoft.com/fwlink/?linkid=832146", |