commit: cb2caafa359b296f0f794b9dab6e7a98375fc5de Author: ingenarel <ingenarelitems <AT> gmail <DOT> com> AuthorDate: Thu Nov 20 23:39:00 2025 +0000 Commit: Saad Abdullah <ingenarelitems <AT> gmail <DOT> com> CommitDate: Thu Nov 20 23:48:05 2025 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=cb2caafa
dev-util/stripe-cli: fix package issues and update package quality - eapi 7 -> 8 - disable telemetry - add necessary upstream info in metadata.xml - use an ebuild template - give licenses for dependencies using go-licenses - add versioned ebuild - fix shell completions: previous one wasn't a way to properly install shell completion since it was trying to just install any .bash file in the root dir - add zsh completion - update the minimum required go version Signed-off-by: ingenarel <ingenarelitems <AT> gmail.com> dev-util/stripe-cli/Manifest | 2 + dev-util/stripe-cli/files/99stripe-cli | 1 + dev-util/stripe-cli/metadata.xml | 7 +++- dev-util/stripe-cli/stripe-cli-1.32.0.ebuild | 56 ++++++++++++++++++++++++++++ dev-util/stripe-cli/stripe-cli-9999.ebuild | 55 +++++++++++++++++---------- 5 files changed, 101 insertions(+), 20 deletions(-) diff --git a/dev-util/stripe-cli/Manifest b/dev-util/stripe-cli/Manifest new file mode 100644 index 0000000000..520539a4a9 --- /dev/null +++ b/dev-util/stripe-cli/Manifest @@ -0,0 +1,2 @@ +DIST stripe-cli-1.32.0-deps.tar.xz 62321788 BLAKE2B ec6747b5ca406eab3da974768862f8567a7f54a99f420e4c4a1e5761e627ce2313a8d465f5e573a2ef696c1d3e74eca1443f4f0c12dc6848b599c1adc7aa180b SHA512 5fd0ddbfa6d2a39b08747704c9669a591e8aa3d1a91cdc14de8dc60ee1ff8eaab408949f155e0b35793091899d77a67b5ff6af8fd9b8d9116e6d5f4e79824a97 +DIST stripe-cli-1.32.0.tar.gz 1984890 BLAKE2B 771bf119ecd48b332676a7ef0efcf90958fb4bece6ac2121a9252a4dc261f68723dc5d17c73c182798d793d17a0ad2dabf56526b0edaf5d3fb4e6bf557258775 SHA512 d6f4b3aabdebd498ac955c61035d566ff4caf9acd9fed059800031d132bf545daefe6d79ee8d2d1944a560b78af1b875d5d1fd9ff72c2255cef03edf4aaaa205 diff --git a/dev-util/stripe-cli/files/99stripe-cli b/dev-util/stripe-cli/files/99stripe-cli new file mode 100644 index 0000000000..08ab2b9b08 --- /dev/null +++ b/dev-util/stripe-cli/files/99stripe-cli @@ -0,0 +1 @@ +STRIPE_CLI_TELEMETRY_OPTOUT=1 diff --git a/dev-util/stripe-cli/metadata.xml b/dev-util/stripe-cli/metadata.xml index 115e9d64a6..1d94b68ded 100644 --- a/dev-util/stripe-cli/metadata.xml +++ b/dev-util/stripe-cli/metadata.xml @@ -1,5 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> - <!-- maintainer-needed --> + <upstream> + <doc>https://docs.stripe.com/cli</doc> + <bugs-to>https://github.com/stripe/stripe-cli/issues</bugs-to> + <remote-id type="github">stripe/stripe-cli</remote-id> + </upstream> + <!-- maintainer-needed --> </pkgmetadata> diff --git a/dev-util/stripe-cli/stripe-cli-1.32.0.ebuild b/dev-util/stripe-cli/stripe-cli-1.32.0.ebuild new file mode 100644 index 0000000000..b3ef47fb54 --- /dev/null +++ b/dev-util/stripe-cli/stripe-cli-1.32.0.ebuild @@ -0,0 +1,56 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit go-module shell-completion + +MY_PN="${PN%-cli}" + +DESCRIPTION="A command-line tool for Stripe" +HOMEPAGE="https://docs.stripe.com/stripe-cli" +if [[ "${PV}" == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/stripe/stripe-cli" + src_unpack() { + git-r3_src_unpack + go-module_live_vendor + } +else + KEYWORDS="~amd64" + SRC_URI="https://github.com/stripe/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + # possible depfiles link if used + SRC_URI+=" https://github.com/ingenarel/guru-depfiles/releases/download/${P}-deps.tar.xz/${P}-deps.tar.xz" +fi + +LICENSE="Apache-2.0" + +# echo "# dependency licenses:"; printf 'LICENSES+=" ' +# go-licenses report ./... 2>/dev/null | awk -F ',' '{ print $NF }' | sort --unique | tr '\n' ' '; echo '"' + +# dependency licenses: +LICENSES+=" Apache-2.0 BSD-2-Clause BSD-3-Clause ISC MIT MPL-2.0 Unlicense " +SLOT="0" +IUSE="bash-completion zsh-completion" + +BDEPEND=">=dev-lang/go-1.24.1" + +src_compile() { + CGO_ENABLED=0 ego build -o "bin/${MY_PN}" "cmd/stripe/main.go" +} + +src_install() { + dobin "bin/${MY_PN}" + + # disables telemetry + doenvd "$FILESDIR/99$PN" + + if use bash-completion ; then + "bin/${MY_PN}" completion --shell bash + newbashcomp "${MY_PN}-completion.bash" "$MY_PN" + fi + if use zsh-completion ; then + "bin/${MY_PN}" completion --shell zsh + newzshcomp "${MY_PN}-completion.zsh" "_$MY_PN" + fi +} diff --git a/dev-util/stripe-cli/stripe-cli-9999.ebuild b/dev-util/stripe-cli/stripe-cli-9999.ebuild index 32e3a901c4..baef2d6710 100644 --- a/dev-util/stripe-cli/stripe-cli-9999.ebuild +++ b/dev-util/stripe-cli/stripe-cli-9999.ebuild @@ -1,39 +1,56 @@ # Copyright 2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 -EGO_PN=github.com/stripe/stripe-cli +inherit go-module shell-completion -inherit git-r3 go-module bash-completion-r1 - -# remove -cli suffix -MY_PN=${PN%-cli} +MY_PN="${PN%-cli}" DESCRIPTION="A command-line tool for Stripe" -HOMEPAGE="https://stripe.com/docs/stripe-cli" -EGIT_REPO_URI="https://${EGO_PN}.git" +HOMEPAGE="https://docs.stripe.com/stripe-cli" +if [[ "${PV}" == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/stripe/stripe-cli" + src_unpack() { + git-r3_src_unpack + go-module_live_vendor + } +else + KEYWORDS="~amd64" + SRC_URI="https://github.com/stripe/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + # possible depfiles link if used + # SRC_URI+="" +fi LICENSE="Apache-2.0" -SLOT="0" -IUSE="bash-completion" -BDEPEND=">=dev-lang/go-1.18" -DEPEND="${BDEPEND}" +# echo "# dependency licenses:"; printf 'LICENSES+=" ' +# go-licenses report ./... 2>/dev/null | awk -F ',' '{ print $NF }' | sort --unique | tr '\n' ' '; echo '"' -src_unpack() { - git-r3_src_unpack - go-module_live_vendor -} +# dependency licenses: +LICENSES+=" Apache-2.0 BSD-2-Clause BSD-3-Clause ISC MIT MPL-2.0 Unlicense " +SLOT="0" +IUSE="bash-completion zsh-completion" + +BDEPEND=">=dev-lang/go-1.24.1" src_compile() { - ego build -o ${MY_PN} cmd/stripe/main.go + CGO_ENABLED=0 ego build -o "bin/${MY_PN}" "cmd/stripe/main.go" } src_install() { - dobin ${MY_PN} + dobin "bin/${MY_PN}" + + # disables telemetry + doenvd "$FILESDIR/99$PN" if use bash-completion ; then - dobashcomp *.bash + "bin/${MY_PN}" completion --shell bash + newbashcomp "${MY_PN}-completion.bash" "$MY_PN" + fi + if use zsh-completion ; then + "bin/${MY_PN}" completion --shell zsh + newzshcomp "${MY_PN}-completion.zsh" "_$MY_PN" fi }
