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

# Autogenerated by pycargoebuild 0.13.3

EAPI=8

CRATES="
	addr2line@0.22.0
	adler32@1.2.0
	adler@1.0.2
	ahash@0.8.11
	aho-corasick@1.1.3
	allocator-api2@0.2.18
	amdgpu-sysfs@0.17.0
	android-tzdata@0.1.1
	android_system_properties@0.1.5
	anes@0.1.6
	anstream@0.6.15
	anstyle-parse@0.2.5
	anstyle-query@1.1.1
	anstyle-wincon@3.0.4
	anstyle@1.0.8
	anyhow@1.0.86
	ash@0.37.3+1.3.251
	async-broadcast@0.7.1
	async-channel@2.3.1
	async-io@2.3.4
	async-lock@3.4.0
	async-process@2.2.4
	async-recursion@1.1.1
	async-signal@0.2.10
	async-task@4.7.1
	async-trait@0.1.81
	atomic-waker@1.1.2
	autocfg@1.3.0
	backtrace@0.3.73
	bitflags@1.3.2
	bitflags@2.6.0
	block-buffer@0.10.4
	blocking@1.6.1
	bumpalo@3.16.0
	bytemuck@1.16.3
	bytemuck_derive@1.7.0
	byteorder@1.5.0
	bytes@1.7.1
	cairo-rs@0.20.1
	cairo-sys-rs@0.20.0
	cast@0.3.0
	cc@1.1.12
	cfg-expr@0.15.8
	cfg-if@1.0.0
	cfg_aliases@0.2.1
	chrono@0.4.38
	ciborium-io@0.2.2
	ciborium-ll@0.2.2
	ciborium@0.2.2
	clap@4.5.16
	clap_builder@4.5.15
	clap_derive@4.5.13
	clap_lex@0.7.2
	colorchoice@1.0.2
	concurrent-queue@2.5.0
	core-foundation-sys@0.8.7
	core-foundation@0.9.4
	core-graphics-types@0.1.3
	core-graphics@0.23.2
	core-text@20.1.0
	core2@0.4.0
	cpufeatures@0.2.13
	crc32fast@1.4.2
	criterion-plot@0.5.0
	criterion@0.5.1
	crossbeam-deque@0.8.5
	crossbeam-epoch@0.9.18
	crossbeam-queue@0.3.11
	crossbeam-utils@0.8.20
	crunchy@0.2.2
	crypto-common@0.1.6
	cstr@0.2.12
	darling@0.20.10
	darling_core@0.20.10
	darling_macro@0.20.10
	dary_heap@0.3.6
	deranged@0.3.11
	diff@0.1.13
	digest@0.10.7
	dirs-next@2.0.0
	dirs-sys-next@0.1.2
	dlib@0.5.2
	dwrote@0.11.0
	either@1.13.0
	endi@1.1.0
	enum_dispatch@0.3.13
	enumflags2@0.7.10
	enumflags2_derive@0.7.10
	equivalent@1.0.1
	errno@0.3.9
	event-listener-strategy@0.5.2
	event-listener@5.3.1
	fastrand@2.1.0
	field-offset@0.3.6
	filetime@0.2.24
	float-ord@0.3.2
	flume@0.11.0
	fnv@1.0.7
	font-kit@0.13.2
	foreign-types-macros@0.2.3
	foreign-types-shared@0.3.1
	foreign-types@0.5.0
	fragile@2.0.0
	freetype-sys@0.20.1
	futures-channel@0.3.30
	futures-core@0.3.30
	futures-executor@0.3.30
	futures-io@0.3.30
	futures-lite@2.3.0
	futures-macro@0.3.30
	futures-sink@0.3.30
	futures-task@0.3.30
	futures-util@0.3.30
	futures@0.3.30
	gdk-pixbuf-sys@0.20.1
	gdk-pixbuf@0.20.1
	gdk4-sys@0.9.0
	gdk4@0.9.0
	generic-array@0.14.7
	getrandom@0.2.15
	gimli@0.29.0
	gio-sys@0.20.1
	gio@0.20.1
	glib-macros@0.20.1
	glib-sys@0.20.1
	glib@0.20.1
	gobject-sys@0.20.1
	graphene-rs@0.20.1
	graphene-sys@0.20.1
	gsk4-sys@0.9.0
	gsk4@0.9.0
	gtk4-macros@0.9.0
	gtk4-sys@0.9.0
	gtk4@0.9.0
	half@2.4.1
	hashbrown@0.14.5
	heck@0.4.1
	heck@0.5.0
	hermit-abi@0.3.9
	hermit-abi@0.4.0
	hex@0.4.3
	iana-time-zone-haiku@0.1.2
	iana-time-zone@0.1.60
	ident_case@1.0.1
	indexmap@2.4.0
	inotify-sys@0.1.5
	inotify@0.9.6
	is-terminal@0.4.13
	is_terminal_polyfill@1.70.1
	itertools@0.10.5
	itertools@0.13.0
	itoa@1.0.11
	js-sys@0.3.70
	kqueue-sys@1.0.4
	kqueue@1.0.8
	lazy_static@1.5.0
	libadwaita-sys@0.7.0
	libadwaita@0.7.0
	libc@0.2.156
	libdrm_amdgpu_sys@0.7.5
	libflate@2.1.0
	libflate_lz77@2.1.0
	libloading@0.7.4
	libloading@0.8.5
	libredox@0.1.3
	linux-raw-sys@0.4.14
	lock_api@0.4.12
	log@0.4.22
	malloc_buf@0.0.6
	matchers@0.1.0
	memchr@2.7.4
	memoffset@0.9.1
	miniz_oxide@0.7.4
	mio@0.8.11
	mio@1.0.2
	nanorand@0.7.0
	nix@0.29.0
	notify@6.1.1
	nu-ansi-term@0.46.0
	num-conv@0.1.0
	num-traits@0.2.19
	num_threads@0.1.7
	objc@0.2.7
	object@0.36.3
	once_cell@1.19.0
	oorandom@11.1.4
	ordered-stream@0.2.0
	os-release@0.1.0
	overload@0.1.1
	pango-sys@0.20.1
	pango@0.20.1
	parking@2.2.0
	parking_lot@0.12.3
	parking_lot_core@0.9.10
	pathfinder_geometry@0.5.1
	pathfinder_simd@0.5.4
	pciid-parser@0.7.2
	pin-project-lite@0.2.14
	pin-utils@0.1.0
	piper@0.2.4
	pkg-config@0.3.30
	plotters-backend@0.3.6
	plotters-cairo@0.7.0
	plotters-svg@0.3.6
	plotters@0.3.6
	polling@3.7.3
	powerfmt@0.2.0
	ppv-lite86@0.2.20
	pretty_assertions@1.4.0
	proc-macro-crate@3.1.0
	proc-macro2@1.0.86
	quote@1.0.36
	rand@0.8.5
	rand_chacha@0.3.1
	rand_core@0.6.4
	raw-window-handle@0.5.2
	rayon-core@1.12.1
	rayon@1.10.0
	redox_syscall@0.5.3
	redox_users@0.4.5
	regex-automata@0.1.10
	regex-automata@0.4.7
	regex-syntax@0.6.29
	regex-syntax@0.8.4
	regex@1.10.6
	relm4-components@0.9.1
	relm4-css@0.9.0
	relm4-macros@0.9.0
	relm4@0.9.0
	rle-decode-fast@1.0.3
	rustc-demangle@0.1.24
	rustc_version@0.4.0
	rustix@0.38.34
	rustversion@1.0.17
	ryu@1.0.18
	same-file@1.0.6
	scopeguard@1.2.0
	semver@1.0.23
	serde-error@0.1.2
	serde@1.0.208
	serde_derive@1.0.208
	serde_json@1.0.125
	serde_repr@0.1.19
	serde_spanned@0.6.7
	serde_with@3.9.0
	serde_with_macros@3.9.0
	serde_yaml@0.9.34+deprecated
	sha1@0.10.6
	sharded-slab@0.1.7
	shlex@1.3.0
	signal-hook-registry@1.4.2
	slab@0.4.9
	smallvec@1.13.2
	socket2@0.5.7
	spin@0.9.8
	static_assertions@1.1.0
	strsim@0.11.1
	syn@2.0.74
	system-deps@7.0.1
	tar@0.4.41
	target-lexicon@0.12.16
	tempfile@3.12.0
	thiserror-impl@1.0.63
	thiserror@1.0.63
	thread_local@1.1.8
	time-core@0.1.2
	time-macros@0.2.18
	time@0.3.36
	tinytemplate@1.2.1
	tokio-macros@2.4.0
	tokio@1.39.2
	toml@0.8.19
	toml_datetime@0.6.8
	toml_edit@0.21.1
	toml_edit@0.22.20
	tracing-attributes@0.1.27
	tracing-core@0.1.32
	tracing-log@0.2.0
	tracing-subscriber@0.3.18
	tracing@0.1.40
	tracker-macros@0.2.2
	tracker@0.2.2
	ttf-parser@0.20.0
	typenum@1.17.0
	uds_windows@1.1.0
	unicode-ident@1.0.12
	unsafe-libyaml@0.2.11
	utf8parse@0.2.2
	valuable@0.1.0
	vergen@8.3.2
	version-compare@0.2.0
	version_check@0.9.5
	vk-parse@0.12.0
	vulkano@0.34.1
	walkdir@2.5.0
	wasi@0.11.0+wasi-snapshot-preview1
	wasm-bindgen-backend@0.2.93
	wasm-bindgen-macro-support@0.2.93
	wasm-bindgen-macro@0.2.93
	wasm-bindgen-shared@0.2.93
	wasm-bindgen@0.2.93
	web-sys@0.3.70
	winapi-i686-pc-windows-gnu@0.4.0
	winapi-util@0.1.9
	winapi-x86_64-pc-windows-gnu@0.4.0
	winapi@0.3.9
	windows-core@0.52.0
	windows-sys@0.48.0
	windows-sys@0.52.0
	windows-sys@0.59.0
	windows-targets@0.48.5
	windows-targets@0.52.6
	windows_aarch64_gnullvm@0.48.5
	windows_aarch64_gnullvm@0.52.6
	windows_aarch64_msvc@0.48.5
	windows_aarch64_msvc@0.52.6
	windows_i686_gnu@0.48.5
	windows_i686_gnu@0.52.6
	windows_i686_gnullvm@0.52.6
	windows_i686_msvc@0.48.5
	windows_i686_msvc@0.52.6
	windows_x86_64_gnu@0.48.5
	windows_x86_64_gnu@0.52.6
	windows_x86_64_gnullvm@0.48.5
	windows_x86_64_gnullvm@0.52.6
	windows_x86_64_msvc@0.48.5
	windows_x86_64_msvc@0.52.6
	winnow@0.5.40
	winnow@0.6.18
	wio@0.2.2
	xattr@1.3.1
	xdg-home@1.3.0
	xml-rs@0.8.21
	yansi@0.5.1
	yeslogic-fontconfig-sys@5.0.0
	zbus@4.4.0
	zbus_macros@4.4.0
	zbus_names@3.0.0
	zerocopy-derive@0.7.35
	zerocopy@0.7.35
	zvariant@4.2.0
	zvariant_derive@4.2.0
	zvariant_utils@2.1.0
