From 06e89b240c525b560c76d5b55f2baf8173ba7f96 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Tue, 10 Mar 2020 16:33:05 -0700 Subject: [PATCH] app-admin/helm: fix build process Fix the build process where 3.1.1 did not build at all, and ensure that it has correct Git data in the version output. Fixes: https://bugs.gentoo.org/711852 Signed-off-by: Robin H. Johnson --- app-admin/helm/helm-3.1.1.ebuild | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/app-admin/helm/helm-3.1.1.ebuild b/app-admin/helm/helm-3.1.1.ebuild index f49619ea932d..21fe413bbc9a 100644 --- a/app-admin/helm/helm-3.1.1.ebuild +++ b/app-admin/helm/helm-3.1.1.ebuild @@ -700,17 +700,29 @@ RESTRICT+=" test" src_prepare() { default - mv ../vendor . - sed -i -e "s/git rev-parse HEAD/echo ${GIT_COMMIT}/"\ - -e "s/git rev-parse --short HEAD/echo ${GIT_COMMIT:0:7}/"\ - -e "s#git describe --tags --abbrev=0 --exact-match 2>/dev/null#echo v${PV}#"\ - -e 's/test -n "`git status --porcelain`" && echo "dirty" || //' \ - -e "/GOFLAGS :=/d" \ + # Makefile: + # - change GIT & LDFLAGS variable assignments from immediate ":=" to + # deferred "=", to allow better overrides. + # - Remove GOFLAGS entirely + # - Remove -w & -s from LDFLAGS + # - Git spec will be passed later + sed -r -i \ + -e '/^GIT_(COMMIT|SHA|TAG|DIRTY)/s,:?=.*,=,g' \ + -e "/^GOFLAGS[[:space:]]+:?=/d" \ + -e '/^LDFLAGS[[:space:]]+:?=/{s,-[ws],,g;s,:=,=,g}' \ Makefile || die } src_compile() { - emake GOFLAGS="-mod=vendor" LDFLAGS= build + # Do not pass LDFLAGS directly here, as the upstream Makefile adds some + # data to it via += + emake \ + GOFLAGS="${GOFLAGS}" \ + GIT_SHA=${GIT_COMMIT} \ + GIT_COMMIT=${GIT_COMMIT:0:7} \ + GIT_TAG=v${PV} \ + GIT_DIRTY=clean \ + build bin/${PN} completion bash > ${PN}.bash || die bin/${PN} completion zsh > ${PN}.zsh || die } -- 2.26.2