public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Benjamin A. Beasley <code@musicinmybrain.net>
To: git-commits@fedoraproject.org
Subject: [rpms/python-pyroaring] f43: Unbundle croaring
Date: Thu, 08 Oct 2026 14:02:29 GMT	[thread overview]
Message-ID: <179146814919.1.15024163864953652294.rpms-python-pyroaring-381b5064f9c9@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/python-pyroaring
Branch : f43
Commit : 381b5064f9c99189225f9b32a9b65276ccd8bde4
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date   : 2026-10-08T14:06:34+01:00
Stats  : +57/-4 in 3 file(s)
URL    : https://src.fedoraproject.org/rpms/python-pyroaring/c/381b5064f9c99189225f9b32a9b65276ccd8bde4?branch=f43

Log:
Unbundle croaring

---
diff --git a/0001-Respect-system-compiler-flags-no-O3.patch b/0001-Respect-system-compiler-flags-no-O3.patch
index 444ebff..8b19e54 100644
--- a/0001-Respect-system-compiler-flags-no-O3.patch
+++ b/0001-Respect-system-compiler-flags-no-O3.patch
@@ -1,7 +1,7 @@
 From 28694e93817bbfff0b04e2a72ce71b51dcbcb104 Mon Sep 17 00:00:00 2001
 From: "Benjamin A. Beasley" <code@musicinmybrain.net>
 Date: Thu, 8 Oct 2026 13:25:11 +0100
-Subject: [PATCH] Respect system compiler flags (no -O3)
+Subject: [PATCH 1/2] Respect system compiler flags (no -O3)
 
 ---
  setup.py | 5 +++--

diff --git a/0002-Do-not-build-bundled-croaring-library-link-libroarin.patch b/0002-Do-not-build-bundled-croaring-library-link-libroarin.patch
new file mode 100644
index 0000000..4f1f6aa
--- /dev/null
+++ b/0002-Do-not-build-bundled-croaring-library-link-libroarin.patch
@@ -0,0 +1,37 @@
+From a0051e78b077dbc083f5743a6a9616bc9d1fc287 Mon Sep 17 00:00:00 2001
+From: "Benjamin A. Beasley" <code@musicinmybrain.net>
+Date: Thu, 8 Oct 2026 13:29:45 +0100
+Subject: [PATCH 2/2] Do not build bundled croaring library; link libroaring
+
+Removing the bundled copy and dealing with include paths are outside the
+scope of this patch.
+---
+ setup.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 9105dc3..93c49a4 100755
+--- a/setup.py
++++ b/setup.py
+@@ -66,6 +66,8 @@ else:
+         sources=[os.path.join(PKG_DIR, 'pyroaring.pyx')],
+         extra_compile_args=compile_args + ["-std=c++11"],
+         language='c++',
++        # https://docs.fedoraproject.org/en-US/packaging-guidelines/#bundling
++        libraries = ['roaring'],
+     )
+ 
+     # Because we compile croaring with a c compiler with sometimes incompatible arguments,
+@@ -78,7 +80,8 @@ else:
+             "extra_compile_args": compile_args + ["-std=c11"],
+         },
+     )
+-    libraries = [croaring]
++    # https://docs.fedoraproject.org/en-US/packaging-guidelines/#bundling
++    libraries = None
+ 
+ setup(
+     name='pyroaring',
+-- 
+2.55.0
+

diff --git a/python-pyroaring.spec b/python-pyroaring.spec
index 2adddab..d862a1b 100644
--- a/python-pyroaring.spec
+++ b/python-pyroaring.spec
@@ -3,8 +3,11 @@ Version:        1.0.3
 Release:        %autorelease
 Summary:        Library for handling efficiently sorted integer sets
 
-# pyroaring/roaring.c and pyroaring/roaring.h are dual licensed
-License:        MIT or Apache-2.0
+# The source contains a bundled, amalgamated copy of croaring in
+# pyroaring/roaring.{h,c}; these two files are (Apache-2.0 OR MIT). We remove
+# them in %%prep, so they do not contribute to the licenses of the binary RPMs.
+License:        MIT
+SourceLicense:  %{license} AND (Apache-2.0 OR MIT)
 URL:            https://github.com/Ezibenroc/PyRoaringBitMap
 Source:         %{url}/archive/%{version}/PyRoaringBitMap-%{version}.tar.gz
 
@@ -13,9 +16,18 @@ Source:         %{url}/archive/%{version}/PyRoaringBitMap-%{version}.tar.gz
 # Downstream-only because upstream validly wants to add -O3 (but we have not
 # proven it is justified).
 Patch:          0001-Respect-system-compiler-flags-no-O3.patch
+# Do not build bundled croaring library; link libroaring
+#
+# Removing the bundled copy and dealing with include paths are outside the
+# scope of this patch.
+#
+# Downstream-only for now; it would be nice to suggest an easy way to use a
+# system copy upstream, but it’s not immediately obvious how best to do this in
+# an upstreamable way.
+Patch:          0002-Do-not-build-bundled-croaring-library-link-libroarin.patch
 
-BuildRequires:  gcc
 BuildRequires:  gcc-c++
+BuildRequires:  pkgconfig(roaring)
 
 # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
 ExcludeArch:    %{ix86}
@@ -35,6 +47,10 @@ Summary:        %{summary}
 %prep
 %autosetup -n PyRoaringBitMap-%{version} -p1
 
+# Unbundle croaring
+rm pyroaring/roaring.c
+printf '#include <%s>\n' 'roaring/roaring.h' > pyroaring/roaring.h
+
 
 %generate_buildrequires
 %pyproject_buildrequires --tox --toxenv=cython3

                 reply	other threads:[~2026-10-08 14:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179146814919.1.15024163864953652294.rpms-python-pyroaring-381b5064f9c9@fedoraproject.org \
    --to=code@musicinmybrain.net \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox