diff options
author | 2022-12-23 12:49:19 +0800 | |
---|---|---|
committer | 2022-12-23 12:49:19 +0800 | |
commit | 85efdc859eafdce398020dd753bbe3c878f2a79c (patch) | |
tree | 53b9ccf51614bcfd93347ad357032d8f9e069d35 | |
parent | [app-misc/dasel] remove in favor of gentoo's (diff) | |
download | pigfoot-85efdc859eafdce398020dd753bbe3c878f2a79c.tar.gz pigfoot-85efdc859eafdce398020dd753bbe3c878f2a79c.tar.bz2 pigfoot-85efdc859eafdce398020dd753bbe3c878f2a79c.zip |
[app-containers/dive] new ebuild
Signed-off-by: Chen, Chih-Chia <pigfoot@gmail.com>
l--------- | app-containers/dive/dive-0.10.0.ebuild | 1 | ||||
-rw-r--r-- | app-containers/dive/dive-9999.ebuild | 58 |
2 files changed, 59 insertions, 0 deletions
diff --git a/app-containers/dive/dive-0.10.0.ebuild b/app-containers/dive/dive-0.10.0.ebuild new file mode 120000 index 0000000..ebc05bf --- /dev/null +++ b/app-containers/dive/dive-0.10.0.ebuild @@ -0,0 +1 @@ +dive-9999.ebuild
\ No newline at end of file diff --git a/app-containers/dive/dive-9999.ebuild b/app-containers/dive/dive-9999.ebuild new file mode 100644 index 0000000..a43b409 --- /dev/null +++ b/app-containers/dive/dive-9999.ebuild @@ -0,0 +1,58 @@ +# Copyright 2019-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +EGO_PN="github.com/wagoodman/dive" + +inherit go-module + +if [[ ${PV} == *9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://${EGO_PN}.git" + EGO_VER="master" + + src_unpack() { + git-r3_src_unpack + go-module_live_vendor + } +else + EGO_VER="${PV}" + #SRC_URI="https://${EGO_PN}/archive/v${EGO_VER}.tar.gz -> ${P}.tar.gz" + inherit git-r3 + EGIT_REPO_URI="https://${EGO_PN}.git" + EGIT_COMMIT="v${EGO_VER}" + + src_unpack() { + git-r3_src_unpack + go-module_live_vendor + } + + KEYWORDS="~amd64 ~x86 ~arm64 ~arm" +fi + +DESCRIPTION="A tool for exploring each layer in a docker image" +LICENSE="MIT" +SLOT="0/${PVR}" +RESTRICT="mirror" +IUSE="+pie" + +src_compile() { + # -buildmode=pie forces external linking mode, even CGO_ENABLED=0 + # https://github.com/golang/go/issues/18968 + use pie && local build_pie="-buildmode=pie" + + local build_flags="$( echo ${EGO_BUILD_FLAGS} ) $( echo ${build_pie} )" + local ld_flags="$( echo "-s -w -X 'main.version=${EGO_VER}'" )" + + set -- env \ + CGO_ENABLED=0 \ + go build -o "bin/${PN}" -mod=vendor -v -work -x ${build_flags} -ldflags "${ld_flags}" \ + . + echo "$@" + "$@" || die +} + +src_install() { + dobin bin/* +} |