To ports list: I'm looking for someone to handle the attached diff, which fixes the build of editors/calligra with recent poppler. I had contacted the maintainer, who is away.
On Fri, 15 Feb 2019 11:18:07 -0500 Rafael Sadowski <raf...@sizeofvoid.org> wrote: > ... To fix the build you > have my OK. Please CC kili@ in poppler stuff. Thanks for your work! I'm attaching a diff in editors/calligra with some patches from calligra's git. This allows me to package calligra on powerpc, but I can't run Qt5 apps like calligra because of a bug in powerpc clang [1], and I haven't tried the diff on amd64. I have poppler 0.73.0, so when I took the patches from git, I left out the parts for poppler < 0.72.0. The diff doesn't bump REVISION, because I don't know whether to do so. [1] https://bugs.llvm.org/show_bug.cgi?id=40736 and my recent mail to ports@ -- George Koehler <kern...@gmail.com>
Index: patches/patch-filters_karbon_pdf_PdfImport_cpp =================================================================== RCS file: patches/patch-filters_karbon_pdf_PdfImport_cpp diff -N patches/patch-filters_karbon_pdf_PdfImport_cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-filters_karbon_pdf_PdfImport_cpp 15 Feb 2019 04:49:41 -0000 @@ -0,0 +1,32 @@ +$OpenBSD$ + +Fix build with poppler 0.73 +https://cgit.kde.org/calligra.git/commit/?id=a615718 +https://cgit.kde.org/calligra.git/commit/?id=fb6bbaf + +Index: filters/karbon/pdf/PdfImport.cpp +--- filters/karbon/pdf/PdfImport.cpp.orig ++++ filters/karbon/pdf/PdfImport.cpp +@@ -88,9 +88,9 @@ KoFilter::ConversionStatus PdfImport::convert(const QB + SvgOutputDev * dev = new SvgOutputDev(m_chain->outputFile()); + if (dev->isOk()) { + int rotate = 0; +- GBool useMediaBox = gTrue; +- GBool crop = gFalse; +- GBool printing = gFalse; ++ bool useMediaBox = true; ++ bool crop = false; ++ bool printing = false; + pdfDoc->displayPages(dev, firstPage, lastPage, hDPI, vDPI, rotate, useMediaBox, crop, printing); + dev->dumpContent(); + } +@@ -101,9 +101,6 @@ KoFilter::ConversionStatus PdfImport::convert(const QB + delete pdfDoc; + delete globalParams; + globalParams = 0; +- +- // check for memory leaks +- Object::memCheck(stderr); + + return KoFilter::OK; + } Index: patches/patch-filters_karbon_pdf_SvgOutputDev_cpp =================================================================== RCS file: patches/patch-filters_karbon_pdf_SvgOutputDev_cpp diff -N patches/patch-filters_karbon_pdf_SvgOutputDev_cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-filters_karbon_pdf_SvgOutputDev_cpp 15 Feb 2019 04:49:41 -0000 @@ -0,0 +1,159 @@ +$OpenBSD$ + +Fix build with poppler 0.73 +https://cgit.kde.org/calligra.git/commit/?id=a615718 +https://cgit.kde.org/calligra.git/commit/?id=ab9cb33 +https://cgit.kde.org/calligra.git/commit/?id=fb6bbaf +https://cgit.kde.org/calligra.git/commit/?id=05a65f9 +https://cgit.kde.org/calligra.git/commit/?id=3a65c7f + +Index: filters/karbon/pdf/SvgOutputDev.cpp +--- filters/karbon/pdf/SvgOutputDev.cpp.orig ++++ filters/karbon/pdf/SvgOutputDev.cpp +@@ -39,7 +39,7 @@ class SvgOutputDev::Private + { + public: + Private(const QString &fname) +- : svgFile(fname), defs(0), body(0), state(gTrue) ++ : svgFile(fname), defs(0), body(0), state(true) + , brush(Qt::SolidPattern) {} + + ~Private() { +@@ -52,7 +52,7 @@ class SvgOutputDev::Private + QString defsData; + QTextStream * defs; + QTextStream * body; +- GBool state; ++ bool state; + QSizeF pageSize; + QPen pen; + QBrush brush; +@@ -62,7 +62,7 @@ SvgOutputDev::SvgOutputDev(const QString &fileName) + : d(new Private(fileName)) + { + if (! d->svgFile.open(QIODevice::WriteOnly)) { +- d->state = gFalse; ++ d->state = false; + return; + } + +@@ -75,24 +75,24 @@ SvgOutputDev::~SvgOutputDev() + delete d; + } + +-GBool SvgOutputDev::isOk() ++bool SvgOutputDev::isOk() + { + return d->state; + } + +-GBool SvgOutputDev::upsideDown() ++bool SvgOutputDev::upsideDown() + { +- return gTrue; ++ return true; + } + +-GBool SvgOutputDev::useDrawChar() ++bool SvgOutputDev::useDrawChar() + { +- return gFalse; ++ return false; + } + +-GBool SvgOutputDev::interpretType3Chars() ++bool SvgOutputDev::interpretType3Chars() + { +- return gFalse; ++ return false; + } + + void SvgOutputDev::startPage(int pageNum, GfxState *state, XRef */*xref*/) +@@ -212,7 +212,7 @@ QString SvgOutputDev::convertMatrix(const QMatrix &mat + .arg(matrix.dx()) .arg(matrix.dy()); + } + +-QString SvgOutputDev::convertMatrix(double * matrix) ++QString SvgOutputDev::convertMatrix(const double * matrix) + { + return QString("matrix(%1 %2 %3 %4 %5 %6)") + .arg(matrix[0]).arg(matrix[1]) +@@ -402,7 +402,7 @@ void SvgOutputDev::drawString(GfxState * state, GooStr + + QString str; + +- char * p = s->getCString(); ++ const char * p = s->c_str(); + int len = s->getLength(); + CharCode code; + Unicode *u = nullptr; +@@ -429,7 +429,7 @@ void SvgOutputDev::drawString(GfxState * state, GooStr + double x = state->getCurX(); + double y = state->getCurY(); + +- double * ctm = state->getCTM(); ++ const double * ctm = state->getCTM(); + QMatrix transform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]); + + QMatrix mirror; +@@ -451,11 +451,11 @@ void SvgOutputDev::drawString(GfxState * state, GooStr + *d->body << " y=\"" << y << "px\""; + + if (font && font->getFamily()) { +- *d->body << " font-family=\"" << QString::fromLatin1(font->getFamily()->getCString()) << "\""; +- //debugPdf << "font family:" << QString::fromLatin1( font->getFamily()->getCString() ); ++ *d->body << " font-family=\"" << QString::fromLatin1(font->getFamily()->c_str()) << "\""; ++ //debugPdf << "font family:" << QString::fromLatin1( font->getFamily()->c_str() ); + } else if (font && font->getName()) { +- *d->body << " font-family=\"" << QString::fromLatin1(font->getName()->getCString()) << "\""; +- //debugPdf << "font name:" << QString::fromLatin1( font->getName()->getCString() ); ++ *d->body << " font-family=\"" << QString::fromLatin1(font->getName()->c_str()) << "\""; ++ //debugPdf << "font name:" << QString::fromLatin1( font->getName()->c_str() ); + } + *d->body << " font-size=\"" << qMax(state->getFontSize(), state->getTransformedFontSize()) << "px\""; + +@@ -476,7 +476,7 @@ void SvgOutputDev::drawString(GfxState * state, GooStr + + void SvgOutputDev::drawImage(GfxState *state, Object */*ref*/, Stream *str, + int width, int height, GfxImageColorMap *colorMap, +- int *maskColors, GBool /*inlineImg*/) ++ int *maskColors, bool /*inlineImg*/) + { + ImageStream * imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits()); + imgStr->reset(); +@@ -488,7 +488,7 @@ void SvgOutputDev::drawImage(GfxState *state, Object * + if (maskColors) { + for (int y = 0; y < height; y++) { + dest = (unsigned int *)(buffer + y * 4 * width); +- Guchar * pix = imgStr->getLine(); ++ unsigned char * pix = imgStr->getLine(); + colorMap->getRGBLine(pix, dest, width); + + for (int x = 0; x < width; x++) { +@@ -507,7 +507,7 @@ void SvgOutputDev::drawImage(GfxState *state, Object * + } else { + for (int y = 0; y < height; y++) { + dest = (unsigned int *)(buffer + y * 4 * width); +- Guchar * pix = imgStr->getLine(); ++ unsigned char * pix = imgStr->getLine(); + colorMap->getRGBLine(pix, dest, width); + } + +@@ -522,7 +522,7 @@ void SvgOutputDev::drawImage(GfxState *state, Object * + return; + } + +- double * ctm = state->getCTM(); ++ const double * ctm = state->getCTM(); + QMatrix m; + m.setMatrix(ctm[0] / width, ctm[1] / width, -ctm[2] / height, -ctm[3] / height, ctm[2] + ctm[4], ctm[3] + ctm[5]); + +@@ -545,7 +545,7 @@ void SvgOutputDev::drawImage(GfxState *state, Object * + + void SvgOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, + int width, int height, GfxImageColorMap *colorMap, +- GBool /*interpolate*/, int *maskColors, GBool inlineImg) ++ bool /*interpolate*/, int *maskColors, bool inlineImg) + { + drawImage(state, ref, str, width, height, colorMap, maskColors, inlineImg); + } Index: patches/patch-filters_karbon_pdf_SvgOutputDev_h =================================================================== RCS file: patches/patch-filters_karbon_pdf_SvgOutputDev_h diff -N patches/patch-filters_karbon_pdf_SvgOutputDev_h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-filters_karbon_pdf_SvgOutputDev_h 15 Feb 2019 04:49:41 -0000 @@ -0,0 +1,47 @@ +$OpenBSD$ + +Fix build with poppler 0.73 +https://cgit.kde.org/calligra.git/commit/?id=a615718 +https://cgit.kde.org/calligra.git/commit/?id=ab9cb33 + +Index: filters/karbon/pdf/SvgOutputDev.h +--- filters/karbon/pdf/SvgOutputDev.h.orig ++++ filters/karbon/pdf/SvgOutputDev.h +@@ -44,11 +44,11 @@ class SvgOutputDev : public OutputDev (public) + explicit SvgOutputDev(const QString &fileName); + virtual ~SvgOutputDev(); + +- GBool isOk(); ++ bool isOk(); + +- virtual GBool upsideDown(); +- virtual GBool useDrawChar(); +- virtual GBool interpretType3Chars(); ++ virtual bool upsideDown(); ++ virtual bool useDrawChar(); ++ virtual bool interpretType3Chars(); + virtual void startPage(int pageNum, GfxState *state, XRef *xref); + virtual void endPage(); + +@@ -63,10 +63,10 @@ class SvgOutputDev : public OutputDev (public) + // images + virtual void drawImage(GfxState *state, Object *ref, Stream *str, + int width, int height, GfxImageColorMap *colorMap, +- int *maskColors, GBool inlineImg); ++ int *maskColors, bool inlineImg); + virtual void drawImage(GfxState *state, Object *ref, Stream *str, + int width, int height, GfxImageColorMap *colorMap, +- GBool interpolate, int *maskColors, GBool inlineImg); ++ bool interpolate, int *maskColors, bool inlineImg); + + // styles + virtual void updateAll(GfxState *state); +@@ -84,7 +84,7 @@ class SvgOutputDev : public OutputDev (public) + private: + QString convertPath(GfxPath *path); + QString convertMatrix(const QMatrix &matrix); +- QString convertMatrix(double * matrix); ++ QString convertMatrix(const double * matrix); + QString printFill(); + QString printStroke(); +