summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2018-11-04 17:29:43 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2018-11-04 21:33:40 +0100
commitc86e7dd1c1a9d872c40589d1cb62856256b5648c (patch)
treed8a646a48a483b27a6d9db6fd30de05b77ef2d64
parentapp-text/ghostscript-gpl: EAPI-7 bump, DESCRIPTION, minor cleanups (diff)
downloadgentoo-c86e7dd1c1a9d872c40589d1cb62856256b5648c.tar.gz
gentoo-c86e7dd1c1a9d872c40589d1cb62856256b5648c.tar.bz2
gentoo-c86e7dd1c1a9d872c40589d1cb62856256b5648c.zip
app-text/ghostscript-gpl: Fix build w/o gtk+:3
Reported-by: Tom Dexter <digitalaudiorock@gmail.com> Bug: https://bugs.gentoo.org/668160 Package-Manager: Portage-2.3.51, Repoman-2.3.12 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
-rw-r--r--app-text/ghostscript-gpl/files/ghostscript-gpl-9.25-no-gtk3.patch43
-rw-r--r--app-text/ghostscript-gpl/ghostscript-gpl-9.25-r1.ebuild11
2 files changed, 50 insertions, 4 deletions
diff --git a/app-text/ghostscript-gpl/files/ghostscript-gpl-9.25-no-gtk3.patch b/app-text/ghostscript-gpl/files/ghostscript-gpl-9.25-no-gtk3.patch
new file mode 100644
index 00000000000..34cc2ec88c1
--- /dev/null
+++ b/app-text/ghostscript-gpl/files/ghostscript-gpl-9.25-no-gtk3.patch
@@ -0,0 +1,43 @@
+From a73071b87a61acf1237da5ad9da59bae9316fb8c Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Mon, 8 Oct 2018 09:24:22 +0100
+Subject: [PATCH] Bug 699907: Reinstate GTK+ 2.x.x code.
+
+The fix (from March 2018) for deprecated API calls in the GTK+ 3.x.x API
+didn't account for the new, supported methods not being available in
+GTK+ 2.x.x. Handle both cases, as we do elsewhere.
+---
+ psi/dxmain.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/psi/dxmain.c b/psi/dxmain.c
+index 72c060e..250269a 100644
+--- a/psi/dxmain.c
++++ b/psi/dxmain.c
+@@ -354,17 +354,23 @@ static void window_resize(IMAGE *img)
+ #endif
+
+ if (!visible) {
+- guint width, height;
+ /* We haven't yet shown the window, so set a default size
+ * which is smaller than the desktop to allow room for
+ * desktop toolbars, and if possible a little larger than
+ * the image to allow room for the scroll bars.
+ * We don't know the width of the scroll bars, so just guess. */
++#if !GTK_CHECK_VERSION(3, 0, 0)
++ gtk_window_set_default_size(GTK_WINDOW(img->window),
++ min(gdk_screen_width()-96, img->width+24),
++ min(gdk_screen_height()-96, img->height+24));
++#else
++ guint width, height;
+ width = gtk_widget_get_allocated_width (img->window) - 96;
+ height = gtk_widget_get_allocated_height (img->window) - 96;
+ gtk_window_set_default_size(GTK_WINDOW(img->window),
+ min(width, img->width+24),
+ min(height, img->height+24));
++#endif
+ }
+ }
+
+--
+2.9.1
diff --git a/app-text/ghostscript-gpl/ghostscript-gpl-9.25-r1.ebuild b/app-text/ghostscript-gpl/ghostscript-gpl-9.25-r1.ebuild
index 028d4480726..29eea9194c5 100644
--- a/app-text/ghostscript-gpl/ghostscript-gpl-9.25-r1.ebuild
+++ b/app-text/ghostscript-gpl/ghostscript-gpl-9.25-r1.ebuild
@@ -58,7 +58,14 @@ RDEPEND="${DEPEND}
S="${WORKDIR}/${MY_P}"
+PATCHES=(
+ "${FILESDIR}/${P}-no-gtk3.patch" # bug 668160
+)
+
src_prepare() {
+ # apply various patches, many borrowed from Fedora
+ # http://pkgs.fedoraproject.org/cgit/ghostscript.git
+ eapply "${WORKDIR}/patches/"*.patch
default
# remove internal copies of various libraries
@@ -74,10 +81,6 @@ src_prepare() {
# remove internal CMaps (CMaps from poppler-data are used instead)
rm -r Resource/CMap || die
- # apply various patches, many borrowed from Fedora
- # http://pkgs.fedoraproject.org/cgit/ghostscript.git
- eapply "${WORKDIR}/patches/"*.patch
-
if ! use gtk ; then
sed -e "s:\$(GSSOX)::" \
-e "s:.*\$(GSSOX_XENAME)$::" \