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

# Autogenerated by pycargoebuild 0.13.3

EAPI=8

CARGO_OPTIONAL=1
DISTUTILS_USE_PEP517=setuptools
DISTUTILS_EXT=1
PYTHON_COMPAT=( python3_{12..14} pypy3_11 )

CRATES="
	aes@0.8.4
	autocfg@1.5.0
	block-buffer@0.10.4
	cfg-if@1.0.3
	cipher@0.4.4
	core2@0.4.0
	cpufeatures@0.2.17
	crypto-common@0.1.6
	digest@0.10.7
	generic-array@0.14.7
	getrandom@0.2.16
	glass_pumpkin@1.7.0
	grammers-crypto@0.7.0
	heck@0.5.0
	hmac@0.12.1
	indoc@2.0.6
	inout@0.1.4
	libc@0.2.177
	memchr@2.7.6
	memoffset@0.9.1
	num-bigint@0.4.6
	num-integer@0.1.46
	num-traits@0.2.19
	once_cell@1.21.3
	pbkdf2@0.12.2
	portable-atomic@1.11.1
	proc-macro2@1.0.101
	pyo3-build-config@0.26.0
	pyo3-ffi@0.26.0
	pyo3-macros-backend@0.26.0
	pyo3-macros@0.26.0
	pyo3@0.26.0
	quote@1.0.41
	rand@0.8.5
	rand_core@0.6.4
	sha1@0.10.6
	sha2@0.10.9
	subtle@2.6.1
	syn@2.0.106
	target-lexicon@0.13.3
	typenum@1.19.0
	unicode-ident@1.0.19
	unindent@0.2.4
	version_check@0.9.5
	wasi@0.11.1+wasi-snapshot-preview1
"

inherit cargo distutils-r1 pypi

DESCRIPTION="Cryptographic utilities for Telegram"
HOMEPAGE="
	https://pypi.org/project/cryptg/
	https://github.com/cher-nov/cryptg/
"
SRC_URI+=" ${CARGO_CRATE_URIS}"

LICENSE="CC0-1.0"
# Dependent crate licenses
LICENSE+="
	Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD MIT Unicode-3.0
"
SLOT="0"
KEYWORDS="~amd64"

BDEPEND="
	${RUST_DEPEND}
	dev-python/setuptools-rust[${PYTHON_USEDEP}]
"

# rust does not use *FLAGS from make.conf, silence portage warning
QA_FLAGS_IGNORED=".*"

EPYTEST_PLUGINS=( pytest-import-check )

distutils_enable_tests import-check

src_unpack() {
	cargo_src_unpack
}
