From 45e100f5125ab91d9fcd68f8e43c4b306d24a05d Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Jan 17 2021 10:58:27 +0000 Subject: Fix build under Python 3.10 --- diff --git a/libsbml-drop-formatter-import.diff b/libsbml-drop-formatter-import.diff new file mode 100644 index 0000000..ccbc5ff --- /dev/null +++ b/libsbml-drop-formatter-import.diff @@ -0,0 +1,24 @@ +--- libSBML-5.19.0-Source/src/bindings/python/doc-converter/rewrite_pydoc.py~ 2020-11-25 12:03:01.000000000 +0100 ++++ libSBML-5.19.0-Source/src/bindings/python/doc-converter/rewrite_pydoc.py 2021-01-17 11:55:21.317440267 +0100 +@@ -118,7 +118,6 @@ + import sys + import os + import textwrap +-from formatter import NullWriter, AbstractFormatter + try: + from htmllib import HTMLParser + except Exception: +@@ -192,12 +191,10 @@ + # writes all text to an internal string variable. The contents can be + # obtained using a call to get_text(). + +-class RewritePydocStringWriter(NullWriter): +- ++class RewritePydocStringWriter: + def __init__(self, maxcol=72): + self.text = '' + self.maxcol = maxcol +- NullWriter.__init__(self) + self.reset() + + def reset(self): diff --git a/libsbml.spec b/libsbml.spec index a7184a0..742ea37 100644 --- a/libsbml.spec +++ b/libsbml.spec @@ -40,7 +40,7 @@ Obsoletes: libsbml-sharp < 0:5.18.0-20 Name: libsbml Version: 5.19.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Systems Biology Markup Language library License: LGPLv2+ URL: http://sbml.org/Software/libSBML @@ -53,6 +53,9 @@ Patch1: libsbml-fix_install_libpaths.patch Patch2: time-clock.diff Patch3: lisbml-fix-jsfile-globs.diff +# formatter was dropped in python3.10. It appears the imported code was just a noop. +Patch4: libsbml-drop-formatter-import.diff + BuildRequires: cmake BuildRequires: zlib-devel BuildRequires: bzip2-devel @@ -407,6 +410,9 @@ popd %endif %changelog +* Sun Jan 17 2021 Zbigniew Jędrzejewski-Szmek - 5.19.0-2 +- Fix build under Python 3.10 (#1913346) + * Thu Jan 7 2021 Zbigniew Jędrzejewski-Szmek - 5.19.0-1 - Update to latest version