[magics] 01/63: WIP: support for python3.

Alastair McKinstry mckinstry at moszumanska.debian.org
Fri Mar 24 10:41:40 UTC 2017


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to branch debian/master
in repository magics.

commit 38d693d36382be6fb9737906d59219fcd980e9e7
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Fri May 1 12:29:16 2015 +0100

    WIP: support for python3.
---
 debian/control               | 11 ++++++++++
 debian/patches/python3.patch | 51 ++++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series        |  2 +-
 debian/rules                 |  6 +++++-
 4 files changed, 68 insertions(+), 2 deletions(-)

diff --git a/debian/control b/debian/control
index 3d7a569..3692e20 100644
--- a/debian/control
+++ b/debian/control
@@ -71,6 +71,17 @@ Description: python support for Magics++
  .
  This package provides python support for the magics++ library.
 
+Package: python3-magics++
+Section: python
+Architecture: any
+Depends:  libmagplus3 ( = ${binary:Version} ), ${misc:Depends}, ${shlibs:Depends}, ${python3:Depends}, python3, python3-simplejson
+Description: python3 support for Magics++
+ Magics++ is the latest generation of the ECMWF's Meteorological plotting
+ software MAGICS. Although completely redesigned in C++, it is intended to be
+ as backwards-compatible as possible with the Fortran interface.
+ .
+ This package provides python support for the magics++ library.
+
 Package: libmagics++-data
 Architecture: all
 Multi-Arch: foreign
diff --git a/debian/patches/python3.patch b/debian/patches/python3.patch
new file mode 100644
index 0000000..f9e6d5e
--- /dev/null
+++ b/debian/patches/python3.patch
@@ -0,0 +1,51 @@
+Author: Alastair McKinstry <mckinstry at debian.org>
+Description: Support for python3
+Forwarded: no
+Last-Updaged: 2015-05-01
+
+Index: magics++-2.24.4/python/Magics/metgram.py
+===================================================================
+--- magics++-2.24.4.orig/python/Magics/metgram.py
++++ magics++-2.24.4/python/Magics/metgram.py
+@@ -1,3 +1,5 @@
++from __future__ import print_function
++
+ import simplejson
+ import tempfile
+ import os
+@@ -309,7 +311,7 @@ def metgram(*args):
+ 
+ 	error = os.system(cmd)
+ 	if (error != 0):
+-		print "Error found"
++		print("Error found")
+ 	f.close
+ 	
+ 
+Index: magics++-2.24.4/python/Magics/setup.py.in
+===================================================================
+--- magics++-2.24.4.orig/python/Magics/setup.py.in
++++ magics++-2.24.4/python/Magics/setup.py.in
+@@ -1,5 +1,6 @@
+ #!/usr/bin/env python
+ 
++from __future__ import print_function
+ from distutils.core import setup, Extension
+ import os,sys
+ 
+@@ -34,13 +35,13 @@ attdict = dict(
+    extra_objects = [],
+ )
+ 
+-add_attribute = lambda **args: [list.append(attdict[key],value) for key,value in args.items()]
++add_attribute = lambda **args: [list.append(attdict[key],value) for key,value in list(args.items())]
+ 
+ build_dir = '../'
+ 
+ import glob
+ ofiles=glob.glob("%s*.o" % build_dir)
+-print "files are %s" % ofiles
++print ("files are {}".format(ofiles))
+ add_attribute(
+     include_dirs = os.path.join(build_dir,'src')
+ )
diff --git a/debian/patches/series b/debian/patches/series
index e77c9a6..f51ce15 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,3 @@
-# metview_fixes.patch
 dynamic_link.patch
 cve-2010-3393.patch
 terralib.patch
@@ -6,3 +5,4 @@ enable_static.patch
 gcc-4.7.patch
 magics-config.patch
 fix-headers.patch
+python3.patch
diff --git a/debian/rules b/debian/rules
index 8e781d5..9af5129 100755
--- a/debian/rules
+++ b/debian/rules
@@ -63,7 +63,7 @@ override_dh_auto_install:
 	dh_auto_install
 	# call configure to rebuild swig/Makefile with correct python version.
 	# (cd swig/Magics && ln -sf /usr/share/pyshared/instant/swig/numpy.i )
-	for pyvers in $(shell pyversions -r) ; do \
+	for pyvers in $(shell pyversions -r) $(shell py3versions -r)  ; do \
                 ver=`echo $$pyvers | sed -e 's/python//g' ` ; \
 		dh_auto_configure -- \
 			--enable-metview --enable-static --enable-cairo --enable-opengl $(WITH_EMOSLIB) \
@@ -83,7 +83,11 @@ override_dh_auto_install:
 	for pyvers in $(shell pyversions -r) ; do \
     		dh_python2 /usr/lib/$$pyvers/site-packages/Magics ; \
 	done
+	for pyvers in $(shell py3versions -r) ; do \
+    		dh_python3 /usr/lib/$$pyvers/site-packages/Magics ; \
+	done
 	dh_numpy -p python-magics++
+	dh_numpy3 -p python3-magics++
 	# remove fonts that are present in dejavu-ttf
 	rm -rf debian/libmagics++-data/usr/share/magics/ttf
 	find debian -name '*.so' -exec chrpath -d {} \;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/magics.git



More information about the debian-science-commits mailing list