From 9769386c2d8bb9b0c177439401bbc227002a7674 Mon Sep 17 00:00:00 2001 From: Antonio T Date: Nov 13 2020 17:10:22 +0000 Subject: Porting to Python-3.10 (rhbz#1897107) --- diff --git a/libsbml-porting_to_python310.patch b/libsbml-porting_to_python310.patch new file mode 100644 index 0000000..49c2e89 --- /dev/null +++ b/libsbml-porting_to_python310.patch @@ -0,0 +1,78 @@ +--- a/configure.orig 2019-04-06 16:48:29.000000000 +0200 ++++ b/configure 2020-11-13 17:51:39.017782615 +0100 +@@ -5212,7 +5212,7 @@ + $as_echo "$PYTHON_PREFIX" >&6; } + + +- PYTHON_VERSION=`"$PYTHON" -c "import sys; print(sys.version[:3])"` ++ PYTHON_VERSION=`"$PYTHON" -c "import sys; import platform; sys.stdout.write('{}.{}'.format(*platform.python_version_tuple()[:2]))"` + + + PYTHON_NAME="python$PYTHON_VERSION" +@@ -5353,7 +5353,7 @@ + + + +- tmp_v=`"$PYTHON" -c "import sys; print(sys.version[:1])"` ++ tmp_v=`"$PYTHON" -c "import sys; import platform; sys.stdout.write('{}.{}'.format(*platform.python_version_tuple()[:2]))"` + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can trust $PYTHON_CONFIG --libs" >&5 +--- a/config/python.orig.m4 2018-04-24 10:35:26.000000000 +0200 ++++ b/config/python.m4 2020-11-13 17:54:52.435847475 +0100 +@@ -106,7 +106,7 @@ + dnl check version if required + m4_ifvaln([$1], [ + AC_MSG_CHECKING([the version of "$PYTHON"]) +- if test `"$PYTHON" -c ["import sys; print(sys.version[:3]) >= \"$1\" and \"OK\" or \"OLD\""]` = "OK" ++ if test `"$PYTHON" -c ["import sys; import platform; sys.stdout.write('{}.{}'.format(*platform.python_version_tuple()[:2])) >= \"$1\" and \"OK\" or \"OLD\""]` = "OK" + then + AC_MSG_RESULT(ok) + else +@@ -120,7 +120,7 @@ + AC_MSG_RESULT($PYTHON_PREFIX) + + changequote(<<, >>) +- PYTHON_VERSION=`"$PYTHON" -c "import sys; print(sys.version[:3])"` ++ PYTHON_VERSION=`"$PYTHON" -c "import sys; import platform; sys.stdout.write('{}.{}'.format(*platform.python_version_tuple()[:2]))"` + changequote([, ]) + + PYTHON_NAME="python$PYTHON_VERSION" +@@ -197,7 +197,7 @@ + dnl contain the library that is named in python-config --libs. + + changequote(<<, >>) +- tmp_v=`"$PYTHON" -c "import sys; print(sys.version[:1])"` ++ tmp_v=`"$PYTHON" -c "import sys; import platform; sys.stdout.write('{}.{}'.format(*platform.python_version_tuple()[:2]))"` + changequote([, ]) + + AC_MSG_CHECKING([if we can trust $PYTHON_CONFIG --libs]) +--- a/build-docs/configure.orig 2019-04-06 16:48:29.000000000 +0200 ++++ b/build-docs/configure 2020-11-13 17:51:39.017782615 +0100 +@@ -5214,3 +5214,3 @@ + +- PYTHON_VERSION=`"$PYTHON" -c "import sys; print(sys.version[:3])"` ++ PYTHON_VERSION=`"$PYTHON" -c "import sys; import platform; sys.stdout.write('{}.{}'.format(*platform.python_version_tuple()[:2]))"` + +@@ -5355,3 +5355,3 @@ + +- tmp_v=`"$PYTHON" -c "import sys; print(sys.version[:1])"` ++ tmp_v=`"$PYTHON" -c "import sys; import platform; sys.stdout.write('{}.{}'.format(*platform.python_version_tuple()[:2]))"` + +--- a/build-docs/config/python.orig.m4 2018-04-24 10:35:26.000000000 +0200 ++++ b/build-docs/config/python.m4 2020-11-13 17:54:52.435847475 +0100 +@@ -108,3 +108,3 @@ + AC_MSG_CHECKING([the version of "$PYTHON"]) +- if test `"$PYTHON" -c ["import sys; print(sys.version[:3]) >= \"$1\" and \"OK\" or \"OLD\""]` = "OK" ++ if test `"$PYTHON" -c ["import sys; import platform; sys.stdout.write('{}.{}'.format(*platform.python_version_tuple()[:2])) >= \"$1\" and \"OK\" or \"OLD\""]` = "OK" + then +@@ -122,3 +122,3 @@ + changequote(<<, >>) +- PYTHON_VERSION=`"$PYTHON" -c "import sys; print(sys.version[:3])"` ++ PYTHON_VERSION=`"$PYTHON" -c "import sys; import platform; sys.stdout.write('{}.{}'.format(*platform.python_version_tuple()[:2]))"` + changequote([, ]) +@@ -199,3 +199,3 @@ + changequote(<<, >>) +- tmp_v=`"$PYTHON" -c "import sys; print(sys.version[:1])"` ++ tmp_v=`"$PYTHON" -c "import sys; import platform; sys.stdout.write('{}.{}'.format(*platform.python_version_tuple()[:2]))"` + changequote([, ]) diff --git a/libsbml.spec b/libsbml.spec index 62643d4..0bb39da 100644 --- a/libsbml.spec +++ b/libsbml.spec @@ -36,7 +36,7 @@ Name: libsbml Version: 5.18.0 -Release: 18%{?dist} +Release: 19%{?dist} Summary: Systems Biology Markup Language library License: LGPLv2+ URL: http://sbml.org/Software/libSBML @@ -51,6 +51,8 @@ Patch1: libsbml-fix_install_libpaths.patch Patch2: time-clock.diff +Patch3: libsbml-porting_to_python310.patch + BuildRequires: cmake BuildRequires: zlib-devel BuildRequires: bzip2-devel @@ -222,6 +224,12 @@ grep -e 'This file was automatically generated by SWIG' -r . -l|xargs rm mkdir build-docs cp -a $(ls -1|grep -v build-docs) build-docs/ +%if %{with python} +%if 0%{?python3_version_nodots} > 39 +%patch3 -p1 -b .porting_to_python310 +%endif +%endif + %build mkdir -p build && pushd build %{set_build_flags} @@ -414,6 +422,9 @@ popd %endif %changelog +* Fri Nov 13 2020 Antonio Trande - 5.18.0-19 +- Porting to Python-3.10 (rhbz#1897107) + * Sat Aug 01 2020 Fedora Release Engineering - 5.18.0-18 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild