New comment by classabbyamp on void-packages repository https://github.com/void-linux/void-packages/pull/46653#issuecomment-1761886216 Comment: - no need to restrict the architectures (especially as what you put limits you to glibc only) - use the go `build_style`, as it takes care of most things for you - `build_helper=qemu` allows the `go run` to work in cross - don't override `do_extract`, use `build_wrksrc` to change the working directory of the build - `XBPS_CHECK_PKGS` should never be set in templates, that's internal to xbps-src - there's no need to use `wget`, the default (`xbps-fetch`) should work fine - indent with tabs - gzipping the manpage is useless because `vman` will ungz the file ```patch From aa70f48c14a71f0101b1a1400baa79621a45337d Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 13 Oct 2023 13:16:27 -0400 Subject: [PATCH] fixup! New package: infisical 0.14.2 --- srcpkgs/infisical/patches/fix_login..go.patch | 4 +- srcpkgs/infisical/template | 58 ++++++------------- 2 files changed, 21 insertions(+), 41 deletions(-) diff --git a/srcpkgs/infisical/patches/fix_login..go.patch b/srcpkgs/infisical/patches/fix_login..go.patch index 39d05f4f62b..90bcc9ba20b 100644 --- a/srcpkgs/infisical/patches/fix_login..go.patch +++ b/srcpkgs/infisical/patches/fix_login..go.patch @@ -1,5 +1,5 @@ ---- a/packages/cmd/login.go 2023-10-13 03:18:59.436901696 -0300 -+++ b/packages/cmd/login.go 2023-10-13 03:23:37.911320438 -0300 +--- a/cli/packages/cmd/login.go 2023-10-13 03:18:59.436901696 -0300 ++++ b/cli/packages/cmd/login.go 2023-10-13 03:23:37.911320438 -0300 @@ -117,7 +117,7 @@ err = util.StoreUserCredsInKeyRing(&userCredentialsToBeStored) diff --git a/srcpkgs/infisical/template b/srcpkgs/infisical/template index 5f7ddd57399..5ee034221e5 100644 --- a/srcpkgs/infisical/template +++ b/srcpkgs/infisical/template @@ -2,53 +2,33 @@ pkgname=infisical version=0.14.2 revision=1 -archs="x86_64 aarch64" -create_wrksrc=true -makedepends="go wget tar" -checkdepends="go git" -short_desc="CLI tool for infisical, an open-source secret management platform" +build_style=go +build_helper="qemu" +build_wrksrc="cli" +go_import_path="github.com/Infisical/infisical-merge" +go_ldflags="-X github.com/Infisical/infisical-merge/packages/util.CLI_VERSION=${version}" +checkdepends="git" +short_desc="Open-source secret management platform (CLI)" maintainer="Matheus Garcias " license="MIT" homepage="https://infisical.com" distfiles="https://github.com/Infisical/infisical/archive/refs/tags/infisical-cli/v${version}.tar.gz" checksum=313caf8d4e6ca5fd88d4f2adf72c721958d602404b6f80611a78a2f757d993f1 -fetch_cmd="wget" -nopie=true -XBPS_CHECK_PKGS=true -unset build_style - -function do_extract() { - tar -xvzf ${XBPS_SRCDISTDIR}/${pkgname}-${version}/v${version}.tar.gz \ - --strip-components=2 \ - infisical-infisical-cli-v${version}/cli -} - -function do_build() { - go build \ - -o infisical \ - --ldflags="-X \"github.com/Infisical/infisical-merge/packages/util.CLI_VERSION=${version}\"" \ - ${XBPS_BUILDDIR}/${pkgname}-${version} +do_check() { + go test ./... } -function do_check() { - [ "$(./infisical --version)" = "infisical version ${version}" ] || return 1 - go test github.com/Infisical/infisical-merge/packages/cmd - go test github.com/Infisical/infisical-merge/report - go test github.com/Infisical/infisical-merge/config - go test github.com/Infisical/infisical-merge/detect -} +post_install() { + mv "${DESTDIR}"/usr/bin/infisical-merge "${DESTDIR}"/usr/bin/infisical -function do_install() { - vbin infisical -} + go run . man > infisical.1 + vman infisical.1 -function post_install() { - go run . man | gzip -c > "infisical.1.gz" - vman "infisical.1.gz" + for sh in bash zsh fish; do + go run . completion "$sh" > "infisical.$sh" + vcompletion "infisical.$sh" "$sh" + done - for sh in bash zsh fish; do - go run . completion "$sh" > "infisical.$sh" - vcompletion "infisical.$sh" "$sh" - done -} \ No newline at end of file + vlicense "${wrksrc}"/LICENSE +} -- 2.42.0 ```