# Maintainer: Yifan Xu pkgname=visual-studio-code-wayland pkgdesc='The Open Source build of Visual Studio Code (vscode) editor with electron 12 (wayland native support)' # Important: Remember to check https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites for target node version # NodeJS versioning cheatsheet: # - carbon: 8 # - dubnium: 10 # - ?: 11 (not in repos) # - erbium: 12 # Important: Remember to check https://github.com/microsoft/vscode/blob/master/.yarnrc (choose correct tag) for target electron version _electron=electron12 _pkgname=vscode pkgver=1.56.2 pkgrel=1 arch=('x86_64') url='https://github.com/microsoft/vscode' license=('MIT') depends=('electron12-bin' '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-dubnium') provides=('code') conflicts=('code') source=("https://codeload.github.com/microsoft/${_pkgname}/tar.gz/$pkgver" 'code.js' 'code.sh' 'product_json.diff') sha512sums=('9bfeef9f78db6a98e29355a074fa03152c473663e325c7533c9dda2559295853eaba0a870c1ec8f9b2d5463f94cb39a480b2d37461b11bc473085acc587a1c2e' '814c9554427183cd893a33cd2cbe91f6e0ea71921ef0717c86217b1d3058d265f9ff7a9ace3e7b76f122e60b7686475cf4d999e581a1845face3033afb9f745f' '2e8b787480fef7d9363bc0f385cd68f448d51e2f3d9e6c6f273454e085911f613608a13227bb005983adaf13881da99bc1700af887bdb6d52fa4e419584f14a0' 'b1aa0d7c5b3e3e8ba1172822d75ea38e90efc431b270e0b4ca9e45bf9c0be0f60922c8618969ef071b5b6dbd9ac9f030294f1bf49bcc28c187b46d113dca63a7') # 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-$pkgver # Change electron binary name to the target electron sed -i "s|exec electron |exec $_electron |" ../code.sh # 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=$(