]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libcupsfilters: For ghostscript() require GS 9.56.0
authorTill Kamppeter <till.kamppeter@gmail.com>
Tue, 12 Apr 2022 08:37:40 +0000 (10:37 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Tue, 12 Apr 2022 08:37:40 +0000 (10:37 +0200)
Removed the conditionals for the presence or absemse of the
"appleraster" output device in Ghostscript (version 9.56.0 and
newer). We already require that the "pclm" device is there (GS version
9.55.0 and newer). So we remove the conditionals now and simply
require Ghostscript 9.56.0.

Makefile.am
README
configure.ac
cupsfilters/ghostscript.c
cupsfilters/universal.c
mime/cupsfilters-ghostscript-appleraster.convs [deleted file]
mime/cupsfilters-ghostscript.convs

index e8c2e535f5bf408362a474d200f8df6c5aba0324..10e9161c52ce0d8a82ba846efb10a816ab4f8281 100644 (file)
@@ -717,8 +717,6 @@ popplermimefiles = \
        mime/cupsfilters-poppler.convs
 gsmimefiles = \
        mime/cupsfilters-ghostscript.convs
-gsapplerastermimefiles = \
-       mime/cupsfilters-ghostscript-appleraster.convs
 mutoolmimefiles = \
        mime/cupsfilters-mupdf.convs
 
@@ -737,9 +735,6 @@ pkgmime_DATA += $(popplermimefiles)
 endif
 if ENABLE_GHOSTSCRIPT
 pkgmime_DATA += $(gsmimefiles)
-if ENABLE_GHOSTSCRIPT_APPLERASTER
-pkgmime_DATA += $(gsapplerastermimefiles)
-endif
 endif
 if ENABLE_MUTOOL
 pkgmime_DATA += $(mutoolmimefiles)
@@ -759,7 +754,6 @@ EXTRA_DIST += \
        $(individualmimefiles) \
        $(popplermimefiles) \
        $(gsmimefiles) \
-       $(gsapplerastermimefiles) \
        $(mutoolmimefiles) \
        $(brlmimefiles)
 
diff --git a/README b/README
index 07765138cbeec188672744847e30da11379aafa9..e6b7a00c6192ec58d50695b98d5bc5b7d5b6dab1 100644 (file)
--- a/README
+++ b/README
@@ -35,7 +35,14 @@ INTRODUCTION
     fontconfig, liblcms (liblcms2 recommended), libavahi-common,
     libavahi-client, libdbus, and glib are needed. It is highly
     recommended, especially if non-PDF printers are used, to have at
-    least one of Ghostscript, Poppler, or MuPDF.
+    least one of Ghostscript (preferred), Poppler, or MuPDF.
+
+    If Ghostscript is used (via the "gsto..." or the "universal" CUPS
+    filters), Ghostscript 9.56.0 is required and it has to be built at
+    least with the "pdfwrite", "ps2write", "cups", "pwgraster",
+    "appleraster", "pclm", "pclm8", "pdfimage24", "pdfimage8",
+    "pxlcolor", and "pxlmono" output devices. libcups of CUPS 2.2.2 or
+    newer is required to buid Ghostscript this way.
 
     The Poppler-based pdftoraster filter needs a C++ compiler which
     supports C++11 and Poppler being built with the "./configure"
index 40b846bb597c89260d578f5f0017595cce9a50cf..333c6b6cf058a413adab584132cf8c773358dc95 100644 (file)
@@ -598,11 +598,6 @@ AC_ARG_ENABLE([gs-ps2write],
        [enable_gs_ps2write="$enableval"],
        [enable_gs_ps2write=yes]
 )
-AC_ARG_ENABLE([gs-appleraster],
-       [AS_HELP_STRING([--disable-gs-appleraster], [Ghostscript doesn't support appleraster device.])],
-       [enable_gs_appleraster="$enableval"],
-       [enable_gs_appleraster=yes]
-)
 
 CUPS_GHOSTSCRIPT=""
 AS_IF([test "x$enable_ghostscript" != "xyes"], [
@@ -631,23 +626,12 @@ AS_IF([test "x$enable_ghostscript" != "xyes"], [
                        AC_MSG_RESULT([no])
                        enable_gs_ps2write=no
                ])
-               AC_MSG_CHECKING(whether gs supports the appleraster device)
-               AS_IF([`$CUPS_GHOSTSCRIPT -h 2>&1 | grep -q appleraster`], [
-                       AC_MSG_RESULT([yes])
-               ], [
-                       AC_MSG_RESULT([no])
-                       enable_gs_appleraster=no
-               ])
        ])
        AS_IF([test x"$enable_gs_ps2write" = "xyes"], [
                AC_DEFINE([HAVE_GHOSTSCRIPT_PS2WRITE], [], [gs supports ps2write])
        ])
-       AS_IF([test x"$enable_gs_appleraster" = "xyes"], [
-               AC_DEFINE([HAVE_GHOSTSCRIPT_APPLERASTER], [], [gs supports APPLERASTER])
-       ])
 ])
 AM_CONDITIONAL(ENABLE_GHOSTSCRIPT, test "x$enable_ghostscript" = xyes)
-AM_CONDITIONAL(ENABLE_GHOSTSCRIPT_APPLERASTER, test "x$enable_gs_appleraster" = xyes)
 AC_SUBST(CUPS_GHOSTSCRIPT)
 
 CUPS_MUTOOL=""
@@ -987,7 +971,6 @@ Build configuration:
        ghostscript:     ${enable_ghostscript}
        gs-path:         ${with_gs_path}
        gs ps2write:     ${enable_gs_ps2write}
-       gs appleraster:  ${enable_gs_appleraster}
        mutool:          ${enable_mutool}
        mutool-path:     ${with_mutool_path}
        ippfind-path:    ${with_ippfind_path}
index 4f05b8841318633a0279a2ef1a165e91b6f87861..3fe9a0862f35d05a68b3d03b74ce5eda73990237 100644 (file)
@@ -110,10 +110,8 @@ add_pdf_header_options(gs_page_header *h, cups_array_t *gs_args,
   if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
       outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
       outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER) {
-#ifdef HAVE_GHOSTSCRIPT_APPLERASTER
-    if (outformat != CF_FILTER_OUT_FORMAT_APPLE_RASTER)
-#endif /* HAVE_GHOSTSCRIPT_APPLERASTER */
-    if (h->MediaClass[0] |= '\0') {
+    if (outformat != CF_FILTER_OUT_FORMAT_APPLE_RASTER &&
+       (h->MediaClass[0] |= '\0')) {
       snprintf(tmpstr, sizeof(tmpstr), "-sMediaClass=%s", h->MediaClass);
       cupsArrayAdd(gs_args, strdup(tmpstr));
     }
@@ -1018,15 +1016,10 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
 
   /* Ghostscript output device */
   if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
-#ifndef HAVE_GHOSTSCRIPT_APPLERASTER
-      outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER ||
-#endif /* !HAVE_GHOSTSCRIPT_APPLERASTER */
       outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER)
     cupsArrayAdd(gs_args, strdup("-sDEVICE=cups"));
-#ifdef HAVE_GHOSTSCRIPT_APPLERASTER
   else if (outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER)
     cupsArrayAdd(gs_args, strdup("-sDEVICE=appleraster"));
-#endif /* HAVE_GHOSTSCRIPT_APPLERASTER */
   else if (outformat == CF_FILTER_OUT_FORMAT_PDF)
     cupsArrayAdd(gs_args, strdup("-sDEVICE=pdfwrite"));
   /* In case of PCL XL, raster-obly PDF, or PCLm output we determine
@@ -1077,14 +1070,7 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
   }
 
   cspace = icc_profile ? CUPS_CSPACE_RGB : -1;
-  cfRasterPrepareHeader(&h, data, outformat,
-#ifdef HAVE_GHOSTSCRIPT_APPLERASTER
-                       outformat,
-#else
-                       (outformat != CF_FILTER_OUT_FORMAT_APPLE_RASTER ?
-                        outformat : CF_FILTER_OUT_FORMAT_CUPS_RASTER),
-#endif /* HAVE_GHOSTSCRIPT_APPLERASTER */
-                       0, &cspace);
+  cfRasterPrepareHeader(&h, data, outformat, outformat, 0, &cspace);
 
   /* Special Ghostscript options for raster-only PDF output */
 
index a65f2f09fa5f6199ca5ed18a88110156d7c4d79f..41fb5e652795115f2e5ccacc355a4a55b125bc75 100644 (file)
@@ -333,22 +333,6 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterUniversal: Adding %s to chain", filter->name);
 
-#ifndef HAVE_GHOSTSCRIPT_APPLERASTER
-      if (!strcmp(output, "image/urf"))
-      {
-       filter = malloc(sizeof(cf_filter_filter_in_chain_t));
-       outformat = malloc(sizeof(cf_filter_out_format_t));
-       *outformat = CF_FILTER_OUT_FORMAT_APPLE_RASTER;
-       filter->function = cfFilterRasterToPWG;
-       filter->parameters = outformat;
-       filter->name = "rastertopwg";
-       cupsArrayAdd(filter_chain, filter);
-       if (log) log(ld, CF_LOGLEVEL_DEBUG,
-                    "cfFilterUniversal: Adding %s to chain",
-                    filter->name);
-      }
-      else
-#endif /* !HAVE_GHOSTSCRIPT_APPLERASTER */
       if (strcmp(output_type, "pwg-raster") &&
          strcmp(output_type, "vnd.cups-raster") &&
          strcmp(output_type, "PCLm"))
@@ -424,22 +408,6 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
          if (log) log(ld, CF_LOGLEVEL_DEBUG,
                       "cfFilterUniversal: Adding %s to chain",
                       filter->name);
-
-#ifndef HAVE_GHOSTSCRIPT_APPLERASTER
-         if (!strcmp(output, "image/urf"))
-         {
-           filter = malloc(sizeof(cf_filter_filter_in_chain_t));
-           outformat = malloc(sizeof(cf_filter_out_format_t));
-           *outformat = CF_FILTER_OUT_FORMAT_APPLE_RASTER;
-           filter->function = cfFilterRasterToPWG;
-           filter->parameters = outformat;
-           filter->name = "rastertopwg";
-           cupsArrayAdd(filter_chain, filter);
-           if (log) log(ld, CF_LOGLEVEL_DEBUG,
-                        "cfFilterUniversal: Adding %s to chain",
-                        filter->name);
-         }
-#endif /* !HAVE_GHOSTSCRIPT_APPLERASTER */
        }
        else if(!strcmp(output, "application/postscript") ||
                !strcmp(output, "application/vnd.cups-postscript"))
diff --git a/mime/cupsfilters-ghostscript-appleraster.convs b/mime/cupsfilters-ghostscript-appleraster.convs
deleted file mode 100644 (file)
index fde40a2..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-#   MIME conversions file for OpenPrinting CUPS Filters.
-#
-#   Copyright 2007-2011 by Apple Inc.
-#   Copyright 1997-2007 by Easy Software Products.
-#   Copyright 2012-2016 by Till Kamppeter.
-#
-#   These coded instructions, statements, and computer programs are the
-#   property of Apple Inc. and are protected by Federal copyright
-#   law.  Distribution and use rights are outlined in the file "COPYING"
-#   which should have been included with this file.
-#
-
-#
-# Ghostscript-based filter for Apple Raster output...
-#
-
-application/vnd.cups-pdf       image/urf                       99      gstoraster
index 5dab11174890b4009af221199f9296bbbc3a37e5..d8b8a0404078d7416d8c58c8bddcc8a2bde97e5c 100644 (file)
@@ -18,5 +18,6 @@
 application/postscript         application/pdf                 0       gstopdf
 application/vnd.cups-pdf       application/vnd.cups-raster     99      gstoraster
 application/vnd.cups-pdf       image/pwg-raster                99      gstoraster
+application/vnd.cups-pdf       image/urf                       99      gstoraster
 application/vnd.cups-pdf       application/PCLm                99      gstoraster
 application/vnd.cups-postscript        application/vnd.cups-raster     175     gstoraster