2016-10-23 14:57:43 +02:00
|
|
|
# Copyright 1999-2016 Gentoo Foundation
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
# $Id$
|
|
|
|
|
2016-10-25 00:49:28 +02:00
|
|
|
EAPI=6
|
|
|
|
inherit eutils golang-build golang-vcs-snapshot
|
2016-10-23 14:57:43 +02:00
|
|
|
|
2016-10-25 00:49:28 +02:00
|
|
|
EGO_PN="gitlab.com/gitlab-org/gitlab-ci-multi-runner/..."
|
2016-10-23 14:57:43 +02:00
|
|
|
|
2016-10-25 00:49:28 +02:00
|
|
|
MY_PV="v${PV/_/-}"
|
|
|
|
MY_BRANCH="1-7-stable"
|
|
|
|
MY_GIT_HASH="c66b00d"
|
2016-10-23 14:57:43 +02:00
|
|
|
|
2016-10-25 00:49:28 +02:00
|
|
|
DESCRIPTION="Official GitLab CI Runner written in Go"
|
|
|
|
HOMEPAGE="https://gitlab.com/gitlab-org/gitlab-ci-multi-runner"
|
|
|
|
SRC_URI="https://gitlab.com/gitlab-org/${PN}/repository/archive.tar.gz?ref=v${PV} -> ${P}.tar.gz
|
|
|
|
!docker-build? (
|
|
|
|
https://${PN}-downloads.s3.amazonaws.com/${MY_PV}/docker/prebuilt-x86_64.tar.xz -> ${P}-prebuilt-x86_64.tar.xz
|
|
|
|
https://${PN}-downloads.s3.amazonaws.com/${MY_PV}/docker/prebuilt-arm.tar.xz -> ${P}-prebuilt-arm.tar.xz
|
|
|
|
)"
|
2016-10-23 14:57:43 +02:00
|
|
|
|
2016-10-25 00:49:28 +02:00
|
|
|
KEYWORDS="~amd64"
|
2016-10-23 14:57:43 +02:00
|
|
|
LICENSE="MIT"
|
2016-10-25 00:49:28 +02:00
|
|
|
SLOT="0/${PVR}"
|
|
|
|
IUSE="docker-build"
|
2016-10-23 14:57:43 +02:00
|
|
|
|
2016-10-25 00:49:28 +02:00
|
|
|
DEPEND=">=dev-go/gox-0.3.1_alpha
|
|
|
|
>=dev-go/go-bindata-3.0.8_alpha
|
|
|
|
docker-build? ( >=app-emulation/docker-1.5 )
|
|
|
|
!dev-vcs/gitlab-ci-multi-runner-bin"
|
2016-10-23 14:57:43 +02:00
|
|
|
|
2016-10-25 00:49:28 +02:00
|
|
|
RESTRICT="test"
|
2016-10-23 14:57:43 +02:00
|
|
|
|
|
|
|
src_prepare() {
|
2016-10-25 00:49:28 +02:00
|
|
|
if ! use docker-build; then
|
|
|
|
mkdir -p src/${EGO_PN%/*}/out/docker || die
|
|
|
|
cp "${DISTDIR}"/${P}-prebuilt-x86_64.tar.xz src/${EGO_PN%/*}/out/docker/prebuilt-x86_64.tar.xz || die
|
|
|
|
cp "${DISTDIR}"/${P}-prebuilt-arm.tar.xz src/${EGO_PN%/*}/out/docker/prebuilt-arm.tar.xz || die
|
|
|
|
else
|
|
|
|
einfo "You need to have docker running on your system during build time"
|
|
|
|
einfo "$(docker info)"
|
|
|
|
fi
|
|
|
|
|
|
|
|
epatch "${FILESDIR}/0001-fix-Makefile.patch"
|
|
|
|
local arch="$(usev amd64)$(usev x86)$(usev arm)$(usev arm64)"
|
|
|
|
|
|
|
|
sed -i -E \
|
|
|
|
-e "s/@@VERSION@@/v${PV/_/-}/" \
|
|
|
|
-e "s/@@REVISION@@/${MY_GIT_HASH}/" \
|
|
|
|
-e "s/@@BRANCH@@/${MY_BRANCH}/" \
|
|
|
|
-e "s|@@OSARCH@@|linux/${arch}|" \
|
|
|
|
src/gitlab.com/gitlab-org/${PN}/Makefile
|
|
|
|
|
2016-10-23 14:57:43 +02:00
|
|
|
eapply_user
|
|
|
|
}
|
|
|
|
|
|
|
|
src_compile() {
|
2016-10-25 00:49:28 +02:00
|
|
|
emake GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" RELEASE=true -C src/${EGO_PN%/*} build
|
2016-10-23 14:57:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
2016-10-25 00:49:28 +02:00
|
|
|
golang-build_src_install
|
|
|
|
dobin bin/*
|
|
|
|
dodoc src/${EGO_PN%/*}/README.md src/${EGO_PN%/*}/CHANGELOG.md
|
2016-10-23 14:57:43 +02:00
|
|
|
}
|