#5 Replace Python 3.7 patch with a sed
Merged 3 years ago by churchyard. Opened 3 years ago by churchyard.
rpms/ churchyard/mathgl py38  into  master

@@ -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)

file modified
+4 -7
@@ -51,9 +51,6 @@ 

  # 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 @@ 

  %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

no initial comment

rebased onto 6149bd4

3 years ago

rebased onto 5abf628

3 years ago

I've replaced the patch with a sed. Now it should work both with 3.7 and 3.8.

It builds with both 3.7 and 3.8.

This works fine. I intent to merge it soon. Let me know if I shall not.

No stop from me. Thank you.

Pull-Request has been merged by churchyard

3 years ago