initial import

This commit is contained in:
2025-06-22 20:39:04 -05:00
commit f8a70886f0
3428 changed files with 302546 additions and 0 deletions

52
tauthon-pygtk/PKGBUILD Normal file
View File

@@ -0,0 +1,52 @@
# Maintainer: Jesus E. <heckyel@riseup.net>
pkgname=tauthon-pygtk
_pkgname=pygtk
pkgver=2.24.0
pkgrel=3
pkgdesc="Tauthon bindings for the GTK widget set"
arch=('i686' 'x86_64')
license=('LGPL-2.1')
depends=('libglade' 'tauthon-pycairo' 'tauthon-pygobject2' 'tauthon-numpy' 'tauthon')
source=("${pkgname}-${pkgver}.tar.bz2::https://download.gnome.org/sources/${_pkgname}/${pkgver%.*}/${_pkgname}-${pkgver}.tar.bz2"
"drop-pangofont.patch"
"python27.patch"
"fix-leaks-of-pango-objects.patch")
sha512sums=('64f4344fcf7636e0b2016ffd5310250b5c02a1bf87e44aef39b5d4cf4a5fc50d27cb4f030d4c6802cff61fffb88dee7752821e3d8a4cd1c34dc3745d9ff2f0da'
'b278297857346e34dc0d8269a75cb8447b69fd4619cf668c960ead2e60ebea0de57288bd26b9c0d7577ceaf4a606f66a0b83d1e432f42100f1240eafa25dd560'
'044115bc08b78b9e656f47e77bd4e0d39b197242e5277fb2c4a03728faa58599090a388ff551ebc5ea9e5af4c979c154079c9efbacd221df2ef3c438014aa311'
'bc385060c0b0cfee406d245c26bf7895be43db36160cf976c4def6416d7c06284a4d1eea0332fbe10e4065a1a3f1ca49ef3286a557e027fb953910a2aaa8359c')
prepare() {
cd "${srcdir}/${_pkgname}-${pkgver}"
# https://bugzilla.gnome.org/show_bug.cgi?id=623965
patch -Np1 -i "${srcdir}/python27.patch"
# https://bugzilla.gnome.org/show_bug.cgi?id=660216
patch -Np1 -i "${srcdir}/fix-leaks-of-pango-objects.patch"
# fix build with new pango
# https://gitlab.gnome.org/Archive/pygtk/-/merge_requests/1
patch -p1 -i "${srcdir}/drop-pangofont.patch"
# fix environment
sed -i -e 's#env python$#env tauthon#' examples/pygtk-demo/{,demos/}*.py
# no docs
sed -i '/^SUBDIRS =/s/docs//' Makefile.in
}
build() {
cd "${srcdir}/${_pkgname}-${pkgver}"
PYTHON=/usr/bin/tauthon ./configure --prefix=/usr --build=unknown-unknown-linux --disable-docs
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make
}
package() {
cd "${srcdir}/${_pkgname}-${pkgver}"
make DESTDIR="${pkgdir}" install
install -m644 gtk/gtk-extrafuncs.defs "${pkgdir}/usr/share/pygtk/2.0/defs/"
install -Dm644 COPYING -t "${pkgdir}/usr/share/licenses/$pkgname"
}

View File

@@ -0,0 +1,41 @@
From 4aaa48eb80c6802aec6d03e5695d2a0ff20e0fc2 Mon Sep 17 00:00:00 2001
From: Jordan Petridis <jpetridis@gnome.org>
Date: Thu, 24 Oct 2019 22:58:36 +0200
Subject: [PATCH] Drop the PangoFont find_shaper virtual method
This API has been removed from Pango 1.44.6, because it was completely
unused by anything.
However, PyGTK tries to bind everything, even unused API.
Removing this from PyGTK means we can build it against the latest Pango
again.
https://gitlab.gnome.org/GNOME/pango/issues/417
---
pango.defs | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/pango.defs b/pango.defs
index 6935c964..da968f58 100644
--- a/pango.defs
+++ b/pango.defs
@@ -1391,15 +1391,6 @@
)
)
-(define-virtual find_shaper
- (of-object "PangoFont")
- (return-type "PangoEngineShape*")
- (parameters
- '("PangoLanguage*" "lang")
- '("guint32" "ch")
- )
-)
-
(define-virtual get_glyph_extents
(of-object "PangoFont")
(return-type "none")
--
2.24.2

View File

@@ -0,0 +1,59 @@
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
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.10.2

View File

@@ -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