app-misc/yazi: Added USE flag 'cli'

This USE flag enables the DDS (Data Distribution Service).
See https://yazi-rs.github.io/docs/dds
An additional binary 'ya' will be compiled/installed.
It's not installed by default by upstream, that's why I don't install it
unconditionally but rather with a USE flag. May change in the future.

cc: @micielski

Signed-off-by: Jonas Frei <freijon@pm.me>
This commit is contained in:
Jonas Frei
2024-06-26 20:22:48 +02:00
parent a0597dc2ad
commit c4c7b4ddfa
2 changed files with 22 additions and 2 deletions

View File

@@ -9,4 +9,7 @@
<remote-id type="github">sxyazi/yazi</remote-id>
<bugs-to>https://github.com/sxyazi/yazi/issues</bugs-to>
</upstream>
<use>
<flag name="cli">Install CLI Data Distribution Service</flag>
</use>
</pkgmetadata>

View File

@@ -324,7 +324,11 @@ LICENSE+="
SLOT="0"
KEYWORDS="~amd64"
QA_FLAGS_IGNORED="usr/bin/${PN}"
IUSE="+cli"
QA_FLAGS_IGNORED="
usr/bin/ya.*
"
DOCS=(
README.md
@@ -336,13 +340,26 @@ src_prepare() {
eapply_user
}
src_compile() {
cargo_src_compile
use cli && cargo_src_compile -p "${PN}-cli"
}
src_install() {
dobin target/$(usex debug debug release)/yazi
dobin "target/$(usex debug debug release)/${PN}"
use cli && dobin "target/$(usex debug debug release)/ya"
newbashcomp "${S}/yazi-boot/completions/${PN}.bash" "${PN}"
dozshcomp "${S}/yazi-boot/completions/_${PN}"
dofishcomp "${S}/yazi-boot/completions/${PN}.fish"
if use cli
then
newbashcomp "${S}/yazi-cli/completions/ya.bash" "ya"
dozshcomp "${S}/yazi-cli/completions/_ya"
dofishcomp "${S}/yazi-cli/completions/ya.fish"
fi
domenu "assets/${PN}.desktop"
einstalldocs
}