# Copyright 2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 DESCRIPTION="Visual Studio Code https://code.visualstudio.com" HOMEPAGE="https://github.com/Microsoft/vscode/wiki/How-to-Contribute#build-and-run" SRC_URI="https://github.com/Microsoft/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz \ https://moriya.zapto.org/attachments/a1521140-9eb9-4a1e-bc24-f44fb5e1353d -> ${P}-yarn_cache.tar.gz" LICENSE="MIT" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="" #DEPEND="=net-libs/nodejs-10.15.3[npm] # =dev-lang/python-2.7.16" #RDEPEND="${DEPEND}" #BDEPEND=">=sys-apps/yarn-1.15.2" PATCHES=( "${FILESDIR}/${PN}-desktop.patch" "${FILESDIR}/${PN}-extensions.patch" ) src_prepare() { if declare -p PATCHES | grep -q "^declare -a "; then [[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}" else [[ -n ${PATCHES} ]] && eapply ${PATCHES} fi eapply_user ewarn ${S} } src_compile() { yarn config set yarn-offline-mirror ${WORKDIR}/offline-cache --offline yarn config set yarn-offline-mirror-pruning true --offline yarn install --offline || die "yarn install failed" yarn compile --offline || die "yarn compile failed" } src_install() { insinto /usr/share/vscode doins -r . || die "Copying the repo in /usr/share/vscode failed " insinto /usr/share/applications doins resources/linux/code.desktop || die "Copying the desktop file failed" exeinto /usr/bin doexe "${FILESDIR}/${PN}" || die "Copying the startup script failed" }