[packages/cups-filters] - added poppler patch (adjust for poppler 0.72 API changes); release 2

qboosh qboosh at pld-linux.org
Fri Dec 21 05:42:05 CET 2018


commit 91e8d1731fac70d148ff11bb3f5688841b3540ca
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Dec 21 05:46:41 2018 +0100

    - added poppler patch (adjust for poppler 0.72 API changes); release 2

 cups-filters-poppler.patch | 234 +++++++++++++++++++++++++++++++++++++++++++++
 cups-filters.spec          |   6 +-
 2 files changed, 238 insertions(+), 2 deletions(-)
---
diff --git a/cups-filters.spec b/cups-filters.spec
index 1837b00..7234665 100644
--- a/cups-filters.spec
+++ b/cups-filters.spec
@@ -12,7 +12,7 @@ Summary:	OpenPrinting CUPS filters and backends
 Summary(pl.UTF-8):	Filtry i backendy CUPS-a z projektu OpenPrinting
 Name:		cups-filters
 Version:	1.21.6
-Release:	1
+Release:	2
 # For a breakdown of the licensing, see COPYING file
 # GPLv2:   filters: commandto*, imagetoraster, pdftops, rasterto*,
 #                   imagetopdf, pstopdf, texttopdf
@@ -30,6 +30,7 @@ Patch0:		%{name}-dbus.patch
 Patch1:		%{name}-php.patch
 Patch2:		%{name}-php7.patch
 Patch3:		%{name}-php73.patch
+Patch4:		%{name}-poppler.patch
 URL:		http://www.linuxfoundation.org/collaborate/workgroups/openprinting/cups-filters
 BuildRequires:	autoconf >= 2.65
 BuildRequires:	automake >= 1:1.11
@@ -56,7 +57,7 @@ BuildRequires:	openldap-devel
 BuildRequires:	pkgconfig >= 1:0.20
 # just for cpp/poppler-version.h
 BuildRequires:	poppler-cpp-devel >= 0.18
-BuildRequires:	poppler-devel >= 0.18
+BuildRequires:	poppler-devel >= 0.72.0
 # /usr/bin/pdftops, for features detection
 BuildRequires:	poppler-progs >= 0.18
 BuildRequires:	qpdf-devel >= 8.1.0
@@ -250,6 +251,7 @@ Moduł PHP do ogólnego systemu druku dla Uniksa.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 %build
 %{__aclocal}
