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

# Autogenerated by pycargoebuild 0.15.0

EAPI=8

CRATES="
	cc@1.2.39
	cfg-if@1.0.3
	colored@3.0.0
	cpu-monitor@0.1.1
	find-msvc-tools@0.1.2
	hidapi@2.6.3
	libc@0.2.176
	libloading@0.8.9
	linux_proc@0.1.1
	pkg-config@0.3.32
	shlex@1.3.0
	winapi-i686-pc-windows-gnu@0.4.0
	winapi-x86_64-pc-windows-gnu@0.4.0
	winapi@0.3.9
	windows-link@0.2.0
	windows-sys@0.48.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
"

RUST_MIN_VER="1.80"

inherit cargo systemd

DESCRIPTION="Linux version for the DeepCool Digital Windows software."
HOMEPAGE="https://github.com/Nortank12/deepcool-digital-linux"
SRC_URI="
	https://github.com/Nortank12/${PN}/archive/v${PV}-alpha.tar.gz -> ${PN}-${PV}-alpha.tar.gz
	${CARGO_CRATE_URIS}
"

S="${WORKDIR}/${PN}-${PV}-alpha"

LICENSE="GPL-3"
# Dependent crate licenses
LICENSE+=" ISC MIT MPL-2.0"
SLOT="0"
KEYWORDS="~amd64"

src_unpack() {
	cargo_src_unpack
}

src_compile() {
	cargo_src_compile
}

src_install() {
	cargo_src_install

	dobin target/release/deepcool-digital-linux

	newinitd "${FILESDIR}"/deepcool-digital-linux.initd deepcool-digital-linux
	systemd_dounit "${FILESDIR}"/deepcool-digital-linux.service
}
