wok-6.x rev 6786

Up: pygtk to 2.22.0.
author Christopher Rogers <slaxemulator@gmail.com>
date Mon Oct 18 16:44:00 2010 +0000 (2010-10-18)
parents a1a90bd36fc1
children 31adf89b4637
files pygtk-dev/receipt pygtk/receipt pygtk/stuff/python27.patch
line diff
     1.1 --- a/pygtk-dev/receipt	Mon Oct 18 16:18:46 2010 +0000
     1.2 +++ b/pygtk-dev/receipt	Mon Oct 18 16:44:00 2010 +0000
     1.3 @@ -1,7 +1,7 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6  PACKAGE="pygtk-dev"
     1.7 -VERSION="2.16.0"
     1.8 +VERSION="2.22.0"
     1.9  CATEGORY="development"
    1.10  SHORT_DESC="GTK+ for Python dev files with codegen."
    1.11  MAINTAINER="erjo@slitaz.org"
     2.1 --- a/pygtk/receipt	Mon Oct 18 16:18:46 2010 +0000
     2.2 +++ b/pygtk/receipt	Mon Oct 18 16:44:00 2010 +0000
     2.3 @@ -1,7 +1,7 @@
     2.4  # SliTaz package receipt.
     2.5  
     2.6  PACKAGE="pygtk"
     2.7 -VERSION="2.16.0"
     2.8 +VERSION="2.22.0"
     2.9  CATEGORY="development"
    2.10  SHORT_DESC="GTK+ for Python"
    2.11  MAINTAINER="erjo@slitaz.org"
    2.12 @@ -9,7 +9,8 @@
    2.13  xorg-libXau xorg-libXcomposite xorg-libXcursor xorg-libXdmcp xorg-libXext \
    2.14  xorg-libXfixes xorg-libXinerama xorg-libXrandr xorg-libXrender \
    2.15  xorg-libXdamage libffi "
    2.16 -BUILD_DEPENDS="pygobject-dev pycairo-dev libglade-dev python-dev xcb-util-dev expat-dev"
    2.17 +BUILD_DEPENDS="pygobject-dev pycairo-dev libglade-dev python-dev xcb-util-dev expat-dev \
    2.18 +xorg-dev-proto"
    2.19  TARBALL="$PACKAGE-$VERSION.tar.bz2"
    2.20  WEB_SITE="http://www.pygtk.org/"
    2.21  WGET_URL="http://ftp.gnome.org/pub/GNOME/sources/pygtk/${VERSION%.*}/$TARBALL"
    2.22 @@ -19,11 +20,13 @@
    2.23  compile_rules()
    2.24  {
    2.25  	cd $src
    2.26 +	#https://bugzilla.gnome.org/show_bug.cgi?id=623965
    2.27 +	patch -Np1 -i ../stuff/python27.patch
    2.28  	./configure --prefix=/usr \
    2.29  	 --infodir=/usr/share/info \
    2.30  	 --disable-docs \
    2.31  	 --mandir=/usr/share/man $CONFIGURE_ARGS &&
    2.32 -	make &&
    2.33 +	make -j 4 &&
    2.34  	make DESTDIR=$PWD/_pkg install
    2.35  }
    2.36  
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/pygtk/stuff/python27.patch	Mon Oct 18 16:44:00 2010 +0000
     3.3 @@ -0,0 +1,50 @@
     3.4 +diff --git a/gtk/gtkmodule.c b/gtk/gtkmodule.c
     3.5 +index c0e1493..aa8cf10 100644
     3.6 +--- a/gtk/gtkmodule.c
     3.7 ++++ b/gtk/gtkmodule.c
     3.8 +@@ -227,8 +227,12 @@ init_gtk(void)
     3.9 +     pygtk_add_stock_items(d);
    3.10 +     
    3.11 +     /* extension API */
    3.12 +-    PyDict_SetItemString(d, "_PyGtk_API",
    3.13 +-			 o=PyCObject_FromVoidPtr(&functions, NULL));
    3.14 ++#if PY_VERSION_HEX >= 0x02070000
    3.15 ++    o = PyCapsule_New(&functions, "gtk._gtk._PyGtk_API", NULL);
    3.16 ++#else
    3.17 ++    o = PyCObject_FromVoidPtr(&functions, NULL);
    3.18 ++#endif
    3.19 ++    PyDict_SetItemString(d, "_PyGtk_API", o);
    3.20 +     Py_DECREF(o);
    3.21 + 	
    3.22 +     PyGtkDeprecationWarning = PyErr_NewException("gtk.GtkDeprecationWarning",
    3.23 +diff --git a/gtk/pygtk.h b/gtk/pygtk.h
    3.24 +index 573c3b9..e4c680f 100644
    3.25 +--- a/gtk/pygtk.h
    3.26 ++++ b/gtk/pygtk.h
    3.27 +@@ -60,6 +60,18 @@ struct _PyGtk_FunctionStruct *_PyGtk_API;
    3.28 + 
    3.29 + 
    3.30 + /* a function to initialise the pygtk functions */
    3.31 ++
    3.32 ++/* Python 2.7 introduced the PyCapsule API and deprecated the CObject API */
    3.33 ++#if PY_VERSION_HEX >= 0x02070000
    3.34 ++#define init_pygtk() G_STMT_START { \
    3.35 ++    void *capsule = PyCapsule_Import("gtk._gtk._PyGtk_API", 0); \
    3.36 ++    if (!capsule) { \
    3.37 ++        return; \
    3.38 ++    } \
    3.39 ++    _PyGtk_API = (struct _PyGtk_FunctionStruct*)capsule; \
    3.40 ++} G_STMT_END
    3.41 ++#else /* PY_VERSION_HEX */
    3.42 ++/* Python 2.6 and earlier use the CObject API */
    3.43 + #define init_pygtk() G_STMT_START { \
    3.44 +     PyObject *pygtk = PyImport_ImportModule("gtk"); \
    3.45 +     if (pygtk != NULL) { \
    3.46 +@@ -79,6 +91,7 @@ struct _PyGtk_FunctionStruct *_PyGtk_API;
    3.47 +         return; \
    3.48 +     } \
    3.49 + } G_STMT_END
    3.50 ++#endif /* PY_VERSION_HEX */
    3.51 + 
    3.52 + #endif
    3.53 +