Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 185692 | Differences between
and this patch

Collapse All | Expand All

(-)pygtk-2.10.6/configure.in (-4 / +5 lines)
Lines 262-279 Link Here
262
esac
262
esac
263
263
264
264
265
dnl checks to see if Numeric Python is installed.
265
dnl checks to see if numpy is installed.
266
AC_ARG_ENABLE(numpy,
266
AC_ARG_ENABLE(numpy,
267
  AC_HELP_STRING([--disable-numpy], [Disable numeric python features]),,
267
  AC_HELP_STRING([--disable-numpy], [Disable numeric python features]),,
268
  enable_numpy=yes)
268
  enable_numpy=yes)
269
269
270
if test "x$enable_numpy" != xno; then
270
if test "x$enable_numpy" != xno; then
271
  save_CPPFLAGS="$CPPFLAGS"
271
  save_CPPFLAGS="$CPPFLAGS"
272
  CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
272
  numpy_INCLUDES=`$PYTHON -c "import numpy; print numpy.get_include()"`
273
  AC_CHECK_HEADER([Numeric/arrayobject.h],
273
  CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES -I$numpy_INCLUDES"
274
  AC_CHECK_HEADER([numpy/arrayobject.h],
274
    [AC_DEFINE(HAVE_NUMPY,,[whether to include numeric python support])],,
275
    [AC_DEFINE(HAVE_NUMPY,,[whether to include numeric python support])],,
275
    [#include <Python.h>])
276
    [#include <Python.h>])
276
  CPPFLAGS="$save_CPPFLAGS"
277
  CPPFLAGS="$save_CPPFLAGS -I$numpy_INCLUDES"
277
fi
278
fi
278
279
279
dnl add required cflags ...
280
dnl add required cflags ...
(-)pygtk-2.10.6/gtk/gdk.override (-1 / +1 lines)
Lines 43-49 Link Here
43
#define GDK_DISPLAY(object) (GDK_DISPLAY_OBJECT(object))
43
#define GDK_DISPLAY(object) (GDK_DISPLAY_OBJECT(object))
44
44
45
#ifdef HAVE_NUMPY
45
#ifdef HAVE_NUMPY
46
#  include <Numeric/arrayobject.h>
46
#  include <numpy/arrayobject.h>
47
static int have_numpy(void);
47
static int have_numpy(void);
48
#endif
48
#endif
49
49
(-)pygtk-2.10.6/m4/jhflags.m4 (+21 lines)
Line 0 Link Here
1
dnl
2
dnl JH_ADD_CFLAG(FLAG)
3
dnl checks whether the C compiler supports the given flag, and if so, adds
4
dnl it to $CFLAGS.  If the flag is already present in the list, then the
5
dnl check is not performed.
6
AC_DEFUN([JH_ADD_CFLAG],
7
[
8
case " $CFLAGS " in
9
*@<:@\	\ @:>@$1@<:@\	\ @:>@*)
10
  ;;
11
*)
12
  save_CFLAGS="$CFLAGS"
13
  CFLAGS="$CFLAGS $1"
14
  AC_MSG_CHECKING([whether [$]CC understands $1])
15
  AC_TRY_COMPILE([], [], [jh_has_option=yes], [jh_has_option=no])
16
  AC_MSG_RESULT($jh_has_option)
17
  if test $jh_has_option = no; then
18
    CFLAGS="$save_CFLAGS"
19
  fi
20
  ;;
21
esac])
(-)pygtk-2.10.6/m4/python.m4 (+66 lines)
Line 0 Link Here
1
## this one is commonly used with AM_PATH_PYTHONDIR ...
2
dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
3
dnl Check if a module containing a given symbol is visible to python.
4
AC_DEFUN([AM_CHECK_PYMOD],
5
[AC_REQUIRE([AM_PATH_PYTHON])
6
py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
7
AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
8
AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
9
ifelse([$2],[], [prog="
10
import sys
11
try:
12
        import $1
13
except ImportError:
14
        sys.exit(1)
15
except:
16
        sys.exit(0)
17
sys.exit(0)"], [prog="
18
import $1
19
$1.$2"])
20
if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
21
  then
22
    eval "py_cv_mod_$py_mod_var=yes"
23
  else
24
    eval "py_cv_mod_$py_mod_var=no"
25
  fi
26
])
27
py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
28
if test "x$py_val" != xno; then
29
  AC_MSG_RESULT(yes)
30
  ifelse([$3], [],, [$3
31
])dnl
32
else
33
  AC_MSG_RESULT(no)
34
  ifelse([$4], [],, [$4
35
])dnl
36
fi
37
])
38
39
dnl a macro to check for ability to create python extensions
40
dnl  AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
41
dnl function also defines PYTHON_INCLUDES
42
AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
43
[AC_REQUIRE([AM_PATH_PYTHON])
44
AC_MSG_CHECKING(for headers required to compile python extensions)
45
dnl deduce PYTHON_INCLUDES
46
py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
47
py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
48
if test -x "$PYTHON-config"; then
49
PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
50
else
51
PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
52
if test "$py_prefix" != "$py_exec_prefix"; then
53
  PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
54
fi
55
fi
56
AC_SUBST(PYTHON_INCLUDES)
57
dnl check if the headers exist:
58
save_CPPFLAGS="$CPPFLAGS"
59
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
60
AC_TRY_CPP([#include <Python.h>],dnl
61
[AC_MSG_RESULT(found)
62
$1],dnl
63
[AC_MSG_RESULT(not found)
64
$2])
65
CPPFLAGS="$save_CPPFLAGS"
66
])
(-)pygtk-2.10.6/README (-1 / +1 lines)
Lines 52-58 Link Here
52
    GTK+ 2.10.0 or higher for 2.10 API
52
    GTK+ 2.10.0 or higher for 2.10 API
53
  * libglade 2.5.0 or higher (optional)
53
  * libglade 2.5.0 or higher (optional)
54
  * pycairo 0.5.0 or higher (optional)
54
  * pycairo 0.5.0 or higher (optional)
55
  * Numeric (optional)
55
  * numpy (optional)
56
56
57
This release is supporting the following GTK+ releases:
57
This release is supporting the following GTK+ releases:
58
58
(-)pygtk-2.10.6/setup.py (-6 / +6 lines)
Lines 233-248 Link Here
233
        data_files.append((DEFS_DIR, ('pangocairo.defs',)))
233
        data_files.append((DEFS_DIR, ('pangocairo.defs',)))
234
        GLOBAL_MACROS.append(('HAVE_PYCAIRO',1))
234
        GLOBAL_MACROS.append(('HAVE_PYCAIRO',1))
235
if gtk.can_build():
235
if gtk.can_build():
236
    if '--disable-numeric' in sys.argv:
236
    if '--disable-numpy' in sys.argv:
237
        sys.argv.remove('--disable-numeric')
237
        sys.argv.remove('--disable-numpy')
238
    else:
238
    else:
239
        try:
239
        try:
240
            import Numeric
240
            import numpy
241
            Numeric # pyflakes
241
            numpy # pyflakes
242
            GLOBAL_MACROS.append(('HAVE_NUMPY', 1))
242
            GLOBAL_MACROS.append(('HAVE_NUMPY', 1))
243
        except ImportError:
243
        except ImportError:
244
            print ('* Numeric module could not be found, '
244
            print ('* numpy module could not be found, '
245
                   'will build without Numeric support.')
245
                   'will build without numpy support.')
246
    ext_modules.append(gtk)
246
    ext_modules.append(gtk)
247
    data_files.append((os.path.join(INCLUDE_DIR, 'pygtk'), ('gtk/pygtk.h',)))
247
    data_files.append((os.path.join(INCLUDE_DIR, 'pygtk'), ('gtk/pygtk.h',)))
248
    data_files.append((DEFS_DIR, ('gtk/gdk.defs', 'gtk/gdk-types.defs',
248
    data_files.append((DEFS_DIR, ('gtk/gdk.defs', 'gtk/gdk-types.defs',

Return to bug 185692