diff --git a/fix_build_err_with_poppler_25.06.patch b/fix_build_err_with_poppler_25.06.patch new file mode 100644 index 0000000000000000000000000000000000000000..d7450c96eee7a109ec6a2e3a347a6a4ad4ad57f3 --- /dev/null +++ b/fix_build_err_with_poppler_25.06.patch @@ -0,0 +1,117 @@ +From 1fdfb889bba9ee146c8b826e97bc58a88cb1e529 Mon Sep 17 00:00:00 2001 +From: Rafael Siejakowski +Date: Sun, 8 Jun 2025 21:30:44 +0200 +Subject: [PATCH] Fix build against Poppler 25.06 + +Accommodate for the private API change, whereby an array of pointers +has been replaced with a vector of unique_ptr. + +Fixes https://gitlab.com/inkscape/inkscape/-/issues/5836 +--- + .../internal/pdfinput/pdf-parser.cpp | 23 +++++++++++-------- + .../pdfinput/poppler-transition-api.h | 12 ++++++++++ + 2 files changed, 25 insertions(+), 10 deletions(-) + +diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp +index b0b6aa9eec4..22c86fbc3a4 100644 +--- a/src/extension/internal/pdfinput/pdf-parser.cpp ++++ b/src/extension/internal/pdfinput/pdf-parser.cpp +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + #include // std::call_once() + #include + #include +@@ -693,7 +694,6 @@ void PdfParser::opSetLineWidth(Object args[], int /*numArgs*/) + void PdfParser::opSetExtGState(Object args[], int /*numArgs*/) + { + Object obj1, obj2, obj3, obj4, obj5; +- Function *funcs[4] = {nullptr, nullptr, nullptr, nullptr}; + GfxColor backdropColor; + GBool haveBackdropColor = gFalse; + GBool alpha = gFalse; +@@ -751,13 +751,14 @@ void PdfParser::opSetExtGState(Object args[], int /*numArgs*/) + state->setLineWidth(obj2.getNum()); + } + ++ _POPPLER_DECLARE_TRANSFER_FUNCTION_VECTOR(funcs); ++ + // transfer function + if (_POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "TR2").isNull()) { + _POPPLER_CALL_ARGS(obj2, obj1.dictLookup, "TR"); + } + if (obj2.isName(const_cast("Default")) || obj2.isName(const_cast("Identity"))) { +- funcs[0] = funcs[1] = funcs[2] = funcs[3] = nullptr; +- state->setTransfer(funcs); ++ state->setTransfer(std::move(funcs)); + } else if (obj2.isArray() && obj2.arrayGetLength() == 4) { + int pos = 4; + for (int i = 0; i < 4; ++i) { +@@ -770,12 +771,14 @@ void PdfParser::opSetExtGState(Object args[], int /*numArgs*/) + } + _POPPLER_FREE(obj3); + if (pos == 4) { +- state->setTransfer(funcs); ++ state->setTransfer(std::move(funcs)); + } + } else if (obj2.isName() || obj2.isDict() || obj2.isStream()) { + if ((funcs[0] = Function::parse(&obj2))) { +- funcs[1] = funcs[2] = funcs[3] = nullptr; +- state->setTransfer(funcs); ++ funcs[1] = nullptr; ++ funcs[2] = nullptr; ++ funcs[3] = nullptr; ++ state->setTransfer(std::move(funcs)); + } + } else if (!obj2.isNull()) { + error(errSyntaxError, getPos(), "Invalid transfer function in ExtGState"); +@@ -797,8 +800,7 @@ void PdfParser::opSetExtGState(Object args[], int /*numArgs*/) + funcs[0] = Function::parse(&obj3); + if (funcs[0]->getInputSize() != 1 || funcs[0]->getOutputSize() != 1) { + error(errSyntaxError, getPos(), "Invalid transfer function in soft mask in ExtGState"); +- delete funcs[0]; +- funcs[0] = nullptr; ++ _POPPLER_DELETE_TRANSFER_FUNCTION(funcs[0]); + } + } + _POPPLER_FREE(obj3); +@@ -842,9 +844,10 @@ void PdfParser::opSetExtGState(Object args[], int /*numArgs*/) + } + } + } +- doSoftMask(&obj3, alpha, blendingColorSpace.get(), isolated, knockout, funcs[0], &backdropColor); ++ doSoftMask(&obj3, alpha, blendingColorSpace.get(), isolated, knockout, ++ _POPPLER_GET_TRANSFER_FUNCTION_POINTER(funcs[0]), &backdropColor); + if (funcs[0]) { +- delete funcs[0]; ++ _POPPLER_DELETE_TRANSFER_FUNCTION(funcs[0]); + } + } else { + error(errSyntaxError, getPos(), "Invalid soft mask in ExtGState - missing group"); +diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h +index a67132ba6bd..d04412757bc 100644 +--- a/src/extension/internal/pdfinput/poppler-transition-api.h ++++ b/src/extension/internal/pdfinput/poppler-transition-api.h +@@ -15,6 +15,18 @@ + #include + #include + ++#if POPPLER_CHECK_VERSION(25, 6, 0) ++#define _POPPLER_DECLARE_TRANSFER_FUNCTION_VECTOR(name) std::vector> name(4) ++#define _POPPLER_DELETE_TRANSFER_FUNCTION(name) name.reset() ++#define _POPPLER_GET_TRANSFER_FUNCTION_POINTER(name) name.get() ++#else ++#define _POPPLER_DECLARE_TRANSFER_FUNCTION_VECTOR(name) Function *name[4] = {} ++#define _POPPLER_DELETE_TRANSFER_FUNCTION(name) \ ++ delete name; \ ++ name = nullptr ++#define _POPPLER_GET_TRANSFER_FUNCTION_POINTER(name) name ++#endif ++ + #if POPPLER_CHECK_VERSION(25,2,0) + #define _POPPLER_GET_CODE_TO_GID_MAP(ff, len) getCodeToGIDMap(ff) + #define _POPPLER_GET_CID_TO_GID_MAP(len) getCIDToGIDMap() +-- +GitLab diff --git a/inkscape.spec b/inkscape.spec index c4e2d319bd7e61aa8cb2edb1b7ae40195f2d9da8..de5dceeedd9af4c8a784eca9250512e23bf8a46e 100644 --- a/inkscape.spec +++ b/inkscape.spec @@ -1,4 +1,4 @@ -%define anolis_release 1 +%define anolis_release 2 %define debug_package %{nil} %bcond_with graphicsmagick @@ -10,6 +10,9 @@ License: GPL-2.0-or-later AND CC-BY-3.0 URL: https://inkscape.org/ Source0: https://inkscape.org/release/inkscape-%{version}/source/archive/xz/dl/inkscape-%{version}.tar.xz +# https://gitlab.com/inkscape/inkscape/-/merge_requests/7261/commits +Patch: fix_build_err_with_poppler_25.06.patch + Provides: bundled(libcroco) Provides: bundled(autotrace) Provides: bundled(libdepixelize) @@ -194,6 +197,9 @@ appstream-util validate-relax --nonet $RPM_BUILD_ROOT%{_datadir}/metainfo/*.appd %changelog +* Wed Oct 29 2025 mgb01105731 - 1.4.2-2 +- Add patch to build with poppler 25.06.0 + * Thu Jun 12 2025 tomcruiseqi <10762123+tomcruiseqi@user.noreply.gitee.com> - 1.4.2-1 - upgrade to 1.4.2 to be compatible with poppler 25.04.0-1 which needs at least c++20