# HG changeset patch # User Christopher Rogers # Date 1287420240 0 # Node ID 66d952425df701ffd8392d6142767a486317a430 # Parent a1a90bd36fc1236e34920e609aa319a9b80460a3 Up: pygtk to 2.22.0. diff -r a1a90bd36fc1 -r 66d952425df7 pygtk-dev/receipt --- a/pygtk-dev/receipt Mon Oct 18 16:18:46 2010 +0000 +++ b/pygtk-dev/receipt Mon Oct 18 16:44:00 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="pygtk-dev" -VERSION="2.16.0" +VERSION="2.22.0" CATEGORY="development" SHORT_DESC="GTK+ for Python dev files with codegen." MAINTAINER="erjo@slitaz.org" diff -r a1a90bd36fc1 -r 66d952425df7 pygtk/receipt --- a/pygtk/receipt Mon Oct 18 16:18:46 2010 +0000 +++ b/pygtk/receipt Mon Oct 18 16:44:00 2010 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="pygtk" -VERSION="2.16.0" +VERSION="2.22.0" CATEGORY="development" SHORT_DESC="GTK+ for Python" MAINTAINER="erjo@slitaz.org" @@ -9,7 +9,8 @@ xorg-libXau xorg-libXcomposite xorg-libXcursor xorg-libXdmcp xorg-libXext \ xorg-libXfixes xorg-libXinerama xorg-libXrandr xorg-libXrender \ xorg-libXdamage libffi " -BUILD_DEPENDS="pygobject-dev pycairo-dev libglade-dev python-dev xcb-util-dev expat-dev" +BUILD_DEPENDS="pygobject-dev pycairo-dev libglade-dev python-dev xcb-util-dev expat-dev \ +xorg-dev-proto" TARBALL="$PACKAGE-$VERSION.tar.bz2" WEB_SITE="http://www.pygtk.org/" WGET_URL="http://ftp.gnome.org/pub/GNOME/sources/pygtk/${VERSION%.*}/$TARBALL" @@ -19,11 +20,13 @@ compile_rules() { cd $src + #https://bugzilla.gnome.org/show_bug.cgi?id=623965 + patch -Np1 -i ../stuff/python27.patch ./configure --prefix=/usr \ --infodir=/usr/share/info \ --disable-docs \ --mandir=/usr/share/man $CONFIGURE_ARGS && - make && + make -j 4 && make DESTDIR=$PWD/_pkg install } diff -r a1a90bd36fc1 -r 66d952425df7 pygtk/stuff/python27.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pygtk/stuff/python27.patch Mon Oct 18 16:44:00 2010 +0000 @@ -0,0 +1,50 @@ +diff --git a/gtk/gtkmodule.c b/gtk/gtkmodule.c +index c0e1493..aa8cf10 100644 +--- a/gtk/gtkmodule.c ++++ b/gtk/gtkmodule.c +@@ -227,8 +227,12 @@ init_gtk(void) + pygtk_add_stock_items(d); + + /* extension API */ +- PyDict_SetItemString(d, "_PyGtk_API", +- o=PyCObject_FromVoidPtr(&functions, NULL)); ++#if PY_VERSION_HEX >= 0x02070000 ++ o = PyCapsule_New(&functions, "gtk._gtk._PyGtk_API", NULL); ++#else ++ o = PyCObject_FromVoidPtr(&functions, NULL); ++#endif ++ PyDict_SetItemString(d, "_PyGtk_API", o); + Py_DECREF(o); + + PyGtkDeprecationWarning = PyErr_NewException("gtk.GtkDeprecationWarning", +diff --git a/gtk/pygtk.h b/gtk/pygtk.h +index 573c3b9..e4c680f 100644 +--- a/gtk/pygtk.h ++++ b/gtk/pygtk.h +@@ -60,6 +60,18 @@ struct _PyGtk_FunctionStruct *_PyGtk_API; + + + /* a function to initialise the pygtk functions */ ++ ++/* Python 2.7 introduced the PyCapsule API and deprecated the CObject API */ ++#if PY_VERSION_HEX >= 0x02070000 ++#define init_pygtk() G_STMT_START { \ ++ void *capsule = PyCapsule_Import("gtk._gtk._PyGtk_API", 0); \ ++ if (!capsule) { \ ++ return; \ ++ } \ ++ _PyGtk_API = (struct _PyGtk_FunctionStruct*)capsule; \ ++} G_STMT_END ++#else /* PY_VERSION_HEX */ ++/* Python 2.6 and earlier use the CObject API */ + #define init_pygtk() G_STMT_START { \ + PyObject *pygtk = PyImport_ImportModule("gtk"); \ + if (pygtk != NULL) { \ +@@ -79,6 +91,7 @@ struct _PyGtk_FunctionStruct *_PyGtk_API; + return; \ + } \ + } G_STMT_END ++#endif /* PY_VERSION_HEX */ + + #endif +