rpms/pygtk2/OLPC-3 pygtk-use-numpy.patch, NONE, 1.1 pygtk2.spec, 1.17, 1.18

Daniel Drake dsd at fedoraproject.org
Wed Aug 27 01:18:12 UTC 2008


Author: dsd

Update of /cvs/pkgs/rpms/pygtk2/OLPC-3
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv5418

Modified Files:
	pygtk2.spec 
Added Files:
	pygtk-use-numpy.patch 
Log Message:
use numpy instead of numeric

pygtk-use-numpy.patch:

--- NEW FILE pygtk-use-numpy.patch ---
From: Ali Polatel
http://bugzilla.gnome.org/show_bug.cgi?id=397544

Makefile.am hunk added by Daniel Drake

Index: pygtk-2.12.1/configure.in
===================================================================
--- pygtk-2.12.1.orig/configure.in
+++ pygtk-2.12.1/configure.in
@@ -295,18 +295,19 @@ case $gdk_target in
 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],
+  numpy_INCLUDES=`$PYTHON -c "import numpy; print numpy.get_include()"`
+  CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES -I$numpy_INCLUDES"
+  AC_CHECK_HEADER([numpy/arrayobject.h],
     [AC_DEFINE(HAVE_NUMPY,,[whether to include numeric python support])],,
     [#include <Python.h>])
-  CPPFLAGS="$save_CPPFLAGS"
+  CPPFLAGS="$save_CPPFLAGS -I$numpy_INCLUDES"
 fi
 
 
Index: pygtk-2.12.1/gtk/gdk.override
===================================================================
--- pygtk-2.12.1.orig/gtk/gdk.override
+++ pygtk-2.12.1/gtk/gdk.override
@@ -43,7 +43,7 @@ headers
 #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
 
Index: pygtk-2.12.1/README
===================================================================
--- pygtk-2.12.1.orig/README
+++ pygtk-2.12.1/README
@@ -53,7 +53,7 @@ Requirements
     GTK+ 2.12.0 or higher for 2.12 API
   * libglade 2.5.0 or higher (optional)
   * pycairo 0.5.0 or higher (optional)
-  * Numeric (optional)
+  * numpy (optional)
 
 This release is supporting the following GTK+ releases:
 
Index: pygtk-2.12.1/setup.py
===================================================================
--- pygtk-2.12.1.orig/setup.py
+++ pygtk-2.12.1/setup.py
@@ -233,16 +233,16 @@ if pango.can_build():
         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',
Index: pygtk-2.12.1/Makefile.am
===================================================================
--- pygtk-2.12.1.orig/Makefile.am
+++ pygtk-2.12.1/Makefile.am
@@ -1,4 +1,5 @@
 AUTOMAKE_OPTIONS = 1.7
+ACLOCAL_AMFLAGS = -I m4
 
 if BUILD_GTK
   GTK_SUBDIR = gtk


Index: pygtk2.spec
===================================================================
RCS file: /cvs/pkgs/rpms/pygtk2/OLPC-3/pygtk2.spec,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- pygtk2.spec	17 Mar 2008 16:41:50 -0000	1.17
+++ pygtk2.spec	27 Aug 2008 01:17:42 -0000	1.18
@@ -6,7 +6,7 @@
 
 Name: pygtk2
 Version: 2.12.1
-Release: 6%{?dist}
+Release: 6%{?dist}.1
 License: LGPLv2+
 Group: Development/Languages
 Summary: Python bindings for GTK+
@@ -21,12 +21,15 @@
 # RH bug #379051 / GNOME bug #523001
 Patch1: pygtk2-2.12.1-pygtk-generic-cell-renderer-activate.patch
 
+# http://dev.laptop.org/ticket/1286
+Patch2: pygtk-use-numpy.patch
+
 ### Dependencies ###
 
 Requires: gtk2 >= 2.9.4
 Requires: pycairo
 Requires: pygobject2
-Requires: python-numeric
+Requires: numpy
 Requires: python2 >= 2.3
 
 ### Build Dependencies ###
@@ -41,7 +44,7 @@
 BuildRequires: pango-devel >= 1.10.0
 BuildRequires: pycairo-devel >= 0.5.0
 BuildRequires: pygobject2-devel >= 2.12.0
-BuildRequires: python-numeric
+BuildRequires: numpy
 BuildRequires: python2-devel >= 2.3
 
 %description
@@ -92,6 +95,8 @@
 %setup -q -n pygtk-%{version}
 %patch0 -p1
 %patch1 -p1 -b .pygtk-generic-cell-renderer-activate
+%patch2 -p1
+autoreconf -f -i
 
 %build
 %configure --enable-thread --enable-numpy
@@ -155,6 +160,9 @@
 %{_datadir}/gtk-doc/html/pygtk
 
 %changelog
+* Tue Aug 26 2008 Daniel Drake <dsd at laptop.org> - 2.12.1-6.1
+- Add patch to use numpy instead of numeric (dlo#1286)
+
 * Mon Mar 17 2008 Matthew Barnes <mbarnes at redhat.com> - 2.12.1-6.fc9
 - Add patch for RH bug #379051 (keyboard events in cell renderer).
 




More information about the fedora-extras-commits mailing list