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

# Autogenerated by pycargoebuild 0.17.2

EAPI=8

RUST_MIN_VER="1.87.0"

CRATES="
	aho-corasick@1.1.4
	android_system_properties@0.1.5
	anyhow@1.0.102
	async-broadcast@0.7.2
	async-channel@2.5.0
	async-executor@1.14.0
	async-io@2.6.0
	async-lock@3.4.2
	async-process@2.5.0
	async-recursion@1.1.1
	async-signal@0.2.14
	async-task@4.7.1
	async-trait@0.1.89
	atomic-waker@1.1.2
	autocfg@1.5.1
	bit-set@0.8.0
	bit-vec@0.8.0
	bitflags@2.13.0
	block-buffer@0.10.4
	blocking@1.6.2
	bumpalo@3.20.3
	bytes@1.11.1
	cargo-husky@1.5.0
	cc@1.2.64
	cfg-if@1.0.4
	cfg_aliases@0.2.1
	chrono-tz@0.10.4
	chrono@0.4.45
	cities@0.2.0
	concurrent-queue@2.5.0
	convert_case@0.10.0
	core-foundation-sys@0.8.7
	cpufeatures@0.2.17
	crossbeam-utils@0.8.21
	crossterm@0.29.0
	crossterm_winapi@0.9.1
	crypto-common@0.1.7
	derive_more-impl@2.1.1
	derive_more@2.1.1
	digest@0.10.7
	dirs-sys@0.5.0
	dirs@6.0.0
	document-features@0.2.12
	downcast-rs@1.2.1
	either@1.16.0
	endi@1.1.1
	enumflags2@0.7.12
	enumflags2_derive@0.7.12
	equivalent@1.0.2
	errno@0.3.14
	event-listener-strategy@0.5.4
	event-listener@5.4.1
	fastrand@2.4.1
	find-msvc-tools@0.1.9
	fixedbitset@0.5.7
	fnv@1.0.7
	foldhash@0.1.5
	fs2@0.4.3
	fsevent-sys@4.1.0
	futures-core@0.3.32
	futures-executor@0.3.32
	futures-io@0.3.32
	futures-lite@2.6.1
	futures-task@0.3.32
	futures-util@0.3.32
	generic-array@0.14.7
	geometry-rs@0.4.1
	getrandom@0.2.17
	getrandom@0.3.4
	getrandom@0.4.2
	hashbrown@0.15.5
	hashbrown@0.17.1
	heck@0.5.0
	hermit-abi@0.5.2
	hex@0.4.3
	iana-time-zone-haiku@0.1.2
	iana-time-zone@0.1.65
	id-arena@2.3.0
	indexmap@2.14.0
	inotify-sys@0.1.5
	inotify@0.11.2
	itertools@0.14.0
	itoa@1.0.18
	js-sys@0.3.102
	kqueue-sys@1.1.2
	kqueue@1.2.0
	leb128fmt@0.1.0
	libc@0.2.186
	libredox@0.1.17
	linux-raw-sys@0.12.1
	litrs@1.0.0
	lock_api@0.4.14
	log@0.4.32
	memchr@2.8.2
	memoffset@0.9.1
	mio@1.2.1
	multimap@0.10.1
	nix@0.31.3
	notify-types@2.1.0
	notify@8.2.0
	num-traits@0.2.19
	once_cell@1.21.4
	option-ext@0.2.0
	ordered-stream@0.2.0
	parking@2.2.1
	parking_lot@0.12.5
	parking_lot_core@0.9.12
	petgraph@0.8.3
	phf@0.12.1
	phf_shared@0.12.1
	pin-project-lite@0.2.17
	piper@0.2.5
	pkg-config@0.3.33
	polling@3.11.0
	ppv-lite86@0.2.21
	pqueue@0.1.0
	prettyplease@0.2.37
	proc-macro-crate@3.5.0
	proc-macro2@1.0.106
	proptest@1.11.0
	prost-build@0.14.4
	prost-derive@0.14.4
	prost-types@0.14.4
	prost@0.14.4
	quick-error@1.2.3
	quick-xml@0.39.4
	quote@1.0.45
	r-efi@5.3.0
	r-efi@6.0.0
	rand@0.9.4
	rand_chacha@0.9.0
	rand_core@0.9.5
	rand_xorshift@0.4.0
	redox_syscall@0.5.18
	redox_users@0.5.2
	regex-automata@0.4.14
	regex-syntax@0.8.11
	regex@1.12.4
	rtree_rs@0.1.4
	rustc_version@0.4.1
	rustix@1.1.4
	rustversion@1.0.22
	rusty-fork@0.3.1
	same-file@1.0.6
	scopeguard@1.2.0
	semver@1.0.28
	serde@1.0.228
	serde_core@1.0.228
	serde_derive@1.0.228
	serde_json@1.0.150
	serde_repr@0.1.20
	serde_spanned@1.1.1
	serial_test@3.5.0
	serial_test_derive@3.5.0
	sha256@1.6.0
	sha2@0.10.9
	shlex@2.0.1
	signal-hook-mio@0.2.5
	signal-hook-registry@1.4.8
	signal-hook@0.3.18
	signal-hook@0.4.4
	siphasher@1.0.3
	slab@0.4.12
	smallvec@1.15.2
	sunrise@3.0.0
	syn@2.0.118
	tempfile@3.27.0
	termios@0.3.3
	thiserror-impl@2.0.18
	thiserror@2.0.18
	tokio@1.52.3
	toml@1.1.2+spec-1.1.0
	toml_datetime@1.1.1+spec-1.1.0
	toml_edit@0.25.12+spec-1.1.0
	toml_parser@1.1.2+spec-1.1.0
	toml_writer@1.1.1+spec-1.1.0
	tracing-attributes@0.1.31
	tracing-core@0.1.36
	tracing@0.1.44
	typenum@1.20.1
	tzf-dist@0.0.2026-b-fix1
	tzf-rs@1.3.3
	uds_windows@1.2.1
	unarray@0.1.4
	unicode-ident@1.0.24
	unicode-segmentation@1.13.3
	unicode-xid@0.2.6
	uuid@1.23.3
	version_check@0.9.5
	wait-timeout@0.2.1
	walkdir@2.5.0
	wasi@0.11.1+wasi-snapshot-preview1
	wasip2@1.0.4+wasi-0.2.12
	wasip3@0.4.0+wasi-0.3.0-rc-2026-01-06
	wasm-bindgen-macro-support@0.2.125
	wasm-bindgen-macro@0.2.125
	wasm-bindgen-shared@0.2.125
	wasm-bindgen@0.2.125
	wasm-encoder@0.244.0
	wasm-metadata@0.244.0
	wasmparser@0.244.0
	wayland-backend@0.3.15
	wayland-client@0.31.14
	wayland-protocols-wlr@0.3.12
	wayland-protocols@0.32.12
	wayland-scanner@0.31.10
	wayland-sys@0.31.11
	winapi-i686-pc-windows-gnu@0.4.0
	winapi-util@0.1.11
	winapi-x86_64-pc-windows-gnu@0.4.0
	winapi@0.3.9
	windows-core@0.62.2
	windows-implement@0.60.2
	windows-interface@0.59.3
	windows-link@0.2.1
	windows-result@0.4.1
	windows-strings@0.5.1
	windows-sys@0.60.2
	windows-sys@0.61.2
	windows-targets@0.53.5
	windows_aarch64_gnullvm@0.53.1
	windows_aarch64_msvc@0.53.1
	windows_i686_gnu@0.53.1
	windows_i686_gnullvm@0.53.1
	windows_i686_msvc@0.53.1
	windows_x86_64_gnu@0.53.1
	windows_x86_64_gnullvm@0.53.1
	windows_x86_64_msvc@0.53.1
	winnow@1.0.3
	wit-bindgen-core@0.51.0
	wit-bindgen-rust-macro@0.51.0
	wit-bindgen-rust@0.51.0
	wit-bindgen@0.51.0
	wit-bindgen@0.57.1
	wit-component@0.244.0
	wit-parser@0.244.0
	zbus@5.16.0
	zbus_macros@5.16.0
	zbus_names@4.3.2
	zerocopy-derive@0.8.52
	zerocopy@0.8.52
	zmij@1.0.21
	zvariant@5.12.0
	zvariant_derive@5.12.0
	zvariant_utils@3.4.0
"

inherit cargo systemd

DESCRIPTION="Automatic blue light filter for Hyprland, Niri, and everything Wayland"
HOMEPAGE="https://github.com/psi4j/sunsetr"
SRC_URI="
	https://github.com/psi4j/sunsetr/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
	${CARGO_CRATE_URIS}
"

LICENSE="MIT"
# Dependent crate licenses
LICENSE+=" Apache-2.0 CC0-1.0 ISC MIT MPL-2.0 ODbL-1.0 Unicode-3.0 ZLIB"
SLOT="0"
KEYWORDS="~amd64"

src_compile() {
	local -x SUNSETR_VERSION="${PV}"
	cargo_src_compile
}

src_install() {
	cargo_src_install
	einstalldocs
	systemd_douserunit ${PN}.service
}

pkg_postinst() {
	elog "With the default auto backend, sunsetr uses Hyprland's native"
	elog "CTM protocol on Hyprland, and wlr-gamma-control on other compositors."
	elog "The optional hyprsunset backend requires hyprsunset >= 0.2.0,"
	elog "not packaged in ::guru or ::gentoo."
}