From 6575ff7ecd7669dc603be0e53fbbaf437c3b359f9ea8fc8c17753f405bcafb2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Fri, 15 Dec 2023 12:22:24 +0000 Subject: [PATCH] Accepting request 1132811 from home:bmwiedemann:branches:devel:languages:python Add reproducible.patch for reproducible builds (boo#1062303) There might be other/better ways to solve this, but upstream moved pretty far already. OBS-URL: https://build.opensuse.org/request/show/1132811 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-rdflib?expand=0&rev=61 --- python-rdflib.changes | 5 +++++ python-rdflib.spec | 2 ++ reproducible.patch | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 reproducible.patch diff --git a/python-rdflib.changes b/python-rdflib.changes index f4e0d9a..606d54f 100644 --- a/python-rdflib.changes +++ b/python-rdflib.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Dec 13 08:40:59 UTC 2023 - Bernhard Wiedemann + +- Add reproducible.patch for reproducible builds (boo#1062303) + ------------------------------------------------------------------- Mon Feb 7 23:38:10 UTC 2022 - Steve Kowalik diff --git a/python-rdflib.spec b/python-rdflib.spec index 56672b8..911aeea 100644 --- a/python-rdflib.spec +++ b/python-rdflib.spec @@ -26,6 +26,7 @@ Summary: A Python library for working with RDF License: BSD-3-Clause URL: http://rdflib.net/ Source: https://files.pythonhosted.org/packages/source/r/rdflib/rdflib-%{version}.tar.gz +Patch0: reproducible.patch BuildRequires: %{python_module html5lib} BuildRequires: %{python_module isodate} BuildRequires: %{python_module pyparsing} @@ -66,6 +67,7 @@ The library also contains both in-memory and persistent Graph backends. %prep %setup -q -n rdflib-%{version} +%patch0 -p1 # remove unwanted shebang find rdflib -name "*.py" | xargs sed -i '1 { /^#!/ d }' diff --git a/reproducible.patch b/reproducible.patch new file mode 100644 index 0000000..58b7e65 --- /dev/null +++ b/reproducible.patch @@ -0,0 +1,35 @@ +Author: Bernhard M. Wiedemann +Date: Wed Dec 13 09:28:20 2023 +0100 + + Mark Restriction and Individual as private + + Fixes https://github.com/RDFLib/rdflib/issues/2645 + + Without this patch, the graph's random identifier leaked into + html/apidocs/rdflib.extras.html + + See https://reproducible-builds.org/ for why this matters. + + This patch was done while working on reproducible builds for openSUSE. + +Index: rdflib-6.1.1/rdflib/extras/infixowl.py +=================================================================== +--- rdflib-6.1.1.orig/rdflib/extras/infixowl.py ++++ rdflib-6.1.1/rdflib/extras/infixowl.py +@@ -365,6 +365,8 @@ class TermDeletionHelper: + class Individual(object): + """ + A typed individual ++ ++ :meta private: + """ + + factoryGraph = Graph() +@@ -1606,6 +1608,7 @@ class Restriction(Class): + individualRestrictionComponent + { individualRestrictionComponent } ')' + ++ :meta private: + """ + + restrictionKinds = [