app-text/libspectre: >=app-text/ghostscript-gpl-9.18 compile fix
authorLars Wendler <polynomial-c@gentoo.org>
Fri, 23 Oct 2015 13:25:42 +0000 (15:25 +0200)
committerLars Wendler <polynomial-c@gentoo.org>
Fri, 23 Oct 2015 13:26:05 +0000 (15:26 +0200)
(bug #563540).

Package-Manager: portage-2.2.23
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
app-text/libspectre/files/libspectre-0.2.7-gs918.patch [new file with mode: 0644]
app-text/libspectre/libspectre-0.2.7.ebuild

diff --git a/app-text/libspectre/files/libspectre-0.2.7-gs918.patch b/app-text/libspectre/files/libspectre-0.2.7-gs918.patch
new file mode 100644 (file)
index 0000000..e9a4eda
--- /dev/null
@@ -0,0 +1,42 @@
+Fixed error namespace for >=ghostscript-gpl-9.18
+
+https://bugs.gentoo.org/563540
+
+--- libspectre-0.2.7/libspectre/spectre-gs.c
++++ libspectre-0.2.7/libspectre/spectre-gs.c
+@@ -43,12 +43,12 @@
+       
+       if (code <= -100) {
+               switch (code) {
+-                      case e_Fatal:
++                      case gs_error_Fatal:
+                               fprintf (stderr, "fatal internal error %d", code);
+                               return TRUE;
+                               break;
+ 
+-                      case e_ExecStackUnderflow:
++                      case gs_error_ExecStackUnderflow:
+                               fprintf (stderr, "stack overflow %d", code);
+                               return TRUE;
+                               break;
+@@ -109,9 +109,9 @@
+               set = _spectre_strdup_printf ("%d %d translate\n", -x, -y);
+               error = gsapi_run_string_continue (ghostscript_instance, set, strlen (set),
+                                                  0, &exit_code);
+-              error = error == e_NeedInput ? 0 : error;
++              error = error == gs_error_NeedInput ? 0 : error;
+               free (set);
+-              if (error != e_NeedInput && critic_error_code (error)) {
++              if (error != gs_error_NeedInput && critic_error_code (error)) {
+                       fclose (fd);
+                       return FALSE;
+               }
+@@ -126,7 +126,7 @@
+               read = fread (buf, sizeof (char), to_read, fd);
+               error = gsapi_run_string_continue (ghostscript_instance,
+                                                  buf, read, 0, &exit_code);
+-              error = error == e_NeedInput ? 0 : error;
++              error = error == gs_error_NeedInput ? 0 : error;
+               left -= read;
+       }
+       
index 920dab4b482636d6ddf1fde89aefe95bc67c2037..68a7ad1b03845a55361639eceb11250e173e1f6e 100644 (file)
@@ -26,6 +26,8 @@ DOCS="NEWS README TODO"
 
 src_prepare() {
        epatch "${FILESDIR}"/${PN}-0.2.0-interix.patch
+       has_version \>=app-text/ghostscript-gpl-9.18 \
+               && epatch "${FILESDIR}"/${PN}-0.2.7-gs918.patch
        eautoreconf # need new libtool for interix
 }