Remove pyton2 bindings

This commit is contained in:
Dmitrij S. Kryzhevich 2018-09-18 08:39:04 +07:00
parent 8c5ddaf747
commit d2b9b2590e
2 changed files with 7 additions and 77 deletions

View File

@ -55,7 +55,7 @@ diff -urp mathgl-2.4.1/lang/CMakeLists.txt mathgl-2.4.1-lang/lang/CMakeLists.txt
set(mgl_clean_files ${mgl_clean_files} mathgl)
endif(enable-octave)
+
+add_subdirectory( python2 )
+#add_subdirectory( python2 )
+add_subdirectory( python3 )
+
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${mgl_clean_files}")
@ -348,66 +348,6 @@ diff -urp mathgl-2.4.1/lang/numpy.i mathgl-2.4.1-lang/lang/numpy.i
PyErr_Format(PyExc_TypeError,
"Int dimension expected. '%s' given.",
typestring);
diff -urp mathgl-2.4.1/lang/python2/CMakeLists.txt mathgl-2.4.1-lang/lang/python2/CMakeLists.txt
--- mathgl-2.4.1/lang/python2/CMakeLists.txt 2017-12-06 12:23:26.756865569 +0700
+++ mathgl-2.4.1-lang/lang/python2/CMakeLists.txt 2017-12-06 18:34:24.611303047 +0700
@@ -0,0 +1,56 @@
+set(src_imp_dep
+../../include/mgl2/type.h
+../../include/mgl2/data.h
+../../include/mgl2/mgl.h
+../mgl.i
+../data.i
+../type.i
+)
+
+set(mgl_clean_files "")
+
+SET_SOURCE_FILES_PROPERTIES(../mathgl.i ../numpy.i PROPERTIES CPLUSPLUS ON)
+
+if(enable-python)
+ set(Python_ADDITIONAL_VERSIONS 2.7)
+ FIND_PACKAGE(PythonInterp 2.7 REQUIRED)
+ if(NOT PYTHONINTERP_FOUND)
+ message(SEND_ERROR "Couldn't find python interpreter.")
+ endif(NOT PYTHONINTERP_FOUND)
+ FIND_PACKAGE(PythonLibs)
+ if(NOT PYTHONLIBS_FOUND)
+ message(SEND_ERROR "Couldn't find python development libraries.")
+ endif(NOT PYTHONLIBS_FOUND)
+ execute_process(
+ COMMAND ${PYTHON_EXECUTABLE} -c "import numpy; print numpy.get_include()"
+ OUTPUT_VARIABLE NUMPY_INCLUDE_PATH
+ RESULT_VARIABLE NUMPY_ERR
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ if(NOT NUMPY_INCLUDE_PATH)
+ message(SEND_ERROR "Couldn't find numpy.")
+ endif(NOT NUMPY_INCLUDE_PATH)
+
+ include_directories(${PYTHON_INCLUDE_DIR} ${NUMPY_INCLUDE_PATH})
+ execute_process(
+ COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(prefix='${CMAKE_INSTALL_PREFIX}')"
+ OUTPUT_VARIABLE MGL_PYTHON_SITE_PACKAGES
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set(SWIG_MODULE_mathgl_EXTRA_DEPS ../numpy.i ${src_imp_dep})
+ SWIG_ADD_MODULE(mathgl python ../mathgl.i)
+ SWIG_LINK_LIBRARIES(mathgl mgl ${PYTHON_LIBRARIES})
+ set_target_properties(_mathgl PROPERTIES BUILD_WITH_INSTALL_RPATH ON)
+ add_custom_command(OUTPUT mathgl.pyc
+ COMMAND ${PYTHON_EXECUTABLE}
+ ARGS -c \"from py_compile import compile\; compile('mathgl.py') \"
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/lang/python2
+ DEPENDS _mathgl
+ )
+ add_custom_target(mgl_python_module ALL DEPENDS _mathgl mathgl.pyc)
+
+ install(FILES ${MathGL2_BINARY_DIR}/lang/python2/mathgl.py ${MathGL2_BINARY_DIR}/lang/python2/mathgl.pyc DESTINATION ${MGL_PYTHON_SITE_PACKAGES})
+ install (TARGETS _mathgl LIBRARY DESTINATION ${MGL_PYTHON_SITE_PACKAGES})
+ set(mgl_clean_files ${mgl_clean_files} mathgl.py)
+endif(enable-python)
+
+set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${mgl_clean_files}")
diff -urp mathgl-2.4.1/lang/python3/CMakeLists.txt mathgl-2.4.1-lang/lang/python3/CMakeLists.txt
--- mathgl-2.4.1/lang/python3/CMakeLists.txt 2017-12-06 12:23:26.756865569 +0700
+++ mathgl-2.4.1-lang/lang/python3/CMakeLists.txt 2017-12-06 18:34:43.280894028 +0700

View File

@ -19,7 +19,7 @@
Name: mathgl
Version: 2.4.1
Release: 9%{?dist}
Release: 10%{?dist}
Summary: Cross-platform library for making high-quality scientific graphics
Summary(de): Plattformübergreifende Bibliothek für hochwertige wissenschaftliche Graphiken
Summary(ru): Библиотека для осуществления высококачественной визуализации данных
@ -76,7 +76,6 @@ BuildRequires: libharu-devel
BuildRequires: swig lua-devel
BuildRequires: libXmu-devel
BuildRequires: python3-devel python3-numpy
BuildRequires: python2-devel python2-numpy
%description
Mathgl is a cross-platform library for making high-quality scientific
@ -169,15 +168,6 @@ mglview reads MGL scripts from scriptfile to produce plots of
specified functions or data. The program will create a GUI window
showing the script result.
%package -n python2-mathgl
%{?python_provide:%python_provide python2-mathgl}
Summary: Python2 module for MathGL
Group: Applications/Engineering
Requires: %{name} = %{version}-%{release}
%description -n python2-mathgl
%{Summary}.
%package -n python3-mathgl
%{?python_provide:%python_provide python3-mathgl}
Summary: Python3 module for MathGL
@ -355,8 +345,8 @@ Requires: wxGTK3-devel
rm -rf addons/getopt
# prep for both py2 and py3 build
mkdir lang/python{2,3}
touch lang/python{2,3}/CMakeLists.txt
mkdir lang/python3
touch lang/python3/CMakeLists.txt
#convert EOL encodings, maintaining timestames
for file in AUTHORS ChangeLog.txt README ; do
@ -632,9 +622,6 @@ fi
%{_datadir}/applications/udav.desktop
%dir %{_datadir}/udav/
%files -n python2-mathgl
%{python2_sitelib}/*
%files -n python3-mathgl
%{python3_sitelib}/*
@ -689,6 +676,9 @@ fi
%endif
%changelog
* Tue Sep 18 2018 Dmitrij S. Kryzhevich <kryzhev@ispms.ru> - 2.4.1-10
- Remove Python2 subpackage. Patch updated.
* Fri Jul 20 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 2.4.1-9
- Use proper %%python2_sitelib macro.