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

# Autogenerated by pycargoebuild 0.14.0

EAPI=8

CRATES="
	addr2line@0.22.0
	adler@1.0.2
	aho-corasick@1.1.3
	anstream@0.6.15
	anstyle-parse@0.2.5
	anstyle-query@1.1.1
	anstyle-wincon@3.0.4
	anstyle@1.0.8
	async-trait@0.1.81
	autocfg@1.3.0
	aws-lc-rs@1.8.1
	aws-lc-sys@0.20.1
	backtrace@0.3.73
	base64@0.22.1
	bincode@1.3.3
	bindgen@0.69.4
	bitflags@2.6.0
	bytes@1.7.1
	cc@1.1.8
	cexpr@0.6.0
	cfg-if@1.0.0
	clang-sys@1.8.1
	cmake@0.1.50
	colorchoice@1.0.2
	dunce@1.0.5
	either@1.13.0
	env_filter@0.1.2
	env_logger@0.11.5
	errno@0.3.9
	fs_extra@1.3.0
	futures-channel@0.3.31
	futures-core@0.3.31
	futures-executor@0.3.31
	futures-io@0.3.31
	futures-macro@0.3.31
	futures-sink@0.3.31
	futures-task@0.3.31
	futures-util@0.3.31
	futures@0.3.31
	getrandom@0.2.15
	gimli@0.29.0
	glob@0.3.1
	heck@0.5.0
	hermit-abi@0.3.9
	home@0.5.9
	humantime@2.1.0
	indoc@2.0.5
	is_terminal_polyfill@1.70.1
	itertools@0.12.1
	itoa@1.0.11
	jobserver@0.1.32
	lazy_static@1.5.0
	lazycell@1.3.0
	libc@0.2.155
	libloading@0.8.5
	linux-raw-sys@0.4.14
	lock_api@0.4.12
	log@0.4.22
	matchers@0.1.0
	memchr@2.7.4
	memoffset@0.9.1
	minimal-lexical@0.2.1
	miniz_oxide@0.7.4
	mio@1.0.1
	mirai-annotations@1.12.0
	nom@7.1.3
	nu-ansi-term@0.46.0
	object@0.36.3
	once_cell@1.19.0
	overload@0.1.1
	parking_lot@0.12.3
	parking_lot_core@0.9.10
	paste@1.0.15
	pin-project-lite@0.2.14
	pin-utils@0.1.0
	portable-atomic@1.7.0
	prettyplease@0.2.20
	proc-macro2@1.0.94
	pyo3-async-runtimes-macros@0.24.0
	pyo3-async-runtimes@0.24.0
	pyo3-build-config@0.24.0
	pyo3-ffi@0.24.0
	pyo3-macros-backend@0.24.0
	pyo3-macros@0.24.0
	pyo3@0.24.0
	quote@1.0.36
	redox_syscall@0.5.3
	regex-automata@0.1.10
	regex-automata@0.4.7
	regex-syntax@0.6.29
	regex-syntax@0.8.4
	regex@1.10.6
	ring@0.17.8
	rustc-demangle@0.1.24
	rustc-hash@1.1.0
	rustix@0.38.34
	rustls-pemfile@2.1.3
	rustls-pki-types@1.8.0
	rustls-webpki@0.102.6
	rustls@0.23.12
	ryu@1.0.18
	scopeguard@1.2.0
	serde@1.0.204
	serde_derive@1.0.204
	serde_json@1.0.122
	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
	subtle@2.6.1
	syn@2.0.100
	target-lexicon@0.13.2
	test-log-macros@0.2.16
	test-log@0.2.16
	thiserror-impl@1.0.63
	thiserror@1.0.63
	thread_local@1.1.8
	tokio-macros@2.4.0
	tokio-rustls@0.26.0
	tokio@1.39.2
	tracing-core@0.1.33
	tracing-log@0.2.0
	tracing-subscriber@0.3.19
	tracing@0.1.41
	unicode-ident@1.0.12
	unindent@0.2.3
	untrusted@0.9.0
	utf8parse@0.2.2
	valuable@0.1.0
	wasi@0.11.0+wasi-snapshot-preview1
	webpki-roots@0.26.6
	webpki@0.22.4
	which@4.4.2
	winapi-i686-pc-windows-gnu@0.4.0
	winapi-x86_64-pc-windows-gnu@0.4.0
	winapi@0.3.9
	windows-sys@0.52.0
	windows-targets@0.52.6
	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
	zeroize@1.8.1
	zeroize_derive@1.4.2
"

PYTHON_COMPAT=( python3_{11..13}  )

inherit cargo python-r1

DESCRIPTION="Proton VPN local agent written in Rust"
HOMEPAGE="https://github.com/ProtonVPN/local-agent-rs"

SRC_URI="
	https://github.com/ProtonVPN/local-agent-rs/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz
	${CARGO_CRATE_URIS}
"

S="${WORKDIR}/local-agent-rs-${PV}/python-proton-vpn-local-agent"
LICENSE="GPL-3+"

# Dependent crate licenses
LICENSE+="
	Apache-2.0
	Apache-2.0-with-LLVM-exceptions
	BSD
	ISC
	MIT
	MPL-2.0
	openssl
	Unicode-DFS-2016
"

SLOT="0"
KEYWORDS="~amd64"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

RDEPEND="${PYTHON_DEPS}"

src_install() {
	einstalldocs

	pushd target/release &>> /dev/null || die
	mv libpython_proton_vpn_local_agent.so local_agent.abi3.so || die
	popd &>> /dev/null || die

	python_moduleinto proton/vpn
	python_foreach_impl python_domodule target/release/local_agent.abi3.so
}