You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.4 KiB
59 lines
1.4 KiB
2 years ago
|
# Copyright 1999-2023 Gentoo Authors
|
||
2 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
|
EAPI=8
|
||
|
|
||
|
inherit go-module
|
||
|
|
||
|
MY_PN="buildx"
|
||
|
DESCRIPTION="Docker CLI plugin for extended build capabilities with BuildKit"
|
||
|
HOMEPAGE="https://github.com/docker/buildx"
|
||
2 years ago
|
if [[ ${PV} == 9999 ]]; then
|
||
|
inherit git-r3
|
||
|
EGIT_REPO_URI="https://github.com/docker/buildx.git"
|
||
|
else
|
||
|
SRC_URI="https://github.com/docker/buildx/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
|
||
|
KEYWORDS="~amd64 ~arm64"
|
||
|
S="${WORKDIR}/${MY_PN}-${PV}"
|
||
|
fi
|
||
2 years ago
|
|
||
|
LICENSE="Apache-2.0"
|
||
|
SLOT="0"
|
||
|
|
||
2 years ago
|
# This gives us the ability to neatly `-skip` tests.
|
||
|
# not required once ::gentoo is all > 1.20
|
||
|
RESTRICT="!test? ( test )"
|
||
|
IUSE="test"
|
||
|
|
||
|
BDEPEND="
|
||
|
test? ( >=dev-lang/go-1.20 )
|
||
|
"
|
||
2 years ago
|
DEPEND="app-containers/docker"
|
||
|
RDEPEND="${DEPEND}"
|
||
|
|
||
|
src_compile() {
|
||
|
local _buildx_r='github.com/docker/buildx'
|
||
|
ego build -mod=vendor -o docker-buildx \
|
||
|
-ldflags "-linkmode=external \
|
||
|
-X $_buildx_r/version.Version=${PV} \
|
||
|
-X $_buildx_r/version.Revision=$(date -u +%FT%T%z) \
|
||
|
-X $_buildx_r/version.Package=$_buildx_r" \
|
||
|
./cmd/buildx
|
||
|
}
|
||
|
|
||
|
src_test() {
|
||
2 years ago
|
# TestGit can't work in a source tarball; TestReadTargets fails seemingly due to parallelism.
|
||
|
if [[ ${PV} == 9999 ]]; then
|
||
|
ego test ./... -skip "TestReadTargets"
|
||
|
else
|
||
|
ego test ./... -skip "TestGit|TestReadTargets"
|
||
|
fi
|
||
2 years ago
|
}
|
||
|
|
||
|
src_install() {
|
||
|
exeinto /usr/libexec/docker/cli-plugins
|
||
|
doexe docker-buildx
|
||
|
|
||
|
dodoc README.md
|
||
|
}
|