From 4f8e7bd077da87073d9e8ab71c87c8a565991d2f Mon Sep 17 00:00:00 2001
From: Jochen Sprickerhof <jspricke@debian.org>
Date: Mon, 14 Sep 2026 06:56:31 +0200
Subject: [PATCH] Add patch to make the build reproducible

---
 ...0007-Make-compile-flags-reproducible.patch | 23 +++++++++++++++++++
 debian/patches/series                         |  1 +
 2 files changed, 24 insertions(+)
 create mode 100644 debian/patches/0007-Make-compile-flags-reproducible.patch

diff --git a/debian/patches/0007-Make-compile-flags-reproducible.patch b/debian/patches/0007-Make-compile-flags-reproducible.patch
new file mode 100644
index 0000000..5bb4c99
--- /dev/null
+++ b/debian/patches/0007-Make-compile-flags-reproducible.patch
@@ -0,0 +1,23 @@
+From: Jochen Sprickerhof <jspricke@debian.org>
+Date: Mon, 14 Sep 2026 06:50:26 +0200
+Subject: Make compile flags reproducible
+
+---
+ setup.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 2609428..5251cf2 100644
+--- a/setup.py
++++ b/setup.py
+@@ -386,8 +386,8 @@ class build_ext(build_ext_):
+ 
+         # Add the compile/link options to each extension
+         for e in self.extensions:
+-            e.extra_compile_args = list(set(e.extra_compile_args).union(compileflags))
+-            e.extra_link_args = list(set(e.extra_link_args).union(linkflags))
++            e.extra_compile_args = sorted(set(e.extra_compile_args).union(compileflags))
++            e.extra_link_args = sorted(set(e.extra_link_args).union(linkflags))
+ 
+         build_ext_.build_extensions(self)
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 60f19f2..ec88dd0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@
 0004-cython-and-setuptools-are-not-runtime-dependencies.patch
 0005-remove-march-and-mcpu-to-avoid-FTBFS.patch
 0006-Remove-extension-config-manipulation.patch
+0007-Make-compile-flags-reproducible.patch
-- 
2.55.0

