pygtk r3122 - in trunk: . gtk



Author: gianmt
Date: Mon Apr  6 22:52:39 2009
New Revision: 3122
URL: http://svn.gnome.org/viewvc/pygtk?rev=3122&view=rev

Log:
2009-04-06  Josselin Mouette  <joss debian org>

	Bug 397544 â Numeric is no longer maintained
	
	* gtk/gdk.override:
	* configure.ac:
	* setup.py:
	* README: Update pygtk to use numpy instead of Numeric.



Modified:
   trunk/ChangeLog
   trunk/README
   trunk/configure.ac
   trunk/gtk/gdk.override
   trunk/setup.py

Modified: trunk/README
==============================================================================
--- trunk/README	(original)
+++ trunk/README	Mon Apr  6 22:52:39 2009
@@ -54,7 +54,7 @@
     GTK+ 2.14.0 or higher for 2.14 API
   * libglade 2.5.0 or higher (optional)
   * pycairo 1.0.2 or higher (optional)
-  * Numeric (optional)
+  * numpy (optional)
 
 This release is supporting the following GTK+ releases:
 

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Mon Apr  6 22:52:39 2009
@@ -367,18 +367,27 @@
 esac
 
 
-dnl checks to see if Numeric Python is installed.
+dnl checks to see if numpy is installed.
 AC_ARG_ENABLE(numpy,
   AC_HELP_STRING([--disable-numpy], [Disable numeric python features]),,
   enable_numpy=yes)
 
 if test "x$enable_numpy" != xno; then
   save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
-  AC_CHECK_HEADER([Numeric/arrayobject.h],
-    [AC_DEFINE(HAVE_NUMPY,,[whether to include numeric python support])],,
-    [#include <Python.h>])
-  CPPFLAGS="$save_CPPFLAGS"
+  numpy_INCLUDES=`$PYTHON -c "import numpy; print numpy.get_include()" 2> /dev/null`
+  if test "x$numpy_INCLUDES" = "x"; then
+    AC_MSG_WARN([Could not find a valid numpy installation, disabling.])
+    enable_numpy=no
+  else
+    CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES -I$numpy_INCLUDES"
+    AC_CHECK_HEADER([numpy/arrayobject.h],
+      [AC_DEFINE(HAVE_NUMPY,,[whether to include numeric python support])],
+      [enable_numpy=no],
+      [#include <Python.h>])
+    if test "x$enable_numpy" != "xno"; then
+      CPPFLAGS="$save_CPPFLAGS -I$numpy_INCLUDES"
+    fi
+  fi
 fi
 
 
@@ -419,11 +428,11 @@
 $have_gtk && echo     gtk with $gtk_version API
 $have_libglade && echo     gtk.glade
 $have_gtkunixprint && echo     gtk.unixprint
-echo
 
 if test ! $have_atk || ! $have_pango || \
         ! $have_gtk || ! $have_libglade || \
         ! $have_pangocairo || ! $have_gtkunixprint; then
+  echo
   echo "The following modules will NOT be built:"
   echo
   $have_atk || echo     atk
@@ -433,3 +442,7 @@
   $have_libglade || echo     gtk.glade
   $have_gtkunixprint || echo     gtk.unixprint
 fi
+
+echo
+echo "Numpy support: $enable_numpy"
+echo

Modified: trunk/gtk/gdk.override
==============================================================================
--- trunk/gtk/gdk.override	(original)
+++ trunk/gtk/gdk.override	Mon Apr  6 22:52:39 2009
@@ -44,7 +44,7 @@
 #define GDK_DISPLAY(object) (GDK_DISPLAY_OBJECT(object))
 
 #ifdef HAVE_NUMPY
-#  include <Numeric/arrayobject.h>
+#  include <numpy/arrayobject.h>
 static int have_numpy(void);
 #endif
 

Modified: trunk/setup.py
==============================================================================
--- trunk/setup.py	(original)
+++ trunk/setup.py	Mon Apr  6 22:52:39 2009
@@ -228,16 +228,16 @@
         data_files.append((DEFS_DIR, ('pangocairo.defs',)))
         GLOBAL_MACROS.append(('HAVE_PYCAIRO',1))
 if gtk.can_build():
-    if '--disable-numeric' in sys.argv:
-        sys.argv.remove('--disable-numeric')
+    if '--disable-numpy' in sys.argv:
+        sys.argv.remove('--disable-numpy')
     else:
         try:
-            import Numeric
-            Numeric # pyflakes
+            import numpy
+            numpy # pyflakes
             GLOBAL_MACROS.append(('HAVE_NUMPY', 1))
         except ImportError:
-            print ('* Numeric module could not be found, '
-                   'will build without Numeric support.')
+            print ('* numpy module could not be found, '
+                   'will build without numpy support.')
     ext_modules.append(gtk)
     data_files.append((os.path.join(INCLUDE_DIR, 'pygtk'), ('gtk/pygtk.h',)))
     data_files.append((DEFS_DIR, ('gtk/gdk.defs', 'gtk/gdk-types.defs',



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]