From 042d521c8957e0b8564c9bcb8701afef129fe41c Mon Sep 17 00:00:00 2001 From: Dimitrios Eftaxiopoulos Date: Sun, 25 Nov 2018 20:58:39 +0200 Subject: [PATCH] Merge A. McKinstry's 2.4.2.1-3 upload changes --- debian/changelog | 7 ++-- debian/copyright | 2 +- debian/patches/python2_and_python3.patch | 47 ++++++++++++++++++------ debian/rules | 8 ++++ debian/source/local-options | 2 - 5 files changed, 47 insertions(+), 19 deletions(-) delete mode 100644 debian/source/local-options diff --git a/debian/changelog b/debian/changelog index 543ae3e..d571e78 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,8 @@ -mathgl (2.4.2.1-3) UNRELEASED; urgency=medium +mathgl (2.4.2.1-3) unstable; urgency=medium - * Trim trailing whitespace. - * Use secure copyright file specification URI. + * Fix FTBFS wiht python3.7. Closes: #912590 - -- Jelmer Vernooij Wed, 24 Oct 2018 23:14:23 +0000 + -- Alastair McKinstry Thu, 01 Nov 2018 17:17:49 +0000 mathgl (2.4.2.1-2) unstable; urgency=medium diff --git a/debian/copyright b/debian/copyright index 00e0ac1..8e7b039 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,4 +1,4 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: MathGL Upstream-Contact: Alexey Balakin Source: http://mathgl.sourceforge.net/ diff --git a/debian/patches/python2_and_python3.patch b/debian/patches/python2_and_python3.patch index d626181..945ce0d 100644 --- a/debian/patches/python2_and_python3.patch +++ b/debian/patches/python2_and_python3.patch @@ -1,6 +1,8 @@ Provide support for both python2 and python3 interfaces +Index: mathgl-2.4.2.1/lang/python2/CMakeLists.txt +=================================================================== --- /dev/null -+++ b/lang/python2/CMakeLists.txt ++++ mathgl-2.4.2.1/lang/python2/CMakeLists.txt @@ -0,0 +1,60 @@ +set(src_imp_dep +../../include/mgl2/type.h @@ -62,8 +64,10 @@ Provide support for both python2 and python3 interfaces +endif(enable-python) + +set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${mgl_clean_files}") +Index: mathgl-2.4.2.1/lang/python3/CMakeLists.txt +=================================================================== --- /dev/null -+++ b/lang/python3/CMakeLists.txt ++++ mathgl-2.4.2.1/lang/python3/CMakeLists.txt @@ -0,0 +1,70 @@ +set(src_imp_dep +../../include/mgl2/type.h @@ -79,10 +83,10 @@ Provide support for both python2 and python3 interfaces +SET_SOURCE_FILES_PROPERTIES(../mathgl.i ../numpy.i PROPERTIES CPLUSPLUS ON) + +if(enable-python) -+ set(Python_ADDITIONAL_VERSIONS 3.6) ++ set(Python_ADDITIONAL_VERSIONS ${PY3VERSION_DOTTED}) + unset(PYTHONINTERP_FOUND) + unset(PYTHON_EXECUTABLE CACHE) -+ FIND_PACKAGE(PythonInterp 3.6 REQUIRED) ++ FIND_PACKAGE(PythonInterp ${PY3VERSION_DOTTED} REQUIRED) + if(NOT PYTHONINTERP_FOUND) + message(SEND_ERROR "Couldn't find python interpreter.") + endif(NOT PYTHONINTERP_FOUND) @@ -94,7 +98,7 @@ Provide support for both python2 and python3 interfaces + unset(PYTHONLIBS_VERSION_STRING CACHE) + unset(PYTHON_LIBRARY CACHE) + unset(PYTHON_INCLUDE_DIR CACHE) -+ FIND_PACKAGE(PythonLibs 3.6 REQUIRED) ++ FIND_PACKAGE(PythonLibs ${PY3VERSION_DOTTED} REQUIRED) + if(NOT PYTHONLIBS_FOUND) + message(SEND_ERROR "Couldn't find python development libraries.") + endif(NOT PYTHONLIBS_FOUND) @@ -129,14 +133,16 @@ Provide support for both python2 and python3 interfaces + ) + add_custom_target(mglp3_python_module ALL DEPENDS _mathglp3 mathgl.pyc) + -+ install(FILES ${MathGL2_BINARY_DIR}/lang/python3/mathgl.py ${MathGL2_BINARY_DIR}/lang/python3/__pycache__/mathgl.cpython-36.pyc DESTINATION ${MGL_PYTHON_SITE_PACKAGES}/__pycache__) ++ install(FILES ${MathGL2_BINARY_DIR}/lang/python3/mathgl.py ${MathGL2_BINARY_DIR}/lang/python3/__pycache__/mathgl.cpython-${PY3VERSION_NODOT}.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}") ---- a/lang/numpy.i -+++ b/lang/numpy.i +Index: mathgl-2.4.2.1/lang/numpy.i +=================================================================== +--- mathgl-2.4.2.1.orig/lang/numpy.i ++++ mathgl-2.4.2.1/lang/numpy.i @@ -107,11 +107,12 @@ if (PyDict_Check( py_obj)) return "dict" ; if (PyList_Check( py_obj)) return "list" ; @@ -154,9 +160,11 @@ Provide support for both python2 and python3 interfaces } /* Given a NumPy typecode, return a string describing the type. ---- a/lang/CMakeLists.txt -+++ b/lang/CMakeLists.txt -@@ -17,52 +17,6 @@ +Index: mathgl-2.4.2.1/lang/CMakeLists.txt +=================================================================== +--- mathgl-2.4.2.1.orig/lang/CMakeLists.txt ++++ mathgl-2.4.2.1/lang/CMakeLists.txt +@@ -17,52 +17,6 @@ if(NOT SWIG_FOUND) endif(NOT SWIG_FOUND) INCLUDE(${SWIG_USE_FILE}) @@ -209,7 +217,7 @@ Provide support for both python2 and python3 interfaces if(enable-lua) INCLUDE(FindLua51) if(NOT LUA51_FOUND) -@@ -145,4 +99,8 @@ +@@ -145,4 +99,8 @@ message(STATUS "${oct_prog} ${oct_host} endif(enable-octave-install) set(mgl_clean_files ${mgl_clean_files} mathgl) endif(enable-octave) @@ -218,3 +226,18 @@ Provide support for both python2 and python3 interfaces +add_subdirectory( python3 ) + set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${mgl_clean_files}") +Index: mathgl-2.4.2.1/CMakeLists.txt +=================================================================== +--- mathgl-2.4.2.1.orig/CMakeLists.txt ++++ mathgl-2.4.2.1/CMakeLists.txt +@@ -9,6 +9,10 @@ set(mgl_clean_files ) + set(MGL_DEP_LIBS) + add_definitions(-DMGL_SRC) + ++# Set these on command-line ++# set(PY3VERSION_DOTTED 3.6) ++# set(PY3VERSION_NODOT 36) ++ + #add_definitions(-DZLIB_WINAPI) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${MathGL2_SOURCE_DIR}/scripts) + diff --git a/debian/rules b/debian/rules index 3ceb32f..64beed8 100755 --- a/debian/rules +++ b/debian/rules @@ -10,9 +10,17 @@ export DH_VERBOSE=1 export DH_OPTIONS=-v +DOTTED:=`py3versions -d | sed 's/python//' ` +NODOT:=`py3versions -d | sed 's/\.//' | sed 's/python//' ` + %: dh $@ --buildsystem=cmake --with python2,python3 + +override_dh_auto_configure: + dh_auto_configure -- \ + -DPY3VERSION_DOTTED=$(DOTTED) -DPY3VERSION_NODOT=$(NODOT) + override_dh_python2: dh_numpy diff --git a/debian/source/local-options b/debian/source/local-options deleted file mode 100644 index d4bb316..0000000 --- a/debian/source/local-options +++ /dev/null @@ -1,2 +0,0 @@ - -unapply-patches -- 2.30.2