# Maintainer: Filipe Laíns (FFY00) # Contributor: Michael Hansen # Contributor: Francisco Magalhães pkgname=code pkgdesc='The Open Source build of Visual Studio Code (vscode) editor' # Important: Remember to check https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites for target node version # Important: Remember to check https://github.com/microsoft/vscode/blob/master/.yarnrc (choose correct tag) for target electron version _electron=electron22 pkgver=1.78.2 pkgrel=1 arch=('x86_64') url='https://github.com/microsoft/vscode' license=('MIT') depends=($_electron 'libsecret' 'libx11' 'libxkbfile' 'ripgrep') optdepends=('bash-completion: Bash completions' 'zsh-completions: ZSH completitons' 'x11-ssh-askpass: SSH authentication') makedepends=('git' 'gulp' 'npm' 'python' 'yarn' 'nodejs-lts-gallium' 'desktop-file-utils') provides=('vscode') source=("$pkgname::git+$url.git#tag=$pkgver" 'code.js' 'code.sh' 'product_json.diff' 'clipath.patch') sha512sums=('SKIP' '6e8ee1df4dd982434a8295ca99e786a536457c86c34212546e548b115081798c5492a79f99cd5a3f1fa30fb71d29983aaabc2c79f4895d4a709d8354e9e2eade' 'f949779dde4e3fe72f8a62db20edffc3e093c7209981e089f91e7d369274639a66b8cbf95cbdea4f3ea36e219d91e0abadb30f9c8e19e37d6077f9545e55a9a0' 'b1aa0d7c5b3e3e8ba1172822d75ea38e90efc431b270e0b4ca9e45bf9c0be0f60922c8618969ef071b5b6dbd9ac9f030294f1bf49bcc28c187b46d113dca63a7' '53c68ed0a4bffa4b19e5ca3de8322870611bca790db84ad60033f1a6ca79d2d95ddd00cfceec2ff4e922240537b5d002c6385e083cf1d0e69df867b5e1d8e197') # Even though we don't officially support other archs, let's # allow the user to use this PKGBUILD to compile the package # for his architecture case "$CARCH" in i686) _vscode_arch=ia32 ;; x86_64) _vscode_arch=x64 ;; armv7h) _vscode_arch=arm ;; *) # Needed for mksrcinfo _vscode_arch=DUMMY ;; esac prepare() { cd $pkgname # Change electron binary name to the target electron sed -e "s|name=electron|name=$_electron |" \ -e '/PKGBUILD/d' \ -i ../code.sh sed "1s|.*|#!/usr/lib/$_electron/electron|" -i ../code.js # This patch no longer contains proprietary modifications. # See https://github.com/Microsoft/vscode/issues/31168 for details. patch -p0 < ../product_json.diff # Set the commit and build date local _commit=$(git rev-parse HEAD) local _datestamp=$(date -u -Is | sed 's/\+00:00/Z/') sed -e "s/@COMMIT@/$_commit/" -e "s/@DATE@/$_datestamp/" -i product.json # Build native modules for system electron local _target=$(