diff options
Diffstat (limited to 'testing/gtk2')
-rw-r--r-- | testing/gtk2/PKGBUILD | 59 | ||||
-rw-r--r-- | testing/gtk2/cups-custom-print.patch | 104 | ||||
-rw-r--r-- | testing/gtk2/gtk2.install | 16 | ||||
-rw-r--r-- | testing/gtk2/xid-collision-debug.patch | 15 |
4 files changed, 194 insertions, 0 deletions
diff --git a/testing/gtk2/PKGBUILD b/testing/gtk2/PKGBUILD new file mode 100644 index 000000000..113ba9c8d --- /dev/null +++ b/testing/gtk2/PKGBUILD @@ -0,0 +1,59 @@ +# $Id: PKGBUILD 148382 2012-01-30 22:03:41Z ibiru $ +# Maintainer: Jan de Groot <jgc@archlinux.org> + +pkgbase=gtk2 +pkgname=('gtk2' 'gtk-update-icon-cache') +pkgver=2.24.9 +pkgrel=3 +arch=('i686' 'x86_64') +url="http://www.gtk.org/" +makedepends=('atk' 'pango' 'libxcursor' 'libxinerama' 'libxrandr' 'libxi' 'libxcomposite' 'libxdamage' + 'shared-mime-info' 'cairo' 'libcups' 'gdk-pixbuf2' 'gobject-introspection') +options=('!libtool' '!docs') +license=('LGPL') +source=(http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-$pkgver.tar.xz + xid-collision-debug.patch cups-custom-print.patch) +sha256sums=('84204bf24cac739fd979943127e7b29cb46b1017684aa24dce630faa01bcb61d' + 'd758bb93e59df15a4ea7732cf984d1c3c19dff67c94b957575efea132b8fe558' + '9535c9df19338cbea98ec4b2b5c8e4cef718455938f05c9cf8a08a3805d6b85d') + +build() { + cd "$srcdir/gtk+-$pkgver" + patch -Np1 -i "$srcdir/xid-collision-debug.patch" + + # https://bugzilla.gnome.org/show_bug.cgi?id=543520 + patch -Rp1 -i "$srcdir/cups-custom-print.patch" + + CXX=/bin/false ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --with-xinput=yes + + # https://bugzilla.gnome.org/show_bug.cgi?id=655517 + sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool + + make +} + +package_gtk2() { + pkgdesc="GTK+ is a multi-platform toolkit (v2)" + install=gtk2.install + depends=('atk' 'pango' 'libxcursor' 'libxinerama' 'libxrandr' 'libxi' 'libxcomposite' 'libxdamage' 'shared-mime-info' 'cairo' 'libcups' 'gtk-update-icon-cache') + backup=(etc/gtk-2.0/gtkrc) + + cd "$srcdir/gtk+-$pkgver" + + make DESTDIR="$pkgdir" install + sed -i "s#env python#env python2#" $pkgdir/usr/bin/gtk-builder-convert + echo 'gtk-fallback-icon-theme = "gnome"' > "$pkgdir/etc/gtk-2.0/gtkrc" + #split this out to use with gtk3 too + rm $pkgdir/usr/bin/gtk-update-icon-cache +} +package_gtk-update-icon-cache() { + pkgdesc="The GTK+ update icon cache tool" + depends=('gdk-pixbuf2>=2.24.1-3') + + cd "$srcdir/gtk+-$pkgver/gtk" + + install -D -m755 gtk-update-icon-cache $pkgdir/usr/bin/gtk-update-icon-cache +} diff --git a/testing/gtk2/cups-custom-print.patch b/testing/gtk2/cups-custom-print.patch new file mode 100644 index 000000000..ffc89aa32 --- /dev/null +++ b/testing/gtk2/cups-custom-print.patch @@ -0,0 +1,104 @@ +From 8170436e61ea68c713d75ad374d22c3261be9203 Mon Sep 17 00:00:00 2001 +From: Benjamin Berg <benjamin@sipsolutions.net> +Date: Sat, 24 Dec 2011 16:26:32 +0000 +Subject: Set cups Custom print options correctly (bug #543520, patch by Marek Kašík) + +This patch fixes the cups print backend to pass Custom options with +the "Custom." prefix to cups if neccessary. +--- +diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c +index 14a1b5d..2751ee4 100644 +--- a/modules/printbackends/cups/gtkprintbackendcups.c ++++ b/modules/printbackends/cups/gtkprintbackendcups.c +@@ -483,22 +483,44 @@ cups_print_cb (GtkPrintBackendCups *print_backend, + GDK_THREADS_LEAVE (); + } + ++typedef struct { ++ GtkCupsRequest *request; ++ GtkPrinterOptionSet *options; ++} CupsOptionsData; ++ + static void + add_cups_options (const gchar *key, + const gchar *value, + gpointer user_data) + { +- GtkCupsRequest *request = user_data; ++ CupsOptionsData *data = (CupsOptionsData *) user_data; ++ GtkCupsRequest *request = data->request; ++ GtkPrinterOptionSet *options = data->options; ++ GtkPrinterOption *option = NULL; ++ gchar *new_value = NULL; + + if (!g_str_has_prefix (key, "cups-")) + return; + + if (strcmp (value, "gtk-ignore-value") == 0) + return; ++ ++ option = gtk_printer_option_set_lookup (options, key); + + key = key + strlen ("cups-"); + +- gtk_cups_request_encode_option (request, key, value); ++ /* Add "Custom." prefix to custom values */ ++ if (value && option && ++ !gtk_printer_option_has_choice (option, value)) ++ new_value = g_strdup_printf ("Custom.%s", value); ++ ++ if (new_value) ++ { ++ gtk_cups_request_encode_option (request, key, new_value); ++ g_free (new_value); ++ } ++ else ++ gtk_cups_request_encode_option (request, key, value); + } + + static void +@@ -511,8 +533,12 @@ gtk_print_backend_cups_print_stream (GtkPrintBackend *print_backend, + { + GtkPrinterCups *cups_printer; + CupsPrintStreamData *ps; ++ CupsOptionsData *options_data; + GtkCupsRequest *request; + GtkPrintSettings *settings; ++ GtkPrinterOptionSet *options; ++ GtkPrintCapabilities capabilities; ++ GtkPageSetup *page_setup; + const gchar *title; + char printer_absolute_uri[HTTP_MAX_URI]; + +@@ -521,6 +547,8 @@ gtk_print_backend_cups_print_stream (GtkPrintBackend *print_backend, + + cups_printer = GTK_PRINTER_CUPS (gtk_print_job_get_printer (job)); + settings = gtk_print_job_get_settings (job); ++ capabilities = cups_printer_get_capabilities (GTK_PRINTER (cups_printer)); ++ page_setup = gtk_printer_get_default_page_size (GTK_PRINTER (cups_printer)); + + request = gtk_cups_request_new_with_username (NULL, + GTK_CUPS_POST, +@@ -558,8 +586,18 @@ gtk_print_backend_cups_print_stream (GtkPrintBackend *print_backend, + IPP_TAG_NAME, "job-name", + NULL, title); + +- gtk_print_settings_foreach (settings, add_cups_options, request); +- ++ options = cups_printer_get_options (GTK_PRINTER (cups_printer), settings, page_setup, capabilities); ++ ++ options_data = g_new0 (CupsOptionsData, 1); ++ options_data->request = request; ++ options_data->options = options; ++ ++ gtk_print_settings_foreach (settings, add_cups_options, options_data); ++ ++ g_object_unref (page_setup); ++ g_object_unref (options); ++ g_free (options_data); ++ + ps = g_new0 (CupsPrintStreamData, 1); + ps->callback = callback; + ps->user_data = user_data; +-- +cgit v0.9.0.2 diff --git a/testing/gtk2/gtk2.install b/testing/gtk2/gtk2.install new file mode 100644 index 000000000..4e2b72f1b --- /dev/null +++ b/testing/gtk2/gtk2.install @@ -0,0 +1,16 @@ +post_install() { + usr/bin/gtk-query-immodules-2.0 > etc/gtk-2.0/gtk.immodules +} + +pre_upgrade() { + pre_remove +} + +post_upgrade() { + post_install +} + +pre_remove() { + rm -f etc/gtk-2.0/gtk.immodules &>/dev/null + rm -f etc/gtk-2.0/gdk-pixbuf.loaders &>/dev/null +} diff --git a/testing/gtk2/xid-collision-debug.patch b/testing/gtk2/xid-collision-debug.patch new file mode 100644 index 000000000..d61238c3b --- /dev/null +++ b/testing/gtk2/xid-collision-debug.patch @@ -0,0 +1,15 @@ +--- gtk+-2.18.3/gdk/x11/gdkxid.c 2009-06-19 04:59:18.000000000 +0200 ++++ gtk+-2.18.3/gdk/x11/gdkxid.c.new 2009-07-22 11:30:12.000000000 +0200 +@@ -56,10 +56,10 @@ + if (!display_x11->xid_ht) + display_x11->xid_ht = g_hash_table_new ((GHashFunc) gdk_xid_hash, + (GEqualFunc) gdk_xid_equal); +- ++/* + if (g_hash_table_lookup (display_x11->xid_ht, xid)) + g_warning ("XID collision, trouble ahead"); +- ++*/ + g_hash_table_insert (display_x11->xid_ht, xid, data); + } + |