Permit to build with Python 2.7.2.

Spotted by nigel@, diff from upstream by me and ok nigel@ (thanks!).
This commit is contained in:
rpointel 2012-02-28 23:01:23 +00:00
parent bdd5b86d65
commit 0703bff907
2 changed files with 21 additions and 6 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.41 2011/11/02 09:57:22 jasper Exp $
# $OpenBSD: Makefile,v 1.42 2012/02/28 23:01:23 rpointel Exp $
VMEM_WARNING= Yes
@ -6,7 +6,7 @@ COMMENT= Python charting and plotting API
DISTNAME= matplotlib-0.98.5.2
PKGNAME= py-${DISTNAME}
REVISION= 10
REVISION= 11
CATEGORIES= graphics devel math
HOMEPAGE= http://matplotlib.sourceforge.net/

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-setupext_py,v 1.11 2011/07/20 15:13:20 naddy Exp $
--- setupext.py.orig Thu Dec 18 21:34:22 2008
+++ setupext.py Wed Jul 20 08:55:48 2011
$OpenBSD: patch-setupext_py,v 1.12 2012/02/28 23:01:23 rpointel Exp $
--- setupext.py.orig Fri Dec 19 05:34:22 2008
+++ setupext.py Tue Feb 28 23:26:18 2012
@@ -46,6 +46,7 @@ import re
import subprocess
@ -66,7 +66,22 @@ $OpenBSD: patch-setupext_py,v 1.11 2011/07/20 15:13:20 naddy Exp $
if not find_include_file(module.include_dirs, "tk.h"):
message = 'Tkinter present, but header files are not found. ' + \
'You may need to install development packages.'
@@ -1051,7 +1058,8 @@ so that setup can determine where your libraries are l
@@ -794,8 +801,13 @@ def check_for_tk():
gotit = False
if gotit:
+ try:
+ tk_v = Tkinter.__version__.split()[-2]
+ except (AttributeError, IndexError):
+ # Tkinter.__version__ has been removed in python 3
+ tk_v = 'version not identified'
print_status("Tkinter", "Tkinter: %s, Tk: %s, Tcl: %s" %
- (Tkinter.__version__.split()[-2], Tkinter.TkVersion, Tkinter.TclVersion))
+ (tk_v, Tkinter.TkVersion, Tkinter.TclVersion))
else:
print_status("Tkinter", "no")
if explanation is not None:
@@ -1051,7 +1063,8 @@ so that setup can determine where your libraries are l
tcl_lib, tcl_inc, tk_lib, tk_inc = result
module.include_dirs.extend([tcl_inc, tk_inc])
module.library_dirs.extend([tcl_lib, tk_lib])