app-misc/cheat: shell-completion, several fixes

- Now making use of the 'shell-completion' eclass
- Removed 'zsh-completion' USE flag (completion is now installed
  undonditionally)
- No longer building manpage since it's pre-built in the release
- Therefore: No longer depending on app-text/pandoc at build time
- Removed weird total blocking of app-shells/zsh-completion. Now
  soft-blocking app-shells/zsh-completion < 0.34.0 because it used to
  install the zsh completion '_cheat' before 0.34.0.

Signed-off-by: Jonas Frei <freijon@pm.me>
This commit is contained in:
Jonas Frei
2023-04-13 07:21:07 +02:00
parent 372548e2b3
commit 79a0c63ed4

View File

@@ -1,9 +1,9 @@
# Copyright 2019-2021 Gentoo Authors
# Copyright 2019-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit bash-completion-r1 go-module optfeature
inherit go-module optfeature shell-completion
DESCRIPTION="cheat allows you to create and view interactive cheatsheets on the command-line"
HOMEPAGE="https://github.com/cheat/cheat"
@@ -14,17 +14,13 @@ SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT Apache-2.0 BSD BSD-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="man zsh-completion"
IUSE="man"
RDEPEND="zsh-completion? ( !app-shells/zsh-completions )"
BDEPEND="man? ( app-text/pandoc )"
RDEPEND="!<app-shells/zsh-completions-0.34.0"
BDEPEND=""
src_compile() {
ego build -o ${PN} ./cmd/${PN}
if use man; then
pandoc -s -t man doc/${PN}.1.md -o doc/${PN}.1 || die "building manpage failed"
fi
}
src_test() {
@@ -37,13 +33,9 @@ src_install() {
use man && doman doc/${PN}.1
newbashcomp scripts/${PN}.bash ${PN}
insinto /usr/share/fish/vendor_completions.d
doins scripts/${PN}.fish
dofishcomp scripts/${PN}.fish
if use zsh-completion; then
insinto /usr/share/zsh/site-functions
newins scripts/${PN}.zsh _cheat
fi
newzshcomp scripts/${PN}.zsh _${PN}
}
pkg_postinst() {