From 5abf628d0882b54bdf492f21bb21d8d702fba9f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 30 Jul 2019 00:26:24 +0200 Subject: [PATCH] Replace Python 3.7 patch with a sed --- mathgl-2.4.1-python37.patch | 34 ---------------------------------- mathgl.spec | 11 ++++------- 2 files changed, 4 insertions(+), 41 deletions(-) delete mode 100644 mathgl-2.4.1-python37.patch diff --git a/mathgl-2.4.1-python37.patch b/mathgl-2.4.1-python37.patch deleted file mode 100644 index c9a3e63..0000000 --- a/mathgl-2.4.1-python37.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff -ru mathgl-2.4.1/lang/python3/CMakeLists.txt mathgl-2.4.1_patched/lang/python3/CMakeLists.txt ---- mathgl-2.4.1/lang/python3/CMakeLists.txt 2018-07-04 14:53:42.165822142 +0200 -+++ mathgl-2.4.1_patched/lang/python3/CMakeLists.txt 2018-07-04 14:53:26.941745985 +0200 -@@ -12,10 +12,10 @@ - SET_SOURCE_FILES_PROPERTIES(../mathgl.i ../numpy.i PROPERTIES CPLUSPLUS ON) - - if(enable-python) -- set(Python_ADDITIONAL_VERSIONS 3.6) -+ set(Python_ADDITIONAL_VERSIONS 3.7) - unset(PYTHONINTERP_FOUND) - unset(PYTHON_EXECUTABLE CACHE) -- FIND_PACKAGE(PythonInterp 3.6 REQUIRED) -+ FIND_PACKAGE(PythonInterp 3.7 REQUIRED) - if(NOT PYTHONINTERP_FOUND) - message(SEND_ERROR "Couldn't find python interpreter.") - endif(NOT PYTHONINTERP_FOUND) -@@ -28,7 +28,7 @@ - unset(PYTHONLIBS_VERSION_STRING CACHE) - unset(PYTHON_LIBRARY CACHE) - unset(PYTHON_INCLUDE_DIR CACHE) -- FIND_PACKAGE(PythonLibs 3.6) -+ FIND_PACKAGE(PythonLibs 3.7) - if(NOT PYTHONLIBS_FOUND) - message(SEND_ERROR "Couldn't find python development libraries.") - endif(NOT PYTHONLIBS_FOUND) -@@ -67,7 +67,7 @@ - - install(FILES ${MathGL2_BINARY_DIR}/lang/python3/mathgl.py DESTINATION ${MGL_PYTHON_SITE_PACKAGES}) - # harcoded for now. another way is to make glob search on *pyc in __pycache__ dir -- install(FILES ${MathGL2_BINARY_DIR}/lang/python3/__pycache__/mathgl.cpython-36.pyc DESTINATION ${MGL_PYTHON_SITE_PACKAGES}/__pycache__) -+ install(FILES ${MathGL2_BINARY_DIR}/lang/python3/__pycache__/mathgl.cpython-37.pyc DESTINATION ${MGL_PYTHON_SITE_PACKAGES}/__pycache__) - install (TARGETS _mathglp3 LIBRARY DESTINATION ${MGL_PYTHON_SITE_PACKAGES}) - set(mgl_clean_files ${mgl_clean_files} mathgl.py) - endif(enable-python) diff --git a/mathgl.spec b/mathgl.spec index 7a0f977..3d495a3 100644 --- a/mathgl.spec +++ b/mathgl.spec @@ -51,9 +51,6 @@ Patch6: mathgl-2.4.1-gcc7.patch # Disable uppdate-{destop,mine}-database during install process Patch7: mathgl-2.4.1-no_updatedb.patch -# Make mathgl use the 3.7 version of Python -Patch9: mathgl-2.4.1-python37.patch - Requires: %{name}-common = %{version}-%{release} # mandatory packages @@ -334,16 +331,16 @@ done %patch5 -p1 -b .lang %patch6 -p1 -b .gcc7 %patch7 -p1 -b .no_updatedb -# Python 3.7 in Fedora 29+ -%if 0%{?fedora} >= 29 -%patch9 -p1 -b .fix_py37} -%endif %if 0%{?with_octave} %patch3 -p1 -b .nooctaveinstall %else %patch4 -p1 -b .no_octave %endif +# Fix hardcoded Python version +sed -i -e 's,3\.[0-9],%{python3_version},g' \ + -e 's,cpython-3[0-9],cpython-%{python3_version_nodots},g' \ + lang/python3/CMakeLists.txt # Fix hardcoded paths sed -i s,/usr/local/share/doc/mathgl/,%{_docdir}/%{name}/, udav/udav_wnd.h