commit:     5a408912a2468dba3e79b685a201338adbfc9b16
Author:     Alexey Zapparov <alexey <AT> zapparov <DOT> com>
AuthorDate: Wed Feb  2 04:03:06 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Feb 26 02:47:59 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a408912

sys-apps/bat: add 0.18.3-r1

* Fix manpage installation with USE=debug
* Install BASH complitions

Closes: https://bugs.gentoo.org/829629
Closes: https://bugs.gentoo.org/828876
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Alexey Zapparov <alexey <AT> zapparov.com>
Closes: https://github.com/gentoo/gentoo/pull/24047
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../{bat-0.18.3.ebuild => bat-0.18.3-r1.ebuild}    | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/sys-apps/bat/bat-0.18.3.ebuild b/sys-apps/bat/bat-0.18.3-r1.ebuild
similarity index 88%
rename from sys-apps/bat/bat-0.18.3.ebuild
rename to sys-apps/bat/bat-0.18.3-r1.ebuild
index b791c28b50a8..97b8c7d47f4b 100644
--- a/sys-apps/bat/bat-0.18.3.ebuild
+++ b/sys-apps/bat/bat-0.18.3-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2017-2021 Gentoo Authors
+# Copyright 2017-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -153,7 +153,7 @@ CRATES="
        yaml-rust-0.4.5
 "
 
-inherit cargo
+inherit bash-completion-r1 cargo
 
 DESCRIPTION="cat(1) clone with syntax highlighting and Git integration"
 # Double check the homepage as the cargo_metadata crate
@@ -191,14 +191,16 @@ src_install() {
 
        einstalldocs
 
-       doman target/release/build/bat-*/out/assets/manual/bat.1
+       local build_dir=( target/$(usex debug{,} release)/build/${PN}-*/out )
+       cd ${build_dir[0]} || die "Cannot change directory to ${PN} build"
 
-       insinto /usr/share/fish/vendor_completions.d/
-       doins target/release/build/bat-*/out/assets/completions/bat.fish
+       doman assets/manual/bat.1
 
-       # Hack to find/install generated zsh completions files as it can be 
present in
-       # multiple directories
-       local BUILD_DIR="$(dirname $(find target/release -name bat.zsh -print 
-quit || die) || die)"
-       insinto /usr/share/zsh/site-functions/
-       newins "${BUILD_DIR}"/bat.zsh _${PN}
+       newbashcomp assets/completions/${PN}.bash ${PN}
+
+       insinto /usr/share/zsh/site-functions
+       newins assets/completions/${PN}.zsh _${PN}
+
+       insinto /usr/share/fish/vendor_completions.d
+       doins assets/completions/${PN}.fish
 }

Reply via email to