mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-18 03:23:20 -04:00
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@gmail.com>
This commit is contained in:
@@ -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"
|
||||
|
||||
# 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"
|
||||
IUSE="bash-completion zsh-completion"
|
||||
|
||||
BDEPEND=">=dev-lang/go-1.18"
|
||||
DEPEND="${BDEPEND}"
|
||||
|
||||
src_unpack() {
|
||||
git-r3_src_unpack
|
||||
go-module_live_vendor
|
||||
}
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user