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

# Autogenerated by pycargoebuild 0.15.1

EAPI=8

CRATES="
	aho-corasick@1.1.5
	android_system_properties@0.1.6
	anstream@1.0.0
	anstyle-parse@1.0.0
	anstyle-query@1.1.5
	anstyle-wincon@3.0.11
	anstyle@1.0.14
	autocfg@1.5.1
	bit_field@0.10.3
	bitflags@1.3.2
	bitflags@2.13.2
	block-buffer@0.10.4
	built@0.8.1
	bumpalo@3.20.3
	cc@1.6.0
	cfg-if@1.0.5
	cfg_aliases@0.2.2
	chacha20@0.10.2
	chrono@0.4.45
	clap-num@1.2.0
	clap-verbosity-flag@3.0.4
	clap@4.6.7
	clap_builder@4.6.7
	clap_complete@4.6.11
	clap_derive@4.6.7
	clap_lex@1.1.1
	clap_mangen@0.3.3
	colorchoice@1.0.5
	core-foundation-sys@0.8.7
	cpufeatures@0.2.17
	cpufeatures@0.3.1
	crypto-common@0.1.7
	darling@0.20.11
	darling_core@0.20.11
	darling_macro@0.20.11
	defmt-macros@1.1.1
	defmt-parser@1.0.0
	defmt@1.1.1
	digest@0.10.7
	dmidecode@1.0.1
	embed-resource@3.0.11
	env_filter@2.0.0
	env_logger@0.11.11
	equivalent@1.0.2
	find-msvc-tools@0.1.14
	fnv@1.0.7
	futures-core@0.3.34
	futures-task@0.3.34
	futures-util@0.3.34
	generic-array@0.14.7
	getrandom@0.4.3
	git2@0.21.0
	guid-create@0.5.2
	hashbrown@0.17.1
	heck@0.5.0
	hidapi@2.6.7
	iana-time-zone-haiku@0.1.2
	iana-time-zone@0.1.65
	ident_case@1.0.1
	indexmap@2.14.2
	is_terminal_polyfill@1.70.2
	jiff-core@0.1.1
	jiff-static@0.2.37
	jiff@0.2.37
	jobserver@0.1.35
	js-sys@0.3.106
	lazy_static@1.5.1
	libc@0.2.190
	libgit2-sys@0.18.8+1.9.7
	libloading@0.8.9
	libusb1-sys@0.7.0
	libz-sys@1.1.29
	lock_api@0.4.14
	log@0.4.34
	memchr@2.8.3
	nix@0.31.3
	no-std-compat@0.4.1
	num-complex@0.4.6
	num-derive@0.5.1
	num-integer@0.1.47
	num-iter@0.1.46
	num-rational@0.4.2
	num-traits@0.2.19
	num@0.4.3
	nvml-wrapper-sys@0.10.0
	nvml-wrapper@0.13.0
	once_cell@1.21.4
	once_cell_polyfill@1.70.2
	pin-project-lite@0.2.17
	pkg-config@0.3.34
	plain@0.2.3
	portable-atomic-util@0.2.8
	portable-atomic@1.15.0
	proc-macro2@1.0.107
	ptr_meta@0.3.2
	ptr_meta_derive@0.3.2
	quote@1.0.47
	r-efi@6.0.0
	rand@0.10.3
	rand_core@0.10.1
	regex-automata@0.4.18
	regex-syntax@0.8.11
	regex@1.13.1
	roff@1.1.1
	rusb@0.9.4
	rustc_version@0.4.1
	rustversion@1.0.23
	scopeguard@1.2.0
	semver@1.0.28
	serde_core@1.0.229
	serde_derive@1.0.229
	serde_spanned@1.1.1
	sha1@0.10.7
	sha2@0.10.9
	shlex@2.0.1
	slab@0.4.12
	smartmon@0.1.0
	spin@0.12.3
	spin@0.9.9
	static_assertions@1.1.0
	static_vcruntime@3.0.0
	strsim@0.11.1
	syn@2.0.119
	syn@3.0.6
	thiserror-impl@1.0.69
	thiserror-impl@2.0.21
	thiserror@1.0.69
	thiserror@2.0.21
	toml@1.1.6+spec-1.1.0
	toml_datetime@1.1.1+spec-1.1.0
	toml_parser@1.1.3+spec-1.1.0
	toml_writer@1.1.2+spec-1.1.0
	typenum@1.20.1
	ucs2@0.3.3
	uefi-macros@0.20.0
	uefi-raw@0.17.0
	uefi@0.41.0
	uguid@2.2.1
	unicode-ident@1.0.26
	utf8parse@0.2.2
	uuid@1.27.0
	vcpkg@0.2.15
	version_check@0.9.5
	vswhom-sys@0.1.3
	vswhom@0.1.0
	wasm-bindgen-macro-support@0.2.129
	wasm-bindgen-macro@0.2.129
	wasm-bindgen-shared@0.2.129
	wasm-bindgen@0.2.129
	winapi-i686-pc-windows-gnu@0.4.0
	winapi-x86_64-pc-windows-gnu@0.4.0
	winapi@0.3.9
	windows-collections@0.3.2
	windows-core@0.62.2
	windows-future@0.3.2
	windows-implement@0.60.2
	windows-interface@0.59.3
	windows-link@0.100.0
	windows-link@0.2.1
	windows-numerics@0.3.1
	windows-result@0.4.1
	windows-strings@0.5.1
	windows-sys@0.59.0
	windows-sys@0.61.2
	windows-targets@0.52.6
	windows-threading@0.2.1
	windows-version@0.100.0
	windows@0.62.2
	windows_aarch64_gnullvm@0.52.6
	windows_aarch64_msvc@0.52.6
	windows_i686_gnu@0.52.6
	windows_i686_gnullvm@0.52.6
	windows_i686_msvc@0.52.6
	windows_x86_64_gnu@0.52.6
	windows_x86_64_gnullvm@0.52.6
	windows_x86_64_msvc@0.52.6
	winnow@1.0.4
	winreg@0.55.0
	winreg@0.56.0
	winresource@0.1.31
	wrapcenum-derive@0.4.1
	zerocopy-derive@0.8.59
	zerocopy@0.8.59
"

RUST_MIN_VER="1.95.0"

inherit shell-completion cargo

DESCRIPTION="Tool to control Framework Computer systems"
HOMEPAGE="https://github.com/FrameworkComputer/framework-system"
SRC_URI="
	https://github.com/FrameworkComputer/framework-system/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz
	${CARGO_CRATE_URIS}
"
S="${WORKDIR}/framework-system-${PV}/${PN}"

LICENSE="BSD"
# Dependent crate licenses
LICENSE+=" GPL-2+ ISC MIT MPL-2.0 Unicode-3.0"
SLOT="0"
KEYWORDS="~amd64"

QA_FLAGS_IGNORED="usr/bin/.*"

DOCS=(
	README.md
	support-matrices.md
)

src_unpack() {
	cargo_src_unpack

	# if more packages require this sort of hack, probably want to change the eclass
	sed -e "s|'https://github.com/FrameworkComputer/uefi-rs'|crates-io|" \
		-i ${CARGO_HOME}/config.toml || die
}

src_install() {
	cargo_src_install

	pushd "${S%${PN}}" > /dev/null || die
	dodoc "${DOCS[@]}"

	dobashcomp framework_tool/completions/bash/${PN}
	dozshcomp framework_tool/completions/zsh/_${PN}
	popd > /dev/null || die
}
