# Maintainer: Daniel Playfair Cal # Contributor: Filipe Laíns (FFY00) # Contributor: Michael Hansen # Contributor: Francisco Magalhães pkgname=code-wayland pkgdesc='The Open Source build of Visual Studio Code (vscode) editor, with ozone enabled for wayland support' # Important: Remember to check https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites for target node version # NodeJS versioning cheatsheet: # - fermium: 14 # Important: Remember to check https://github.com/microsoft/vscode/blob/master/.yarnrc (choose correct tag) for target electron version _electron=electron17 pkgver=1.66.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' 'imagemagick') provides=('vscode') conflicts=('code') source=("$pkgname::git+$url.git#tag=$pkgver" 'code.js' 'code.sh' '0001-patch-product.json-to-enable-all-extensions.patch') sha512sums=('SKIP' '6e8ee1df4dd982434a8295ca99e786a536457c86c34212546e548b115081798c5492a79f99cd5a3f1fa30fb71d29983aaabc2c79f4895d4a709d8354e9e2eade' '42ee9fb98134331166ad9fa5aa509f4d74d6dfa5553eed84ec1db9cb9ff4e2d516517c5cf1248a1b59e9abe243bf9b75bd8d5206e306bb5867434bc61a3fa677' '9aca8a8987d4f6e0e027a795e614c828d434b17e2ff13ed1ce26387b1a079a4227a85169decbc9c9edf6b4db0450989b3970b4ce485bed853600f83f71d399ed') # 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 -i "s|exec electron |exec $_electron |" ../code.sh sed -i "s|#!/usr/bin/electron|#!/usr/bin/$_electron|" ../code.js # Make extensions and live share work patch -Np1 -i ../0001-patch-product.json-to-enable-all-extensions.patch # 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=$(