"

inherit cargo xdg

DESCRIPTION="Linux AMDGPU Controller"
HOMEPAGE="https://github.com/ilya-zlobintsev/LACT"
SRC_URI="
	https://github.com/ilya-zlobintsev/LACT/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
	${CARGO_CRATE_URIS}
"
S="${WORKDIR}/${P^^}"

LICENSE="MIT"
# Dependent crate licenses
LICENSE+="
	Apache-2.0 Apache-2.0-with-LLVM-exceptions CC0-1.0 GPL-3 ISC MIT
	MPL-2.0 Unicode-DFS-2016 ZLIB
"
SLOT="0"
KEYWORDS="~amd64"
IUSE="gui libadwaita"
REQUIRED_USE="libadwaita? ( gui )"

DEPEND="
	x11-libs/libdrm[video_cards_amdgpu]
	gui? (
		dev-libs/glib:2
		gui-libs/gtk:4[introspection]
		media-libs/fontconfig
		media-libs/freetype
		media-libs/graphene
		x11-libs/cairo
		x11-libs/pango
	)
	libadwaita? ( >=gui-libs/libadwaita-1.4.0:1 )
"
RDEPEND="
	${DEPEND}
	sys-apps/hwdata
"
BDEPEND="
	dev-util/blueprint-compiler
	virtual/pkgconfig
"

QA_FLAGS_IGNORED="usr/bin/lact"

src_configure() {
	sed -i "/^strip =/d" Cargo.toml || die
	sed -i "s|target/release|$(cargo_target_dir)|" Makefile || die

	local myfeatures=(
		$(usev gui lact-gui)
		$(usev libadwaita adw)
	)
	cargo_src_configure --no-default-features -p lact
}

src_install() {
	emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install
	newinitd res/lact-daemon-openrc lactd
}