commit: 3de1701784351a4d13e576418c3feaa44cb763d4 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org> AuthorDate: Sun Feb 8 10:36:55 2026 +0000 Commit: William Hubbs <williamh <AT> gentoo <DOT> org> CommitDate: Fri Feb 13 17:27:44 2026 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3de17017
sys-cluster/kube-apiserver: Fix cross-compiling, add shell completion Closes: https://github.com/gentoo/gentoo/pull/45684 Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org> Signed-off-by: William Hubbs <williamh <AT> gentoo.org> .../kube-apiserver/kube-apiserver-1.35.0.ebuild | 24 ++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/sys-cluster/kube-apiserver/kube-apiserver-1.35.0.ebuild b/sys-cluster/kube-apiserver/kube-apiserver-1.35.0.ebuild index 0f962dd1f368..c7b2b1952c1f 100644 --- a/sys-cluster/kube-apiserver/kube-apiserver-1.35.0.ebuild +++ b/sys-cluster/kube-apiserver/kube-apiserver-1.35.0.ebuild @@ -3,7 +3,7 @@ EAPI=8 -inherit go-module systemd +inherit go-env go-module shell-completion sysroot systemd DESCRIPTION="Kubernetes API server" HOMEPAGE="https://kubernetes.io" @@ -27,12 +27,28 @@ BDEPEND=">=dev-lang/go-1.25.4" QA_PRESTRIPPED=usr/bin/kube-apiserver src_compile() { - CGO_LDFLAGS="$(usex hardened '-fNO-PIC ' '')" FORCE_HOST_GO="yes" \ - emake -j1 GOFLAGS="${GOFLAGS}" GOLDFLAGS="" LDFLAGS="" WHAT=cmd/${PN} + local GOOS=$(go-env_goos) + + CGO_LDFLAGS="$(usex hardened '-fno-PIC ' '')" \ + emake -j1 GOFLAGS="${GOFLAGS}" GOLDFLAGS="" LDFLAGS="" FORCE_HOST_GO=yes \ + KUBE_BUILD_PLATFORMS="${GOOS}/${GOARCH}" KUBE_${GOOS@U}_${GOARCH@U}_CC="${CC}" \ + WHAT=cmd/${PN} + + bin=_output/local/bin/${GOOS}/${GOARCH}/${PN} + + einfo "generating shell completion files" + sysroot_try_run_prefixed ${bin} completion bash > ${PN}.bash || die + sysroot_try_run_prefixed ${bin} completion zsh > ${PN}.zsh || die + sysroot_try_run_prefixed ${bin} completion fish > ${PN}.fish || die } src_install() { - dobin _output/bin/${PN} + dobin ${bin} + + [[ -s ${PN}.bash ]] && newbashcomp ${PN}.bash ${PN} + [[ -s ${PN}.zsh ]] && newzshcomp ${PN}.zsh _${PN} + [[ -s ${PN}.fish ]] && dofishcomp ${PN}.fish + newinitd "${FILESDIR}"/${PN}.initd ${PN} newconfd "${FILESDIR}"/${PN}.confd ${PN} systemd_dounit "${FILESDIR}"/${PN}.service
