commit:     85d5f8711e34207fdf5aa4a5796972a937b81b28
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon Nov  4 20:01:33 2024 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Nov  4 20:02:49 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=85d5f871

dev-python/dulwich-0.22.4: avoid hard rust dep

hack setup.py not to require setuptools_rust so a rust-free system can
install this Pure Python package with USE=-native-extensions

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 dev-python/dulwich/dulwich-0.22.4.ebuild | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/dev-python/dulwich/dulwich-0.22.4.ebuild 
b/dev-python/dulwich/dulwich-0.22.4.ebuild
index 294fd2a15e19..20b5987431a8 100644
--- a/dev-python/dulwich/dulwich-0.22.4.ebuild
+++ b/dev-python/dulwich/dulwich-0.22.4.ebuild
@@ -73,6 +73,18 @@ src_unpack() {
        cargo_src_unpack
 }
 
+src_prepare() {
+       default
+
+       if use !native-extensions; then
+               # avoid hard dep on rust via setuptools_rust
+           sed -i \
+            -e '/from setuptools_rust/d' \
+            -e '/^rust_extensions = \[/,/^\]/d' \
+            setup.py || die
+       fi
+}
+
 python_compile() {
        unset PURE
        # TODO: enable Rust extensions

Reply via email to