OI/app-editors/vscode/vscode-1.33.1.ebuild

50 lines
1.5 KiB
Bash
Raw Normal View History

2019-04-27 18:44:26 +02:00
# 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"
2019-04-28 20:33:49 +02:00
SRC_URI="https://github.com/Microsoft/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz \
2019-04-28 23:43:46 +02:00
https://moriya.zapto.org/attachments/97d78125-739b-4fd5-a60d-da0f959b533a -> ${P}-cache-offline.tar.gz"
2019-04-27 18:44:26 +02:00
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
2019-04-28 20:33:49 +02:00
#DEPEND="=net-libs/nodejs-10.15.3[npm]
# =dev-lang/python-2.7.16"
#RDEPEND="${DEPEND}"
#BDEPEND=">=sys-apps/yarn-1.15.2"
2019-04-27 18:44:26 +02:00
2019-04-27 22:15:04 +02:00
PATCHES=(
2019-04-28 20:33:49 +02:00
"${FILESDIR}/${PN}-desktop.patch"
"${FILESDIR}/${PN}-extensions.patch"
2019-04-27 22:15:04 +02:00
)
2019-04-28 20:33:49 +02:00
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}
}
2019-04-27 18:44:26 +02:00
src_compile() {
2019-04-28 21:54:05 +02:00
yarn config set yarn-offline-mirror ${WORKDIR}/offline-cache --offline
2019-04-28 22:19:40 +02:00
yarn install --offline --cache-folder ${WORKDIR}/yarn-cache || die "yarn install failed"
yarn compile --offline --cache-folder ${WORKDIR}/yarn-cache || die "yarn compile failed"
2019-04-27 18:44:26 +02:00
}
src_install() {
2019-04-28 20:33:49 +02:00
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"
2019-04-27 18:44:26 +02:00
}