diff options
Diffstat (limited to 'meta/recipes-devtools/python/python-pygtk')
8 files changed, 314 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python-pygtk/acinclude.m4 b/meta/recipes-devtools/python/python-pygtk/acinclude.m4 new file mode 100644 index 0000000000..53518fb2eb --- /dev/null +++ b/meta/recipes-devtools/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/recipes-devtools/python/python-pygtk/add-gtk-types.defs-into-gdk.c-dependence.patch b/meta/recipes-devtools/python/python-pygtk/add-gtk-types.defs-into-gdk.c-dependence.patch new file mode 100644 index 0000000000..df0f9cd6c0 --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk/add-gtk-types.defs-into-gdk.c-dependence.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | Upstream-Status: Submitted | ||
2 | |||
3 | add gtk-types.defs into gdk.c dependence | ||
4 | |||
5 | gdk.c depends on gtk-types.defs but | ||
6 | gdk/Makefile.am miss this. This will cause | ||
7 | build error sometimes when built | ||
8 | with multi-jobbing, so add gtk-types.defs into | ||
9 | gdk.c dependence. | ||
10 | |||
11 | Signed-off-by: Song.Li <Song.Li@windriver.com> | ||
12 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
13 | --- | ||
14 | gtk/Makefile.am | 2 +- | ||
15 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
16 | |||
17 | diff --git a/gtk/Makefile.am b/gtk/Makefile.am | ||
18 | index 7bb5d0c..4a88351 100644 | ||
19 | --- a/gtk/Makefile.am | ||
20 | +++ b/gtk/Makefile.am | ||
21 | @@ -214,7 +214,7 @@ gtkunixprint.defs: $(GTKUNIXPRINT_DEFS) Makefile | ||
22 | gtkunixprint-types.defs: $(GTKUNIXPRINT_TYPES_DEFS) Makefile | ||
23 | $(CREATEDEFS) $@ $(GTKUNIXPRINT_TYPES_DEFS) | ||
24 | |||
25 | -gdk.c: gdk-types.defs gdk.defs $(GDK_OVERRIDES) | ||
26 | +gdk.c: gdk-types.defs gtk-types.defs gdk.defs $(GDK_OVERRIDES) | ||
27 | gtk.c: gdk-types.defs gtk-types.defs gtk.defs gdk-types.defs $(GTK_OVERRIDES) | ||
28 | _gtk_la_CFLAGS = $(PYCAIRO_CFLAGS) $(GTK_CFLAGS) | ||
29 | _gtk_la_LDFLAGS = $(common_ldflags) -export-symbols-regex init_gtk | ||
30 | -- | ||
31 | 1.7.4 | ||
32 | |||
diff --git a/meta/recipes-devtools/python/python-pygtk/fix-gtkunixprint.patch b/meta/recipes-devtools/python/python-pygtk/fix-gtkunixprint.patch new file mode 100644 index 0000000000..16c0e8e770 --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk/fix-gtkunixprint.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | Upstream-Status: Inappropriate [configuration] | ||
2 | |||
3 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
4 | |||
5 | Index: pygtk-2.24.0/gtk/gtkunixprint.override | ||
6 | =================================================================== | ||
7 | --- pygtk-2.24.0.orig/gtk/gtkunixprint.override | ||
8 | +++ pygtk-2.24.0/gtk/gtkunixprint.override | ||
9 | @@ -102,11 +102,6 @@ _wrap_gtk_print_job_get_surface(PyGObjec | ||
10 | if (pyg_error_check(&error)) | ||
11 | return NULL; | ||
12 | |||
13 | -#if PYCAIRO_VERSION_HEX >= 0x1010600 | ||
14 | - return PycairoSurface_FromSurface(cairo_surface_reference(surface), NULL); | ||
15 | -#else | ||
16 | - return PycairoSurface_FromSurface(cairo_surface_reference(surface), NULL, NULL); | ||
17 | -#endif | ||
18 | } | ||
19 | %% | ||
20 | override gtk_print_job_send kwargs | ||
diff --git a/meta/recipes-devtools/python/python-pygtk/fix-pygtk-2.0.pc.patch b/meta/recipes-devtools/python/python-pygtk/fix-pygtk-2.0.pc.patch new file mode 100644 index 0000000000..b6156540bd --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk/fix-pygtk-2.0.pc.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | Upstream-Status: Inappropriate [configuration] | ||
2 | |||
3 | Index: pygtk-2.24.0/pygtk-2.0.pc.in | ||
4 | =================================================================== | ||
5 | --- pygtk-2.24.0.orig/pygtk-2.0.pc.in | ||
6 | +++ pygtk-2.24.0/pygtk-2.0.pc.in | ||
7 | @@ -1,5 +1,6 @@ | ||
8 | prefix=@prefix@ | ||
9 | exec_prefix=@exec_prefix@ | ||
10 | +libdir=@libdir@ | ||
11 | includedir=@includedir@ | ||
12 | datarootdir=@datarootdir@ | ||
13 | datadir=@datadir@ | ||
diff --git a/meta/recipes-devtools/python/python-pygtk/nodocs.patch b/meta/recipes-devtools/python/python-pygtk/nodocs.patch new file mode 100644 index 0000000000..f07309a7ba --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk/nodocs.patch | |||
@@ -0,0 +1,15 @@ | |||
1 | Upstream-Status: Inappropriate [configuration] | ||
2 | |||
3 | Index: pygtk-2.17.0/Makefile.am | ||
4 | =================================================================== | ||
5 | --- pygtk-2.17.0.orig/Makefile.am | ||
6 | +++ pygtk-2.17.0/Makefile.am | ||
7 | @@ -4,7 +4,7 @@ if BUILD_GTK | ||
8 | GTK_SUBDIR = gtk | ||
9 | endif | ||
10 | |||
11 | -SUBDIRS = . $(GTK_SUBDIR) examples tests docs | ||
12 | +SUBDIRS = . $(GTK_SUBDIR) examples tests | ||
13 | |||
14 | PLATFORM_VERSION = 2.0 | ||
15 | |||
diff --git a/meta/recipes-devtools/python/python-pygtk/prevent_to_get_display_during_import.patch b/meta/recipes-devtools/python/python-pygtk/prevent_to_get_display_during_import.patch new file mode 100644 index 0000000000..833038e7f8 --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk/prevent_to_get_display_during_import.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | Index: pygtk-2.10.4/gtk/__init__.py | ||
4 | =================================================================== | ||
5 | --- pygtk-2.10.4.orig/gtk/__init__.py 2007-11-27 19:27:05.000000000 -0300 | ||
6 | +++ pygtk-2.10.4/gtk/__init__.py 2007-11-27 19:28:22.000000000 -0300 | ||
7 | @@ -78,7 +78,8 @@ | ||
8 | |||
9 | keysyms = LazyModule('keysyms', locals()) | ||
10 | |||
11 | -_init() | ||
12 | +if not hasattr(sys.modules['__main__'], 'python_launcher_enabled'): | ||
13 | + _init() | ||
14 | |||
15 | # CAPI | ||
16 | _PyGtk_API = _gtk._PyGtk_API | ||
diff --git a/meta/recipes-devtools/python/python-pygtk/python-pygtk2/acinclude.m4 b/meta/recipes-devtools/python/python-pygtk/python-pygtk2/acinclude.m4 new file mode 100644 index 0000000000..53518fb2eb --- /dev/null +++ b/meta/recipes-devtools/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]) | ||
diff --git a/meta/recipes-devtools/python/python-pygtk/update-dependences-of-defs.c.patch b/meta/recipes-devtools/python/python-pygtk/update-dependences-of-defs.c.patch new file mode 100644 index 0000000000..3ed954eee5 --- /dev/null +++ b/meta/recipes-devtools/python/python-pygtk/update-dependences-of-defs.c.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From dc024e9079bbffbb44436ba3e70a758ebad5520f Mon Sep 17 00:00:00 2001 | ||
2 | From: "Song.Li" <Song.Li@windriver.com> | ||
3 | Date: Sat, 5 Jan 2013 14:55:59 +0800 | ||
4 | Subject: [PATCH] update dependences of defs.c in Makefile.am | ||
5 | |||
6 | In gtk/Makefile.am, defs.c should dependes on gdk-types.defs and | ||
7 | gtk-types.defs, otherwise it fails occasionally when parallel compile. | ||
8 | The error message: | ||
9 | "IOError: [Errno 2] No such file or directory: 'gtk-types.defs'" | ||
10 | |||
11 | Add them to dependences of defs.c to fix this issue. | ||
12 | |||
13 | Upstream-Status: Submitted | ||
14 | https://bugzilla.gnome.org/show_bug.cgi?id=702706 | ||
15 | |||
16 | Signed-off-by: Song.Li <Song.Li@windriver.com> | ||
17 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
18 | |||
19 | --- | ||
20 | gtk/Makefile.am | 2 +- | ||
21 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
22 | |||
23 | diff --git a/gtk/Makefile.am b/gtk/Makefile.am | ||
24 | index 7bb5d0c..91826cb 100644 | ||
25 | --- a/gtk/Makefile.am | ||
26 | +++ b/gtk/Makefile.am | ||
27 | @@ -289,7 +289,7 @@ if HAVE_GIO_TYPES_DEFS | ||
28 | extra_codegen_args += --register $(PYGOBJECT_DEFSDIR)/gio-types.defs | ||
29 | endif | ||
30 | |||
31 | -.defs.c: | ||
32 | +.defs.c: gdk-types.defs gtk-types.defs | ||
33 | ($(PYTHON) $(CODEGENDIR)/codegen.py \ | ||
34 | $(PYGTK_CODEGEN_DEFINES) \ | ||
35 | -I $(srcdir) \ | ||
36 | -- | ||
37 | 1.7.9.5 | ||
38 | |||