Hi,
I need some help for letting calligra build with poppler-0.83.0.
My current diff at the end of this mail, but see that XXX in the
Makefile: some ports, including calligra, need at least -std=c++-14
(for make_unique). This works for all except this one, because cmake
*appends* -std=c++0x to CXXFLAGS:
/home/ports/pobj/p2/calligra-3.1.0/bin/c++ [...] -O2 -pipe -std=c++14
-std=c++0x [...] -c
/home/ports/pobj/p2/calligra-3.1.0/calligra-3.1.0/filters/karbon/pdf/PdfImport.cpp
And this fails, because -std=c++0x overrides the earlier -std=c++14.
Note: that -std=c++0x does *not* come from the corresponding snippe
in CMakeLists.txt -- I tried patching that away, first, but it
didn't help.
A (more or less) find(1)/xargs(1)/grep(1) combo found exacly one
suspicious file in /usr/local: qt5/mkspecs/features/qt_module_headers.prf
I don't want to touch x11/qt5/base, and I'm really still unfamiliar
with cmake -- has anyone an idea how to fix calligra to not use
that -std=c++0x, or how to forcibly *append* -std=c++14 to the and
of the CXXFLAGS used by cmake?
Or should I just mark calligra temporarily as broken (which I think
would be very unpolite, because rsadowski is currently on vacation,
and I wouldn't like others to mark any of my own ports as broken,
either).
Any other ideas?
Ciao,
Kili
Index: Makefile
===================================================================
RCS file: /cvs/ports/editors/calligra/Makefile,v
retrieving revision 1.37
diff -u -p -r1.37 Makefile
--- Makefile 10 Nov 2019 15:32:56 -0000 1.37
+++ Makefile 17 Dec 2019 20:31:56 -0000
@@ -19,6 +19,10 @@ DPB_PROPERTIES = parallel
MODULES = devel/kf5 \
multimedia/phonon
+# c++-14
+COMPILER = base-clang ports-gcc
+CXXFLAGS += -std=c++14 # XXX: overriden by -std=c++0x
+
SHARED_LIBS = RtfReader 50.0 # 0.0
SHARED_LIBS += basicflakes 50.0 # 0.0
SHARED_LIBS += calligrasheetscommon 50.0 # 9.0
Index: patches/patch-CMakeLists_txt
===================================================================
RCS file: patches/patch-CMakeLists_txt
diff -N patches/patch-CMakeLists_txt
Index: patches/patch-filters_karbon_pdf_PdfImport_cpp
===================================================================
RCS file:
/cvs/ports/editors/calligra/patches/patch-filters_karbon_pdf_PdfImport_cpp,v
retrieving revision 1.1
diff -u -p -r1.1 patch-filters_karbon_pdf_PdfImport_cpp
--- patches/patch-filters_karbon_pdf_PdfImport_cpp 17 Feb 2019 20:38:20
-0000 1.1
+++ patches/patch-filters_karbon_pdf_PdfImport_cpp 17 Dec 2019 20:31:56
-0000
@@ -4,10 +4,33 @@ Fix build with poppler 0.73
https://cgit.kde.org/calligra.git/commit/?id=a615718
https://cgit.kde.org/calligra.git/commit/?id=fb6bbaf
+And with poppler-0.83.
+
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
+@@ -60,19 +60,17 @@ KoFilter::ConversionStatus PdfImport::convert(const QB
+ }
+
+ // read config file
+- globalParams = new GlobalParams();
++ globalParams = std::make_unique<GlobalParams>();
+ if (! globalParams)
+ return KoFilter::NotImplemented;
+
+ GooString * fname = new
GooString(QFile::encodeName(m_chain->inputFile()).data());
+ PDFDoc * pdfDoc = new PDFDoc(fname, 0, 0, 0);
+ if (! pdfDoc) {
+- delete globalParams;
+ return KoFilter::StupidError;
+ }
+
+ if (! pdfDoc->isOk()) {
+- delete globalParams;
+ delete pdfDoc;
+ return KoFilter::StupidError;
+ }
+@@ -88,9 +86,9 @@ KoFilter::ConversionStatus PdfImport::convert(const QB
SvgOutputDev * dev = new SvgOutputDev(m_chain->outputFile());
if (dev->isOk()) {
int rotate = 0;
@@ -20,9 +43,11 @@ Index: filters/karbon/pdf/PdfImport.cpp
pdfDoc->displayPages(dev, firstPage, lastPage, hDPI, vDPI, rotate,
useMediaBox, crop, printing);
dev->dumpContent();
}
-@@ -101,9 +101,6 @@ KoFilter::ConversionStatus PdfImport::convert(const QB
+@@ -99,11 +97,7 @@ KoFilter::ConversionStatus PdfImport::convert(const QB
+
+ delete dev;
delete pdfDoc;
- delete globalParams;
+- delete globalParams;
globalParams = 0;
-
- // check for memory leaks
Index: patches/patch-filters_karbon_pdf_SvgOutputDev_cpp
===================================================================
RCS file:
/cvs/ports/editors/calligra/patches/patch-filters_karbon_pdf_SvgOutputDev_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-filters_karbon_pdf_SvgOutputDev_cpp
--- patches/patch-filters_karbon_pdf_SvgOutputDev_cpp 12 Nov 2019 22:05:36
-0000 1.2
+++ patches/patch-filters_karbon_pdf_SvgOutputDev_cpp 17 Dec 2019 20:31:56
-0000
@@ -7,7 +7,7 @@ https://cgit.kde.org/calligra.git/commit
https://cgit.kde.org/calligra.git/commit/?id=05a65f9
https://cgit.kde.org/calligra.git/commit/?id=3a65c7f
-and with poppler-0.82
+And with poppler-0.83
Index: filters/karbon/pdf/SvgOutputDev.cpp
--- filters/karbon/pdf/SvgOutputDev.cpp.orig
@@ -71,6 +71,24 @@ Index: filters/karbon/pdf/SvgOutputDev.c
}
void SvgOutputDev::startPage(int pageNum, GfxState *state, XRef */*xref*/)
+@@ -172,7 +172,7 @@ void SvgOutputDev::eoFill(GfxState *state)
+ *d->body << "/>" << endl;
+ }
+
+-QString SvgOutputDev::convertPath(GfxPath *path)
++QString SvgOutputDev::convertPath(const GfxPath *path)
+ {
+ if (! path)
+ return QString();
+@@ -180,7 +180,7 @@ QString SvgOutputDev::convertPath(GfxPath *path)
+ QString output;
+
+ for (int i = 0; i < path->getNumSubpaths(); ++i) {
+- GfxSubpath * subpath = path->getSubpath(i);
++ const GfxSubpath * subpath = path->getSubpath(i);
+ if (subpath->getNumPoints() > 0) {
+ output += QString("M%1
%2").arg(subpath->getX(0)).arg(subpath->getY(0));
+ int j = 1;
@@ -212,7 +212,7 @@ QString SvgOutputDev::convertMatrix(const QMatrix &mat
.arg(matrix.dx()) .arg(matrix.dy());
}
Index: patches/patch-filters_karbon_pdf_SvgOutputDev_h
===================================================================
RCS file:
/cvs/ports/editors/calligra/patches/patch-filters_karbon_pdf_SvgOutputDev_h,v
retrieving revision 1.2
diff -u -p -r1.2 patch-filters_karbon_pdf_SvgOutputDev_h
--- patches/patch-filters_karbon_pdf_SvgOutputDev_h 12 Nov 2019 22:05:36
-0000 1.2
+++ patches/patch-filters_karbon_pdf_SvgOutputDev_h 17 Dec 2019 20:31:56
-0000
@@ -4,7 +4,7 @@ Fix build with poppler 0.73
https://cgit.kde.org/calligra.git/commit/?id=a615718
https://cgit.kde.org/calligra.git/commit/?id=ab9cb33
-and with poppler-0.82
+And with poppler-0.83
Index: filters/karbon/pdf/SvgOutputDev.h
--- filters/karbon/pdf/SvgOutputDev.h.orig
@@ -44,9 +44,12 @@ Index: filters/karbon/pdf/SvgOutputDev.h
// styles
virtual void updateAll(GfxState *state);
-@@ -84,7 +84,7 @@ class SvgOutputDev : public OutputDev (public)
+@@ -82,9 +82,9 @@ class SvgOutputDev : public OutputDev (public)
+ /// Dumps content to svg file
+ void dumpContent();
private:
- QString convertPath(GfxPath *path);
+- QString convertPath(GfxPath *path);
++ QString convertPath(const GfxPath *path);
QString convertMatrix(const QMatrix &matrix);
- QString convertMatrix(double * matrix);
+ QString convertMatrix(const double * matrix);