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

# Auto-Generated by cargo-ebuild 0.5.4-r1

EAPI=8

MY_PV="${PV/_p/-}"

CRATES="
	aho-corasick@1.1.3
	android-tzdata@0.1.1
	android_system_properties@0.1.5
	anstream@0.6.13
	anstyle@1.0.6
	anstyle-parse@0.2.3
	anstyle-query@1.0.2
	anstyle-wincon@3.0.2
	anyhow@1.0.82
	atty@0.2.14
	autocfg@1.2.0
	bindgen@0.69.4
	bitflags@2.5.0
	bumpalo@3.16.0
	camino@1.1.6
	cargo-platform@0.1.8
	cargo_metadata@0.15.4
	cc@1.0.95
	cexpr@0.6.0
	cfg-if@1.0.0
	chrono@0.4.38
	clang-sys@1.7.0
	clap@4.5.4
	clap_builder@4.5.2
	clap_derive@4.5.4
	clap_lex@0.7.0
	colorchoice@1.0.0
	core-foundation-sys@0.8.6
	either@1.11.0
	equivalent@1.0.1
	errno@0.3.8
	fastrand@2.0.2
	glob@0.3.1
	hashbrown@0.14.3
	heck@0.4.1
	heck@0.5.0
	hermit-abi@0.1.19
	hermit-abi@0.3.9
	home@0.5.9
	iana-time-zone@0.1.60
	iana-time-zone-haiku@0.1.2
	indexmap@2.2.6
	itertools@0.12.1
	itoa@1.0.11
	js-sys@0.3.69
	lazy_static@1.4.0
	lazycell@1.3.0
	libbpf-cargo@0.22.1
	libbpf-rs@0.22.1
	libbpf-sys@1.4.0+v1.4.0
	libc@0.2.153
	libloading@0.8.3
	libudev-sys@0.1.4
	linux-raw-sys@0.4.13
	log@0.4.21
	memchr@2.7.2
	memmap2@0.5.10
	memoffset@0.9.1
	minimal-lexical@0.2.1
	mio@0.8.11
	nix@0.27.1
	nom@7.1.3
	num-traits@0.2.18
	num_cpus@1.16.0
	num_enum@0.5.11
	num_enum_derive@0.5.11
	once_cell@1.19.0
	pkg-config@0.3.30
	prettyplease@0.2.19
	proc-macro-crate@1.3.1
	proc-macro2@1.0.81
	quote@1.0.36
	regex@1.10.4
	regex-automata@0.4.6
	regex-syntax@0.8.3
	rustc-hash@1.1.0
	rustix@0.38.33
	rustversion@1.0.15
	ryu@1.0.17
	scroll@0.11.0
	scroll_derive@0.11.1
	semver@1.0.22
	serde@1.0.198
	serde_derive@1.0.198
	serde_json@1.0.116
	shlex@1.3.0
	stderrlog@0.5.4
	strsim@0.11.1
	strum_macros@0.24.3
	syn@1.0.109
	syn@2.0.60
	tempfile@3.10.1
	termcolor@1.1.3
	thiserror@1.0.59
	thiserror-impl@1.0.59
	thread_local@1.1.8
	toml_datetime@0.6.5
	toml_edit@0.19.15
	udev@0.7.0
	unicode-ident@1.0.12
	utf8parse@0.2.1
	vsprintf@2.0.0
	wasi@0.11.0+wasi-snapshot-preview1
	wasm-bindgen@0.2.92
	wasm-bindgen-backend@0.2.92
	wasm-bindgen-macro@0.2.92
	wasm-bindgen-macro-support@0.2.92
	wasm-bindgen-shared@0.2.92
	which@4.4.2
	winapi@0.3.9
	winapi-i686-pc-windows-gnu@0.4.0
	winapi-util@0.1.6
	winapi-x86_64-pc-windows-gnu@0.4.0
	windows-core@0.52.0
	windows-sys@0.48.0
	windows-sys@0.52.0
	windows-targets@0.48.5
	windows-targets@0.52.5
	windows_aarch64_gnullvm@0.48.5
	windows_aarch64_gnullvm@0.52.5
	windows_aarch64_msvc@0.48.5
	windows_aarch64_msvc@0.52.5
	windows_i686_gnu@0.48.5
	windows_i686_gnu@0.52.5
	windows_i686_gnullvm@0.52.5
	windows_i686_msvc@0.48.5
	windows_i686_msvc@0.52.5
	windows_x86_64_gnu@0.48.5
	windows_x86_64_gnu@0.52.5
	windows_x86_64_gnullvm@0.48.5
	windows_x86_64_gnullvm@0.52.5
	windows_x86_64_msvc@0.48.5
	windows_x86_64_msvc@0.52.5
	winnow@0.5.40
"

inherit cargo

DESCRIPTION="An automatic HID-BPF loader based on udev events"
# Double check the homepage as the cargo_metadata crate
# does not provide this value so instead repository is used
HOMEPAGE="https://libevdev.pages.freedesktop.org/udev-hid-bpf/"
SRC_URI="
	${CARGO_CRATE_URIS}
	https://gitlab.freedesktop.org/libevdev/${PN}/-/archive/${MY_PV}/${PN}-${MY_PV}.tar.bz2
"
S="${WORKDIR}/${PN}-${MY_PV}"

# License set may be more restrictive as OR is not respected
# use cargo-license for a more accurate license picture
LICENSE="Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD BSD-2 Boost-1.0 GPL-2 ISC LGPL-2.1 MIT Unicode-DFS-2016 Unlicense"
SLOT="0"
KEYWORDS="~amd64"

DEPEND="virtual/libudev virtual/libelf"
RDEPEND="${DEPEND}"
BDEPEND="sys-devel/clang[llvm_targets_BPF]"

#QA_FLAGS_IGNORED="usr/bin/udev-hid-bpf"

src_install() {
	# this was added right after 1.0.0, uncomment on next release
	#newman ${S}/udev-hid-bpf.man udev-hid-bpf.1
	cargo_src_install
}