mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-24 11:37:20 -08:00
dev-util/maturin: add 1.13.2
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
This commit is contained in:
@@ -2,3 +2,5 @@ DIST maturin-1.12.6-vendor.tar.xz 19339996 BLAKE2B 5fa56bde7c2445eebd51802e58ae5
|
||||
DIST maturin-1.12.6.gh.tar.gz 650246 BLAKE2B ea808aac177168947c059506ae19c53d322811fc8c0c20c01cf8a40364344daca0a3ffba09032352b0faea2f3f88286509d5fc4434658f30fbe6971aaa6d657f SHA512 49d4e6d759be491f7c689c37738586f0059ec4c0067ed9862858b124aad904504e7af44d2b58c1aa123b268a536ab2bdecef53564c8a0e649e37678fdf0170be
|
||||
DIST maturin-1.13.1-vendor.tar.xz 21185996 BLAKE2B 1f1dfd72948296a29e70de2dc75b76dbb9569ca24bc77f09123bc3c06895bf1e61c2b02da3bec3e4c38dbcc1f560a89a6982cbf7741157a247c9cf7fa7e3b8ae SHA512 98d3c1905d9bce620a28d4e9deceef16ee8a26e837cc029758b807de706370906fb12cdec3a827cdc20ae9df72c33907a3432432501dbcdcd458c328fb07cac0
|
||||
DIST maturin-1.13.1.gh.tar.gz 727220 BLAKE2B 33495999ede9aaa47e37a89c68fceb3bed7d9a473a45253a3960cd101a938a72834c68b4fa8638af4f758206fcbc712fbd892f181ff889a405ba33fe632cd546 SHA512 b5487a89d3a400467dcb381f80e0e33bccf5bd28272460c781452862887cc1244b89ed6abab7099c95ace0fa247b71ac1eaedce2da4707338a579f33c8087d29
|
||||
DIST maturin-1.13.2-vendor.tar.xz 21259304 BLAKE2B 0b30000345c42a23bd732f5b9ead6643ce634ff8f6bde62f37a13664e9d1e62367b9597562b1c760fea0a38d5e82204c126a873f5b1b606adc67de98ce92185e SHA512 3a3fe108f5b0fee1f77c0484c1db3877e39b07145f7aa9c8ebe760e8f1a8a3fd6fb1d90be403bc243624c6451de1ef973f789af23fbb24e4387c7728b18298c2
|
||||
DIST maturin-1.13.2.gh.tar.gz 759073 BLAKE2B 3ae9ccfd1eb04e3d3571c9078bc7d2a4e55bc96cd789dd43d660c5175fa5fb8669849a548dd961caf0b55a8ee702f8d684435d6788753748deb279b3f40b9555 SHA512 c24f6186a16105de8b75b117333fe16245bed4294bea64479a0e2a2f90fc7ab40aed9078f8c10df45da85dccf64061a284c7e261f32ae5c3c6ee5adcda644dde
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
# Copyright 1999-2026 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.88.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://distfiles.gentoo.org/pub/dev/ionen@gentoo.org/${P}-vendor.tar.xz
|
||||
"
|
||||
# ^ tarball also includes test-crates' Cargo.lock(s) crates for tests
|
||||
|
||||
LICENSE="|| ( Apache-2.0 MIT ) doc? ( Apache-2.0 OFL-1.1 )"
|
||||
LICENSE+="
|
||||
0BSD Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD
|
||||
CDLA-Permissive-2.0 ISC MIT MIT-0 MPL-2.0 openssl 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-0.5 )
|
||||
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
|
||||
|
||||
# needed by several sdist:: 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 "${T}"/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 CARGO_SKIP_TESTS=(
|
||||
# picky cli output test that easily benignly fail (bug #937992)
|
||||
cli_tests
|
||||
# fragile depending on rust version, also wants libpypy*-c.so for pypy
|
||||
errors::pyo3_no_extension_module
|
||||
# fails for unsupported rust targets, non-issue here (bug #973104)
|
||||
errors::pypi_compatibility_linux_tag
|
||||
# unimportant tests that require uv, and not obvious to get it
|
||||
# to work with network-sandbox (not worth the trouble)
|
||||
develop::develop_uv_cases::case_1_hello_world
|
||||
develop::develop_uv_cases::case_2_pyo3_ffi_pure
|
||||
# compliance tests using zig (if present) need old libc (bug #946967)
|
||||
integration::integration_cases::case_07_cffi_mixed_py_subdir
|
||||
integration::integration_cases::case_16_pyo3_stub_generation_zig
|
||||
# avoid need for wasm over a single hello world test
|
||||
integration::integration_wasm_hello_world
|
||||
# these currently attempt to install tomli regardless of python version
|
||||
pep517::pep517_default_profile
|
||||
pep517::pep517_editable_profile
|
||||
# unimportant and simpler to skip, does not work with just `git init`
|
||||
sdist::lib_with_parent_workspace_git_dep_sdist
|
||||
)
|
||||
|
||||
cargo_src_test
|
||||
}
|
||||
|
||||
python_install_all() {
|
||||
dobin "$(cargo_target_dir)"/maturin
|
||||
|
||||
dodoc Changelog.md README.md
|
||||
use doc && dodoc -r "${T}"/html
|
||||
|
||||
if ! tc-is-cross-compiler; then
|
||||
dobashcomp "${T}"/${PN}
|
||||
dofishcomp "${T}"/${PN}.fish
|
||||
dozshcomp "${T}"/_${PN}
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user