diff options
author | Richard Purdie <richard@openedhand.com> | 2008-08-25 20:33:55 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2008-08-25 20:33:55 +0000 |
commit | 16e6877c4ce53fd3be88dd77263a03e7d88c3163 (patch) | |
tree | 831004ca391e04c8deaace28b15cb602c0848c77 /meta/packages/python/python-pygtk | |
parent | 07eeb6a8b6d671db7566f839ab22a26b6f118077 (diff) | |
download | poky-16e6877c4ce53fd3be88dd77263a03e7d88c3163.tar.gz |
python: Promote from meta-extras to meta
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5092 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/python/python-pygtk')
5 files changed, 223 insertions, 0 deletions
diff --git a/meta/packages/python/python-pygtk/acinclude.m4 b/meta/packages/python/python-pygtk/acinclude.m4 new file mode 100644 index 0000000000..53518fb2eb --- /dev/null +++ b/meta/packages/python/python-pygtk/acinclude.m4 | |||
@@ -0,0 +1,90 @@ | |||
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 | AC_ARG_WITH(python-includes, | ||
47 | [ --with-python-includes=DIR path to Python includes], py_exec_prefix=$withval) | ||
48 | if test x$py_exec_prefix != x; then | ||
49 | PYTHON_INCLUDES="-I${py_exec_prefix}/include/python${PYTHON_VERSION}" | ||
50 | else | ||
51 | py_prefix=`$PYTHON -c "import sys; print sys.prefix"` | ||
52 | py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` | ||
53 | PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" | ||
54 | if test "$py_prefix" != "$py_exec_prefix"; then | ||
55 | PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" | ||
56 | fi | ||
57 | fi | ||
58 | AC_SUBST(PYTHON_INCLUDES) | ||
59 | dnl check if the headers exist: | ||
60 | save_CPPFLAGS="$CPPFLAGS" | ||
61 | CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" | ||
62 | AC_TRY_CPP([#include <Python.h>],dnl | ||
63 | [AC_MSG_RESULT(found) | ||
64 | $1],dnl | ||
65 | [AC_MSG_RESULT(not found) | ||
66 | $2]) | ||
67 | CPPFLAGS="$save_CPPFLAGS" | ||
68 | ]) | ||
69 | |||
70 | dnl | ||
71 | dnl JH_ADD_CFLAG(FLAG) | ||
72 | dnl checks whether the C compiler supports the given flag, and if so, adds | ||
73 | dnl it to $CFLAGS. If the flag is already present in the list, then the | ||
74 | dnl check is not performed. | ||
75 | AC_DEFUN([JH_ADD_CFLAG], | ||
76 | [ | ||
77 | case " $CFLAGS " in | ||
78 | *@<:@\ \ @:>@$1@<:@\ \ @:>@*) | ||
79 | ;; | ||
80 | *) | ||
81 | save_CFLAGS="$CFLAGS" | ||
82 | CFLAGS="$CFLAGS $1" | ||
83 | AC_MSG_CHECKING([whether [$]CC understands $1]) | ||
84 | AC_TRY_COMPILE([], [], [jh_has_option=yes], [jh_has_option=no]) | ||
85 | AC_MSG_RESULT($jh_has_option) | ||
86 | if test $jh_has_option = no; then | ||
87 | CFLAGS="$save_CFLAGS" | ||
88 | fi | ||
89 | ;; | ||
90 | esac]) | ||
diff --git a/meta/packages/python/python-pygtk/fix-gtkunixprint.patch b/meta/packages/python/python-pygtk/fix-gtkunixprint.patch new file mode 100644 index 0000000000..dca19ce5ed --- /dev/null +++ b/meta/packages/python/python-pygtk/fix-gtkunixprint.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | Index: pygtk-2.10.0/gtk/gtkunixprint.override | ||
2 | =================================================================== | ||
3 | --- pygtk-2.10.0.orig/gtk/gtkunixprint.override | ||
4 | +++ pygtk-2.10.0/gtk/gtkunixprint.override | ||
5 | @@ -105,11 +105,7 @@ _wrap_gtk_print_job_get_surface(PyGObjec | ||
6 | if (pyg_error_check(&error)) | ||
7 | return NULL; | ||
8 | |||
9 | -#if PYCAIRO_VERSION_HEX >= 0x1010600 | ||
10 | return PycairoSurface_FromSurface(surface, NULL); | ||
11 | -#else | ||
12 | - return PycairoSurface_FromSurface(surface, NULL, NULL); | ||
13 | -#endif | ||
14 | } | ||
15 | %% | ||
16 | override gtk_print_job_send kwargs | ||
diff --git a/meta/packages/python/python-pygtk/nodocs.patch b/meta/packages/python/python-pygtk/nodocs.patch new file mode 100644 index 0000000000..9b2387e959 --- /dev/null +++ b/meta/packages/python/python-pygtk/nodocs.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | Index: pygtk-2.10.4/Makefile.am | ||
2 | =================================================================== | ||
3 | --- pygtk-2.10.4.orig/Makefile.am | ||
4 | +++ pygtk-2.10.4/Makefile.am | ||
5 | @@ -4,7 +4,7 @@ if BUILD_GTK | ||
6 | GTK_SUBDIR = gtk | ||
7 | endif | ||
8 | |||
9 | -SUBDIRS = codegen . $(GTK_SUBDIR) examples tests docs | ||
10 | +SUBDIRS = codegen . $(GTK_SUBDIR) examples tests | ||
11 | |||
12 | PLATFORM_VERSION = 2.0 | ||
13 | |||
diff --git a/meta/packages/python/python-pygtk/prevent_to_get_display_during_import.patch b/meta/packages/python/python-pygtk/prevent_to_get_display_during_import.patch new file mode 100644 index 0000000000..9340f8244d --- /dev/null +++ b/meta/packages/python/python-pygtk/prevent_to_get_display_during_import.patch | |||
@@ -0,0 +1,14 @@ | |||
1 | Index: pygtk-2.10.4/gtk/__init__.py | ||
2 | =================================================================== | ||
3 | --- pygtk-2.10.4.orig/gtk/__init__.py 2007-11-27 19:27:05.000000000 -0300 | ||
4 | +++ pygtk-2.10.4/gtk/__init__.py 2007-11-27 19:28:22.000000000 -0300 | ||
5 | @@ -78,7 +78,8 @@ | ||
6 | |||
7 | keysyms = LazyModule('keysyms', locals()) | ||
8 | |||
9 | -_init() | ||
10 | +if not hasattr(sys.modules['__main__'], 'python_launcher_enabled'): | ||
11 | + _init() | ||
12 | |||
13 | # CAPI | ||
14 | _PyGtk_API = _gtk._PyGtk_API | ||
diff --git a/meta/packages/python/python-pygtk/python-pygtk2/acinclude.m4 b/meta/packages/python/python-pygtk/python-pygtk2/acinclude.m4 new file mode 100644 index 0000000000..53518fb2eb --- /dev/null +++ b/meta/packages/python/python-pygtk/python-pygtk2/acinclude.m4 | |||
@@ -0,0 +1,90 @@ | |||
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 | AC_ARG_WITH(python-includes, | ||
47 | [ --with-python-includes=DIR path to Python includes], py_exec_prefix=$withval) | ||
48 | if test x$py_exec_prefix != x; then | ||
49 | PYTHON_INCLUDES="-I${py_exec_prefix}/include/python${PYTHON_VERSION}" | ||
50 | else | ||
51 | py_prefix=`$PYTHON -c "import sys; print sys.prefix"` | ||
52 | py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` | ||
53 | PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" | ||
54 | if test "$py_prefix" != "$py_exec_prefix"; then | ||
55 | PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" | ||
56 | fi | ||
57 | fi | ||
58 | AC_SUBST(PYTHON_INCLUDES) | ||
59 | dnl check if the headers exist: | ||
60 | save_CPPFLAGS="$CPPFLAGS" | ||
61 | CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" | ||
62 | AC_TRY_CPP([#include <Python.h>],dnl | ||
63 | [AC_MSG_RESULT(found) | ||
64 | $1],dnl | ||
65 | [AC_MSG_RESULT(not found) | ||
66 | $2]) | ||
67 | CPPFLAGS="$save_CPPFLAGS" | ||
68 | ]) | ||
69 | |||
70 | dnl | ||
71 | dnl JH_ADD_CFLAG(FLAG) | ||
72 | dnl checks whether the C compiler supports the given flag, and if so, adds | ||
73 | dnl it to $CFLAGS. If the flag is already present in the list, then the | ||
74 | dnl check is not performed. | ||
75 | AC_DEFUN([JH_ADD_CFLAG], | ||
76 | [ | ||
77 | case " $CFLAGS " in | ||
78 | *@<:@\ \ @:>@$1@<:@\ \ @:>@*) | ||
79 | ;; | ||
80 | *) | ||
81 | save_CFLAGS="$CFLAGS" | ||
82 | CFLAGS="$CFLAGS $1" | ||
83 | AC_MSG_CHECKING([whether [$]CC understands $1]) | ||
84 | AC_TRY_COMPILE([], [], [jh_has_option=yes], [jh_has_option=no]) | ||
85 | AC_MSG_RESULT($jh_has_option) | ||
86 | if test $jh_has_option = no; then | ||
87 | CFLAGS="$save_CFLAGS" | ||
88 | fi | ||
89 | ;; | ||
90 | esac]) | ||