dev-util/maturin: add 1.10.0

Annoyingly two new tests unconditionally try to `pip install tomli`
in virtualenv "for <python-3.11" with the idea that it's going to test
every python versions including old ones, except that we don't. To keep
this simple, just going to skip these.

Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
This commit is contained in:
Ionen Wolkens 2025-11-10 06:33:21 -05:00
parent 6b810c648f
commit 6aab345bf3
No known key found for this signature in database
GPG Key ID: B24406B0B0AC4334
2 changed files with 159 additions and 0 deletions

View File

@ -1,3 +1,5 @@
DIST maturin-1.10.0-vendor.tar.xz 16226072 BLAKE2B 04974238c6fc5cf4fd5dbac36f1666e446222f492d391ff700ebee2f9c778cc78b9865f184322739662a360959192fafb760a34b8bad7fc085dc5b16de874c86 SHA512 861f6b53caafc8d44b855b7a60b87683e698b5c0fb194f55c1af6e9e004c635ce4aa1da0c3045d0e12537c19353537429b9fb79d7e865ffa8fb2fd8e95e53bef
DIST maturin-1.10.0.gh.tar.gz 586700 BLAKE2B ce079391b3fd7ef1947f976f06af88cb81b93b19fb4e35e7e768d2164a3e31fdc97437c0371dfde3a73f394709bd2a73036ff4737ef1c0508dc94e7b6e147f16 SHA512 bd5239995c0909a9cbb29e40f53c7ce0042e21a33acee344a98f0ea854ad81805c08d0bb303a056f69854be28cf6f88e1cffc0c2d9ed9ce9c1701b65d0340015
DIST maturin-1.9.4-vendor.tar.xz 15870760 BLAKE2B 8ea5a26d618fc2698ecf0a264a81d41a28b0e74602dc6004c6a72788c1b5f7e65e9efbc56e2e2b2418f550055ff4510bdb7d77445472da300a495d31a3e84a11 SHA512 901ff4dd5901ea21f6f0ef6c055e58f3592ef651f95c413669f4fabdc009c55a453247866ab23a4ebf4c0a1b987084eeb9719d0f474ec72587bc0fba964958e2
DIST maturin-1.9.4.gh.tar.gz 564039 BLAKE2B 968c3838ba27c358fca2d00c748ecc0b8a19ca4d0c2da61c6b2df9fb1a6387366bf9ff600a3850e9cc866fe1516e4be468f2eb229030a1d85a023e2d59106d02 SHA512 8fb6dcb1d75f47b41b3541b5084fdf3c64f4264b8f254a2767449963cde2f9f8dbef833273d245e87732ebfc8ff61139ef463b18888f422365361fc8fa966fca
DIST maturin-1.9.6-vendor.tar.xz 15789148 BLAKE2B 74b7b1b7ec6b0b0339f7833e6dbfe1ab77324edf6199a20e1820fb784da635ac5e60297201e225bc99b521a88eee75e9b45b8db447ad962585ee4cb158424fe1 SHA512 77a800cc9652529507628acbab7dd3c27fb80a3972499fd5c342054db4ae104c5e42d343f08d23fee56aa58d929c82a4f9c41c3cf172f4a3044b4f4279b1fe4a

View File

