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

EAPI=8

CRATES="
    atomic-0.6.1
    autocfg-1.5.0
    block-buffer-0.10.4
    bumpalo-3.19.0
    bytemuck-1.24.0
    cfg-if-1.0.4
    crypto-common-0.1.6
    digest-0.10.7
    generic-array-0.14.9
    getrandom-0.2.16
    getrandom-0.3.4
    heck-0.5.0
    indoc-2.0.6
    js-sys-0.3.81
    libc-0.2.177
    log-0.4.28
    md-5-0.10.6
    memoffset-0.9.1
    once_cell-1.21.3
    portable-atomic-1.11.1
    ppv-lite86-0.2.21
    proc-macro2-1.0.101
    pyo3-0.26.0
    pyo3-build-config-0.26.0
    pyo3-ffi-0.26.0
    pyo3-macros-0.26.0
    pyo3-macros-backend-0.26.0
    quote-1.0.41
    r-efi-5.3.0
    rand-0.8.5
    rand_chacha-0.3.1
    rand_core-0.6.4
    rustversion-1.0.22
    sha1_smol-1.0.1
    syn-2.0.107
    target-lexicon-0.13.3
    typenum-1.19.0
    unicode-ident-1.0.19
    unindent-0.2.4
    uuid-1.18.1
    version_check-0.9.5
    wasi-0.11.1+wasi-snapshot-preview1
    wasip2-1.0.1+wasi-0.2.4
    wasm-bindgen-0.2.104
    wasm-bindgen-backend-0.2.104
    wasm-bindgen-macro-0.2.104
    wasm-bindgen-macro-support-0.2.104
    wasm-bindgen-shared-0.2.104
    wit-bindgen-0.46.0
    zerocopy-0.8.27
    zerocopy-derive-0.8.27
    "

DISTUTILS_USE_PEP517=maturin
PYTHON_COMPAT=( python3_{12..14} )
DISTUTILS_EXT=1  

RUST_MIN_VER="1.80.0"

inherit cargo distutils-r1 pypi

DESCRIPTION="Fast UUID library with Python bindings to Rust's UUID crate"
HOMEPAGE="https://github.com/fastuuid/fastuuid"

SRC_URI+="
	${CARGO_CRATE_URIS}
"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~x86"
IUSE="test"
RESTRICT="!test? ( test )"

RDEPEND="
        >=dev-lang/rust-bin-${RUST_MIN_VER}:=
"
DEPEND="${RDEPEND}
    test? (
        dev-python/pytest[${PYTHON_USEDEP}]
    )
"
BDEPEND="
    >=dev-util/maturin-1.0[${PYTHON_USEDEP}]
"

distutils_enable_tests pytest

QA_FLAGS_IGNORED=".*site-packages/fastuuid/.*\.so"  # Ignore PIC/LTO flags on Rust SO