EAPI=8

inherit autotools cargo

DESCRIPTION="PipeWire Volume Control"
HOMEPAGE="https://github.com/saivert/${PN}"
SRC_URI="${HOMEPAGE}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="rust"

CRATES="
    wireplumber@0.4.12
"

DEPEND="
    media-video/pipewire
    dev-lang/rust
"
RDEPEND="${DEPEND}"

src_prepare() {
    default
}

src_compile() {
    # meson setup builddir
    # meson compile -C builddir
    cargo build --release
}

src_install() {
    # meson install -C builddir
    # emake DESTDIR="${D}" install
    cargo install --path . --root "${D}"
}