Hello community, here is the log from the commit of package cups-filters for openSUSE:Factory checked in at 2019-01-10 15:16:39 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cups-filters (Old) and /work/SRC/openSUSE:Factory/.cups-filters.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cups-filters" Thu Jan 10 15:16:39 2019 rev:38 rq:663893 version:1.21.6 Changes: -------- --- /work/SRC/openSUSE:Factory/cups-filters/cups-filters.changes 2018-12-24 11:35:56.033742806 +0100 +++ /work/SRC/openSUSE:Factory/.cups-filters.new.28833/cups-filters.changes 2019-01-10 15:16:41.434727230 +0100 @@ -1,0 +2,9 @@ +Sat Dec 29 03:18:16 UTC 2018 - Stefan BrĂ¼ns <stefan.bru...@rwth-aachen.de> + +- Fix building with Poppler 0.72 + Add 0001-Raise-minimum-poppler-version-from-0.18-to-0.19.patch + Add 0002-Adapt-code-for-SplashXPathScanner-state-handling-sin.patch + Add 0003-Support-some-more-methods-returning-const.patch + Add 0004-Support-GooString-c_str-introduced-by-poppler-0.72.patch + +------------------------------------------------------------------- New: ---- 0001-Raise-minimum-poppler-version-from-0.18-to-0.19.patch 0002-Adapt-code-for-SplashXPathScanner-state-handling-sin.patch 0003-Support-some-more-methods-returning-const.patch 0004-Support-GooString-c_str-introduced-by-poppler-0.72.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cups-filters.spec ++++++ --- /var/tmp/diff_new_pack.Ib0Otm/_old 2019-01-10 15:16:41.970726717 +0100 +++ /var/tmp/diff_new_pack.Ib0Otm/_new 2019-01-10 15:16:41.974726713 +0100 @@ -40,6 +40,14 @@ Version: 1.21.6 Release: 0 Source0: http://www.openprinting.org/download/cups-filters/cups-filters-%{version}.tar.xz +# PATCH-FIX-UPSTREAM 0001-Raise-minimum-poppler-version-from-0.18-to-0.19.patch - https://github.com/OpenPrinting/cups-filters/pull/83 +Patch0: 0001-Raise-minimum-poppler-version-from-0.18-to-0.19.patch +# PATCH-FIX-UPSTREAM 0002-Adapt-code-for-SplashXPathScanner-state-handling-sin.patch +Patch1: 0002-Adapt-code-for-SplashXPathScanner-state-handling-sin.patch +# PATCH-FIX-UPSTREAM 0003-Support-some-more-methods-returning-const.patch +Patch2: 0003-Support-some-more-methods-returning-const.patch +# PATCH-FIX-UPSTREAM 0004-Support-GooString-c_str-introduced-by-poppler-0.72.patch +Patch3: 0004-Support-GooString-c_str-introduced-by-poppler-0.72.patch # Upstream fix for https://bugs.linuxfoundation.org/show_bug.cgi?id=1421 # in https://github.com/OpenPrinting/cups-filters/commit/6db3b08d3b20332b1525b8dd1a47950381b8f637 # dowloaded via @@ -219,6 +227,10 @@ %prep %setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build # Just do what is described in the upstream INSTALL file ++++++ 0001-Raise-minimum-poppler-version-from-0.18-to-0.19.patch ++++++ ++++ 867 lines (skipped) ++++++ 0002-Adapt-code-for-SplashXPathScanner-state-handling-sin.patch ++++++ >From 659bb523432b7c7095db235e8dddbf770266b6aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bru...@rwth-aachen.de> Date: Fri, 28 Dec 2018 18:17:28 +0100 Subject: [PATCH 2/4] Adapt code for SplashXPathScanner state handling since poppler 0.70 The state for the scanline iteration is no longer part of the scanner, but has been moved to a iterator helper class. --- filter/pdftoopvp/oprs/OPVPSplash.cxx | 8 +++++++- filter/pdftoopvp/oprs/OPVPSplashClip.cxx | 21 +++++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/filter/pdftoopvp/oprs/OPVPSplash.cxx b/filter/pdftoopvp/oprs/OPVPSplash.cxx index 822f65fa..89b7d33a 100644 --- a/filter/pdftoopvp/oprs/OPVPSplash.cxx +++ b/filter/pdftoopvp/oprs/OPVPSplash.cxx @@ -966,7 +966,13 @@ SplashError OPVPSplash::fillByMyself(OPVPSplashPath *path, bool eo) setStrokePattern(state->fillPattern->copy()); for (y = yMinI; y < yMaxI; ++y) { - while (scanner->getNextSpan(y, &x0, &x1)) { +#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 70 + SplashXPathScanIterator iterator(*scanner, y); + while (iterator.getNextSpan(&x0, &x1)) +#else + while (scanner->getNextSpan(y, &x0, &x1)) +#endif + { if (x0 == x1) continue; if (clipRes == splashClipAllInside) { drawSpan(x0, x1-1, y, true); diff --git a/filter/pdftoopvp/oprs/OPVPSplashClip.cxx b/filter/pdftoopvp/oprs/OPVPSplashClip.cxx index bb6150bc..d81fd3f6 100644 --- a/filter/pdftoopvp/oprs/OPVPSplashClip.cxx +++ b/filter/pdftoopvp/oprs/OPVPSplashClip.cxx @@ -1,4 +1,9 @@ #include <config.h> + +#ifdef HAVE_CPP_POPPLER_VERSION_H +#include "cpp/poppler-version.h" +#endif + #include "splash/SplashXPathScanner.h" #include "OPVPSplashClip.h" @@ -42,7 +47,13 @@ OPVPSplashPath *OPVPSplashClip::makePath() for (i = 0;i < blen;i++) { cbuf[i] = 0; } - while (scanners[0]->getNextSpan(y,&x0,&x1)) { +#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 70 + SplashXPathScanIterator iterator(*scanners[0], y); + while (iterator.getNextSpan(&x0, &x1)) +#else + while (scanners[0]->getNextSpan(y,&x0,&x1)) +#endif + { if (x0 < txMin) x0 = txMin; if (x1 > txMax) x1 = txMax; for (i = x0;i < x1;i++) { @@ -54,7 +65,13 @@ OPVPSplashPath *OPVPSplashClip::makePath() for (i = 0;i < blen;i++) { tbuf[i] = 0; } - while (scanners[j]->getNextSpan(y,&x0,&x1)) { +#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 70 + SplashXPathScanIterator iterator2(*scanners[j], y); + while (iterator2.getNextSpan(&x0, &x1)) +#else + while (scanners[j]->getNextSpan(y,&x0,&x1)) +#endif + { if (x0 < txMin) x0 = txMin; if (x1 > txMax) x1 = txMax; for (i = x0;i < x1;i++) { -- 2.20.1 ++++++ 0003-Support-some-more-methods-returning-const.patch ++++++ >From 8e96c4aa3b387d40b9fdfa1a535a6dece6937c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bru...@rwth-aachen.de> Date: Fri, 28 Dec 2018 19:24:36 +0100 Subject: [PATCH 3/4] Support some more methods returning const The return values of these methods should not be modified. Since poppler 0.70, this is enforced for GfxFont::getCharName, and for State::getCTM since 0.72. These methods now return const T*. --- filter/pdftoopvp/OPVPOutputDev.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/filter/pdftoopvp/OPVPOutputDev.cxx b/filter/pdftoopvp/OPVPOutputDev.cxx index e9a4dde5..a85bfc31 100644 --- a/filter/pdftoopvp/OPVPOutputDev.cxx +++ b/filter/pdftoopvp/OPVPOutputDev.cxx @@ -294,7 +294,7 @@ void OPVPOutputDev::startPage(int pageNum, GfxState *state) { if (state) { if (scaleWidth > 0 && scaleHeight > 0) { - double *ctm = state->getCTM(); + const double *ctm = state->getCTM(); switch (rotate) { case 90: @@ -709,7 +709,7 @@ void OPVPOutputDev::doUpdateFont(GfxState *state) { 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') { @@ -1060,7 +1060,7 @@ void OPVPOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, bool invert, bool interpolate, bool inlineImg) { - double *ctm; + const double *ctm; SplashCoord mat[6]; SplashOutImageMaskData imgMaskData; @@ -1324,7 +1324,7 @@ void OPVPOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, GfxImageColorMap *colorMap, bool interpolate, int *maskColors, bool inlineImg) { - double *ctm; + const double *ctm; SplashCoord mat[6]; SplashOutImageData imgData; SplashColorMode srcMode; @@ -1549,7 +1549,7 @@ void OPVPOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *maskStr, int maskWidth, int maskHeight, bool maskInvert, bool maskInterpolate) { - double *ctm; + const double *ctm; SplashCoord mat[6]; SplashOutMaskedImageData imgData; SplashOutImageMaskData imgMaskData; @@ -1704,7 +1704,7 @@ void OPVPOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, int maskWidth, int maskHeight, GfxImageColorMap *maskColorMap, bool maskInterpolate) { - double *ctm; + const double *ctm; SplashCoord mat[6]; SplashOutImageData imgData; SplashOutImageData imgMaskData; -- 2.20.1 ++++++ 0004-Support-GooString-c_str-introduced-by-poppler-0.72.patch ++++++ >From 3e1f86c9289660bf83781a31260ec079b21fd21e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bru...@rwth-aachen.de> Date: Fri, 28 Dec 2018 19:42:32 +0100 Subject: [PATCH 4/4] Support GooString::c_str() introduced by poppler 0.72 --- filter/pdftoopvp/OPVPOutputDev.cxx | 48 +++++++++++++++--------------- filter/pdftoopvp/pdftoopvp.cxx | 19 ++++++++++++ 2 files changed, 43 insertions(+), 24 deletions(-) diff --git a/filter/pdftoopvp/OPVPOutputDev.cxx b/filter/pdftoopvp/OPVPOutputDev.cxx index a85bfc31..25267148 100644 --- a/filter/pdftoopvp/OPVPOutputDev.cxx +++ b/filter/pdftoopvp/OPVPOutputDev.cxx @@ -499,6 +499,7 @@ void OPVPOutputDev::doUpdateFont(GfxState *state) { SplashOutFontFileID *id; SplashFontFile *fontFile; SplashFontSrc *fontsrc = NULL; + const char *fontName = "(unnamed)"; FoFiTrueType *ff; Ref embRef; Object refObj, strObj; @@ -530,6 +531,13 @@ void OPVPOutputDev::doUpdateFont(GfxState *state) { delete id; } else { + if (gfxFont->getName()) { +#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR <= 71 + fontName = gfxFont->getName()->getCString(); +#else + fontName = gfxFont->getName()->c_str(); +#endif + } // if there is an embedded font, write it to disk if (gfxFont->getEmbeddedFontID(&embRef)) { @@ -542,9 +550,7 @@ void OPVPOutputDev::doUpdateFont(GfxState *state) { fileName = globalParams->findSystemFontFile(gfxFont,&sftype, &faceIndex, NULL); if (fileName == 0) { - opvpError(-1, "Couldn't find a font for '%s'", - gfxFont->getName() ? gfxFont->getName()->getCString() - : "(unnamed)"); + opvpError(-1, "Couldn't find a font for '%s'", fontName); goto err2; } switch (sftype) { @@ -573,9 +579,7 @@ void OPVPOutputDev::doUpdateFont(GfxState *state) { fontsrc, (const char **) ((Gfx8BitFont *)gfxFont)->getEncoding()))) { - opvpError(-1, "Couldn't create a font for '%s'", - gfxFont->getName() ? gfxFont->getName()->getCString() - : "(unnamed)"); + opvpError(-1, "Couldn't create a font for '%s'", fontName); goto err2; } break; @@ -585,9 +589,7 @@ void OPVPOutputDev::doUpdateFont(GfxState *state) { fontsrc, (const char **) ((Gfx8BitFont *)gfxFont)->getEncoding()))) { - opvpError(-1, "Couldn't create a font for '%s'", - gfxFont->getName() ? gfxFont->getName()->getCString() - : "(unnamed)"); + opvpError(-1, "Couldn't create a font for '%s'", fontName); goto err2; } break; @@ -597,16 +599,18 @@ void OPVPOutputDev::doUpdateFont(GfxState *state) { fontsrc, (const char **) ((Gfx8BitFont *)gfxFont)->getEncoding()))) { - opvpError(-1, "Couldn't create a font for '%s'", - gfxFont->getName() ? gfxFont->getName()->getCString() - : "(unnamed)"); + opvpError(-1, "Couldn't create a font for '%s'", fontName); goto err2; } break; case fontTrueTypeOT: case fontTrueType: if (fileName) +#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR <= 71 ff = FoFiTrueType::load(fileName->getCString()); +#else + ff = FoFiTrueType::load(fileName->c_str()); +#endif else ff = FoFiTrueType::make(tmpBuf, tmpBufLen); if (ff) { @@ -621,9 +625,7 @@ void OPVPOutputDev::doUpdateFont(GfxState *state) { id, fontsrc, codeToGID, n))) { - opvpError(-1, "Couldn't create a font for '%s'", - gfxFont->getName() ? gfxFont->getName()->getCString() - : "(unnamed)"); + opvpError(-1, "Couldn't create a font for '%s'", fontName); goto err2; } break; @@ -632,9 +634,7 @@ void OPVPOutputDev::doUpdateFont(GfxState *state) { if (!(fontFile = fontEngine->loadCIDFont( id, fontsrc))) { - opvpError(-1, "Couldn't create a font for '%s'", - gfxFont->getName() ? gfxFont->getName()->getCString() - : "(unnamed)"); + opvpError(-1, "Couldn't create a font for '%s'", fontName); goto err2; } break; @@ -650,9 +650,7 @@ void OPVPOutputDev::doUpdateFont(GfxState *state) { if (!(fontFile = fontEngine->loadOpenTypeCFFFont( id, fontsrc,codeToGID,n))) { - opvpError(-1, "Couldn't create a font for '%s'", - gfxFont->getName() ? gfxFont->getName()->getCString() - : "(unnamed)"); + opvpError(-1, "Couldn't create a font for '%s'", fontName); goto err2; } break; @@ -669,7 +667,11 @@ void OPVPOutputDev::doUpdateFont(GfxState *state) { } } else { if (fileName) +#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR <= 71 ff = FoFiTrueType::load(fileName->getCString()); +#else + ff = FoFiTrueType::load(fileName->c_str()); +#endif else ff = FoFiTrueType::make(tmpBuf, tmpBufLen); if (! ff) @@ -681,9 +683,7 @@ void OPVPOutputDev::doUpdateFont(GfxState *state) { id, fontsrc, codeToGID, n, faceIndex))) { - opvpError(-1, "Couldn't create a font for '%s'", - gfxFont->getName() ? gfxFont->getName()->getCString() - : "(unnamed)"); + opvpError(-1, "Couldn't create a font for '%s'", fontName); goto err2; } break; diff --git a/filter/pdftoopvp/pdftoopvp.cxx b/filter/pdftoopvp/pdftoopvp.cxx index 65aca4d8..dfff692e 100644 --- a/filter/pdftoopvp/pdftoopvp.cxx +++ b/filter/pdftoopvp/pdftoopvp.cxx @@ -464,12 +464,21 @@ int main(int argc, char *argv[]) { if (choices != 0) free(choices); } +#if POPPLER_VERSION_MAJOR == 0 && POPPLER_VERSION_MINOR <= 71 strncpy(jobInfo,jobInfoStr.getCString(),sizeof(jobInfo)-1); jobInfo[sizeof(jobInfo)-1] = '\0'; strncpy(docInfo,docInfoStr.getCString(),sizeof(docInfo)-1); docInfo[sizeof(docInfo)-1] = '\0'; strncpy(pageInfo,pageInfoStr.getCString(),sizeof(pageInfo)-1); pageInfo[sizeof(pageInfo)-1] = '\0'; +#else + strncpy(jobInfo,jobInfoStr.c_str(),sizeof(jobInfo)-1); + jobInfo[sizeof(jobInfo)-1] = '\0'; + strncpy(docInfo,docInfoStr.c_str(),sizeof(docInfo)-1); + docInfo[sizeof(docInfo)-1] = '\0'; + strncpy(pageInfo,pageInfoStr.c_str(),sizeof(pageInfo)-1); + pageInfo[sizeof(pageInfo)-1] = '\0'; +#endif colorProfile = getColorProfilePath(ppd,&colorProfilePath); @@ -629,7 +638,13 @@ exit(0); name.append("/tmp"); } name.append("/XXXXXX"); +#if POPPLER_VERSION_MAJOR == 0 && POPPLER_VERSION_MINOR <= 71 fd = mkstemp(name.getCString()); +#else + std::string t = name.toStr(); + fd = mkstemp(&t[0]); + name = GooString(std::move(t)); +#endif if (fd < 0) { opvpError(-1,"Can't create temporary file"); exitCode = 2; @@ -673,7 +688,11 @@ exit(0); close(fd); doc = new PDFDoc(&name); /* remove name */ +#if POPPLER_VERSION_MAJOR == 0 && POPPLER_VERSION_MINOR <= 71 unlink(name.getCString()); +#else + unlink(name.c_str()); +#endif } else { /* no jcl check */ doc = new PDFDoc(fileName.copy()); -- 2.20.1