Toggle diff (447 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 3f19b3fe79..6541bcc8be 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -832,6 +832,7 @@ dist_patch_DATA = \
%D%/packages/patches/icedtea-7-hotspot-gcc-segfault-workaround.patch \
%D%/packages/patches/id3lib-CVE-2007-4460.patch \
%D%/packages/patches/ilmbase-fix-tests.patch \
+ %D%/packages/patches/inkscape-poppler-compat3.patch \
%D%/packages/patches/intltool-perl-compatibility.patch \
%D%/packages/patches/irrlicht-use-system-libs.patch \
%D%/packages/patches/isl-0.11.1-aarch64-support.patch \
@@ -1061,7 +1062,6 @@ dist_patch_DATA = \
%D%/packages/patches/plink-endian-detection.patch \
%D%/packages/patches/plotutils-libpng-jmpbuf.patch \
%D%/packages/patches/podofo-cmake-3.12.patch \
- %D%/packages/patches/poppler-CVE-2018-19149.patch \
%D%/packages/patches/portaudio-audacity-compat.patch \
%D%/packages/patches/portmidi-modular-build.patch \
%D%/packages/patches/postgresql-disable-resolve_symlinks.patch \
@@ -1186,6 +1186,9 @@ dist_patch_DATA = \
%D%/packages/patches/teeworlds-use-latest-wavpack.patch \
%D%/packages/patches/texinfo-perl-compat.patch \
%D%/packages/patches/texinfo-5-perl-compat.patch \
+ %D%/packages/patches/texlive-bin-luatex-poppler-compat.patch \
+ %D%/packages/patches/texlive-bin-pdftex-poppler-compat.patch \
+ %D%/packages/patches/texlive-bin-xetex-poppler-compat.patch \
%D%/packages/patches/telegram-purple-adjust-test.patch \
%D%/packages/patches/texi2html-document-encoding.patch \
%D%/packages/patches/texi2html-i18n.patch \
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index d8a9ffeaed..24446bfc9e 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -1634,7 +1634,15 @@ filters, new key bindings and faces. It can be enabled by
(sha256
(base32
"1i4647vax5na73basc5dz4lh9kprir00fh8ps4i0l1y3ippnjs2s"))
- (patches (search-patches "emacs-pdf-tools-poppler.patch"))))
+ (patches (search-patches "emacs-pdf-tools-poppler.patch"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ ;; In addition to the above patch, we need this additional
+ ;; provision for compatibility with Poppler 0.72:
+ (substitute* "server/poppler-hack.cc"
+ (("getCString") "c_str"))
+ #t))))
(build-system gnu-build-system)
(arguments
`(#:tests? #f ; there are no tests
diff --git a/gnu/packages/inkscape.scm b/gnu/packages/inkscape.scm
index 1673cc602e..eae8ac962b 100644
--- a/gnu/packages/inkscape.scm
+++ b/gnu/packages/inkscape.scm
@@ -71,7 +71,24 @@
(file-name "inkscape-poppler-compat2.patch")
(sha256
(base32
- "14k9yrfjz4nx3bz9dk91q74mc0i7rvl2qzkwhcy1br71yqjvngn5")))))))
+ "14k9yrfjz4nx3bz9dk91q74mc0i7rvl2qzkwhcy1br71yqjvngn5")))
+ (search-patch "inkscape-poppler-compat3.patch")
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://gitlab.com/inkscape/inkscape/commit/"
+ "d047859d90cef3784e2d13e40887a70d8d517897.diff"))
+ (file-name "inkscape-poppler-compat4.patch")
+ (sha256
+ (base32
+ "0xdfg3q4g4m15z7wna4brjn5j4kr15qiqc2f25vcw2nnr6x54qcp")))
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://gitlab.com/inkscape/inkscape/commit/"
+ "b3d59cc8106da3bf6020a6c47eeb3b8a7bbae1a9.diff"))
+ (file-name "inkscape-poppler-compat5.patch")
+ (sha256
+ (base32
+ "0haviy66q9szizmvb82msfj80bb3wgi1fnq3ml8fyfp8l90a1217")))))))
(build-system cmake-build-system)
(inputs
`(("aspell" ,aspell)
diff --git a/gnu/packages/libreoffice.scm b/gnu/packages/libreoffice.scm
index 45e2f63767..eadf7697ae 100644
--- a/gnu/packages/libreoffice.scm
+++ b/gnu/packages/libreoffice.scm
@@ -984,9 +984,44 @@ converting QuarkXPress file format. It supports versions 3.1 to 4.1.")
(file-name "libreoffice-mdds.patch")
(sha256
(base32
- "0apbmammmp4pk473xiv5vk50r4c5gjvqzf9jkficksvz58q6114f"))))
+ "0apbmammmp4pk473xiv5vk50r4c5gjvqzf9jkficksvz58q6114f")))
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/LibreOffice/core/commit/"
+ "1688a395d05125b83eac6cd5c43f0e3f2f66c491"
+ ".patch"))
+ (file-name "libreoffice-poppler-compat.patch")
+ (sha256
+ (base32
+ "0ia5avmj772mrgs6m4qqf01hs8hzpy3nafidj7w7gqx2zz2s5ih9")))
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/LibreOffice/core/commit/"
+ "5e8bdd9203dd642111c62a6668ee665a20d4ba19"
+ ".patch"))
+ (file-name "libreoffice-poppler-gbool.patch")
+ (sha256
+ (base32
+ "19kc74h5vnk48l2vny8zmm2lkxpwc7g8n9d3wwpg99748dvbmikd")))
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/LibreOffice/core/commit/"
+ "8ff41a26caf51544699863c89598d37d93dc1b21"
+ ".patch"))
+ (file-name "libreoffice-poppler-0.71.patch")
+ (sha256
+ (base32
+ "1dsd0gynjf7d6412dd2sx70xa2s8kld7ibyjdkwg5w9hhi2zxw2f"))))
(search-patches "libreoffice-icu.patch"
- "libreoffice-glm.patch")))))
+ "libreoffice-glm.patch")))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ (for-each (lambda (file)
+ ;; Adjust to renamed function in Poppler 0.72.
+ (substitute* file (("getCString") "c_str")))
+ (find-files "sdext/source/pdfimport/xpdfwrapper"))
+ #t))))
(build-system glib-or-gtk-build-system)
(native-inputs
`(("bison" ,bison)
diff --git a/gnu/packages/patches/inkscape-poppler-compat3.patch b/gnu/packages/patches/inkscape-poppler-compat3.patch
new file mode 100644
index 0000000000..eaaf7d93f1
--- /dev/null
+++ b/gnu/packages/patches/inkscape-poppler-compat3.patch
@@ -0,0 +1,499 @@
+Fix compatibility with Poppler >= 0.69.
+
+This is a combination of these upstream commits:
+https://gitlab.com/inkscape/inkscape/commit/722e121361d0f784083d10e897155b7d4e44e515
+https://gitlab.com/inkscape/inkscape/commit/402c0274420fe39fd2f3393bc7d8d8879d436358
+
+...with slight adjustments for the 0.92.3 release tarball.
+
+diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake
+--- a/CMakeScripts/DefineDependsandFlags.cmake
++++ b/CMakeScripts/DefineDependsandFlags.cmake
+@@ -116,18 +116,6 @@ if(ENABLE_POPPLER)
+ set(HAVE_POPPLER_GLIB ON)
+ endif()
+ endif()
+- if(POPPLER_VERSION VERSION_GREATER "0.26.0" OR
+- POPPLER_VERSION VERSION_EQUAL "0.26.0")
+- set(POPPLER_EVEN_NEWER_COLOR_SPACE_API ON)
+- endif()
+- if(POPPLER_VERSION VERSION_GREATER "0.29.0" OR
+- POPPLER_VERSION VERSION_EQUAL "0.29.0")
+- set(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API ON)
+- endif()
+- if(POPPLER_VERSION VERSION_GREATER "0.58.0" OR
+- POPPLER_VERSION VERSION_EQUAL "0.58.0")
+- set(POPPLER_NEW_OBJECT_API ON)
+- endif()
+ else()
+ set(ENABLE_POPPLER_CAIRO OFF)
+ endif()
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -793,7 +793,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ dlg->getImportSettings(prefs);
+
+ // Apply crop settings
+- PDFRectangle *clipToBox = NULL;
++ _POPPLER_CONST PDFRectangle *clipToBox = NULL;
+ double crop_setting;
+ sp_repr_get_double(prefs, "cropTo", &crop_setting);
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.h b/src/extension/internal/pdfinput/pdf-input.h
+--- a/src/extension/internal/pdfinput/pdf-input.h
++++ b/src/extension/internal/pdfinput/pdf-input.h
+@@ -15,6 +15,7 @@
+ #endif
+
+ #ifdef HAVE_POPPLER
++#include "poppler-transition-api.h"
+
+ #include <gtkmm/dialog.h>
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -36,6 +36,7 @@ extern "C" {
+ #include "pdf-parser.h"
+ #include "util/units.h"
+
++#include "glib/poppler-features.h"
+ #include "goo/gmem.h"
+ #include "goo/GooString.h"
+ #include "GlobalParams.h"
+@@ -294,8 +295,8 @@ PdfParser::PdfParser(XRef *xrefA,
+ int /*pageNum*/,
+ int rotate,
+ Dict *resDict,
+- PDFRectangle *box,
+- PDFRectangle *cropBox) :
++ _POPPLER_CONST PDFRectangle *box,
++ _POPPLER_CONST PDFRectangle *cropBox) :
+ xref(xrefA),
+ builder(builderA),
+ subPage(gFalse),
+@@ -317,7 +318,7 @@ PdfParser::PdfParser(XRef *xrefA,
+ builder->setDocumentSize(Inkscape::Util::Quantity::convert(state->getPageWidth(), "pt", "px"),
+ Inkscape::Util::Quantity::convert(state->getPageHeight(), "pt", "px"));
+
+- double *ctm = state->getCTM();
++ const double *ctm = state->getCTM();
+ double scaledCTM[6];
+ for (int i = 0; i < 6; ++i) {
+ baseMatrix[i] = ctm[i];
+@@ -352,7 +353,7 @@ PdfParser::PdfParser(XRef *xrefA,
+ PdfParser::PdfParser(XRef *xrefA,
+ Inkscape::Extension::Internal::SvgBuilder *builderA,
+ Dict *resDict,
+- PDFRectangle *box) :
++ _POPPLER_CONST PDFRectangle *box) :
+ xref(xrefA),
+ builder(builderA),
+ subPage(gTrue),
+@@ -571,7 +572,7 @@ const char *PdfParser::getPreviousOperator(unsigned int look_back) {
+
+ void PdfParser::execOp(Object *cmd, Object args[], int numArgs) {
+ PdfOperator *op;
+- char *name;
++ const char *name;
+ Object *argPtr;
+ int i;
+
+@@ -619,7 +620,7 @@ void PdfParser::execOp(Object *cmd, Object args[], int numArgs) {
+ (this->*op->func)(argPtr, numArgs);
+ }
+
+-PdfOperator* PdfParser::findOp(char *name) {
++PdfOperator* PdfParser::findOp(const char *name) {
+ int a = -1;
+ int b = numOps;
+ int cmp = -1;
+@@ -1751,7 +1752,7 @@ void PdfParser::doShadingPatternFillFallback(GfxShadingPattern *sPat,
+ GBool stroke, GBool eoFill) {
+ GfxShading *shading;
+ GfxPath *savedPath;
+- double *ctm, *btm, *ptm;
++ const double *ctm, *btm, *ptm;
+ double m[6], ictm[6], m1[6];
+ double xMin, yMin, xMax, yMax;
+ double det;
+@@ -1993,7 +1994,7 @@ void PdfParser::doFunctionShFill1(GfxFunctionShading *shading,
+ GfxColor color0M, color1M, colorM0, colorM1, colorMM;
+ GfxColor colors2[4];
+ double functionColorDelta = colorDeltas[pdfFunctionShading-1];
+- double *matrix;
++ const double *matrix;
+ double xM, yM;
+ int nComps, i, j;
+
+@@ -2173,7 +2174,7 @@ void PdfParser::doPatchMeshShFill(GfxPatchMeshShading *shading) {
+ }
+ }
+
+-void PdfParser::fillPatch(GfxPatch *patch, int nComps, int depth) {
++void PdfParser::fillPatch(_POPPLER_CONST GfxPatch *patch, int nComps, int depth) {
+ GfxPatch patch00 = blankPatch();
+ GfxPatch patch01 = blankPatch();
+ GfxPatch patch10 = blankPatch();
+@@ -2581,7 +2582,11 @@ void PdfParser::opShowSpaceText(Object args[], int /*numArgs*/)
+ }
+ }
+
++#if POPPLER_CHECK_VERSION(0,64,0)
+ void PdfParser::doShowText(const GooString *s) {
++#else
++void PdfParser::doShowText(GooString *s) {
++#endif
+ GfxFont *font;
+ int wMode;
+ double riseX, riseY;
+@@ -2590,11 +2595,15 @@ void PdfParser::doShowText(const GooString *s) {
+ double x, y, dx, dy, tdx, tdy;
+ double originX, originY, tOriginX, tOriginY;
+ double oldCTM[6], newCTM[6];
+- double *mat;
++ const double *mat;
+ Object charProc;
+ Dict *resDict;
+ Parser *oldParser;
++#if POPPLER_CHECK_VERSION(0,64,0)
++ const char *p;
++#else
+ char *p;
++#endif
+ int len, n, uLen;
+
+ font = state->getFont();
+@@ -2630,7 +2639,7 @@ void PdfParser::doShowText(const GooString *s) {
+ double lineX = state->getLineX();
+ double lineY = state->getLineY();
+ oldParser = parser;
+- p = g_strdup(s->getCString());
++ p = s->getCString();
+ len = s->getLength();
+ while (len > 0) {
+ n = font->getNextChar(p, len, &code,
+@@ -2685,7 +2694,7 @@ void PdfParser::doShowText(const GooString *s) {
+
+ } else {
+ state->textTransformDelta(0, state->getRise(), &riseX, &riseY);
+- p = g_strdup(s->getCString());
++ p = s->getCString();
+ len = s->getLength();
+ while (len > 0) {
+ n = font->getNextChar(p, len, &code,
+@@ -2731,7 +2740,11 @@ void PdfParser::opXObject(Object args[], int /*numArgs*/)
+ {
+ Object obj1, obj2, obj3, refObj;
+
+- char *name = g_strdup(args[0].getName());
++#if POPPLER_CHECK_VERSION(0,64,0)
++ const char *name = args[0].getName();
++#else
++ char *name = args[0].getName();
++#endif
+ #if defined(POPPLER_NEW_OBJECT_API)
+ if ((obj1 = res->lookupXObject(name)).isNull()) {
+ #else
+@@ -3656,7 +3669,6 @@ void PdfParser::opBeginImage(Object /*args*/[], int /*numArgs*/)
+ Stream *PdfParser::buildImageStream() {
+ Object dict;
+ Object obj;
+- char *key;
+ Stream *str;
+
+ // build dictionary
+@@ -3674,26 +3686,17 @@ Stream *PdfParser::buildImageStream() {
+ obj.free();
+ #endif
+ } else {
+- key = copyString(obj.getName());
+-#if defined(POPPLER_NEW_OBJECT_API)
+- obj = parser->getObj();
+-#else
+- obj.free();
+- parser->getObj(&obj);
+-#endif
+- if (obj.isEOF() || obj.isError()) {
+- gfree(key);
++ Object obj2;
++ _POPPLER_CALL(obj2, parser->getObj);
++ if (obj2.isEOF() || obj2.isError()) {
++ _POPPLER_FREE(obj);
+ break;
+ }
+-#if defined(POPPLER_NEW_OBJECT_API)
+- dict.dictAdd(key, std::move(obj));
+- }
+- obj = parser->getObj();
+-#else
+- dict.dictAdd(key, &obj);
++ _POPPLER_DICTADD(dict, obj.getName(), obj2);
++ _POPPLER_FREE(obj);
++ _POPPLER_FREE(obj2);
+ }
+- parser->getObj(&obj);
+-#endif
++ _POPPLER_CALL(obj, parser->getObj);
+ }
+ if (obj.isEOF()) {
+ error(errSyntaxError, getPos(), "End of file in inline image");
+diff --git a/src/extension/internal/pdfinput/pdf-parser.h b/src/extension/internal/pdfinput/pdf-parser.h
+--- a/src/extension/internal/pdfinput/pdf-parser.h
++++ b/src/extension/internal/pdfinput/pdf-parser.h
+@@ -9,6 +9,7 @@
+ #define PDF_PARSER_H
+
+ #ifdef HAVE_POPPLER
++#include "poppler-transition-api.h"
+
+ #ifdef USE_GCC_PRAGMAS
+ #pragma interface
+@@ -25,6 +26,7 @@ namespace Inkscape {
+ // TODO clean up and remove using:
+ using Inkscape::Extension::Internal::SvgBuilder;
+
++#include "glib/poppler-features.h"
+ #include "goo/gtypes.h"
+ #include "Object.h"
+
+@@ -127,11 +129,14 @@ public:
+
+ // Constructor for regular output.
+ PdfParser(XRef *xrefA, SvgBuilder *builderA, int pageNum, int rotate,
+- Dict *resDict, PDFRectangle *box, PDFRectangle *cropBox);
++ Dict *resDict,
++ _POPPLER_CONST PDFRectangle *box,
++ _POPPLER_CONST PDFRectangle *cropBox);
+
+ // Constructor for a sub-page object.
+ PdfParser(XRef *xrefA, Inkscape::Extension::Internal::SvgBuilder *builderA,
+- Dict *resDict, PDFRectangle *box);
++ Dict *resDict,
++ _POPPLER_CONST PDFRectangle *box);
+
+ virtual ~PdfParser();
+
+@@ -185,7 +190,7 @@ private:
+
+ void go(GBool topLevel);
+ void execOp(Object *cmd, Object args[], int numArgs);
+- PdfOperator *findOp(char *name);
++ PdfOperator *findOp(const char *name);
+ GBool checkArg(Object *arg, TchkType type);
+ int getPos();
+
+@@ -256,7 +261,7 @@ private:
+ double x2, double y2, GfxColor *color2,
+ int nComps, int depth);
+ void doPatchMeshShFill(GfxPatchMeshShading *shading);
+- void fillPatch(GfxPatch *patch, int nComps, int depth);
++ void fillPatch(_POPPLER_CONST GfxPatch *patch, int nComps, int depth);
+ void doEndPath();
+
+ // path clipping operators
+@@ -287,7 +292,12 @@ private:
+ void opMoveShowText(Object args[], int numArgs);
+ void opMoveSetShowText(Object args[], int numArgs);
+ void opShowSpaceText(Object args[], int numArgs);
++#if POPPLER_CHECK_VERSION(0,64,0)
+ void doShowText(const GooString *s);
++#else
++ void doShowText(GooString *s);
++#endif
++
+
+ // XObject operators
+ void opXObject(Object args[], int numArgs);
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h