febuild/media-sound/coppwr/coppwr-9999.ebuild

96 lines
2.3 KiB
Bash

# Copyright 2020-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
CRATES="
"
inherit cargo xdg desktop
DESCRIPTION="Low level control GUI for the PipeWire multimedia server"
HOMEPAGE="https://github.com/dimtpap/coppwr"
if [[ ${PV} == "9999" ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/dimtpap/coppwr.git"
else
SRC_URI="
https://github.com/dimtpap/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
${CARGO_CRATE_URIS}
"
KEYWORDS="~amd64 ~ppc64"
fi
# LICENSE=""
SLOT="0"
KEYWORDS="~amd64"
IUSE="+persistence xdg_desktop_portal"
# Rust packages ignore CFLAGS and LDFLAGS so let's silence the QA warnings
# QA_FLAGS_IGNORED="usr/bin/btm"
src_unpack() {
if [[ "${PV}" == *9999* ]]; then
git-r3_src_unpack
cargo_live_src_unpack
else
cargo_src_unpack
fi
}
src_prepare() {
# Stripping symbols should be the choice of the user.
sed -i '/strip = "symbols"/d' Cargo.toml || die "Unable to patch out symbol stripping"
eapply_user
}
src_configure() {
myfeatures=(
pw_v0_3_77
$(usev persistence)
$(usev xdg_desktop_portal)
)
# https://github.com/ClementTsang/bottom/blob/bacaca5548c2b23d261ef961ee6584b609529567/Cargo.toml#L63
# fern and log features are for debugging only, so disable default features
# cargo_src_configure $(usev !debug --no-default-features)
cargo_src_configure --no-default-features
}
src_install() {
cargo_src_install
# Find generated shell completion files. btm.bash can be present in multiple dirs if we build
# additional features, so grab the first match only.
# local BUILD_DIR="$(dirname $(find target -name btm.bash -print -quit || die) || die)"
# newbashcomp "${BUILD_DIR}"/btm.bash btm
# insinto /usr/share/fish/vendor_completions.d
# doins "${BUILD_DIR}"/btm.fish
# insinto /usr/share/zsh/site-functions
# doins "${BUILD_DIR}"/_btm
# doins assets/io.github.dimtpap.coppwr.desktop
# doins -r assets/icon
sed -i 's/Icon=io\.github\.dimtpap\.coppwr/Icon=coppwr/' assets/io.github.dimtpap.coppwr.desktop
domenu assets/io.github.dimtpap.coppwr.desktop
for size in 32 48 64 128 256 512; do
mv assets/icon/${size}.png assets/icon/coppwr.png
doicon --size ${size} assets/icon/coppwr.png
done
local DOCS=( README.md )
einstalldocs
}