# Copyright 2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Auto-Generated by cargo-ebuild 0.5.4

EAPI=8

CRATES="
	alsa@0.8.1
	alsa-sys@0.3.1
	android-tzdata@0.1.1
	android_system_properties@0.1.5
	atty@0.2.14
	autocfg@1.1.0
	bitflags@1.3.2
	bitflags@2.4.0
	bumpalo@3.14.0
	cc@1.0.79
	cfg-if@1.0.0
	chrono@0.4.31
	clap@4.1.6
	clap-verbosity-flag@2.0.0
	clap_derive@4.1.0
	clap_lex@0.3.1
	colored@1.9.4
	configparser@3.0.3
	core-foundation-sys@0.8.4
	equivalent@1.0.1
	errno@0.2.8
	errno-dragonfly@0.1.2
	hashbrown@0.14.3
	heck@0.4.1
	hermit-abi@0.1.19
	hermit-abi@0.3.1
	iana-time-zone@0.1.58
	iana-time-zone-haiku@0.1.2
	indexmap@2.1.0
	io-lifetimes@1.0.5
	is-terminal@0.4.3
	itoa@1.0.5
	js-sys@0.3.64
	json@0.12.4
	lazy_static@1.4.0
	libc@0.2.150
	linux-raw-sys@0.1.4
	log@0.4.17
	nix@0.26.4
	num-traits@0.2.17
	num_threads@0.1.6
	once_cell@1.17.1
	os_str_bytes@6.4.1
	pkg-config@0.3.26
	proc-macro-error@1.0.4
	proc-macro-error-attr@1.0.4
	proc-macro2@1.0.69
	quote@1.0.33
	rustix@0.36.8
	serde@1.0.152
	signal-hook@0.3.17
	signal-hook-registry@1.4.1
	simple_logger@1.16.0
	strsim@0.10.0
	syn@1.0.108
	syn@2.0.38
	termcolor@1.2.0
	time@0.3.19
	time-core@0.1.0
	time-macros@0.2.7
	unicode-ident@1.0.6
	version_check@0.9.4
	wasm-bindgen@0.2.87
	wasm-bindgen-backend@0.2.87
	wasm-bindgen-macro@0.2.87
	wasm-bindgen-macro-support@0.2.87
	wasm-bindgen-shared@0.2.87
	winapi@0.3.9
	winapi-i686-pc-windows-gnu@0.4.0
	winapi-util@0.1.5
	winapi-x86_64-pc-windows-gnu@0.4.0
	windows-core@0.51.1
	windows-sys@0.45.0
	windows-targets@0.42.1
	windows-targets@0.48.5
	windows_aarch64_gnullvm@0.42.1
	windows_aarch64_gnullvm@0.48.5
	windows_aarch64_msvc@0.42.1
	windows_aarch64_msvc@0.48.5
	windows_i686_gnu@0.42.1
	windows_i686_gnu@0.48.5
	windows_i686_msvc@0.42.1
	windows_i686_msvc@0.48.5
	windows_x86_64_gnu@0.42.1
	windows_x86_64_gnu@0.48.5
	windows_x86_64_gnullvm@0.42.1
	windows_x86_64_gnullvm@0.48.5
	windows_x86_64_msvc@0.42.1
	windows_x86_64_msvc@0.48.5
"

inherit cargo udev

DESCRIPTION="Speaker protection daemon for embedded Linux systems"
HOMEPAGE="https://github.com/AsahiLinux/speakersafetyd/"
SRC_URI="https://github.com/AsahiLinux/speakersafetyd/archive/refs/tags/${PV}.tar.gz -> ${PN}-${PV}.tar.gz
${CARGO_CRATE_URIS}"

LICENSE="MIT"
SLOT="0"
KEYWORDS="arm64"

DEPEND="
	virtual/rust
	media-libs/alsa-ucm-conf-asahi
"
RDEPEND="${DEPEND}"

QA_FLAGS_IGNORED="usr/bin/${PN}"

src_install() {
	emake DESTDIR="${D}" install || die
	doinitd "${FILESDIR}/speakersafetyd"
}

src_postinst() {
	udev_reload
	default
}