@ -0,0 +1,157 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
DISTUTILS_UPSTREAM_PEP517=standalone
PYTHON_COMPAT=( pypy3_11 python3_{11..14} )
RUST_MIN_VER=1.75.0
inherit cargo distutils-r1 flag-o-matic shell-completion toolchain-funcs
DESCRIPTION="Build and publish crates with pyo3, rust-cpython and cffi bindings"
HOMEPAGE="https://www.maturin.rs/"
SRC_URI="
https://github.com/PyO3/maturin/archive/refs/tags/v${PV}.tar.gz
-> ${P}.gh.tar.gz
https://dev.gentoo.org/~ionen/distfiles/${P}-vendor.tar.xz
"
# ^ tarball also includes test-crates' Cargo.lock(s) crates for tests
LICENSE="|| ( Apache-2.0 MIT ) doc? ( CC-BY-4.0 OFL-1.1 )"
LICENSE+="
0BSD Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD MIT MPL-2.0
Unicode-3.0 ZLIB BZIP2
" # crates
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
IUSE="doc +ssl test"
RESTRICT="!test? ( test )"
RDEPEND="
app-arch/xz-utils
app-arch/zstd:=
ssl? ( dev-libs/openssl:= )
"
DEPEND="${RDEPEND}"
BDEPEND="
virtual/pkgconfig
doc? ( app-text/mdbook )
test? (
$(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*')
dev-python/boltons[${PYTHON_USEDEP}]
dev-python/virtualenv[${PYTHON_USEDEP}]
dev-vcs/git
elibc_musl? ( dev-util/patchelf )
)
"
QA_FLAGS_IGNORED="usr/bin/${PN}"
src_prepare() {
distutils-r1_src_prepare
# we build the Rust executable (just once) via cargo_src_compile
sed -i -e '/setuptools_rust/d' -e '/rust_extensions/d' setup.py || die
if use test; then
# used to prevent use of network during tests, and silence pip
# if it finds unrelated issues with system packages (bug #913613)
cat > "${T}"/pip.conf <<-EOF || die
[global]
quiet = 2
[install]
no-index = yes
no-dependencies = yes
EOF
# uv does not work easily w/ network-sandbox, force virtualenv
sed -i 's/"uv"/"uv-not-found"/' tests/common/mod.rs || die
# increase timeouts for tests (bug #950332)
sed -i '/^#\[timeout/s/secs(60)/secs(300)/' tests/run.rs || die
# used by *git_sdist_generator tests
git init -q || die
git config --global user.email "larry@gentoo.org" || die
git config --global user.name "Larry the Cow" || die
git add . || die
git commit -qm init || die
fi
}
src_configure() {
export OPENSSL_NO_VENDOR=1
export ZSTD_SYS_USE_PKG_CONFIG=1
# https://github.com/rust-lang/stacker/issues/79
use s390 && ! is-flagq '-march=*' &&
append-cflags $(test-flags-CC -march=z10)
local myfeatures=(
# like release.yml + native-tls for better platform support than rustls
full
password-storage
$(usev ssl native-tls)
)
cargo_src_configure --no-default-features
}
python_compile_all() {
cargo_src_compile
use !doc || mdbook build -d html guide || die
if ! tc-is-cross-compiler; then
local maturin=$(cargo_target_dir)/maturin
"${maturin}" completions bash > "${T}"/${PN} || die
"${maturin}" completions fish > "${T}"/${PN}.fish || die
"${maturin}" completions zsh > "${T}"/_${PN} || die
else
ewarn "shell completion files were skipped due to cross-compilation"
fi
}
python_test() {
local -x MATURIN_TEST_PYTHON=${EPYTHON}
local -x PIP_CONFIG_FILE=${T}/pip.conf
local -x VIRTUALENV_SYSTEM_SITE_PACKAGES=1
# need this for (new) python versions not yet recognized by pyo3
local -x PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
local skip=(
# picky cli output test that easily benignly fail (bug #937992)
--skip cli_tests
# avoid need for wasm over a single hello world test
--skip integration_wasm_hello_world
# fragile depending on rust version, also wants libpypy*-c.so for pypy
--skip pyo3_no_extension_module
# unimportant tests that require uv, and not obvious to get it
# to work with network-sandbox (not worth the trouble)
--skip develop_hello_world::case_2
--skip develop_pyo3_ffi_pure::case_2
# compliance test using zig requires an old libc to pass (bug #946967)
--skip integration_pyo3_mixed_py_subdir
# these currently attempt to install tomli regardless of python version
--skip pep517_default_profile
--skip pep517_editable_profile
)
cargo_src_test -- "${skip[@]}"
}
python_install_all() {
dobin "$(cargo_target_dir)"/maturin
dodoc Changelog.md README.md
use doc && dodoc -r guide/html
if ! tc-is-cross-compiler; then
dobashcomp "${T}"/${PN}
dofishcomp "${T}"/${PN}.fish
dozshcomp "${T}"/_${PN}
fi
}