diff options
author | Gene Carlson | 2024-03-08 16:03:25 +0100 |
---|---|---|
committer | Matteo Bernardini | 2024-04-27 10:33:45 +0200 |
commit | 2e20df1e2e3fd0d5ab6ed89b465660434bbd8468 (patch) | |
tree | b8dab82441a1e6215d21d3ba13a57cdc0829caab | |
parent | 68ac93024440c1dcb61e579018ce241a1ab44180 (diff) | |
download | slackbuilds-inkscape.tar.gz |
graphics/inkscape: Patched for poppler-24.03.inkscape
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
-rw-r--r-- | graphics/inkscape/inkscape.SlackBuild | 1 | ||||
-rw-r--r-- | graphics/inkscape/poppler-24.03.patch | 61 |
2 files changed, 62 insertions, 0 deletions
diff --git a/graphics/inkscape/inkscape.SlackBuild b/graphics/inkscape/inkscape.SlackBuild index 416df46df2..e46844bde4 100644 --- a/graphics/inkscape/inkscape.SlackBuild +++ b/graphics/inkscape/inkscape.SlackBuild @@ -95,6 +95,7 @@ dos2unix -k -q share/extensions/*.py sed -i CMakeScripts/Pod2man.cmake -e "s/SHARE_INSTALL/CMAKE_INSTALL_PREFIX/g" patch -p1 < $CWD/libxml2-2.12.patch +patch -p1 < $CWD/poppler-24.03.patch mkdir -p build cd build diff --git a/graphics/inkscape/poppler-24.03.patch b/graphics/inkscape/poppler-24.03.patch new file mode 100644 index 0000000000..53cf3fd2b6 --- /dev/null +++ b/graphics/inkscape/poppler-24.03.patch @@ -0,0 +1,61 @@ +From 3dd9846ab99260134e11938f0e575be822507037 Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner <asturm@gentoo.org> +Date: Mon, 4 Mar 2024 22:59:40 +0100 +Subject: [PATCH] Fix build with >=poppler-24.03.0 + +Fixes build errors caused by: + +"Use an enum for Function getType" +Upstream commit 6e3824d45d42cb806a28a2df84e4ab6bb3587083 + +Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> +--- + src/extension/internal/pdfinput/svg-builder.cpp | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp +index 525fbfec0..bcd7b1f61 100644 +--- a/src/extension/internal/pdfinput/svg-builder.cpp ++++ b/src/extension/internal/pdfinput/svg-builder.cpp +@@ -1175,9 +1175,13 @@ static bool svgGetShadingColor(GfxShading *shading, double offset, GfxColor *res + #define INT_EPSILON 8 + bool SvgBuilder::_addGradientStops(Inkscape::XML::Node *gradient, GfxShading *shading, + _POPPLER_CONST Function *func) { +- int type = func->getType(); ++ auto type = func->getType(); + auto space = shading->getColorSpace(); ++#if POPPLER_CHECK_VERSION(24, 3, 0) ++ if ( type == Function::Type::Sampled || type == Function::Type::Exponential ) { // Sampled or exponential function ++#else + if ( type == 0 || type == 2 ) { // Sampled or exponential function ++#endif + GfxColor stop1, stop2; + if (!svgGetShadingColor(shading, 0.0, &stop1) || !svgGetShadingColor(shading, 1.0, &stop2)) { + return false; +@@ -1185,7 +1189,11 @@ bool SvgBuilder::_addGradientStops(Inkscape::XML::Node *gradient, GfxShading *sh + _addStopToGradient(gradient, 0.0, &stop1, space, 1.0); + _addStopToGradient(gradient, 1.0, &stop2, space, 1.0); + } ++#if POPPLER_CHECK_VERSION(24, 3, 0) ++ } else if ( type == Function::Type::Stitching ) { // Stitching ++#else + } else if ( type == 3 ) { // Stitching ++#endif + auto stitchingFunc = static_cast<_POPPLER_CONST StitchingFunction*>(func); + const double *bounds = stitchingFunc->getBounds(); + const double *encode = stitchingFunc->getEncode(); +@@ -1200,7 +1208,11 @@ bool SvgBuilder::_addGradientStops(Inkscape::XML::Node *gradient, GfxShading *sh + for ( int i = 0 ; i < num_funcs ; i++ ) { + svgGetShadingColor(shading, bounds[i + 1], &color); + // Add stops ++#if POPPLER_CHECK_VERSION(24, 3, 0) ++ if (stitchingFunc->getFunc(i)->getType() == Function::Type::Exponential) { // process exponential fxn ++#else + if (stitchingFunc->getFunc(i)->getType() == 2) { // process exponential fxn ++#endif + double expE = (static_cast<_POPPLER_CONST ExponentialFunction*>(stitchingFunc->getFunc(i)))->getE(); + if (expE > 1.0) { + expE = (bounds[i + 1] - bounds[i])/expE; // approximate exponential as a single straight line at x=1 +-- +2.44.0 + |