commit:     88f355bfa33622b26d1a9d958e1593527cf3dc97
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  5 05:32:35 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Oct  5 05:32:35 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=88f355bf

dev-python/bcrypt: add workaround for sys-cluster/ceph

Do as Fedora have done and enable the pyo3_unsafe_allow_subinterpreters
feature temporarily for the benefit of sys-cluster/ceph.

It's not ideal but it's only going to affect people who choose to use
it in their applications and that should only be ceph. From what I've read,
ceph was using these the whole time, just the check wasn't firing.

Bug: https://bugs.gentoo.org/920906
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-python/bcrypt/bcrypt-4.2.0-r1.ebuild | 90 ++++++++++++++++++++++++++++++++
 1 file changed, 90 insertions(+)

diff --git a/dev-python/bcrypt/bcrypt-4.2.0-r1.ebuild 
b/dev-python/bcrypt/bcrypt-4.2.0-r1.ebuild
new file mode 100644
index 000000000000..f2f6e6cf8b84
--- /dev/null
+++ b/dev-python/bcrypt/bcrypt-4.2.0-r1.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..13} pypy3 )
+
+CRATES="
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]+wasi-snapshot-preview1
+       [email protected]
+"
+
+inherit cargo distutils-r1 pypi
+
+DESCRIPTION="Modern password hashing for software and servers"
+HOMEPAGE="
+       https://github.com/pyca/bcrypt/
+       https://pypi.org/project/bcrypt/
+"
+SRC_URI+="
+       ${CARGO_CRATE_URIS}
+"
+
+LICENSE="Apache-2.0"
+# Dependent crate licenses
+LICENSE+=" Apache-2.0-with-LLVM-exceptions BSD MIT Unicode-DFS-2016"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+
+BDEPEND="
+       >=dev-python/setuptools-rust-1.7.0[${PYTHON_USEDEP}]
+"
+
+# Rust
+QA_FLAGS_IGNORED="usr/lib.*/py.*/site-packages/bcrypt/_bcrypt.*.so"
+
+distutils_enable_tests pytest
+
+export UNSAFE_PYO3_SKIP_VERSION_CHECK=1
+
+python_configure() {
+       # Workaround for sys-cluster/ceph (bug #920906)
+       # https://github.com/pyca/bcrypt/issues/694
+       # https://github.com/PyO3/pyo3/issues/3451
+       export RUSTFLAGS="${RUSTFLAGS} --cfg pyo3_unsafe_allow_subinterpreters"
+}
+
+python_test() {
+       local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+       epytest tests
+}

Reply via email to