Prod graphviz to support both ghostscript agpl as well as gpl,

gs agpl enforces using gserrors.h which isn't installed by gs gpl.
This commit is contained in:
richard 2015-12-13 17:44:45 +00:00
parent fb7c70d5a1
commit faa9aaad06
2 changed files with 36 additions and 1 deletions

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.55 2015/11/03 21:34:02 agc Exp $
$NetBSD: distinfo,v 1.56 2015/12/13 17:44:45 richard Exp $
SHA1 (graphviz-2.38.0.tar.gz) = 053c771278909160916ca5464a0a98ebf034c6ef
RMD160 (graphviz-2.38.0.tar.gz) = a80c2fa6b9955444b2103a99167d7020b23e4c4e
@ -10,4 +10,5 @@ SHA1 (patch-configure) = f772bedfac63c3b473ebae1621b72982a13fe5a3
SHA1 (patch-configure.ac) = ec844ae85b6be9cf095ec800df6983b061d62b5d
SHA1 (patch-lib_cgraph_scan.l) = 72cc178acb369007a4a672d20af196bb6b6df35b
SHA1 (patch-lib_gvc_Makefile.in) = 985ffe3efb0e7f876ece14dc0d2a719ec06357e2
SHA1 (patch-plugin_gs_gvloadimage__gs.c) = b5b46a1e7dc52f163526c5b8b7e1b893d5500e3c
SHA1 (patch-plugin_xlib_gvdevice__xlib.c) = 932c337dcf9cb53d52f24c6c20818038ed169cd0

View file

@ -0,0 +1,34 @@
$NetBSD: patch-plugin_gs_gvloadimage__gs.c,v 1.1 2015/12/13 17:44:45 richard Exp $
ghostscript-agpl enforces using gserrors.h which is not included
by default in ghostscript-gpl, so conditionalise based upon which
one is being used.
--- plugin/gs/gvloadimage_gs.c.orig 2014-04-13 20:40:25.000000000 +0000
+++ plugin/gs/gvloadimage_gs.c
@@ -72,6 +72,16 @@ static void gs_error(GVJ_t * job, const
assert (err < 0);
+#ifdef gserrors_INCLUDED /* ghostscript-agpl uses gserrors.h */
+ if (err >= gs_error_VMerror)
+ errsrc = "PostScript Level 1";
+ else if (err >= gs_error_unregistered)
+ errsrc = "PostScript Level 2";
+ else if (err >= gs_error_invalidid)
+ errsrc = "DPS error";
+ else
+ errsrc = "Ghostscript internal error";
+#else
if (err >= e_VMerror)
errsrc = "PostScript Level 1";
else if (err >= e_unregistered)
@@ -80,7 +90,7 @@ static void gs_error(GVJ_t * job, const
errsrc = "DPS error";
else
errsrc = "Ghostscript internal error";
-
+#endif
job->common->errorfn("%s: %s() returned: %d \"%s\" (%s)\n",
name, funstr, err, gs_error_names[-err - 1], errsrc);
}