void-packages/srcpkgs/vscode/template

39 lines
1.2 KiB
Bash

# Template file for 'vscode'
pkgname=vscode
version=1.25.1
revision=2
hostmakedepends="pkg-config python nodejs-lts yarn"
makedepends="libX11-devel libxkbfile-devel libsecret-devel"
depends="GConf libXtst libxkbfile nss"
short_desc="Microsoft Code for Linux"
maintainer="Julio Galvan <juliogalvan@protonmail.com>"
license="MIT"
homepage="https://code.visualstudio.com/"
distfiles="https://github.com/Microsoft/vscode/archive/${version}.tar.gz"
checksum=af95547a64647d4097c1b45902fc53f45d323f053a7558bfa42e1900621d972c
# Due to electron
only_for_archs="i686 x86_64"
nostrip_files="code-oss"
case "$XBPS_TARGET_MACHINE" in
i686) broken="https://build.voidlinux.eu/builders/i686_builder/builds/10486/steps/shell_3/logs/stdio"
_ARCH="ia32";;
x86_64) _ARCH="x64";;
esac
do_build() {
sed -i 's/\"enableTelemetry\":.*/\"enableTelemetry\": false,/g' product.json
echo > build/npm/preinstall.js
yarn install --ignore-engines --arch=${_ARCH}
yarn run gulp vscode-linux-${_ARCH}
}
do_install() {
vmkdir usr/lib
vmkdir usr/share/applications
vcopy ${FILESDIR}/code.desktop usr/share/applications/
mv ../VSCode-linux-${_ARCH} ${DESTDIR}/usr/lib/code-oss
vbin ${FILESDIR}/code
vlicense LICENSE.txt
}