diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 46 |
1 files changed, 36 insertions, 10 deletions
@@ -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" |