mirror of
https://github.com/flatcar/scripts.git
synced 2025-12-16 14:52:24 +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$
|
# $Id$
|
||||||
|
|
||||||
EAPI=5
|
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
|
if [[ ${PV} == *9999 ]]; then
|
||||||
inherit golang-vcs
|
EGIT_REPO_URI="https://${GITHUB_URI}.git"
|
||||||
|
inherit git-r3
|
||||||
else
|
else
|
||||||
MY_PV="${PV/_/-}"
|
MY_PV="${PV/_/-}"
|
||||||
EGIT_COMMIT="v${MY_PV}"
|
EGIT_COMMIT="v${MY_PV}"
|
||||||
SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
|
SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
|
||||||
KEYWORDS="amd64 arm64"
|
KEYWORDS="amd64 arm64"
|
||||||
inherit golang-vcs-snapshot
|
inherit vcs-snapshot
|
||||||
fi
|
fi
|
||||||
|
|
||||||
inherit coreos-go
|
inherit coreos-go
|
||||||
@ -29,20 +32,11 @@ DEPEND=""
|
|||||||
RDEPEND="app-emulation/runc
|
RDEPEND="app-emulation/runc
|
||||||
seccomp? ( sys-libs/libseccomp )"
|
seccomp? ( sys-libs/libseccomp )"
|
||||||
|
|
||||||
S=${WORKDIR}/${P}/src/${EGO_PN}
|
|
||||||
|
|
||||||
src_compile() {
|
src_compile() {
|
||||||
export GOARCH=$(go_arch)
|
local options=( $(usev seccomp) )
|
||||||
export CGO_ENABLED=1
|
LDFLAGS= emake GIT_COMMIT="$EGIT_COMMIT" BUILDTAGS="${options[*]}"
|
||||||
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[@]}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
dobin bin/containerd* bin/ctr
|
dobin bin/containerd* bin/ctr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@ EAPI=5
|
|||||||
CROS_WORKON_PROJECT="coreos/docker"
|
CROS_WORKON_PROJECT="coreos/docker"
|
||||||
CROS_WORKON_LOCALNAME="docker"
|
CROS_WORKON_LOCALNAME="docker"
|
||||||
CROS_WORKON_REPO="git://github.com"
|
CROS_WORKON_REPO="git://github.com"
|
||||||
|
COREOS_GO_VERSION="go1.6"
|
||||||
|
|
||||||
if [[ ${PV} == *9999 ]]; then
|
if [[ ${PV} == *9999 ]]; then
|
||||||
DOCKER_GITCOMMIT="unknown"
|
DOCKER_GITCOMMIT="unknown"
|
||||||
@ -17,7 +18,7 @@ else
|
|||||||
KEYWORDS="amd64 arm64"
|
KEYWORDS="amd64 arm64"
|
||||||
fi
|
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"
|
DESCRIPTION="Docker complements kernel namespacing with a high-level API which operates at the process level"
|
||||||
HOMEPAGE="https://dockerproject.org"
|
HOMEPAGE="https://dockerproject.org"
|
||||||
@ -43,8 +44,6 @@ CDEPEND="
|
|||||||
DEPEND="
|
DEPEND="
|
||||||
${CDEPEND}
|
${CDEPEND}
|
||||||
|
|
||||||
dev-lang/go:=
|
|
||||||
|
|
||||||
btrfs? (
|
btrfs? (
|
||||||
>=sys-fs/btrfs-progs-3.16.1
|
>=sys-fs/btrfs-progs-3.16.1
|
||||||
)
|
)
|
||||||
@ -205,20 +204,11 @@ src_prepare() {
|
|||||||
rm --recursive --force .git
|
rm --recursive --force .git
|
||||||
}
|
}
|
||||||
|
|
||||||
go_get_arch() {
|
|
||||||
echo ${ARCH}
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
src_compile() {
|
||||||
# if we treat them right, Docker's build scripts will set up a
|
# if we treat them right, Docker's build scripts will set up a
|
||||||
# reasonable GOPATH for us
|
# reasonable GOPATH for us
|
||||||
export AUTO_GOPATH=1
|
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
|
# if we're building from a zip, we need the GITCOMMIT value
|
||||||
[ "$DOCKER_GITCOMMIT" ] && export DOCKER_GITCOMMIT
|
[ "$DOCKER_GITCOMMIT" ] && export DOCKER_GITCOMMIT
|
||||||
|
|
||||||
@ -262,10 +252,7 @@ src_compile() {
|
|||||||
unset DOCKER_EXPERIMENTAL
|
unset DOCKER_EXPERIMENTAL
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export GOARCH=$(go_get_arch)
|
go_export
|
||||||
export CGO_ENABLED=1
|
|
||||||
export CC=$(tc-getCC)
|
|
||||||
export CXX=$(tc-getCXX)
|
|
||||||
|
|
||||||
# verbose building
|
# verbose building
|
||||||
export BUILDFLAGS="-x -v"
|
export BUILDFLAGS="-x -v"
|
||||||
|
|||||||
@ -6,11 +6,12 @@ EAPI=5
|
|||||||
|
|
||||||
GITHUB_URI="github.com/opencontainers/runc"
|
GITHUB_URI="github.com/opencontainers/runc"
|
||||||
COREOS_GO_PACKAGE="${GITHUB_URI}"
|
COREOS_GO_PACKAGE="${GITHUB_URI}"
|
||||||
|
COREOS_GO_VERSION="go1.6"
|
||||||
# the commit of runc that docker uses.
|
# the commit of runc that docker uses.
|
||||||
# see https://github.com/docker/docker/blob/v1.12.0/Dockerfile#L236
|
# see https://github.com/docker/docker/blob/v1.12.0/Dockerfile#L236
|
||||||
COMMIT_ID="cc29e3dded8e27ba8f65738f40d251c885030a28"
|
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"
|
DESCRIPTION="runc container cli tools"
|
||||||
HOMEPAGE="http://runc.io"
|
HOMEPAGE="http://runc.io"
|
||||||
@ -30,29 +31,18 @@ RDEPEND="
|
|||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
epatch "${FILESDIR}/0001-Makefile-do-not-install-dependencies-of-target.patch"
|
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() {
|
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
|
# build up optional flags
|
||||||
local options=(
|
local options=(
|
||||||
$(usex apparmor 'apparmor')
|
$(usev apparmor)
|
||||||
$(usex seccomp 'seccomp')
|
$(usev seccomp)
|
||||||
)
|
)
|
||||||
|
|
||||||
emake BUILDTAGS="${options[*]}"
|
emake BUILDTAGS="${options[*]}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user