public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-zstandard] epel9: disable cffi backend to fix build on EPEL9 (resolves rhbz#2483911)
@ 2026-08-13  8:05 Dominik 'Rathann' Mierzejewski
  0 siblings, 0 replies; only message in thread
From: Dominik 'Rathann' Mierzejewski @ 2026-08-13  8:05 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/python-zstandard
            Branch : epel9
            Commit : 38682871a0b750172c1e7d168709367fe42a0c01
            Author : Dominik 'Rathann' Mierzejewski <dominik@greysector.net>
            Date   : 2026-08-12T22:47:32+02:00
            Stats  : +76/-22 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/python-zstandard/c/38682871a0b750172c1e7d168709367fe42a0c01?branch=epel9

            Log:
            disable cffi backend to fix build on EPEL9 (resolves rhbz#2483911)

- enable tests
- drop unnecessary patch

---
diff --git a/python-zstandard-py313.patch b/python-zstandard-py313.patch
deleted file mode 100644
index 641e646..0000000
--- a/python-zstandard-py313.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -up zstandard-0.22.0/c-ext/backend_c.c.orig zstandard-0.22.0/c-ext/backend_c.c
---- zstandard-0.22.0/c-ext/backend_c.c.orig	2023-11-01 07:04:15.000000000 +0100
-+++ zstandard-0.22.0/c-ext/backend_c.c	2023-11-22 12:51:36.452480448 +0100
-@@ -17,6 +17,8 @@
- 
- #include <sys/sysctl.h>
- 
-+#elif defined(__linux__) && defined(HAVE_UNISTD_H)
-+#include <unistd.h>
- #endif
- 
- #include "python-zstandard.h"

diff --git a/python-zstandard-relax-deps.patch b/python-zstandard-relax-deps.patch
new file mode 100644
index 0000000..706f753
--- /dev/null
+++ b/python-zstandard-relax-deps.patch
@@ -0,0 +1,64 @@
+diff -up zstandard-0.25.0/pyproject.toml.orig zstandard-0.25.0/pyproject.toml
+--- zstandard-0.25.0/pyproject.toml.orig	2025-09-14 22:35:55.000000000 +0200
++++ zstandard-0.25.0/pyproject.toml	2026-07-13 00:30:47.054553885 +0200
+@@ -25,7 +25,7 @@ dependencies = []
+ 
+ [project.optional-dependencies]
+ cffi = [
+-    "cffi~=1.17; platform_python_implementation != 'PyPy' and python_version < '3.14'",
++    "cffi~=1.14.5; platform_python_implementation != 'PyPy' and python_version < '3.14'",
+     "cffi>=2.0.0b; platform_python_implementation != 'PyPy' and python_version >= '3.14'",
+ ]
+ 
+@@ -35,16 +35,16 @@ Documentation = "https://python-zstandar
+ 
+ [build-system]
+ requires = [
+-    "cffi~=1.17; platform_python_implementation != 'PyPy' and python_version < '3.14'",
++    "cffi~=1.14.5; platform_python_implementation != 'PyPy' and python_version < '3.14'",
+     "cffi>=2.0.0b; platform_python_implementation != 'PyPy' and python_version >= '3.14'",
+     "packaging",
+-    "setuptools>=77.0.0",
++    "setuptools>=53.0.0",
+ ]
+ build-backend = "setuptools.build_meta"
+ 
+ [dependency-groups]
+ dev = [
+-    "cffi~=1.17; platform_python_implementation != 'PyPy' and python_version < '3.14'",
++    "cffi~=1.14.5; platform_python_implementation != 'PyPy' and python_version < '3.14'",
+     "cffi>=2.0.0b; platform_python_implementation != 'PyPy' and python_version >= '3.14'",
+     "hypothesis==6.111.0",
+     "mypy>=1.17.1",
+diff -up zstandard-0.25.0/setup_zstd.py.orig zstandard-0.25.0/setup_zstd.py
+--- zstandard-0.25.0/setup_zstd.py.orig	2025-09-14 22:35:55.000000000 +0200
++++ zstandard-0.25.0/setup_zstd.py	2026-07-12 22:49:06.772528817 +0200
+@@ -94,7 +94,11 @@ def get_c_extension(
+     # musl 1.1 doesn't define qsort_r. We need to force using the C90
+     # variant. ZDICT_QSORT officially introduced in 1.5.8. But our
+     # vendored copy backported to 1.5.7.
+-    for tag in packaging.tags.platform_tags():
++    try:
++        _platform_tags = packaging.tags.platform_tags()
++    except AttributeError:
++        _platform_tags = []
++    for tag in _platform_tags: 
+         if tag.startswith("musllinux_1_1_"):
+             extra_args.append("-DZDICT_QSORT=ZDICT_QSORT_C90")
+ 
+diff -up zstandard-0.25.0/make_cffi.py.orig zstandard-0.25.0/make_cffi.py
+--- zstandard-0.25.0/make_cffi.py.orig	2025-09-14 22:35:55.000000000 +0200
++++ zstandard-0.25.0/make_cffi.py	2026-07-12 22:50:26.131035846 +0200
+@@ -171,7 +171,11 @@ def normalize_output(output):
+ # musl 1.1 doesn't define qsort_r. We need to force using the C90
+ # variant.
+ define_macros = []
+-for tag in packaging.tags.platform_tags():
++try:
++    _platform_tags = packaging.tags.platform_tags()
++except AttributeError:
++    _platform_tags = []
++for tag in _platform_tags: 
+     if tag.startswith("musllinux_1_1_"):
+         define_macros.append(("ZDICT_QSORT", "ZDICT_QSORT_C90"))
+ 

diff --git a/python-zstandard.spec b/python-zstandard.spec
index f866727..aeaffb5 100644
--- a/python-zstandard.spec
+++ b/python-zstandard.spec
@@ -1,8 +1,4 @@
-%if 0%{?rhel}
-%bcond_with check
-%else
 %bcond_without check
-%endif
 
 %global pypi_name zstandard
 
@@ -11,12 +7,14 @@ compression library. A C extension and CFFI interface are provided.
 
 Name: python-%{pypi_name}
 Version: 0.25.0
-Release: 1%{?dist}
+Release: 2%{?dist}
 Summary: Zstandard bindings for Python
 License: (BSD-3-Clause OR GPL-2.0-only) AND MIT
 URL: https://github.com/indygreg/python-zstandard
 Source0: %{pypi_source}
-Patch0: %{name}-py313.patch
+# allow building with older setuptools
+# cffi must be present, but EL9 build is too old, so backend won't be built
+Patch0: %{name}-relax-deps.patch
 
 %description
 %{desc}
@@ -36,14 +34,12 @@ Provides: bundled(zstd) = 1.5.7
 %description -n python3-%{pypi_name}
 %{desc}
 
-%pyproject_extras_subpkg -n python3-%{pypi_name} cffi
-
 %prep
 %autosetup -p1 -n %{pypi_name}-%{version}
 rm -r %{pypi_name}.egg-info
 
 %generate_buildrequires
-%pyproject_buildrequires -x cffi
+%pyproject_buildrequires
 
 %build
 %pyproject_wheel
@@ -53,7 +49,8 @@ rm -r %{pypi_name}.egg-info
 %pyproject_save_files -L %{pypi_name}
 
 %check
-%pyproject_check_import
+# avoid trying to import the cffi submodule that is not built
+%pyproject_check_import -t
 %if %{with check}
 mv zstandard{,.src}
 export ZSTD_SLOW_TESTS=1
@@ -67,6 +64,11 @@ mv zstandard{.src,}
 %doc README.rst
 
 %changelog
+* Wed Aug 12 2026 Dominik Mierzejewski <dominik@greysector.net> - 0.25.0-2
+- disable cffi backend to fix build on EPEL9 (resolves rhbz#2483911)
+- enable tests
+- drop unnecessary patch
+
 * Mon Sep 22 2025 Dominik Mierzejewski <dominik@greysector.net> - 0.25.0-1
 - update to 0.25.0 (resolves rhbz#2395104)
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-13  8:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-13  8:05 [rpms/python-zstandard] epel9: disable cffi backend to fix build on EPEL9 (resolves rhbz#2483911) Dominik 'Rathann' Mierzejewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox