[packages/python3-url-py] - use vendored crates
qboosh
qboosh at pld-linux.org
Sat Jul 19 17:05:59 CEST 2025
commit 8db04a7760ce9d087b5ecd56f1333986a90697dd
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sat Jul 19 17:07:38 2025 +0200
- use vendored crates
python3-url-py.spec | 38 +++++++++++++++++++++++++++++++++++++-
1 file changed, 37 insertions(+), 1 deletion(-)
---
diff --git a/python3-url-py.spec b/python3-url-py.spec
index 1a7ceb0..25a6a5d 100644
--- a/python3-url-py.spec
+++ b/python3-url-py.spec
@@ -14,6 +14,10 @@ Group: Libraries/Python
#Source0Download: https://pypi.org/simple/url-py/
Source0: https://files.pythonhosted.org/packages/source/u/url-py/url_py-%{version}.tar.gz
# Source0-md5: f9fdebd536424d919033a4a89b296d4c
+# cargo vendor-filterer --platform='*-unknown-linux-*' --tier=2
+# tar cJf url_py-%{version}-vendor.tar.xz vendor Cargo.lock
+Source1: url_py-%{version}-vendor.tar.xz
+# Source1-md5: 971f255ed331bec3a4d4c85c5aec7797
URL: https://pypi.org/project/url-py/
BuildRequires: python3-build
BuildRequires: python3-devel >= 1:3.9
@@ -58,9 +62,32 @@ API documentation for Python url_py module.
Dokumentacja API modułu Pythona url_py.
%prep
-%setup -q -n url_py-%{version}
+%setup -q -n url_py-%{version} -a1
+
+# use our offline registry
+export CARGO_HOME="$(pwd)/.cargo"
+
+mkdir -p "$CARGO_HOME"
+cat >.cargo/config.toml <<EOF
+[source.crates-io]
+replace-with = "vendored-sources"
+
+[source.vendored-sources]
+directory = "$PWD/vendor"
+EOF
%build
+export CARGO_BUILD_JOBS="%{__jobs}"
+export CARGO_HOME="$(pwd)/.cargo"
+export CARGO_OFFLINE=true
+export RUSTFLAGS="%{rpmrustflags}"
+export CARGO_TERM_VERBOSE=true
+%ifarch x32
+export CARGO_BUILD_TARGET=x86_64-unknown-linux-gnux32
+export PKG_CONFIG_ALLOW_CROSS=1
+export PYO3_CROSS_LIB_DIR=%{_libdir}
+%endif
+
%py3_build_pyproject
%if %{with tests} || %{with doc}
@@ -81,6 +108,15 @@ PYTHONPATH=$(pwd)/build-3-ext \
%install
rm -rf $RPM_BUILD_ROOT
+export CARGO_HOME="$(pwd)/.cargo"
+export CARGO_OFFLINE=true
+export RUSTFLAGS="%{rpmrustflags}"
+export CARGO_TERM_VERBOSE=true
+%ifarch x32
+export CARGO_BUILD_TARGET=x86_64-unknown-linux-gnux32
+export PKG_CONFIG_ALLOW_CROSS=1
+%endif
+
%py3_install_pyproject
%clean
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3-url-py.git/commitdiff/8db04a7760ce9d087b5ecd56f1333986a90697dd
More information about the pld-cvs-commit
mailing list