diff --git a/_service b/_service
index 751c30f..0544aa1 100644
--- a/_service
+++ b/_service
@@ -1,9 +1,8 @@
- cryptography-43.0.0/src/rust
- Cargo.toml
+ cryptography-*
+ src/rust/Cargo.toml
zst
- false
diff --git a/no-pytest_benchmark.patch b/no-pytest_benchmark.patch
index 8751fa6..b183ae2 100644
--- a/no-pytest_benchmark.patch
+++ b/no-pytest_benchmark.patch
@@ -1,6 +1,5 @@
---
pyproject.toml | 31 -------------------------
- src/cryptography.egg-info/requires.txt | 2 -
tests/bench/test_aead.py | 40 ++++++++++++++++-----------------
tests/bench/test_ec_load.py | 8 +++---
tests/bench/test_hashes.py | 4 +--
@@ -21,7 +20,7 @@ Index: cryptography-43.0.0/pyproject.toml
"pytest-xdist",
"pretend",
"certifi",
-@@ -118,7 +116,7 @@ exclude = [
+@@ -117,7 +115,7 @@ exclude = [
]
[tool.pytest.ini_options]
@@ -30,7 +29,7 @@ Index: cryptography-43.0.0/pyproject.toml
console_output_style = "progress-even-when-capture-no"
markers = [
"skip_fips: this test is not executed in FIPS mode",
-@@ -140,33 +138,6 @@ module = [
+@@ -139,33 +137,6 @@ module = [
]
ignore_missing_imports = true
@@ -285,16 +284,3 @@ Index: cryptography-43.0.0/tests/bench/test_x509.py
- benchmark(bench)
+ bench
-Index: cryptography-43.0.0/tests/bench/test_fernet.py
-===================================================================
---- cryptography-43.0.0.orig/tests/bench/test_fernet.py
-+++ cryptography-43.0.0/tests/bench/test_fernet.py
-@@ -5,6 +5,6 @@
- from cryptography import fernet
-
-
--def test_fernet_encrypt(benchmark):
-+def test_fernet_encrypt():
- f = fernet.Fernet(fernet.Fernet.generate_key())
-- benchmark(f.encrypt, b"\x00" * 256)
-+ f.encrypt(b"\x00" * 256)
diff --git a/python-cryptography.changes b/python-cryptography.changes
index 6a68b28..a62d39d 100644
--- a/python-cryptography.changes
+++ b/python-cryptography.changes
@@ -1,3 +1,15 @@
+-------------------------------------------------------------------
+Mon Aug 12 20:36:00 UTC 2024 - Matej Cepl
+
+- Fix building optimized binaries with debuginfo.
+
+-------------------------------------------------------------------
+Wed Jul 31 21:45:43 UTC 2024 - Matej Cepl
+
+- Update building of Rust modules to use modern cargo_vendor
+ service
+- Remove unneeded use-offline-build.patch
+
-------------------------------------------------------------------
Fri Jul 26 10:33:45 UTC 2024 - Dirk Müller
diff --git a/python-cryptography.spec b/python-cryptography.spec
index b56edb2..e8bd730 100644
--- a/python-cryptography.spec
+++ b/python-cryptography.spec
@@ -37,7 +37,6 @@ Source0: https://files.pythonhosted.org/packages/source/c/cryptography/cr
# use `osc service manualrun` to regenerate
Source2: vendor.tar.zst
Source4: python-cryptography.keyring
-Patch1: use-offline-build.patch
# PATCH-FEATURE-OPENSUSE no-pytest_benchmark.patch mcepl@suse.com
# We don't need no benchmarking and coverage measurement
Patch4: no-pytest_benchmark.patch
@@ -46,13 +45,11 @@ BuildRequires: %{python_module devel}
BuildRequires: %{python_module exceptiongroup}
BuildRequires: %{python_module maturin}
BuildRequires: %{python_module pip}
-BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools-rust >= 1.7.0}
-BuildRequires: %{python_module setuptools-rust >= 1.7.0}
-BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: cargo >= 1.56.0
+BuildRequires: cargo-packaging
BuildRequires: fdupes
BuildRequires: libopenssl-devel
BuildRequires: pkgconfig
@@ -62,8 +59,10 @@ BuildRequires: zstd
BuildRequires: pkgconfig(libffi)
# python-base is not enough, we need the _ssl module
Requires: python
+Requires: python-bcrypt
%requires_eq python-cffi
%if %{with test}
+BuildRequires: %{python_module bcrypt}
BuildRequires: %{python_module certifi}
BuildRequires: %{python_module cryptography >= %{version}}
BuildRequires: %{python_module cryptography-vectors = %{version}}
@@ -71,6 +70,7 @@ BuildRequires: %{python_module hypothesis >= 1.11.4}
BuildRequires: %{python_module iso8601}
BuildRequires: %{python_module pretend}
BuildRequires: %{python_module pytest > 6.0}
+BuildRequires: %{python_module pytest-benchmark}
BuildRequires: %{python_module pytest-subtests}
BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module pytz}
@@ -90,9 +90,17 @@ functions.
%prep
%autosetup -a2 -p1 -n cryptography-%{version}
-rm -v src/rust/Cargo.lock
%build
+export CARGO_NET_OFFLINE=true
+export CARGO_PROFILE_RELEASE_DEBUG=true
+export CARGO_PROFILE_RELEASE_SPLIT_DEBUGINFO=off
+cd src/rust
+tar xfv %{S:2}
+rm -v Cargo.lock
+%cargo_build
+cd -
+
# https://github.com/pyca/cryptography/issues/9023
%global _lto_cflags %{nil}
export RUSTFLAGS=%{rustflags}
diff --git a/use-offline-build.patch b/use-offline-build.patch
deleted file mode 100644
index 5f6a1e4..0000000
--- a/use-offline-build.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Index: cryptography-43.0.0/pyproject.toml
-===================================================================
---- cryptography-43.0.0.orig/pyproject.toml
-+++ cryptography-43.0.0/pyproject.toml
-@@ -84,7 +84,8 @@ python-source = "src"
- python-packages = ["cryptography"]
- manifest-path = "src/rust/Cargo.toml"
- module-name = "cryptography.hazmat.bindings._rust"
--locked = true
-+locked = false
-+offline = true
- sdist-generator = "git"
- features = ["pyo3/abi3-py37"]
- include = [
diff --git a/vendor.tar.zst b/vendor.tar.zst
index 915ac69..dc929a0 100644
--- a/vendor.tar.zst
+++ b/vendor.tar.zst
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:60c28d9dc8f864cd112b91c911f7ddc7718117540c4b94c87c335289200aad9e
-size 1948651
+oid sha256:0189963d634540b54819a21f8a5ebac6b2a60f54e21369ba98259e743e8b08a7
+size 1950998