public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-print/libcupsfilters/, net-print/libcupsfilters/files/
@ 2024-04-08 16:34 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2024-04-08 16:34 UTC (permalink / raw
  To: gentoo-commits

commit:     c0d3a113d5842f182fb13f51e011a83bcfe791fe
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Apr  8 16:33:06 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Apr  8 16:34:19 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c0d3a113

net-print/libcupsfilters: backport color vs. b/w fixes

Closes: https://bugs.gentoo.org/927137
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/libcupsfilters-2.0.0-color-space.patch   | 254 +++++++++++++++++++++
 .../libcupsfilters-2.0.0-raster-build-fix.patch    |  28 +++
 .../files/libcupsfilters-2.0.0-raster-gray.patch   |  50 ++++
 .../libcupsfilters/libcupsfilters-2.0.0-r4.ebuild  |  77 +++++++
 4 files changed, 409 insertions(+)

diff --git a/net-print/libcupsfilters/files/libcupsfilters-2.0.0-color-space.patch b/net-print/libcupsfilters/files/libcupsfilters-2.0.0-color-space.patch
new file mode 100644
index 000000000000..37a8bce64d7b
--- /dev/null
+++ b/net-print/libcupsfilters/files/libcupsfilters-2.0.0-color-space.patch
@@ -0,0 +1,254 @@
+https://bugs.gentoo.org/927137
+https://github.com/OpenPrinting/cups-filters/issues/578
+https://github.com/OpenPrinting/libcupsfilters/commit/c6175a2f3f66dbf76bb35ec8d1ba0dc094c9dbac
+
+From c6175a2f3f66dbf76bb35ec8d1ba0dc094c9dbac Mon Sep 17 00:00:00 2001
+From: Till Kamppeter <till.kamppeter@gmail.com>
+Date: Wed, 29 Nov 2023 00:25:16 +0100
+Subject: [PATCH] raster_base_header(): Several fixes on color space selection
+
+Fixes #38
+
+The internal (static) funcrion raster_base_header() creates a CUPS or
+PWG Raster header from scratch, without using data of a PPD file by
+means of Raster header derived from the PPD. It solely uses IPP
+attributes or command line options.
+
+It distinguishes between CUPS Raster and PWG/Apple Raster headers.
+
+There were several bugs in selecting the correct color space and depth
+settings:
+
+- For PWG-Raster all attributes and options got ignored and standard
+  8-bit sRGB set.
+
+- Without any valid color space/depth setting attribute or "auto"
+  always standard 8-bit sRGB got set as the default, regardless
+  whether the printer is actually a color printer.
+
+- Color spaces for printing in color could be set on monochrome
+  printers by options or atrributes.
+
+- Color spaces not valid on PWG Raster could be set on PWG Raster.
+
+- DeviceN modes could only be set by specifying a depth, like
+  "Device4_8" not just "Device4".
+
+Now we use 8-bit SGray as default for monochrome printers and 8-bit
+RGB for color printers. We use the printer IPP attribute
+"color-supported" to check whether the printer is color.
+
+IPP ttributes or command line options setting a color mode on a
+monochrome printer are ignored now, also, if the output format is PWG
+Raster, setting a color space not supported by PWG Raster is ignored.
+
+Now for monochrome AirPrint (Apple Raster) printers, the Raster data
+sent should be actually monochrome (grayscale) and not color.
+---
+ cupsfilters/raster.c | 103 +++++++++++++++++++++++++------------------
+ 1 file changed, 61 insertions(+), 42 deletions(-)
+
+diff --git a/cupsfilters/raster.c b/cupsfilters/raster.c
+index 32a8b807..5e10f3bb 100644
+--- a/cupsfilters/raster.c
++++ b/cupsfilters/raster.c
+@@ -792,7 +792,7 @@ cfRasterSetColorSpace(cups_page_header_t *h,   // I  - Raster header
+ 
+ 
+ static int                                 // O - -1 on error, 0 on success
+-raster_base_header(cups_page_header2_t *h, // O - Raster header
++raster_base_header(cups_page_header2_t *h,  // O - Raster header
+ 		   cf_filter_data_t *data, // I - Filter data
+ 		   int pwg_raster)         // I - 1 if PWG/Apple Raster
+ {
+@@ -1420,41 +1420,46 @@ raster_base_header(cups_page_header_t *h, // O - Raster header
+   // TODO - Support for MediaType number
+   h->cupsMediaType = 0;
+ 
+-  // Only for CUPS Raster, if we do not have a sample header from a PPD file
+-  if (pwg_raster == 0 &&
+-      ((val = cupsGetOption("pwg-raster-document-type", num_options,
+-			    options)) != NULL ||
+-       (val = cupsGetOption("PwgRasterDocumentType", num_options,
+-			    options)) != NULL ||
+-       (val = cupsGetOption("color-space", num_options, options)) != NULL ||
+-       (val = cupsGetOption("ColorSpace", num_options, options)) != NULL ||
+-       (val = cupsGetOption("color-model", num_options, options)) != NULL ||
+-       (val = cupsGetOption("ColorModel", num_options, options)) != NULL ||
+-       (val = cupsGetOption("print-color-mode", num_options, options)) !=
+-       NULL ||
+-       (val = cupsGetOption("output-mode", num_options, options)) != NULL ||
+-       (val = cupsGetOption("OutputMode", num_options, options)) != NULL ||
+-       (val = cfIPPAttrEnumValForPrinter(data->printer_attrs,
+-					 data->job_attrs,
+-					 "print-color-mode")) != NULL))
++
++  // Do we have a color printer?
++  bool is_color =
++    ((attr = ippFindAttribute(data->printer_attrs, "color-supported",
++			      IPP_TAG_BOOLEAN)) != NULL &&
++     ippGetBoolean(attr, 0));
++
++  // Color modes
++  int numcolors = 0;		// Number of colorants
++  if ((val = cupsGetOption("pwg-raster-document-type", num_options,
++			   options)) != NULL ||
++      (val = cupsGetOption("PwgRasterDocumentType", num_options,
++			   options)) != NULL ||
++      (val = cupsGetOption("color-space", num_options, options)) != NULL ||
++      (val = cupsGetOption("ColorSpace", num_options, options)) != NULL ||
++      (val = cupsGetOption("color-model", num_options, options)) != NULL ||
++      (val = cupsGetOption("ColorModel", num_options, options)) != NULL ||
++      (val = cupsGetOption("print-color-mode", num_options, options)) !=
++      NULL ||
++      (val = cupsGetOption("output-mode", num_options, options)) != NULL ||
++      (val = cupsGetOption("OutputMode", num_options, options)) != NULL ||
++      (val = cfIPPAttrEnumValForPrinter(data->printer_attrs,
++					data->job_attrs,
++					"print-color-mode")) != NULL)
+   {
+     int	        bitspercolor,	// Bits per color
+                 bitsperpixel,   // Bits per pixel
+-                colorspace,     // CUPS/PWG raster color space
+-                numcolors;	// Number of colorants
++                colorspace;     // CUPS/PWG raster color space;
+     const char	*ptr;		// Pointer into value
+ 
+     ptr = NULL;
+-    numcolors = 0;
+     bitspercolor = 8;
+-    if (!strncasecmp(val, "AdobeRgb", 8))
++    if (is_color && !strncasecmp(val, "AdobeRgb", 8))
+     {
+       if (*(val + 8) == '_' || *(val + 8) == '-')
+ 	ptr = val + 9;
+       colorspace = 20;
+       numcolors = 3;
+     }
+-    else if (!strncasecmp(val, "adobe-rgb", 9))
++    else if (is_color && !strncasecmp(val, "adobe-rgb", 9))
+     {
+       if (*(val + 9) == '_' || *(val + 9) == '-')
+ 	ptr = val + 10;
+@@ -1500,19 +1505,19 @@ raster_base_header(cups_page_header_t *h, // O - Raster header
+       colorspace = 18;
+       numcolors = 1;
+     }
+-    else if (!strcasecmp(val, "color"))
++    else if (is_color && !strcasecmp(val, "color"))
+     {
+       colorspace = 19;
+       numcolors = 3;
+     }
+-    else if (!strncasecmp(val, "Cmyk", 4))
++    else if (is_color && !strncasecmp(val, "Cmyk", 4))
+     {
+       if (*(val + 4) == '_' || *(val + 4) == '-')
+ 	ptr = val + 5;
+       colorspace = 6;
+       numcolors = 4;
+     }
+-    else if (!strncasecmp(val, "Cmy", 3))
++    else if (!pwg_raster && is_color && !strncasecmp(val, "Cmy", 3))
+     {
+       if (*(val + 3) == '_' || *(val + 3) == '-')
+ 	ptr = val + 4;
+@@ -1524,10 +1529,9 @@ raster_base_header(cups_page_header_t *h, // O - Raster header
+       ptr = val + 6;
+       numcolors = strtol(ptr, (char **)&ptr, 10);
+       if (*ptr == '_' || *ptr == '-')
+-      {
+ 	ptr ++;
++      if (numcolors > 0 && numcolors < 16)
+ 	colorspace = 47 + numcolors;
+-      }
+       else
+       {
+ 	numcolors = 0;
+@@ -1548,21 +1552,21 @@ raster_base_header(cups_page_header_t *h, // O - Raster header
+       colorspace = 18;
+       numcolors = 1;
+     }
+-    else if (!strncasecmp(val, "Srgb", 4))
++    else if (is_color && !strncasecmp(val, "Srgb", 4))
+     {
+       if (*(val + 4) == '_' || *(val + 4) == '-')
+ 	ptr = val + 5;
+       colorspace = 19;
+       numcolors = 3;
+     }
+-    else if (!strncasecmp(val, "Rgbw", 4))
++    else if (!pwg_raster && is_color && !strncasecmp(val, "Rgbw", 4))
+     {
+       if (*(val + 4) == '_' || *(val + 4) == '-')
+ 	ptr = val + 5;
+       colorspace = 17;
+       numcolors = 4;
+     }
+-    else if (!strncasecmp(val, "Rgb", 3))
++    else if (is_color && !strncasecmp(val, "Rgb", 3))
+     {
+       if (*(val + 3) == '_' || *(val + 3) == '-')
+ 	ptr = val + 4;
+@@ -1572,12 +1576,22 @@ raster_base_header(cups_page_header_t *h, // O - Raster header
+     else if (!strcasecmp(val, "auto"))
+     {
+       // Let "auto" not look like an error
+-      colorspace = 19;
+-      numcolors = 3;
++      if (is_color)
++      {
++	colorspace = 19;
++	numcolors = 3;
++      }
++      else
++      {
++	colorspace = 18;
++	numcolors = 1;
++      }
+     }
++
++    // Color mode found
+     if (numcolors > 0)
+     {
+-      if (ptr)
++      if (ptr && *ptr)
+ 	bitspercolor = strtol(ptr, (char **)&ptr, 10);
+       bitsperpixel = bitspercolor * numcolors;
+       // In 1-bit-per-color RGB modes we add a forth bit to each pixel
+@@ -1590,20 +1604,25 @@ raster_base_header(cups_page_header_t *h, // O - Raster header
+       h->cupsColorSpace = colorspace;
+       h->cupsNumColors = numcolors;
+     }
+-    else
++  }
++
++  // No color mode found
++  if (numcolors == 0)
++  {
++    if (is_color)
+     {
+       h->cupsBitsPerColor = 8;
+       h->cupsBitsPerPixel = 24;
+       h->cupsColorSpace = 19;
+       h->cupsNumColors = 3;
+     }
+-  }
+-  else
+-  {
+-    h->cupsBitsPerColor = 8;
+-    h->cupsBitsPerPixel = 24;
+-    h->cupsColorSpace = 19;
+-    h->cupsNumColors = 3;
++    else
++    {
++      h->cupsBitsPerColor = 8;
++      h->cupsBitsPerPixel = 8;
++      h->cupsColorSpace = 18;
++      h->cupsNumColors = 1;
++    }
+   }
+ 
+   // TODO - Support for color orders 1 (banded) and 2 (planar)
+
+

diff --git a/net-print/libcupsfilters/files/libcupsfilters-2.0.0-raster-build-fix.patch b/net-print/libcupsfilters/files/libcupsfilters-2.0.0-raster-build-fix.patch
new file mode 100644
index 000000000000..c274b8473c47
--- /dev/null
+++ b/net-print/libcupsfilters/files/libcupsfilters-2.0.0-raster-build-fix.patch
@@ -0,0 +1,28 @@
+https://bugs.gentoo.org/927137
+https://github.com/OpenPrinting/cups-filters/issues/578
+https://github.com/OpenPrinting/libcupsfilters/commit/107091186dce1c0cb2f042f8b880f571089acaf1
+
+From 107091186dce1c0cb2f042f8b880f571089acaf1 Mon Sep 17 00:00:00 2001
+From: zdohnal <zdohnal@redhat.com>
+Date: Wed, 29 Nov 2023 13:30:48 +0100
+Subject: [PATCH] raster.c: Fix build after last fix (#40)
+
+Add header file `stdbool`, since we started to use `bool` in
+`raster_base_header()`.
+---
+ cupsfilters/raster.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/cupsfilters/raster.c b/cupsfilters/raster.c
+index 5e10f3bb..e9a8ad1f 100644
+--- a/cupsfilters/raster.c
++++ b/cupsfilters/raster.c
+@@ -29,6 +29,7 @@
+ #include <cupsfilters/ipp.h>
+ #include <cupsfilters/libcups2-private.h>
+ #include <cups/pwg.h>
++#include <stdbool.h>
+ 
+ //
+ // Local functions
+

diff --git a/net-print/libcupsfilters/files/libcupsfilters-2.0.0-raster-gray.patch b/net-print/libcupsfilters/files/libcupsfilters-2.0.0-raster-gray.patch
new file mode 100644
index 000000000000..e1648c041e97
--- /dev/null
+++ b/net-print/libcupsfilters/files/libcupsfilters-2.0.0-raster-gray.patch
@@ -0,0 +1,50 @@
+https://bugs.gentoo.org/927137
+https://github.com/OpenPrinting/cups-filters/issues/578
+https://github.com/OpenPrinting/libcupsfilters/commit/78cc6758d98c31397c8addefaa3dfd8746331b72
+
+From 78cc6758d98c31397c8addefaa3dfd8746331b72 Mon Sep 17 00:00:00 2001
+From: zdohnal <zdohnal@redhat.com>
+Date: Thu, 7 Mar 2024 18:27:06 +0100
+Subject: [PATCH] raster.c: Always use sRGB/sGray if driver is PWG/URF and
+ RGB/Gray is requested (#51)
+
+Some driverless printers (EPSON L3160 in Fedora report) stopped working
+after commit c6175a2 if `ColorModel=RGB` is passed as option. A
+different CUPS color space is assigned with the fix - CUPS_CSPACE_RGB,
+which results in no ICC profile being assigned into Ghostscript command
+line.
+
+Probably we can try other .icc profiles with CUPS_CSPACE_RGB (srgb.icc
+does not work with RGB color space), but I tested with reporter that
+using sRGB space + srgb.icc works for the printer - so the patch is to
+use sRGB if the driver is URF/PWG.
+
+Same logic applied for grayscale printing, if Gray is requested, sGray is
+used for URF/PWG.
+---
+ cupsfilters/raster.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/cupsfilters/raster.c b/cupsfilters/raster.c
+index e9a8ad1f..7b62b922 100644
+--- a/cupsfilters/raster.c
++++ b/cupsfilters/raster.c
+@@ -1550,7 +1550,7 @@ raster_base_header(cups_page_header_t *h,  // O - Raster header
+     {
+       if (*(val + 4) == '_' || *(val + 4) == '-')
+ 	ptr = val + 5;
+-      colorspace = 18;
++      colorspace = pwg_raster ? 18 : 3;
+       numcolors = 1;
+     }
+     else if (is_color && !strncasecmp(val, "Srgb", 4))
+@@ -1571,7 +1571,7 @@ raster_base_header(cups_page_header_t *h,  // O - Raster header
+     {
+       if (*(val + 3) == '_' || *(val + 3) == '-')
+ 	ptr = val + 4;
+-      colorspace = 1;
++      colorspace = pwg_raster ? 19 : 1;
+       numcolors = 3;
+     }
+     else if (!strcasecmp(val, "auto"))
+

diff --git a/net-print/libcupsfilters/libcupsfilters-2.0.0-r4.ebuild b/net-print/libcupsfilters/libcupsfilters-2.0.0-r4.ebuild
new file mode 100644
index 000000000000..1d3b175d5905
--- /dev/null
+++ b/net-print/libcupsfilters/libcupsfilters-2.0.0-r4.ebuild
@@ -0,0 +1,77 @@
+# Copyright 2023-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit libtool
+
+DESCRIPTION="library for developing printing features, split out of cups-filters"
+HOMEPAGE="https://github.com/OpenPrinting/libcupsfilters"
+SRC_URI="https://github.com/OpenPrinting/libcupsfilters/releases/download/${PV}/${P}.tar.xz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="dbus exif jpeg pdf +poppler +postscript png test tiff"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+	>=app-text/qpdf-8.3.0:=
+	media-libs/fontconfig
+	media-libs/lcms:2
+	>=net-print/cups-2
+	!<net-print/cups-filters-2.0.0
+
+	exif? ( media-libs/libexif )
+	dbus? ( sys-apps/dbus )
+	jpeg? ( media-libs/libjpeg-turbo:= )
+	pdf? ( app-text/mupdf )
+	postscript? ( app-text/ghostscript-gpl[cups] )
+	poppler? ( >=app-text/poppler-0.32[cxx] )
+	png? ( media-libs/libpng:= )
+	tiff? ( media-libs/tiff:= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	>=sys-devel/gettext-0.18.3
+	virtual/pkgconfig
+	test? ( media-fonts/dejavu )
+"
+
+PATCHES=(
+	"${FILESDIR}/${P}-r3-c++17.patch"
+	"${FILESDIR}/${P}-color-space.patch"
+	"${FILESDIR}/${P}-raster-build-fix.patch"
+	"${FILESDIR}/${P}-raster-gray.patch"
+)
+
+src_prepare() {
+	default
+
+	# respect --as-needed
+	elibtoolize
+}
+
+src_configure() {
+	local myeconfargs=(
+		--enable-imagefilters
+		--localstatedir="${EPREFIX}"/var
+		--with-cups-rundir="${EPREFIX}"/run/cups
+
+		$(use_enable exif)
+		$(use_enable dbus)
+		$(use_enable poppler)
+		$(use_enable postscript ghostscript)
+		$(use_enable pdf mutool)
+		$(use_with jpeg)
+		$(use_with png)
+		$(use_with tiff)
+	)
+
+	econf "${myeconfargs[@]}"
+}
+
+src_install() {
+	default
+	find "${ED}" -name '*.la' -delete || die
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-print/libcupsfilters/, net-print/libcupsfilters/files/
@ 2024-09-26 22:13 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2024-09-26 22:13 UTC (permalink / raw
  To: gentoo-commits

commit:     429f7f1f7ec1dd9e83c4b556e829f95f9e8c50f4
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 26 22:12:07 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Sep 26 22:12:07 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=429f7f1f

net-print/libcupsfilters: add 2.1_beta1

Similar rationale to 7eba3af91f1fd96ebb7491890479e7aef6c649ac in terms
of why a beta.

Bug: https://bugs.gentoo.org/940312
Bug: https://bugs.gentoo.org/940311
Bug: https://bugs.gentoo.org/940313
Bug: https://bugs.gentoo.org/940314
Bug: https://bugs.gentoo.org/940315
Bug: https://bugs.gentoo.org/940316
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-print/libcupsfilters/Manifest                  |  1 +
 .../libcupsfilters-2.1_beta1-CVE-2024-47076.patch  | 31 +++++++++
 .../libcupsfilters/libcupsfilters-2.1_beta1.ebuild | 75 ++++++++++++++++++++++
 3 files changed, 107 insertions(+)

diff --git a/net-print/libcupsfilters/Manifest b/net-print/libcupsfilters/Manifest
index 9145aecf6f6d..0ebcb3991370 100644
--- a/net-print/libcupsfilters/Manifest
+++ b/net-print/libcupsfilters/Manifest
@@ -1 +1,2 @@
 DIST libcupsfilters-2.0.0.tar.xz 1279856 BLAKE2B ce9d839bb700017c303c1301c7a97fd02e3657a908e685377be49557d995574a7fc5a31d4fcbda5eeb9ba2d3cd07858224540dbf0bc9fa078cfd25a58ee15a41 SHA512 279bff6dcfa76312b10dae97480914345defd90eab79c4716d4553870f73e0f9db404786fd7e2948a86ae5aedb10dca0c2984ccb4222acbd4e835cd572030d6a
+DIST libcupsfilters-2.1b1.tar.xz 1443976 BLAKE2B 043174e47c6c5de5393cfb4d6f41e3839646932cff42cf677319b2ea22fe8408fbf1d1edfb3b99c1d2c36916a92993069a40ed5f75552d47d88300e283b6aa84 SHA512 5b0cd2472f54188dda13b091f82b257ba926e12065c225ddbde9cab97597baa6d855f09d7352b7d7ee4af8416fc9c3ddb3c75e0c6a0a201b366d047abe47ecef

diff --git a/net-print/libcupsfilters/files/libcupsfilters-2.1_beta1-CVE-2024-47076.patch b/net-print/libcupsfilters/files/libcupsfilters-2.1_beta1-CVE-2024-47076.patch
new file mode 100644
index 000000000000..016d086ea2b1
--- /dev/null
+++ b/net-print/libcupsfilters/files/libcupsfilters-2.1_beta1-CVE-2024-47076.patch
@@ -0,0 +1,31 @@
+https://bugs.gentoo.org/940313
+https://github.com/OpenPrinting/libcupsfilters/commit/95576ec3d20c109332d14672a807353cdc551018
+
+From 95576ec3d20c109332d14672a807353cdc551018 Mon Sep 17 00:00:00 2001
+From: Zdenek Dohnal <zdohnal@redhat.com>
+Date: Thu, 26 Sep 2024 23:09:29 +0200
+Subject: [PATCH] cfGetPrinterAttributes5(): Validate response attributes
+ before return
+
+The destination can be corrupted or forged, so validate the response
+to strenghten security measures.
+
+Fixes CVE-2024-47076
+--- a/cupsfilters/ipp.c
++++ b/cupsfilters/ipp.c
+@@ -404,6 +404,14 @@ cfGetPrinterAttributes5(http_t *http_printer,
+ 	    ippDelete(response2);
+ 	  }
+ 	}
++
++	// Check if the response is valid
++	if (!ippValidateAttributes(response))
++	{
++	  ippDelete(response);
++	  response = NULL;
++	}
++
+ 	if (have_http == 0) httpClose(http_printer);
+ 	if (uri) free(uri);
+ 	return (response);
+

diff --git a/net-print/libcupsfilters/libcupsfilters-2.1_beta1.ebuild b/net-print/libcupsfilters/libcupsfilters-2.1_beta1.ebuild
new file mode 100644
index 000000000000..6fc8a01f0022
--- /dev/null
+++ b/net-print/libcupsfilters/libcupsfilters-2.1_beta1.ebuild
@@ -0,0 +1,75 @@
+# Copyright 2023-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit libtool
+
+DESCRIPTION="library for developing printing features, split out of cups-filters"
+HOMEPAGE="https://github.com/OpenPrinting/libcupsfilters"
+SRC_URI="https://github.com/OpenPrinting/libcupsfilters/releases/download/${PV/_beta/b}/${P/_beta/b}.tar.xz"
+S="${WORKDIR}"/${P/_beta/b}
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="dbus exif jpeg pdf +poppler +postscript png test tiff"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+	>=app-text/qpdf-8.3.0:=
+	media-libs/fontconfig
+	media-libs/lcms:2
+	>=net-print/cups-2
+	!<net-print/cups-filters-2.0.0
+
+	exif? ( media-libs/libexif )
+	dbus? ( sys-apps/dbus )
+	jpeg? ( media-libs/libjpeg-turbo:= )
+	pdf? ( app-text/mupdf )
+	postscript? ( app-text/ghostscript-gpl[cups] )
+	poppler? ( >=app-text/poppler-0.32:=[cxx] )
+	png? ( media-libs/libpng:= )
+	tiff? ( media-libs/tiff:= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	>=sys-devel/gettext-0.18.3
+	virtual/pkgconfig
+	test? ( media-fonts/dejavu )
+"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-CVE-2024-47076.patch
+)
+
+src_prepare() {
+	default
+
+	# respect --as-needed
+	elibtoolize
+}
+
+src_configure() {
+	local myeconfargs=(
+		--enable-imagefilters
+		--localstatedir="${EPREFIX}"/var
+		--with-cups-rundir="${EPREFIX}"/run/cups
+
+		$(use_enable exif)
+		$(use_enable dbus)
+		$(use_enable poppler)
+		$(use_enable postscript ghostscript)
+		$(use_enable pdf mutool)
+		$(use_with jpeg)
+		$(use_with png)
+		$(use_with tiff)
+	)
+
+	econf "${myeconfargs[@]}"
+}
+
+src_install() {
+	default
+	find "${ED}" -name '*.la' -delete || die
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-09-26 22:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-08 16:34 [gentoo-commits] repo/gentoo:master commit in: net-print/libcupsfilters/, net-print/libcupsfilters/files/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2024-09-26 22:13 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox