mirror of
https://github.com/flatcar/scripts.git
synced 2025-12-15 22:31:59 +01:00
app-emulation/docker: migrate to coreos-go-depend eclass
This commit is contained in:
parent
4150be487c
commit
9b831ddf4e
@ -3,17 +3,20 @@
|
||||
# $Id$
|
||||
|
||||
EAPI=5
|
||||
EGO_PN="github.com/docker/${PN}"
|
||||
COREOS_GO_PACKAGE="${EGO_PN}"
|
||||
|
||||
GITHUB_URI="github.com/docker/${PN}"
|
||||
COREOS_GO_PACKAGE="${GITHUB_URI}"
|
||||
COREOS_GO_VERSION="go1.6"
|
||||
|
||||
if [[ ${PV} == *9999 ]]; then
|
||||
inherit golang-vcs
|
||||
EGIT_REPO_URI="https://${GITHUB_URI}.git"
|
||||
inherit git-r3
|
||||
else
|
||||
MY_PV="${PV/_/-}"
|
||||
EGIT_COMMIT="v${MY_PV}"
|
||||
SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
|
||||
KEYWORDS="amd64 arm64"
|
||||
inherit golang-vcs-snapshot
|
||||
inherit vcs-snapshot
|
||||
fi
|
||||
|
||||
inherit coreos-go
|
||||
@ -29,20 +32,11 @@ DEPEND=""
|
||||
RDEPEND="app-emulation/runc
|
||||
seccomp? ( sys-libs/libseccomp )"
|
||||
|
||||
S=${WORKDIR}/${P}/src/${EGO_PN}
|
||||
|
||||
src_compile() {
|
||||
export GOARCH=$(go_arch)
|
||||
export CGO_ENABLED=1
|
||||
export CC=$(tc-getCC)
|
||||
export CXX=$(tc-getCXX)
|
||||
|
||||
local options=( $(usex seccomp "seccomp") )
|
||||
export GOPATH="${WORKDIR}/${P}" # ${PWD}/vendor
|
||||
LDFLAGS= emake GIT_COMMIT="$EGIT_COMMIT" BUILDTAGS="${options[@]}"
|
||||
local options=( $(usev seccomp) )
|
||||
LDFLAGS= emake GIT_COMMIT="$EGIT_COMMIT" BUILDTAGS="${options[*]}"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
dobin bin/containerd* bin/ctr
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ EAPI=5
|
||||
CROS_WORKON_PROJECT="coreos/docker"
|
||||
CROS_WORKON_LOCALNAME="docker"
|
||||
CROS_WORKON_REPO="git://github.com"
|
||||
COREOS_GO_VERSION="go1.6"
|
||||
|
||||
if [[ ${PV} == *9999 ]]; then
|
||||
DOCKER_GITCOMMIT="unknown"
|
||||
@ -17,7 +18,7 @@ else
|
||||
KEYWORDS="amd64 arm64"
|
||||
fi
|
||||
|
||||
inherit bash-completion-r1 eutils linux-info multilib systemd udev user cros-workon
|
||||
inherit bash-completion-r1 eutils linux-info multilib systemd udev user cros-workon coreos-go-depend
|
||||
|
||||
DESCRIPTION="Docker complements kernel namespacing with a high-level API which operates at the process level"
|
||||
HOMEPAGE="https://dockerproject.org"
|
||||
@ -43,8 +44,6 @@ CDEPEND="
|
||||
DEPEND="
|
||||
${CDEPEND}
|
||||
|
||||
dev-lang/go:=
|
||||
|
||||
btrfs? (
|
||||
>=sys-fs/btrfs-progs-3.16.1
|
||||
)
|
||||
@ -205,20 +204,11 @@ src_prepare() {
|
||||
rm --recursive --force .git
|
||||
}
|
||||
|
||||
go_get_arch() {
|
||||
echo ${ARCH}
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# if we treat them right, Docker's build scripts will set up a
|
||||
# reasonable GOPATH for us
|
||||
export AUTO_GOPATH=1
|
||||
|
||||
# setup CFLAGS and LDFLAGS for separate build target
|
||||
# see https://github.com/tianon/docker-overlay/pull/10
|
||||
export CGO_CFLAGS="-I${ROOT}/usr/include"
|
||||
export CGO_LDFLAGS="-L${ROOT}/usr/$(get_libdir)"
|
||||
|
||||
# if we're building from a zip, we need the GITCOMMIT value
|
||||
[ "$DOCKER_GITCOMMIT" ] && export DOCKER_GITCOMMIT
|
||||
|
||||
@ -262,10 +252,7 @@ src_compile() {
|
||||
unset DOCKER_EXPERIMENTAL
|
||||
fi
|
||||
|
||||
export GOARCH=$(go_get_arch)
|
||||
export CGO_ENABLED=1
|
||||
export CC=$(tc-getCC)
|
||||
export CXX=$(tc-getCXX)
|
||||
go_export
|
||||
|
||||
# verbose building
|
||||
export BUILDFLAGS="-x -v"
|
||||
|
||||
@ -6,11 +6,12 @@ EAPI=5
|
||||
|
||||
GITHUB_URI="github.com/opencontainers/runc"
|
||||
COREOS_GO_PACKAGE="${GITHUB_URI}"
|
||||
COREOS_GO_VERSION="go1.6"
|
||||
# the commit of runc that docker uses.
|
||||
# see https://github.com/docker/docker/blob/v1.12.0/Dockerfile#L236
|
||||
COMMIT_ID="cc29e3dded8e27ba8f65738f40d251c885030a28"
|
||||
|
||||
inherit eutils multilib coreos-go vcs-snapshot
|
||||
inherit eutils flag-o-matic coreos-go-depend vcs-snapshot
|
||||
|
||||
DESCRIPTION="runc container cli tools"
|
||||
HOMEPAGE="http://runc.io"
|
||||
@ -30,29 +31,18 @@ RDEPEND="
|
||||
|
||||
src_prepare() {
|
||||
epatch "${FILESDIR}/0001-Makefile-do-not-install-dependencies-of-target.patch"
|
||||
# Work around https://github.com/golang/go/issues/14669
|
||||
# Remove after updating to go1.7
|
||||
filter-flags -O*
|
||||
|
||||
go_export
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# fix up cross-compiling variables
|
||||
export GOARCH=$(go_arch)
|
||||
export CGO_ENABLED=1
|
||||
export CC=$(tc-getCC)
|
||||
export CXX=$(tc-getCXX)
|
||||
|
||||
# Taken from app-emulation/docker-1.7.0-r1
|
||||
export CGO_CFLAGS="-I${ROOT}/usr/include"
|
||||
export CGO_LDFLAGS="-L${ROOT}/usr/$(get_libdir)"
|
||||
|
||||
# Setup GOPATH so things build
|
||||
rm -rf .gopath
|
||||
mkdir -p .gopath/src/"$(dirname "${GITHUB_URI}")"
|
||||
ln -sf ../../../.. .gopath/src/"${GITHUB_URI}"
|
||||
export GOPATH="${PWD}/.gopath:${PWD}/vendor"
|
||||
|
||||
# build up optional flags
|
||||
local options=(
|
||||
$(usex apparmor 'apparmor')
|
||||
$(usex seccomp 'seccomp')
|
||||
$(usev apparmor)
|
||||
$(usev seccomp)
|
||||
)
|
||||
|
||||
emake BUILDTAGS="${options[*]}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user