diff --git a/cups-filters-poppler.patch b/cups-filters-poppler.patch
new file mode 100644
index 0000000..96c5c05
--- /dev/null
+++ b/cups-filters-poppler.patch
@@ -0,0 +1,234 @@
+--- cups-filters-1.21.6/filter/pdftoopvp/oprs/OPVPSplashClip.cxx.orig	2018-12-17 17:50:48.000000000 +0100
++++ cups-filters-1.21.6/filter/pdftoopvp/oprs/OPVPSplashClip.cxx	2018-12-20 21:00:31.188863926 +0100
+@@ -40,14 +40,15 @@
+   
+   /* dummy call to clear state */
+   scanners[0]->getBBox(&tsxMin,&tsyMin,&tsxMax,&tsyMax);
+-  scanners[0]->getNextSpan(tsyMin-2,&x0,&x1);
++  SplashXPathScanIterator(*scanners[0], tsyMin-2).getNextSpan(&x0,&x1);
+ 
+   for (y = tyMin;y <= tyMax;y++) {
+     /* clear buffer */
+     for (i = 0;i < blen;i++) {
+       cbuf[i] = 0;
+     }
+-    while (scanners[0]->getNextSpan(y,&x0,&x1)) {
++    SplashXPathScanIterator iter(*scanners[0], y);
++    while (iter.getNextSpan(&x0,&x1)) {
+       if (x0 < txMin) x0 = txMin;
+       if (x1 > txMax) x1 = txMax;
+       for (i = x0;i < x1;i++) {
+@@ -59,7 +60,8 @@
+       for (i = 0;i < blen;i++) {
+ 	tbuf[i] = 0;
+       }
+-      while (scanners[j]->getNextSpan(y,&x0,&x1)) {
++      SplashXPathScanIterator iter2(*scanners[j], y);
++      while (iter2.getNextSpan(&x0,&x1)) {
+ 	if (x0 < txMin) x0 = txMin;
+ 	if (x1 > txMax) x1 = txMax;
+ 	for (i = x0;i < x1;i++) {
+--- cups-filters-1.21.6/filter/pdftoopvp/oprs/OPVPSplash.cxx.orig	2018-12-17 17:50:48.000000000 +0100
++++ cups-filters-1.21.6/filter/pdftoopvp/oprs/OPVPSplash.cxx	2018-12-20 21:02:03.895529536 +0100
+@@ -1006,7 +1006,8 @@
+     setStrokePattern(state->fillPattern->copy());
+ 
+     for (y = yMinI; y < yMaxI; ++y) {
+-      while (scanner->getNextSpan(y, &x0, &x1)) {
++      SplashXPathScanIterator iter(*scanner, y);
++      while (iter.getNextSpan(&x0, &x1)) {
+         if (x0 == x1) continue;
+ 	if (clipRes == splashClipAllInside) {
+ 	  drawSpan(x0, x1-1, y, true);
+--- cups-filters-1.21.6/filter/pdftoopvp/OPVPOutputDev.cxx.orig	2018-12-17 17:50:48.000000000 +0100
++++ cups-filters-1.21.6/filter/pdftoopvp/OPVPOutputDev.cxx	2018-12-20 21:05:04.392194142 +0100
+@@ -294,7 +294,7 @@
+ 
+   if (state) {
+     if (scaleWidth > 0 && scaleHeight > 0) {
+-      double *ctm = state->getCTM();
++      const double *ctm = state->getCTM();
+ 
+       switch (rotate) {
+       case 90:
+@@ -548,7 +548,7 @@
+                           &faceIndex, NULL);
+       if (fileName == 0) {
+ 	opvpError(-1, "Couldn't find a font for '%s'",
+-	      gfxFont->getName() ? gfxFont->getName()->getCString()
++	      gfxFont->getName() ? gfxFont->getName()->c_str()
+ 	                         : "(unnamed)");
+ 	goto err2;
+       }
+@@ -574,7 +574,7 @@
+       }
+       if (!dfp) {
+ 	opvpError(-1, "Couldn't find a font for '%s'",
+-	      gfxFont->getName() ? gfxFont->getName()->getCString()
++	      gfxFont->getName() ? gfxFont->getName()->c_str()
+ 	                         : "(unnamed)");
+ 	goto err2;
+       }
+@@ -609,7 +609,7 @@
+ #endif
+ 			   ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
+ 	opvpError(-1, "Couldn't create a font for '%s'",
+-	      gfxFont->getName() ? gfxFont->getName()->getCString()
++	      gfxFont->getName() ? gfxFont->getName()->c_str()
+ 	                         : "(unnamed)");
+ 	goto err2;
+       }
+@@ -623,7 +623,7 @@
+ #endif
+ 			   ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
+ 	opvpError(-1, "Couldn't create a font for '%s'",
+-	      gfxFont->getName() ? gfxFont->getName()->getCString()
++	      gfxFont->getName() ? gfxFont->getName()->c_str()
+ 	                         : "(unnamed)");
+ 	goto err2;
+       }
+@@ -637,7 +637,7 @@
+ #endif
+ 			   ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
+ 	opvpError(-1, "Couldn't create a font for '%s'",
+-	      gfxFont->getName() ? gfxFont->getName()->getCString()
++	      gfxFont->getName() ? gfxFont->getName()->c_str()
+ 	                         : "(unnamed)");
+ 	goto err2;
+       }
+@@ -645,7 +645,7 @@
+     case fontTrueTypeOT:
+     case fontTrueType:
+ 	if (fileName)
+-	 ff = FoFiTrueType::load(fileName->getCString());
++	 ff = FoFiTrueType::load(fileName->c_str());
+ 	else
+ 	ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+       if (ff) {
+@@ -661,7 +661,7 @@
+ 			   fontsrc,
+ 			   codeToGID, n))) {
+ 	opvpError(-1, "Couldn't create a font for '%s'",
+-	      gfxFont->getName() ? gfxFont->getName()->getCString()
++	      gfxFont->getName() ? gfxFont->getName()->c_str()
+ 	                         : "(unnamed)");
+ 	goto err2;
+       }
+@@ -672,7 +672,7 @@
+ 			   id,
+ 			   fontsrc))) {
+ 	opvpError(-1, "Couldn't create a font for '%s'",
+-	      gfxFont->getName() ? gfxFont->getName()->getCString()
++	      gfxFont->getName() ? gfxFont->getName()->c_str()
+ 	                         : "(unnamed)");
+ 	goto err2;
+       }
+@@ -696,7 +696,7 @@
+ 			   fontsrc))) {
+ #endif
+ 	opvpError(-1, "Couldn't create a font for '%s'",
+-	      gfxFont->getName() ? gfxFont->getName()->getCString()
++	      gfxFont->getName() ? gfxFont->getName()->c_str()
+ 	                         : "(unnamed)");
+ 	goto err2;
+       }
+@@ -720,7 +720,7 @@
+ 	}
+       } else {
+ 	if (fileName)
+-	  ff = FoFiTrueType::load(fileName->getCString());
++	  ff = FoFiTrueType::load(fileName->c_str());
+ 	else
+ 	  ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 	if (! ff)
+@@ -733,7 +733,7 @@
+ 			   fontsrc,
+ 			   codeToGID, n, faceIndex))) {
+ 	opvpError(-1, "Couldn't create a font for '%s'",
+-	      gfxFont->getName() ? gfxFont->getName()->getCString()
++	      gfxFont->getName() ? gfxFont->getName()->c_str()
+ 	                         : "(unnamed)");
+ 	goto err2;
+       }
+@@ -760,7 +760,7 @@
+   if (fontFile->doAdjustMatrix && !gfxFont->isCIDFont()) {
+     double w1, w2;
+     CharCode code;
+-    char *name;
++    const char *name;
+     for (code = 0; code < 256; ++code) {
+       if ((name = ((Gfx8BitFont *)gfxFont)->getCharName(code)) &&
+           name[0] == 'm' && name[1] == '\0') {
+@@ -1115,7 +1115,7 @@
+ 				    int width, int height, bool invert,
+ 				    bool interpolate,
+ 				    bool inlineImg) {
+-  double *ctm;
++  const double *ctm;
+   SplashCoord mat[6];
+   SplashOutImageMaskData imgMaskData;
+ 
+@@ -1379,7 +1379,7 @@
+ 				GfxImageColorMap *colorMap,
+ 			        bool interpolate,
+ 				int *maskColors, bool inlineImg) {
+-  double *ctm;
++  const double *ctm;
+   SplashCoord mat[6];
+   SplashOutImageData imgData;
+   SplashColorMode srcMode;
+@@ -1604,7 +1604,7 @@
+ 				      Stream *maskStr, int maskWidth,
+ 				      int maskHeight, bool maskInvert,
+ 				      bool maskInterpolate) {
+-  double *ctm;
++  const double *ctm;
+   SplashCoord mat[6];
+   SplashOutMaskedImageData imgData;
+   SplashOutImageMaskData imgMaskData;
+@@ -1759,7 +1759,7 @@
+ 					  int maskWidth, int maskHeight,
+ 					  GfxImageColorMap *maskColorMap,
+ 					  bool maskInterpolate) {
+-  double *ctm;
++  const double *ctm;
+   SplashCoord mat[6];
+   SplashOutImageData imgData;
+   SplashOutImageData imgMaskData;
+--- cups-filters-1.21.6/filter/pdftoopvp/pdftoopvp.cxx.orig	2018-12-17 17:50:48.000000000 +0100
++++ cups-filters-1.21.6/filter/pdftoopvp/pdftoopvp.cxx	2018-12-20 21:09:35.195524381 +0100
+@@ -482,11 +482,11 @@
+       if (choices != 0) free(choices);
+     }
+ 
+-    strncpy(jobInfo,jobInfoStr.getCString(),sizeof(jobInfo)-1);
++    strncpy(jobInfo,jobInfoStr.c_str(),sizeof(jobInfo)-1);
+     jobInfo[sizeof(jobInfo)-1] = '\0';
+-    strncpy(docInfo,docInfoStr.getCString(),sizeof(docInfo)-1);
++    strncpy(docInfo,docInfoStr.c_str(),sizeof(docInfo)-1);
+     docInfo[sizeof(docInfo)-1] = '\0';
+-    strncpy(pageInfo,pageInfoStr.getCString(),sizeof(pageInfo)-1);
++    strncpy(pageInfo,pageInfoStr.c_str(),sizeof(pageInfo)-1);
+     pageInfo[sizeof(pageInfo)-1] = '\0';
+ 
+     colorProfile = getColorProfilePath(ppd,&colorProfilePath);
+@@ -647,7 +647,9 @@
+       name.append("/tmp");
+     }
+     name.append("/XXXXXX");
+-    fd = mkstemp(name.getCString());
++    char namebuf[name.getLength()+1];
++    strcpy(namebuf, name.c_str());
++    fd = mkstemp(namebuf);
+     if (fd < 0) {
+       opvpError(-1,"Can't create temporary file");
+       exitCode = 2;
+@@ -691,7 +693,7 @@
+     close(fd);
+     doc = new PDFDoc(&name);
+     /* remove name */
+-    unlink(name.getCString());
++    unlink(name.c_str());
+   } else {
+     /* no jcl check */
+     doc = new PDFDoc(fileName.copy());
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/cups-filters.git/commitdiff/91e8d1731fac70d148ff11bb3f5688841b3540ca



More information about the pld-cvs-commit mailing list