Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New package: infisical 0.14.2 #46653

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

0xdeadbad
Copy link
Contributor

@0xdeadbad 0xdeadbad commented Oct 13, 2023

Testing the changes

  • I tested the changes in this PR: YES

New package

Local build testing

  • I built this PR locally for my native architecture, x86_64-glibc
  • I built this PR locally for these architectures (if supported. mark crossbuilds):
    • aarch64-musl
    • aarch64
    • armv5te-musl
    • armv5te
    • armv5tel-musl
    • armv5tel
    • armv6hf-musl
    • armv6hf
    • armv6l-musl
    • armv6l
    • armv7hf-musl
    • armv7hf
    • armv7l-musl
    • armv7l
    • i686-musl
    • i686
    • ppc64le-musl
    • ppc64le
    • riscv64-musl
    • riscv64
    • x86_64-musl

@classabbyamp classabbyamp added the new-package This PR adds a new package label Oct 13, 2023
@0xdeadbad
Copy link
Contributor Author

Ok, I just woke up and this looks terrible. Going to refactor-fix

@classabbyamp
Copy link
Member

  • 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
From aa70f48c14a71f0101b1a1400baa79621a45337d Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
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 <matheus.dasilva.garcias@gmail.com>"
 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

@classabbyamp
Copy link
Member

ah that probably worked for me because I have binfmts set up locally. instead of go run . ... use vtargetrun "${DESTDIR}"/usr/bin/infisical ...

@0xdeadbad
Copy link
Contributor Author

Wow, thank you very much for the tips, changes and the very clean patch @classabbyamp .I'll do my best to bring cleaner PRs!

@chrysos349
Copy link
Contributor

you could also disable telemetry

post_patch() {
	# disable telemetry
	vsed -i packages/cmd/root.go \
		-e 's/"telemetry", true/"telemetry", false/'
}

@0xdeadbad
Copy link
Contributor Author

you could also disable telemetry

post_patch() {
	# disable telemetry
	vsed -i packages/cmd/root.go \
		-e 's/"telemetry", true/"telemetry", false/'
}

Well spotted! Thank you.

@0xdeadbad
Copy link
Contributor Author

@classabbyamp I think I'm done with it, I tested personally on my computer (x86_64-glibc) and my raspberry pi 4 (aarch64-glibc) and added to the list every architecture that were cross built successfully. I can squash the commits and add co authors as I did. Anything you think that should be changed?

@classabbyamp
Copy link
Member

squash but there's no need to add coauthors

@0xdeadbad
Copy link
Contributor Author

squash but there's no need to add coauthors

Done. Thanks for the guidance!

Copy link

Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.

@github-actions github-actions bot added the Stale label Jan 13, 2024
@chrysos349
Copy link
Contributor

bump

@github-actions github-actions bot removed the Stale label Jan 14, 2024
Copy link

Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.

@github-actions github-actions bot added the Stale label Apr 14, 2024
@chrysos349
Copy link
Contributor

bump

@github-actions github-actions bot removed the Stale label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-package This PR adds a new package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants