From 5fd3d0bd41c5bafbda78dcd0cd8e820ab689383f Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Mon, 8 Mar 2021 18:42:15 +0100 Subject: [PATCH] Generate manifests in `flux-{go,scm}` AUR packages This commit makes a couple of changes to the `flux-{go,scm}` packages so that they properly build again: - The manifests are generated before the compilation of the `flux` binary. - The `makedepends` have been updated to require a version of Go `>=1.16` (which is a requirement for `embed`). - The `makedepends` have been updated to require a `kustomize` version `>=3.0` (as we use `transformers`). Signed-off-by: Hidde Beydals --- .github/aur/flux-go/PKGBUILD.template | 7 ++++--- .github/aur/flux-scm/PKGBUILD.template | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/aur/flux-go/PKGBUILD.template b/.github/aur/flux-go/PKGBUILD.template index 551bea9b..e71d8322 100644 --- a/.github/aur/flux-go/PKGBUILD.template +++ b/.github/aur/flux-go/PKGBUILD.template @@ -12,7 +12,7 @@ provides=("flux-bin") conflicts=("flux-bin") replaces=("flux-cli") depends=("glibc") -makedepends=("go") +makedepends=('go>=1.16', 'kustomize>=3.0') optdepends=('kubectl: for apply actions on the Kubernetes cluster', 'bash-completion: auto-completion for flux in Bash', 'zsh-completions: auto-completion for flux in ZSH') @@ -30,8 +30,9 @@ build() { export CGO_CFLAGS="$CFLAGS" export CGO_CXXFLAGS="$CXXFLAGS" export CGO_CPPFLAGS="$CPPFLAGS" - export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" - go build -ldflags "-X main.VERSION=${pkgver}" -o ${_srcname} ./cmd/flux + export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw" + ./manifests/scripts/bundle.sh "${PWD}/manifests" "${PWD}/cmd/flux/manifests" + go build -ldflags "-linkmode=external -X main.VERSION=${pkgver}" -o ${_srcname} ./cmd/flux } check() { diff --git a/.github/aur/flux-scm/PKGBUILD.template b/.github/aur/flux-scm/PKGBUILD.template index 08aee439..16cdf969 100644 --- a/.github/aur/flux-scm/PKGBUILD.template +++ b/.github/aur/flux-scm/PKGBUILD.template @@ -11,7 +11,7 @@ license=("APACHE") provides=("flux-bin") conflicts=("flux-bin") depends=("glibc") -makedepends=("go") +makedepends=('go>=1.16', 'kustomize>=3.0') optdepends=('kubectl: for apply actions on the Kubernetes cluster', 'bash-completion: auto-completion for flux in Bash', 'zsh-completions: auto-completion for flux in ZSH') @@ -32,8 +32,9 @@ build() { export CGO_CFLAGS="$CFLAGS" export CGO_CXXFLAGS="$CXXFLAGS" export CGO_CPPFLAGS="$CPPFLAGS" - export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" - go build -ldflags "-X main.VERSION=${pkgver}" -o ${_srcname} ./cmd/flux + export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw" + make cmd/flux/manifests + go build -ldflags "-linkmode=external -X main.VERSION=${pkgver}" -o ${_srcname} ./cmd/flux } check() {