[arch-commits] Commit in code/trunk (PKGBUILD)

Filipe Laíns ffy00 at archlinux.org
Tue May 21 12:35:07 UTC 2019


    Date: Tuesday, May 21, 2019 @ 12:35:07
  Author: ffy00
Revision: 468182

upgpkg: code 1.34.0-2

- add code-oss-url-handler.desktop
- add bash and zsh completions

Modified:
  code/trunk/PKGBUILD

----------+
 PKGBUILD |   23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-05-21 12:21:52 UTC (rev 468181)
+++ PKGBUILD	2019-05-21 12:35:07 UTC (rev 468182)
@@ -5,11 +5,13 @@
 pkgname=code
 pkgdesc='The Open Source build of Visual Studio Code (vscode) editor'
 pkgver=1.34.0
-pkgrel=1
+pkgrel=2
 arch=('x86_64')
 url='https://github.com/Microsoft/vscode'
 license=('MIT')
 depends=('electron' 'libsecret' 'libxkbfile' 'ripgrep')
+optdepends=('bash-completion: Bash completions'
+            'zsh-completions: ZSH completitons')
 makedepends=('git' 'gulp' 'npm' 'python2' 'yarn' 'nodejs-lts-dubnium')
 source=("$pkgname::git+https://github.com/Microsoft/vscode.git#tag=$pkgver"
         'code.js'
@@ -67,8 +69,14 @@
           s|@@NAME@@|code-oss|g
           s|@@ICON@@|code-oss|g
           s|@@LICENSE@@|MIT|g
-          s|inode/directory;||' resources/linux/code.{appdata.xml,desktop}
+          s|inode/directory;||' resources/linux/code{.appdata.xml,.desktop,-url-handler.desktop}
 
+  # Add missing exectable name to bash completion
+  sed -i 's|complete -F _code code|complete -F _code code code-oss|' resources/completions/bash/code
+  # Create new zsh completion file for our binary
+  cp resources/completions/zsh/_code resources/completions/zsh/_code-oss
+  sed -i 's|#compdef code|#compdef code-oss|' resources/completions/zsh/_code-oss
+
   # Fix bin path
   sed -i "s|return path.join(path.dirname(execPath), 'bin', \`\${product.applicationName}\`);|return '/usr/bin/code';|g
           s|return path.join(appRoot, 'scripts', 'code-cli.sh');|return '/usr/bin/code';|g" \
@@ -115,10 +123,17 @@
   ln -sf /usr/bin/code-oss "$pkgdir"/usr/bin/code
 
   # Install appdata and desktop file
-  install -Dm 644 code/resources/linux/code.appdata.xml "$pkgdir"/usr/share/metainfo/code-oss.appdata.xml
-  install -Dm 644 code/resources/linux/code.desktop "$pkgdir"/usr/share/applications/code-oss.desktop
+  install -Dm 644 $pkgname/resources/linux/code.appdata.xml "$pkgdir"/usr/share/metainfo/code-oss.appdata.xml
+  install -Dm 644 $pkgname/resources/linux/code.desktop "$pkgdir"/usr/share/applications/code-oss.desktop
+  install -Dm 644 $pkgname/resources/linux/code-url-handler.desktop "$pkgdir"/usr/share/applications/code-oss-url-handler.desktop
   install -Dm 644 VSCode-linux-$_vscode_arch/resources/app/resources/linux/code.png "$pkgdir"/usr/share/pixmaps/code-oss.png
 
+  # Install bash and zsh completions
+  install -Dm 644 $pkgname/resources/completions/bash/code "$pkgdir"/usr/share/bash-completion/completions/code-oss
+  ln -sf /usr/share/bash-completion/completions/code-oss "$pkgdir"/usr/share/bash-completion/completions/code
+  install -Dm 644 $pkgname/resources/completions/zsh/_code-oss "$pkgdir"/usr/share/zsh/vendor-completions/_code-oss
+  install -Dm 644 $pkgname/resources/completions/zsh/_code "$pkgdir"/usr/share/zsh/vendor-completions/_code
+
   # Install license files
   install -Dm 644 VSCode-linux-$_vscode_arch/resources/app/LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
   install -Dm 644 VSCode-linux-$_vscode_arch/resources/app/ThirdPartyNotices.txt "$pkgdir"/usr/share/licenses/$pkgname/ThirdPartyNotices.txt


More information about the arch-commits mailing list