diff options
Diffstat (limited to 'source/l/pygtk')
-rw-r--r-- | source/l/pygtk/pygtk-fix-pango-object-leaks.patch | 63 | ||||
-rwxr-xr-x | source/l/pygtk/pygtk.SlackBuild | 19 | ||||
-rw-r--r-- | source/l/pygtk/slack-desc | 8 |
3 files changed, 82 insertions, 8 deletions
diff --git a/source/l/pygtk/pygtk-fix-pango-object-leaks.patch b/source/l/pygtk/pygtk-fix-pango-object-leaks.patch new file mode 100644 index 00000000..fb8f5f9e --- /dev/null +++ b/source/l/pygtk/pygtk-fix-pango-object-leaks.patch @@ -0,0 +1,63 @@ +From eca72baa5616fbe4dbebea43c7e5940847dc5ab8 Mon Sep 17 00:00:00 2001 +From: "Owen W. Taylor" <otaylor@fishsoup.net> +Date: Tue, 27 Sep 2011 00:17:52 -0400 +Subject: Fix leaks of Pango objects + +Gtk.PrintContext.create_pango_context() +Gtk.PrintContext.create_pango_layout() +pangocairo.CairoContext.create_layout() + +were leaking the objects they returned. + +https://bugzilla.gnome.org/show_bug.cgi?id=660216 +--- + gtk/gtk-2.10.defs | 2 ++ + pangocairo.override | 11 ++++++++--- + 2 files changed, 10 insertions(+), 3 deletions(-) + +diff --git a/gtk/gtk-2.10.defs b/gtk/gtk-2.10.defs +index 69c7e0c..faa45e1 100644 +--- a/gtk/gtk-2.10.defs ++++ b/gtk/gtk-2.10.defs +@@ -1388,12 +1388,14 @@ + (define-method create_pango_context + (of-object "GtkPrintContext") + (c-name "gtk_print_context_create_pango_context") ++ (caller-owns-return #t) + (return-type "PangoContext*") + ) + + (define-method create_pango_layout + (of-object "GtkPrintContext") + (c-name "gtk_print_context_create_pango_layout") ++ (caller-owns-return #t) + (return-type "PangoLayout*") + ) + +diff --git a/pangocairo.override b/pangocairo.override +index bb923e6..5101107 100644 +--- a/pangocairo.override ++++ b/pangocairo.override +@@ -118,11 +118,16 @@ _wrap_pango_cairo_update_context(PyGObject *self, PyObject *args, PyObject *kwar + static PyObject * + _wrap_pango_cairo_create_layout(PyGObject *self) + { +- PangoLayout *ret; ++ PangoLayout *layout; ++ PyObject *ret; + +- ret = pango_cairo_create_layout(PycairoContext_GET(self)); ++ layout = pango_cairo_create_layout(PycairoContext_GET(self)); + /* pygobject_new handles NULL checking */ +- return pygobject_new((GObject *)ret); ++ ret = pygobject_new((GObject *)layout); ++ if (layout) ++ g_object_unref(layout); ++ ++ return ret; + } + + static PyObject * +-- +cgit v0.12 + diff --git a/source/l/pygtk/pygtk.SlackBuild b/source/l/pygtk/pygtk.SlackBuild index 7e3a32a8..81b535f7 100755 --- a/source/l/pygtk/pygtk.SlackBuild +++ b/source/l/pygtk/pygtk.SlackBuild @@ -1,7 +1,7 @@ -#!/bin/sh +#!/bin/bash # Copyright 2007 Erik Hanson erik@slackbuilds.org -# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2008, 2009, 2010, 2018 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -21,10 +21,11 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +cd $(dirname $0) ; CWD=$(pwd) PKGNAM=pygtk VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-2} +BUILD=${BUILD:-5} NUMJOBS=${NUMJOBS:-" -j7 "} @@ -38,7 +39,14 @@ if [ -z "$ARCH" ]; then esac fi -CWD=$(pwd) +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz" + exit 0 +fi + TMP=${TMP:-/tmp} PKG=$TMP/package-$PKGNAM @@ -72,6 +80,9 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; +# https://bugzilla.gnome.org/show_bug.cgi?id=660216 +zcat $CWD/pygtk-fix-pango-object-leaks.patch.gz | patch -p1 --verbose || exit 1 + CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ diff --git a/source/l/pygtk/slack-desc b/source/l/pygtk/slack-desc index c83785e9..ee31d102 100644 --- a/source/l/pygtk/slack-desc +++ b/source/l/pygtk/slack-desc @@ -1,9 +1,9 @@ # HOW TO EDIT THIS FILE: -# The "handy ruler" below makes it easier to edit a package description. Line +# The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' on -# the right side marks the last column you can put a character in. You must make -# exactly 11 lines for the formatting to be correct. It's also customary to +# the right side marks the last column you can put a character in. You must make +# exactly 11 lines for the formatting to be correct. It's also customary to # leave one space after the ':'. |-----handy-ruler------------------------------------------------------| @@ -13,7 +13,7 @@ pygtk: PyGTK provides a convenient wrapper for the GTK+ library for use in pygtk: Python programs, taking care of many of the boring details such as pygtk: managing memory and type casting. pygtk: -pygtk: PyGTK's web page: http://www.pygtk.org/ +pygtk: PyGTK's web page: http://www.pygtk.org/ pygtk: pygtk: pygtk: |