Update to new 2.4.1

This commit is contained in:
Dmitrij S. Kryzhevich 2017-12-07 15:31:08 +07:00
parent 4fc1cbbd0b
commit 09bdd5ea52
14 changed files with 748 additions and 132 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ mathgl-1.10.2.1.tgz
/mathgl-2.3.3.tar.gz
/mathgl-2.3.4.tar.gz
/mathgl-2.3.5.1.tar.gz
/mathgl-2.4.1.tar.gz

View File

@ -1,11 +0,0 @@
diff -urp mathgl-2.3.5.1/CMakeLists.txt mathgl-2.3.5.1-fltk-skip-fluid/CMakeLists.txt
--- mathgl-2.3.5.1/CMakeLists.txt 2016-12-27 09:44:48.138478382 +0700
+++ mathgl-2.3.5.1-fltk-skip-fluid/CMakeLists.txt 2016-12-27 10:01:05.130484991 +0700
@@ -515,6 +515,7 @@ endif(enable-glut)
if(enable-fltk)
set(MGL_HAVE_FLTK 1)
+ set(FLTK_SKIP_FLUID 1)
include(FindFLTK)
if(NOT FLTK_FOUND)
message(SEND_ERROR "Couldn't find FLTK library.")

View File

@ -1,16 +0,0 @@
diff -urp mathgl-2.3.5.1/CMakeLists.txt mathgl-2.3.5.1-no_qt4/CMakeLists.txt
--- mathgl-2.3.5.1/CMakeLists.txt 2016-06-19 23:06:40.000000000 +0600
+++ mathgl-2.3.5.1-no_qt4/CMakeLists.txt 2016-12-29 17:04:31.366201051 +0700
@@ -150,8 +150,10 @@ CMAKE_DEPENDENT_OPTION(enable-gif "Enabl
CMAKE_DEPENDENT_OPTION(enable-glut "Enable glut support" OFF "NOT enable-all-widgets" ON)
CMAKE_DEPENDENT_OPTION(enable-fltk "Enable fltk widget" OFF "NOT enable-all-widgets" ON)
CMAKE_DEPENDENT_OPTION(enable-wx "Enable wxWidget widget" OFF "NOT enable-all-widgets" ON)
-CMAKE_DEPENDENT_OPTION(enable-qt4 "Enable Qt4 widget" OFF "NOT enable-all-widgets" ON)
-CMAKE_DEPENDENT_OPTION(enable-qt4asqt "Set Qt4 as default libmgl-qt" OFF "enable-qt4" OFF)
+#CMAKE_DEPENDENT_OPTION(enable-qt4 "Enable Qt4 widget" OFF "NOT enable-all-widgets" ON)
+#CMAKE_DEPENDENT_OPTION(enable-qt4asqt "Set Qt4 as default libmgl-qt" OFF "enable-qt4" OFF)
+SET(enable-qt4 OFF)
+SET(enable-qt4asqt OFF)
CMAKE_DEPENDENT_OPTION(enable-qt5 "Enable Qt5 widget" OFF "NOT enable-all-widgets" ON)
CMAKE_DEPENDENT_OPTION(enable-qt5asqt "Set Qt5 as default libmgl-qt" OFF "enable-qt5" OFF)

View File

@ -1,16 +0,0 @@
diff -urp mathgl-2.3.5.1/lang/CMakeLists.txt mathgl-2.3.5.1-nooctaveinstall/lang/CMakeLists.txt
--- mathgl-2.3.5.1/lang/CMakeLists.txt 2016-06-19 23:01:08.000000000 +0600
+++ mathgl-2.3.5.1-nooctaveinstall/lang/CMakeLists.txt 2016-12-27 10:04:11.786000696 +0700
@@ -125,12 +125,6 @@ message(STATUS "${oct_prog} ${oct_host}
)
add_custom_target(mgl_octave_module ALL DEPENDS mathgl.tar.gz)
- install(FILES ${CMAKE_BINARY_DIR}/lang/mathgl.tar.gz DESTINATION ${MGL_DATA_PATH})
- if(enable-octave-install)
- install(CODE "execute_process(
- COMMAND ${oct_exec} -q --eval \"pkg install mathgl.tar.gz\"
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/lang )")
- endif(enable-octave-install)
set(mgl_clean_files ${mgl_clean_files} mathgl)
endif(enable-octave)
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${mgl_clean_files}")

View File

@ -1,7 +1,8 @@
diff -urp mathgl-2.3.5.1/examples/CMakeLists.txt mathgl-2.3.5.1-examples/examples/CMakeLists.txt
--- mathgl-2.3.5.1/examples/CMakeLists.txt 2016-06-19 23:06:40.000000000 +0600
+++ mathgl-2.3.5.1-examples/examples/CMakeLists.txt 2016-12-27 09:49:06.567485492 +0700
@@ -1,21 +1,25 @@
diff -urp mathgl-2.4.1/examples/CMakeLists.txt mathgl-2.4.1-examples/examples/CMakeLists.txt
--- mathgl-2.4.1/examples/CMakeLists.txt 2017-12-05 11:48:37.416881961 +0700
+++ mathgl-2.4.1-examples/examples/CMakeLists.txt 2017-12-05 11:51:35.612120557 +0700
@@ -2,22 +2,26 @@ file(COPY ${CMAKE_SOURCE_DIR}/examples/i
file(COPY ${CMAKE_SOURCE_DIR}/examples/Equirectangular-projection.jpg DESTINATION ${CMAKE_BINARY_DIR}/examples)
add_executable(mgl_example wnd_samples.cpp full_test.cpp samples.cpp)
target_link_libraries(mgl_example mgl-static ${getopt_lib-static})
+SET(MGL_INSTALL_EXAMPLES_LIST mgl_example)
@ -27,23 +28,17 @@ diff -urp mathgl-2.3.5.1/examples/CMakeLists.txt mathgl-2.3.5.1-examples/example
endif(MGL_HAVE_WX)
if(QT_ENABLED)
@@ -27,6 +31,7 @@ if(QT_ENABLED)
include(../cmake-qt4.txt)
target_link_libraries(mgl_qt_example mgl-qt4)
endif(enable-qt5)
+ SET(MGL_INSTALL_EXAMPLES_LIST ${MGL_INSTALL_EXAMPLES_LIST} mgl_qt_example)
if(MGL_HAVE_OPENGL)
add_executable(mgl_qgl_example wnd_samples.cpp qgl_example.cpp)
@@ -35,6 +40,7 @@ if(QT_ENABLED)
@@ -37,7 +41,9 @@ if(QT_ENABLED)
else(enable-qt5)
target_link_libraries(mgl_qgl_example mgl ${MGL_QT4_LIBS})
endif(enable-qt5)
+ SET(MGL_INSTALL_EXAMPLES_LIST ${MGL_INSTALL_EXAMPLES_LIST} mgl_qgl_example)
endif(MGL_HAVE_OPENGL)
+ SET(MGL_INSTALL_EXAMPLES_LIST ${MGL_INSTALL_EXAMPLES_LIST} mgl_qt_example)
endif(QT_ENABLED)
@@ -43,3 +49,7 @@ if(MGL_HAVE_LTDL)
if(MGL_HAVE_LTDL)
@@ -45,3 +51,7 @@ if(MGL_HAVE_LTDL)
target_link_libraries(mgl_module mgl) # for compatibility with win32
endif(MGL_HAVE_LTDL)

View File

@ -0,0 +1,11 @@
diff -urp mathgl-2.4.1/CMakeLists.txt mathgl-2.4.1-fluid/CMakeLists.txt
--- mathgl-2.4.1/CMakeLists.txt 2017-12-05 11:49:15.767073586 +0700
+++ mathgl-2.4.1-fluid/CMakeLists.txt 2017-12-05 11:53:07.085161409 +0700
@@ -556,6 +556,7 @@ endif(enable-glut)
if(enable-fltk)
set(MGL_HAVE_FLTK 1)
+ set(FLTK_SKIP_FLUID 1)
FIND_PACKAGE(FLTK)
if(NOT FLTK_FOUND)
message(SEND_ERROR "Couldn't find FLTK library.")

23
mathgl-2.4.1-gcc7.patch Normal file
View File

@ -0,0 +1,23 @@
diff -urp mathgl-2.4.1/examples/wx_example.cpp mathgl-2.4.1-gcc7/examples/wx_example.cpp
--- mathgl-2.4.1/examples/wx_example.cpp 2017-12-05 12:02:01.771791180 +0700
+++ mathgl-2.4.1-gcc7/examples/wx_example.cpp 2017-12-05 15:41:42.622938431 +0700
@@ -53,7 +53,7 @@ IMPLEMENT_APP(testApp)
//-----------------------------------------------------------------------------
bool testApp::OnInit()
{
- testFrame* frame = new testFrame(0L, _("MathGL + wxWidgets sample"));
+ testFrame* frame = new testFrame(0L, wxString(_("MathGL + wxWidgets sample")));
frame->Show();
return true;
}
@@ -68,8 +68,8 @@ testFrame::testFrame(wxFrame *frame, con
// create a menu bar
wxMenuBar* mbar = new wxMenuBar();
wxMenu* fileMenu = new wxMenu(_T(""));
- fileMenu->Append(idMenuQuit, _("&Quit\tAlt-F4"), _("Quit the application"));
- mbar->Append(fileMenu, _("&File"));
+ fileMenu->Append(idMenuQuit, wxString(_("&Quit\tAlt-F4")), wxString(_("Quit the application")));
+ mbar->Append(fileMenu, wxString(_("&File")));
SetMenuBar(mbar);
SetSize(800,620);

489
mathgl-2.4.1-lang.patch Normal file
View File

@ -0,0 +1,489 @@
diff -urp mathgl-2.4.1/lang/CMakeLists.txt mathgl-2.4.1-lang/lang/CMakeLists.txt
--- mathgl-2.4.1/lang/CMakeLists.txt 2017-12-05 12:02:01.776791073 +0700
+++ mathgl-2.4.1-lang/lang/CMakeLists.txt 2017-12-06 12:19:53.510447509 +0700
@@ -17,48 +17,6 @@ if(NOT SWIG_FOUND)
endif(NOT SWIG_FOUND)
INCLUDE(${SWIG_USE_FILE})
-if(enable-python)
- set(Python_ADDITIONAL_VERSIONS 2.7)
- FIND_PACKAGE(PythonInterp)
- 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
- DEPENDS _mathgl
- )
- add_custom_target(mgl_python_module ALL DEPENDS _mathgl mathgl.pyc)
-
- install(FILES ${MathGL2_BINARY_DIR}/lang/mathgl.py ${MathGL2_BINARY_DIR}/lang/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)
-
if(enable-lua)
INCLUDE(FindLua51)
if(NOT LUA51_FOUND)
@@ -133,4 +91,8 @@ message(STATUS "${oct_prog} ${oct_host}
endif(enable-octave-install)
set(mgl_clean_files ${mgl_clean_files} mathgl)
endif(enable-octave)
+
+add_subdirectory( python2 )
+add_subdirectory( python3 )
+
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${mgl_clean_files}")
diff -urp mathgl-2.4.1/lang/numpy.i mathgl-2.4.1-lang/lang/numpy.i
--- mathgl-2.4.1/lang/numpy.i 2017-12-05 12:02:01.776791073 +0700
+++ mathgl-2.4.1-lang/lang/numpy.i 2017-12-05 12:02:18.766427285 +0700
@@ -97,7 +97,7 @@
{
/* Given a PyObject, return a string describing its type.
*/
- char* pytype_string(PyObject* py_obj) {
+ const char* pytype_string(PyObject* py_obj) {
if (py_obj == NULL ) return "C NULL value";
if (py_obj == Py_None ) return "Python None" ;
if (PyCallable_Check(py_obj)) return "callable" ;
@@ -107,17 +107,18 @@
if (PyDict_Check( py_obj)) return "dict" ;
if (PyList_Check( py_obj)) return "list" ;
if (PyTuple_Check( py_obj)) return "tuple" ;
- if (PyFile_Check( py_obj)) return "file" ;
if (PyModule_Check( py_obj)) return "module" ;
+%#if PY_MAJOR_VERSION < 3
+ if (PyFile_Check( py_obj)) return "file" ;
if (PyInstance_Check(py_obj)) return "instance" ;
-
- return "unknow type";
+%#endif
+ return "unkown type";
}
/* Given a NumPy typecode, return a string describing the type.
*/
- char* typecode_string(int typecode) {
- static char* type_names[25] = {"bool", "byte", "unsigned byte",
+ const char* typecode_string(int typecode) {
+ static const char* type_names[25] = {"bool", "byte", "unsigned byte",
"short", "unsigned short", "int",
"unsigned int", "long", "unsigned long",
"long long", "unsigned long long",
@@ -159,8 +160,8 @@
}
else if is_array(input)
{
- char* desired_type = typecode_string(typecode);
- char* actual_type = typecode_string(array_type(input));
+ const char* desired_type = typecode_string(typecode);
+ const char* actual_type = typecode_string(array_type(input));
PyErr_Format(PyExc_TypeError,
"Array of type '%s' required. Array of type '%s' given",
desired_type, actual_type);
@@ -168,8 +169,8 @@
}
else
{
- char * desired_type = typecode_string(typecode);
- char * actual_type = pytype_string(input);
+ const char * desired_type = typecode_string(typecode);
+ const char * actual_type = pytype_string(input);
PyErr_Format(PyExc_TypeError,
"Array of type '%s' required. A '%s' was given",
desired_type, actual_type);
@@ -307,6 +308,95 @@
return ary1;
}
+ /* The following code was added by Ilmar M. Wilbers for forcing a copy of the
+ * object even when it is a NumPy array. This is meant for use with the
+ * IN_ARRAY typemaps, and allows the user to perform changes on an array
+ * without these chenges being reflected in the calling code.
+ */
+
+ /* Convert the given PyObject to a NumPy array with the given
+ * typecode as a copy. On success, return a valid PyArrayObject* with the
+ * correct type. On failure, the python error string will be set and
+ * the routine returns NULL.
+ */
+ PyArrayObject* obj_to_array_force_conversion(PyObject* input, int typecode,
+ int* is_new_object)
+ {
+ PyArrayObject* ary = NULL;
+ PyObject* py_obj;
+ if (is_array(input) && (typecode == NPY_NOTYPE ||
+ PyArray_EquivTypenums(array_type(input),typecode)))
+ {
+ py_obj = PyArray_Copy((PyArrayObject*) input);
+ ary = (PyArrayObject*) py_obj;
+ *is_new_object = 1;
+ }
+ else
+ {
+ py_obj = PyArray_FROMANY(input, typecode, 0, 0, NPY_DEFAULT);
+ /* If NULL, PyArray_FromObject will have set python error value.*/
+ ary = (PyArrayObject*) py_obj;
+ *is_new_object = 1;
+ }
+ return ary;
+ }
+
+ /* Convert a given PyObject to a contiguous PyArrayObject of the
+ * specified type. If the input object is not a contiguous
+ * PyArrayObject, a new one will be created and the new object flag
+ * will be set.
+ */
+ PyArrayObject* obj_to_array_contiguous_force_conversion(PyObject* input,
+ int typecode,
+ int* is_new_object)
+ {
+ int is_new1 = 0;
+ int is_new2 = 0;
+ PyArrayObject* ary2;
+ PyArrayObject* ary1 = obj_to_array_force_conversion(input, typecode,
+ &is_new1);
+ if (ary1)
+ {
+ ary2 = make_contiguous(ary1, &is_new2, 0, 0);
+ if ( is_new1 && is_new2)
+ {
+ Py_DECREF(ary1);
+ }
+ ary1 = ary2;
+ }
+ *is_new_object = is_new1 || is_new2;
+ return ary1;
+ }
+
+ /* Convert a given PyObject to a Fortran-ordered PyArrayObject of the
+ * specified type. If the input object is not a Fortran-ordered
+ * PyArrayObject, a new one will be created and the new object flag
+ * will be set.
+ */
+ PyArrayObject* obj_to_array_fortran_force_conversion(PyObject* input,
+ int typecode,
+ int* is_new_object)
+ {
+ int is_new1 = 0;
+ int is_new2 = 0;
+ PyArrayObject* ary2;
+ PyArrayObject* ary1 = obj_to_array_force_conversion(input, typecode,
+ &is_new1);
+ if (ary1)
+ {
+ ary2 = make_fortran(ary1, &is_new2, 0, 0);
+ if (is_new1 && is_new2)
+ {
+ Py_DECREF(ary1);
+ }
+ ary1 = ary2;
+ }
+ *is_new_object = is_new1 || is_new2;
+ return ary1;
+ }
+ /* End modifications by Ilmar M. Wilbers
+ */
+
} /* end fragment */
@@ -601,7 +691,7 @@
(PyArrayObject* array=NULL, int is_new_object=0)
{
npy_intp size[1] = { $1_dim0 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+ array = obj_to_array_contiguous_force_conversion($input, DATA_TYPECODE,
&is_new_object);
if (!array || !require_dimensions(array, 1) ||
!require_size(array, size, 1)) SWIG_fail;
@@ -628,7 +718,7 @@
(PyArrayObject* array=NULL, int is_new_object=0)
{
npy_intp size[1] = { -1 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+ array = obj_to_array_contiguous_force_conversion($input, DATA_TYPECODE,
&is_new_object);
if (!array || !require_dimensions(array, 1) ||
!require_size(array, size, 1)) SWIG_fail;
@@ -656,7 +746,7 @@
(PyArrayObject* array=NULL, int is_new_object=0)
{
npy_intp size[1] = {-1};
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+ array = obj_to_array_contiguous_force_conversion($input, DATA_TYPECODE,
&is_new_object);
if (!array || !require_dimensions(array, 1) ||
!require_size(array, size, 1)) SWIG_fail;
@@ -684,7 +774,7 @@
(PyArrayObject* array=NULL, int is_new_object=0)
{
npy_intp size[2] = { $1_dim0, $1_dim1 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+ array = obj_to_array_contiguous_force_conversion($input, DATA_TYPECODE,
&is_new_object);
if (!array || !require_dimensions(array, 2) ||
!require_size(array, size, 2)) SWIG_fail;
@@ -711,7 +801,7 @@
(PyArrayObject* array=NULL, int is_new_object=0)
{
npy_intp size[2] = { -1, -1 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+ array = obj_to_array_contiguous_force_conversion($input, DATA_TYPECODE,
&is_new_object);
if (!array || !require_dimensions(array, 2) ||
!require_size(array, size, 2)) SWIG_fail;
@@ -740,7 +830,7 @@
(PyArrayObject* array=NULL, int is_new_object=0)
{
npy_intp size[2] = { -1, -1 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+ array = obj_to_array_contiguous_force_conversion($input, DATA_TYPECODE,
&is_new_object);
if (!array || !require_dimensions(array, 2) ||
!require_size(array, size, 2)) SWIG_fail;
@@ -769,7 +859,7 @@
(PyArrayObject* array=NULL, int is_new_object=0)
{
npy_intp size[2] = { -1, -1 };
- array = obj_to_array_fortran_allow_conversion($input, DATA_TYPECODE,
+ array = obj_to_array_fortran_force_conversion($input, DATA_TYPECODE,
&is_new_object);
if (!array || !require_dimensions(array, 2) ||
!require_size(array, size, 2) || !require_fortran(array)) SWIG_fail;
@@ -798,7 +888,7 @@
(PyArrayObject* array=NULL, int is_new_object=0)
{
npy_intp size[2] = { -1, -1 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+ array = obj_to_array_contiguous_force_conversion($input, DATA_TYPECODE,
&is_new_object);
if (!array || !require_dimensions(array, 2) ||
!require_size(array, size, 2) || !require_fortran(array)) SWIG_fail;
@@ -827,7 +917,7 @@
(PyArrayObject* array=NULL, int is_new_object=0)
{
npy_intp size[3] = { $1_dim0, $1_dim1, $1_dim2 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+ array = obj_to_array_contiguous_force_conversion($input, DATA_TYPECODE,
&is_new_object);
if (!array || !require_dimensions(array, 3) ||
!require_size(array, size, 3)) SWIG_fail;
@@ -855,7 +945,7 @@
(PyArrayObject* array=NULL, int is_new_object=0)
{
npy_intp size[3] = { -1, -1, -1 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+ array = obj_to_array_contiguous_force_conversion($input, DATA_TYPECODE,
&is_new_object);
if (!array || !require_dimensions(array, 3) ||
!require_size(array, size, 3)) SWIG_fail;
@@ -886,7 +976,7 @@
(PyArrayObject* array=NULL, int is_new_object=0)
{
npy_intp size[3] = { -1, -1, -1 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+ array = obj_to_array_contiguous_force_conversion($input, DATA_TYPECODE,
&is_new_object);
if (!array || !require_dimensions(array, 3) ||
!require_size(array, size, 3)) SWIG_fail;
@@ -917,7 +1007,7 @@
(PyArrayObject* array=NULL, int is_new_object=0)
{
npy_intp size[3] = { -1, -1, -1 };
- array = obj_to_array_fortran_allow_conversion($input, DATA_TYPECODE,
+ array = obj_to_array_fortran_force_conversion($input, DATA_TYPECODE,
&is_new_object);
if (!array || !require_dimensions(array, 3) ||
!require_size(array, size, 3) | !require_fortran(array)) SWIG_fail;
@@ -948,7 +1038,7 @@
(PyArrayObject* array=NULL, int is_new_object=0)
{
npy_intp size[3] = { -1, -1, -1 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+ array = obj_to_array_contiguous_force_conversion($input, DATA_TYPECODE,
&is_new_object);
if (!array || !require_dimensions(array, 3) ||
!require_size(array, size, 3) || !require_fortran(array)) SWIG_fail;
@@ -1291,7 +1381,7 @@
npy_intp dims[1];
if (!PyInt_Check($input))
{
- char* typestring = pytype_string($input);
+ const char* typestring = pytype_string($input);
PyErr_Format(PyExc_TypeError,
"Int dimension expected. '%s' given.",
typestring);
@@ -1319,7 +1409,7 @@
npy_intp dims[1];
if (!PyInt_Check($input))
{
- char* typestring = pytype_string($input);
+ const char* typestring = pytype_string($input);
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
@@ -0,0 +1,75 @@
+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 3.6)
+ unset(PYTHONINTERP_FOUND)
+ unset(PYTHON_EXECUTABLE CACHE)
+ FIND_PACKAGE(PythonInterp 3.6 REQUIRED)
+ if(NOT PYTHONINTERP_FOUND)
+ message(SEND_ERROR "Couldn't find python interpreter.")
+ endif(NOT PYTHONINTERP_FOUND)
+
+ unset(PYTHONLIBS_FOUND)
+ unset(PYTHON_LIBRARIES CACHE)
+ unset(PYTHON_INCLUDE_PATH CACHE)
+ unset(PYTHON_INCLUDE_DIRS CACHE)
+ unset(PYTHON_DEBUG_LIBRARIES CACHE)
+ unset(PYTHONLIBS_VERSION_STRING CACHE)
+ unset(PYTHON_LIBRARY CACHE)
+ unset(PYTHON_INCLUDE_DIR CACHE)
+ FIND_PACKAGE(PythonLibs 3.6)
+ 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_mathglp3_EXTRA_DEPS ../numpy.i ${src_imp_dep})
+ SWIG_ADD_MODULE(mathglp3 python ../mathgl.i)
+ SWIG_LINK_LIBRARIES(mathglp3 mgl ${PYTHON_LIBRARIES})
+ execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('SO'))"
+ OUTPUT_VARIABLE MGL_PYTHON_LIB_SUFFIX
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set_target_properties(_mathglp3 PROPERTIES
+ BUILD_WITH_INSTALL_RPATH ON
+ OUTPUT_NAME _mathgl
+ SUFFIX ${MGL_PYTHON_LIB_SUFFIX})
+ 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/python3
+ DEPENDS _mathglp3
+ )
+ add_custom_target(mgl_python_modulep3 ALL DEPENDS _mathglp3 mathgl.pyc)
+
+ 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 (TARGETS _mathglp3 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}")

View File

@ -1,7 +1,7 @@
diff -urp mathgl-2.3.5.1/CMakeLists.txt mathgl-2.3.5.1-no_hdf4-and-hdf5-simultaneously/CMakeLists.txt
--- mathgl-2.3.5.1/CMakeLists.txt 2016-12-29 17:04:31.366201051 +0700
+++ mathgl-2.3.5.1-no_hdf4-and-hdf5-simultaneously/CMakeLists.txt 2016-12-29 17:45:25.155442474 +0700
@@ -143,7 +143,8 @@ CMAKE_DEPENDENT_OPTION(enable-zlib "Enab
diff -urp mathgl-2.4.1/CMakeLists.txt mathgl-2.4.1-no_hdf4-and-hdf5-simultaneously/CMakeLists.txt
--- mathgl-2.4.1/CMakeLists.txt 2017-12-05 11:55:05.173632219 +0700
+++ mathgl-2.4.1-no_hdf4-and-hdf5-simultaneously/CMakeLists.txt 2017-12-05 11:56:38.303638637 +0700
@@ -179,7 +179,8 @@ CMAKE_DEPENDENT_OPTION(enable-zlib "Enab
CMAKE_DEPENDENT_OPTION(enable-png "Enable png support" ON "NOT enable-all" ON)
CMAKE_DEPENDENT_OPTION(enable-jpeg "Enable jpeg support" OFF "NOT enable-all" ON)
MGL_DEPENDENT_OPTION(enable-gsl "Enable gsl support" OFF "NOT enable-lgpl" ON "NOT enable-all" ON)

View File

@ -0,0 +1,29 @@
diff -urp mathgl-2.4.1/mgllab/CMakeLists.txt mathgl-2.4.1-no_udaveupdatedb/mgllab/CMakeLists.txt
--- mathgl-2.4.1/mgllab/CMakeLists.txt 2017-12-05 12:02:01.765791309 +0700
+++ mathgl-2.4.1-no_udaveupdatedb/mgllab/CMakeLists.txt 2017-12-06 08:58:18.269129131 +0700
@@ -51,7 +51,7 @@ if(MGL_HAVE_FLTK)
find_program(findupmdb update-mime-database)
if(findupmdb)
install(FILES ${CMAKE_BINARY_DIR}/mgllab/mgl.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/mime/packages/)
- install(CODE "execute_process(COMMAND \"${findupmdb}\" \"${CMAKE_INSTALL_PREFIX}/share/mime\")")
+# install(CODE "execute_process(COMMAND \"${findupmdb}\" \"${CMAKE_INSTALL_PREFIX}/share/mime\")")
endif(findupmdb)
mgl_po_src(${mgllab_src} ${mgllab_hdr})
diff -urp mathgl-2.4.1/udav/CMakeLists.txt mathgl-2.4.1-no_udaveupdatedb/udav/CMakeLists.txt
--- mathgl-2.4.1/udav/CMakeLists.txt 2017-12-05 12:02:01.762791373 +0700
+++ mathgl-2.4.1-no_udaveupdatedb/udav/CMakeLists.txt 2017-12-05 17:58:07.349289539 +0700
@@ -49,11 +49,11 @@ install(FILES udav_ru.qm DESTINATION ${C
find_program(findupddb update-desktop-database)
if(findupddb)
install(FILES udav.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications/)
- install(CODE "execute_process(COMMAND \"${findupddb}\" \"${CMAKE_INSTALL_PREFIX}/share/applications\")")
+# install(CODE "execute_process(COMMAND \"${findupddb}\" \"${CMAKE_INSTALL_PREFIX}/share/applications\")")
endif(findupddb)
find_program(findupmdb update-mime-database)
if(findupmdb)
install(FILES ${CMAKE_BINARY_DIR}/udav/mgl.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/mime/packages/)
- install(CODE "execute_process(COMMAND \"${findupmdb}\" \"${CMAKE_INSTALL_PREFIX}/share/mime\")")
+# install(CODE "execute_process(COMMAND \"${findupmdb}\" \"${CMAKE_INSTALL_PREFIX}/share/mime\")")
endif(findupmdb)
endif(QT_ENABLED)

View File

@ -1,8 +1,8 @@
diff -urp mathgl-2.3.5.1/CMakeLists.txt mathgl-2.3.5.1-nooctave/CMakeLists.txt
--- mathgl-2.3.5.1/CMakeLists.txt 2016-12-29 17:45:25.155442474 +0700
+++ mathgl-2.3.5.1-nooctave/CMakeLists.txt 2017-01-09 15:44:30.045888852 +0700
@@ -183,7 +183,8 @@ endif(enable-qt4 OR enable-qt5)
CMAKE_DEPENDENT_OPTION(enable-json-sample "Enable JSON sample" ON "QT_ENABLED" OFF)
diff -urp mathgl-2.4.1/CMakeLists.txt mathgl-2.4.1-nooctave/CMakeLists.txt
--- mathgl-2.4.1/CMakeLists.txt 2017-12-05 11:59:25.413103840 +0700
+++ mathgl-2.4.1-nooctave/CMakeLists.txt 2017-12-05 12:01:15.317779072 +0700
@@ -233,7 +233,8 @@ CMAKE_DEPENDENT_OPTION(enable-json-sampl
CMAKE_DEPENDENT_OPTION(enable-json-sample-we "Enable JSON sample (WebEngine variant)." OFF "enable-json-sample" OFF)
MGL_DEPENDENT_OPTION(enable-python "Enable python interface" OFF "NOT enable-lgpl" ON "NOT enable-all-swig" ON)
MGL_DEPENDENT_OPTION(enable-lua "Enable Lua (v.5.1) interface" OFF "NOT enable-lgpl" ON "NOT enable-all-swig" ON)
-MGL_DEPENDENT_OPTION(enable-octave "Enable octave interface" OFF "NOT enable-lgpl" ON "NOT enable-all-swig" ON)
@ -10,4 +10,4 @@ diff -urp mathgl-2.3.5.1/CMakeLists.txt mathgl-2.3.5.1-nooctave/CMakeLists.txt
+SET(enable-octave OFF)
MGL_DEPENDENT_OPTION(enable-octave-install "Octave interface will install for all users" ON "NOT enable-lgpl" ON "NOT enable-all-swig" ON)
include_directories( ${MathGL_SOURCE_DIR}/include ${MathGL_BINARY_DIR}/include)
include_directories( ${MathGL2_SOURCE_DIR}/include ${MathGL2_BINARY_DIR}/include)

View File

@ -0,0 +1,15 @@
diff -urp mathgl-2.4.1/lang/CMakeLists.txt mathgl-2.4.1-nooctaveinstall/lang/CMakeLists.txt
--- mathgl-2.4.1/lang/CMakeLists.txt 2017-12-05 11:57:45.607214992 +0700
+++ mathgl-2.4.1-nooctaveinstall/lang/CMakeLists.txt 2017-12-05 11:59:48.869607674 +0700
@@ -84,11 +84,6 @@ message(STATUS "${oct_prog} ${oct_host}
add_custom_target(mgl_octave_module ALL DEPENDS mathgl.tar.gz)
install(FILES ${CMAKE_BINARY_DIR}/lang/mathgl.tar.gz DESTINATION ${MGL_DATA_PATH})
- if(enable-octave-install)
- install(CODE "execute_process(
- COMMAND ${oct_exec} -q --eval \"pkg install mathgl.tar.gz\"
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/lang )")
- endif(enable-octave-install)
set(mgl_clean_files ${mgl_clean_files} mathgl)
endif(enable-octave)

View File

@ -18,35 +18,39 @@
Name: mathgl
Version: 2.3.5
# .1 from Version go to Release as octave fails with 4 digits in ver string
Release: 9%{?dist}.1
Version: 2.4.1
Release: 1%{?dist}
Summary: Cross-platform library for making high-quality scientific graphics
Summary(de): Plattformübergreifende Bibliothek für hochwertige wissenschaftliche Graphiken
Summary(ru): Библиотека для осуществления высококачественной визуализации данных
License: GPLv2+
Group: Development/Libraries
Url: http://mathgl.sourceforge.net
# Add .1 to version
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.1.tar.gz
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
# Install binaries for generation examples of illustrations
Patch0: mathgl-2.3.5.1-examples.patch
Patch0: mathgl-2.4.1-examples.patch
# Skip FLUID binary test
Patch1: mathgl-2.3.5.1-fltk-skip-fluid.patch
# No qt4 and qt5 simultaneously.
Patch2: mathgl-2.3.5.1-no_qt4.patch
Patch1: mathgl-2.4.1-fltk-skip-fluid.patch
# Mathgl's enable all tries to use hdf4 and 5 at the same time
Patch3: mathgl-2.3.5.1-no_hdf4-and-hdf5-simultaneously.patch
Patch2: mathgl-2.4.1-no_hdf4-and-hdf5-simultaneously.patch
# Let macros to decide how to install octave module
Patch4: mathgl-2.3.5.1-nooctaveinstall.patch
Patch3: mathgl-2.4.1-nooctaveinstall.patch
# There is no easy way to disable ONLY octave. Have to cut it from CmakeList.txt
Patch5: mathgl-2.3.5.1-nooctave.patch
Patch4: mathgl-2.4.1-nooctave.patch
# Add python3 support
Patch5: mathgl-2.4.1-lang.patch
# Fix convertions
Patch6: mathgl-2.4.1-gcc7.patch
# Disable uppdate-{destop,mine}-database during install process
Patch7: mathgl-2.4.1-no_updatedb.patch
Requires: %{name}-common = %{version}-%{release}
@ -58,12 +62,15 @@ BuildRequires: perl(Storable)
# optional packages
BuildRequires: freeglut-devel hdf5-devel libjpeg-devel libtiff-devel
BuildRequires: fltk-devel qt5-qtbase-devel qt5-qtwebkit-devel
BuildRequires: wxGTK-devel giflib-devel libtool-ltdl-devel
BuildRequires: fltk-devel
BuildRequires: qt5-qtbase-devel qt5-qtwebkit-devel
BuildRequires: qt4-devel qt4-webkit-devel
BuildRequires: wxGTK3-devel giflib-devel libtool-ltdl-devel
BuildRequires: libharu-devel
BuildRequires: swig lua-devel
BuildRequires: libXmu-devel
BuildRequires: python2-devel numpy
BuildRequires: python3-devel python3-numpy
BuildRequires: python2-devel python2-numpy
%description
Mathgl is a cross-platform library for making high-quality scientific
@ -127,15 +134,29 @@ using the MathGL library. UDAV works as a front-end to the mathgl
scripting engine, allowing for the generation of a wide variety of
scientific graph styles.
%description -n udav -l ru
UDAV - это кроссплатформенное приложение для интерактивной визуализации массивов
данных с применением библиотеки MathGL. UDAV, как GUI для MathGL, может быть
использован для формирования различного вида научных иллюстраций.
%package mgllab
Summary: Viewer and editor for mathgl graphs
Summary(ru): Редактор и средство визуализации для MathGL
Group: Applications/Engineering
Requires: %{name} = %{version}-%{release}
Provides: mgllab = %{version}-%{release}
%description mgllab
mgllab is FLTK port of UDAV, cross-platform program for interactive
data array visualization using the MathGL library. Mgllab works as a
front-end to the mathgl scripting engine, allowing for the generation
of a wide variety of scientific graph styles.
%description mgllab -l ru
mgllab - это FLTK порт UDAV, кроссплатформенное приложение для
интерактивной визуализации массивов данных с применением библиотеки MathGL.
Mgllab, как GUI для MathGL, может быть использован для формирования
различного вида научных иллюстраций.
%package mglview
Summary: Execute MathGL scripts and show in an window
Group: Applications/Engineering
Requires: %{name}-qt = %{version}-%{release}
Requires: %{name}-fltk = %{version}-%{release}
%description mglview
mglview reads MGL scripts from scriptfile to produce plots of
@ -144,13 +165,30 @@ showing the script result.
%package -n python2-mathgl
%{?python_provide:%python_provide python2-mathgl}
Summary: Python module for 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
Group: Applications/Engineering
Requires: %{name} = %{version}-%{release}
%description -n python3-mathgl
%{Summary}.
%package lua
Summary: Lua module for MathGL
Group: Applications/Engineering
Requires: %{name} = %{version}-%{release}
%description lua
%{Summary}.
%if 0%{?with_octave}
%package -n octave-mathgl
Summary: Octave module for MathGL
@ -234,21 +272,39 @@ Requires: zlib-devel%{?_isa}
%{summary}.
%endif
%package qt
Summary: Qt widgets of %{name} library
%package qt4
Summary: Qt4 widgets of %{name} library
Group: Applications/Engineering
Requires: %{name} = %{version}-%{release}
%description qt
%description qt4
%{summary}.
%package qt-devel
Summary: Devel files for qt widgets of %{name} library
%package qt4-devel
Summary: Devel files for qt4 widgets of %{name} library
Group: Applications/Engineering
Requires: %{name}-devel = %{version}-%{release}
%description qt4-devel
%{summary}.
%package qt5
Summary: Qt5 widgets of %{name} library
Group: Applications/Engineering
Requires: %{name} = %{version}-%{release}
Obsoletes: %{name}-qt < 2.4
%description qt5
%{summary}.
%package qt5-devel
Summary: Devel files for qt5 widgets of %{name} library
Group: Applications/Engineering
Requires: %{name}-devel = %{version}-%{release}
Obsoletes: %{name}-qt-devel < 2.4
Requires: qt5-qtbase-devel
%description qt-devel
%description qt5-devel
%{summary}.
%package fltk
@ -287,9 +343,14 @@ Requires: wxGTK-devel
%{summary}.
%prep
# .1 go here too
%setup -qn %{name}-%{version}.1
%setup -q
# get rid of 3d-paty getopt
rm -rf addons/getopt
# prep for both py2 and py3 build
mkdir lang/python{2,3}
touch lang/python{2,3}/CMakeLists.txt
#convert EOL encodings, maintaining timestames
for file in AUTHORS ChangeLog.txt README ; do
@ -300,12 +361,14 @@ done
%patch0 -p1 -b .examples
%patch1 -p1 -b .fluid
%patch2 -p1 -b .no_qt4
%patch3 -p1 -b .no-hdf4-and-hdf5-simultaneously
%patch2 -p1 -b .no-hdf4-and-hdf5-simultaneously
%patch5 -p1 -b .lang
%patch6 -p1 -b .gcc7
%patch7 -p1 -b .no_updatedb
%if 0%{?with_octave}
%patch4 -p1 -b .nooctaveinstall
%patch3 -p1 -b .nooctaveinstall
%else
%patch5 -p1 -b .no_octave
%patch4 -p1 -b .no_octave
%endif
@ -339,27 +402,25 @@ BUILD_MPI="-Denable-mpi=on -Denable-all-docs=off" %buildcommon
%define building_serial() \
BUILD_MPI="-Denable-mpi=off \
-Denable-all-docs=%{docs} \
-Denable-qt4=off \
-Denable-qt5=on \
-Denable-all-widgets=on \
-Denable-all-swig=on \
-Denable-all-widgets=on \
-Denable-hdf4=off \
" %buildcommon
# Disable SMP build
%define buildcommon() \
mkdir -p %{_target_platform}_$MPI_COMPILER_NAME; \
pushd %{_target_platform}_$MPI_COMPILER_NAME; \
%{cmake} \\\
-DMGL_LIB_INSTALL_DIR=%{_libdir} \\\
-DMathGL_INSTALL_LIB_DIR=%{_libdir} \\\
-Denable-all=on \\\
$BUILD_MPI \\\
..; \
popd; \
make -C %{_target_platform}_$MPI_COMPILER_NAME
# Disable SMP build
#make %{?_smp_mflags} -C %{_target_platform}_$MPI_COMPILER_NAME
# serial
MPI_COMPILER_NAME=serial %building_serial
@ -399,8 +460,13 @@ make install DESTDIR=%{buildroot} -C %{_target_platform}_serial INSTALL="install
mkdir -p %{mgl_octarch_dir}
cp %{_target_platform}_serial/lang/%{octpkg}.tar.gz %{mgl_octarch_dir}/%{mgl_octarch_name}
%octave_pkg_install
rm -f %{mgl_octarch_dir}/%{mgl_octarch_name}/%{octpkg}.tar.gz
%endif
# part of serial build
%find_lang %{name}
%find_lang udav --with-qt
%if 0%{?with_openmpi}
# OpenMPI
%{_openmpi_load}
@ -416,7 +482,9 @@ MPI_COMPILER_NAME=mpich %installing
%endif
#Remove symlink to .so file in python dir. Let python find libs normally
unlink %{buildroot}/%{python_sitelib}/_mathgl.so
# not needed now?
#unlink %{buildroot}/%{python_sitelib}/_mathgl.so
#unlink %{buildroot}/%{python3_sitelib}/_mathgl.so
#Remove static libraries generated by cmake
rm %{buildroot}/%{_libdir}/*.a
@ -435,24 +503,28 @@ fi
mv %{buildroot}%{_docdir}/mathgl _tmp_docdir
%endif
# Check .desktop file
desktop-file-validate %{buildroot}%{_datadir}/applications/udav.desktop
# Maintain l18n for udav
%find_lang udav --with-qt
# mathgl cmake file is placed into strange location. Move it to proper one with proper name
mkdir -p %{buildroot}%{_datadir}/cmake/Modules
mv %{buildroot}/%{_libdir}/cmake/mathgl2/mathgl2-config.cmake %{buildroot}%{_datadir}/cmake/Modules/FindMathGL2.cmake
rm -r %{buildroot}/%{_libdir}/cmake
%check
desktop-file-validate %{buildroot}%{_datadir}/applications/udav.desktop
desktop-file-validate %{buildroot}%{_datadir}/applications/mgllab.desktop
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%post qt -p /sbin/ldconfig
%post qt4 -p /sbin/ldconfig
%postun qt -p /sbin/ldconfig
%postun qt4 -p /sbin/ldconfig
%post qt5 -p /sbin/ldconfig
%postun qt5 -p /sbin/ldconfig
%post fltk -p /sbin/ldconfig
@ -462,22 +534,25 @@ rm -r %{buildroot}/%{_libdir}/cmake
%postun wx -p /sbin/ldconfig
%if 0%{?with_doc}
%post common
%if 0%{?with_doc}
/sbin/install-info %{_infodir}/%{name}_en.info %{_infodir}/dir || :
%endif
touch --no-create %{_datadir}/mime ||:
%postun common
if [ $1 -eq 0 ] ; then
update-desktop-database -q &> /dev/null
touch --no-create %{_datadir}/mime ||:
fi
%preun common
%if 0%{?with_doc}
if [ $1 = 0 ] ; then
/sbin/install-info --delete %{_infodir}/%{name}_en.info %{_infodir}/dir || :
fi
%endif
%post -n udav
/usr/bin/update-desktop-database &> /dev/null || :
%postun -n udav
/usr/bin/update-desktop-database &> /dev/null || :
%if 0%{?with_octave}
%post -n octave-mathgl
%octave_cmd pkg rebuild
@ -489,10 +564,9 @@ fi
%octave_cmd pkg rebuild
%endif
%files
%files -f %{name}.lang
%doc AUTHORS ChangeLog.txt README COPYING README_V2
%{_libdir}/libmgl.so.*
%{_libdir}/mgl-lua.so
%{_bindir}/mglconv
%exclude %{_bindir}/mgl_*example
%if 0%{?with_doc}
@ -501,22 +575,31 @@ fi
%files devel
%{_libdir}/libmgl.so
%exclude %{_libdir}/mgl-lua.so
%{_includedir}/mgl2/
%{_datadir}/cmake/Modules/FindMathGL2.cmake
%files mgllab
%{_bindir}/mgllab
%{_datadir}/applications/mgllab.desktop
%files mglview
%{_bindir}/mglview
%if 0%{?with_doc}
%{_mandir}/man1/mglview.1.gz
%endif
%files qt
%{_libdir}/libmgl-qt*.so.*
%files qt4
%{_libdir}/libmgl-qt4.so.*
%files qt4-devel
%{_libdir}/libmgl-qt4.so
%files qt5
%{_libdir}/libmgl-qt5.so.*
%{_libdir}/libmgl-wnd.so.*
%files qt-devel
%{_libdir}/libmgl-qt*.so
%files qt5-devel
%{_libdir}/libmgl-qt5.so
%{_libdir}/libmgl-wnd.so
%files wx
@ -539,13 +622,17 @@ fi
%{_mandir}/man1/udav.1.gz
%endif
%{_datadir}/applications/udav.desktop
%{_datadir}/mime/packages/mgl.xml
%dir %{_datadir}/udav/
%{_datadir}/pixmaps/*.png
%files -n python2-mathgl
%{python_sitelib}/*
%files -n python3-mathgl
%{python3_sitelib}/*
%files lua
%{_libdir}/mgl-lua.so
%if 0%{?with_octave}
%files -n octave-mathgl
%{octpkglibdir}
@ -563,6 +650,8 @@ fi
%{_datadir}/%{name}/
%files common
%{_datadir}/pixmaps/*.png
%{_datadir}/mime/packages/mgl.xml
%if 0%{?with_doc}
%{_mandir}/man5/mgl.5.gz
%{_infodir}/%{name}*.gz
@ -592,6 +681,13 @@ fi
%endif
%changelog
* Thu Dec 07 2017 Dmitrij S. Kryzhevich <kryzhev@ispms.ru> - 2.4.1-1
- Update to 2.4.1.
- Add python3 bindings.
- Refresh patches. Add new ones.
- Drop noqt4 patch. Make qt4 and qt5 widgets so, rename qt->qt4, add qt5 subpackage.
- Move lua bindings to lua subpackage.
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.3.5-9.1
- Python 2 binary package renamed to python2-mathgl
See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

View File

@ -1 +1 @@
SHA512 (mathgl-2.3.5.1.tar.gz) = 6af17b2fb2e6652028063839b14677a4256f20e568a854f9cc5ce79819838a425124193c5f580f96d5b3e9dc81ca0c7ab7076b0b8cfc17c0a7676f3d4c7ed6a3
SHA512 (mathgl-2.4.1.tar.gz) = 10fd016662ca60b9507942691f85b4d9151104319627732f4add0175475f7e8dff16e3645bb858c283b747f34e58f410d0532e94dc64cf8cf472938d3966402d