mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2025-12-08 00:05:33 +03:00
media-gfx/inkscape: drop 1.4-r3
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
This commit is contained in:
parent
20330ba3d9
commit
1d98acf6a8
@ -1,2 +1 @@
|
||||
DIST inkscape-1.4.2.tar.xz 53278452 BLAKE2B f42d675c51af7d5c8e01851a5eeb74d03b5b75436eabf25237559839b092b7382d03e388594aae97c511b143680f822940890fa787eab9bf78f1a91838456a49 SHA512 e7d69f477d11aee296efe48d3a9dd24f76fd5e64e5f2a29574f387bc681ced3d806d30b0f98d842c485443624dbf31fd9dabdb92848ee852121bc9d9e90191a1
|
||||
DIST inkscape-1.4.tar.xz 46321868 BLAKE2B 3f21402019995122f043f5ebd8f07e1c9548c507f27c494e4214e090c46acae016c21f950609c95cef2e1b0011693e6629326d733b257402391e2d919bcd0303 SHA512 3b81306b81416597073e7eda2a103112cee63493bcf96fa737bb1edfbd682ebb329e415bbbbfda877aef2a78dc376460040ebc5c0cc2c90c0fe60db5d7d12368
|
||||
|
||||
@ -1,48 +0,0 @@
|
||||
From e412149bd1da7b30846e87c09813f0b719a61089 Mon Sep 17 00:00:00 2001
|
||||
From: Marc Jeanmougin <marc@jeanmougin.fr>
|
||||
Date: Mon, 3 Feb 2025 19:40:11 +0100
|
||||
Subject: [PATCH] Bump cmake requirements
|
||||
|
||||
---
|
||||
CMakeLists.txt | 12 ++++--------
|
||||
CMakeScripts/DefineDependsandFlags.cmake | 2 +-
|
||||
2 files changed, 5 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 3765ed4bd92..79bfa42a842 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1,13 +1,9 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
-cmake_minimum_required(VERSION 3.1.0)
|
||||
+cmake_minimum_required(VERSION 3.12.0)
|
||||
|
||||
-cmake_policy(SET CMP0003 NEW) # don't be prolific with library paths
|
||||
-cmake_policy(SET CMP0005 NEW) # proper define quoting
|
||||
-cmake_policy(SET CMP0009 NEW) # don't follow symbolic links when using GLOB
|
||||
-
|
||||
-if(POLICY CMP0075)
|
||||
- cmake_policy(SET CMP0075 NEW) # link check-executable to CMAKE_REQUIRED_LIBRARIES (CMake 3.12.1)
|
||||
-endif(POLICY CMP0075)
|
||||
+if(POLICY CMP0167)
|
||||
+ cmake_policy(SET CMP0167 NEW) # use FindBoost from boost 1.70+ (cmake 3.30+)
|
||||
+endif()
|
||||
|
||||
message("------------------------------")
|
||||
message("Building Makefile for Inkscape")
|
||||
diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake
|
||||
index bebb49e5e05..744e9787c34 100644
|
||||
--- a/CMakeScripts/DefineDependsandFlags.cmake
|
||||
+++ b/CMakeScripts/DefineDependsandFlags.cmake
|
||||
@@ -164,7 +164,7 @@ add_definitions(${Intl_DEFINITIONS})
|
||||
|
||||
# Check for system-wide version of 2geom and fallback to internal copy if not found
|
||||
if(NOT WITH_INTERNAL_2GEOM)
|
||||
- pkg_check_modules(2Geom QUIET IMPORTED_TARGET GLOBAL 2geom>=1.4.0)
|
||||
+ pkg_check_modules(2Geom QUIET IMPORTED_TARGET GLOBAL 2geom>=${INKSCAPE_VERSION_MAJOR}.${INKSCAPE_VERSION_MINOR})
|
||||
if(2Geom_FOUND)
|
||||
add_library(2Geom::2geom ALIAS PkgConfig::2Geom)
|
||||
else()
|
||||
--
|
||||
GitLab
|
||||
|
||||
@ -1,21 +0,0 @@
|
||||
https://bugs.gentoo.org/941674
|
||||
https://gitlab.com/inkscape/inkscape/-/commit/eb6dadcf1a5c660167ba43f3606c8e7cc6529787
|
||||
|
||||
From eb6dadcf1a5c660167ba43f3606c8e7cc6529787 Mon Sep 17 00:00:00 2001
|
||||
From: Liam <byteslice@airmail.cc>
|
||||
Date: Sat, 12 Oct 2024 05:22:29 -0400
|
||||
Subject: [PATCH] gobjectptr: fix member name
|
||||
|
||||
--- a/src/util/gobjectptr.h
|
||||
+++ b/src/util/gobjectptr.h
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
GObjectPtr() = default;
|
||||
explicit GObjectPtr(T *p, bool add_ref = false) : _p(p) { if (add_ref) _ref(); }
|
||||
GObjectPtr(GObjectPtr const &other) : _p(other._p) { _ref(); }
|
||||
- GObjectPtr &operator=(GObjectPtr const &other) { if (&other != this) { _unref(); _p = other.p; _ref(); } return *this; }
|
||||
+ GObjectPtr &operator=(GObjectPtr const &other) { if (&other != this) { _unref(); _p = other._p; _ref(); } return *this; }
|
||||
GObjectPtr(GObjectPtr &&other) noexcept : _p(other._p) { other._p = nullptr; }
|
||||
GObjectPtr &operator=(GObjectPtr &&other) { if (&other != this) { _unref(); _p = other._p; other._p = nullptr; } return *this; }
|
||||
~GObjectPtr() { _unref(); }
|
||||
--
|
||||
GitLab
|
||||
@ -1,432 +0,0 @@
|
||||
https://bugs.gentoo.org/941933
|
||||
|
||||
From 22304ae8034d067670a9f95022083a75fac92b4c Mon Sep 17 00:00:00 2001
|
||||
From: PBS <pbs3141@gmail.com>
|
||||
Date: Tue, 22 Oct 2024 14:48:31 +0100
|
||||
Subject: [PATCH] Future-proof against poppler 24.10 changes
|
||||
|
||||
---
|
||||
.../internal/pdfinput/pdf-parser.cpp | 120 ++++++++----------
|
||||
src/extension/internal/pdfinput/pdf-parser.h | 4 +-
|
||||
.../pdfinput/poppler-transition-api.h | 6 +
|
||||
3 files changed, 61 insertions(+), 69 deletions(-)
|
||||
|
||||
diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
|
||||
index 97b2909218a..28000a87b0c 100644
|
||||
--- a/src/extension/internal/pdfinput/pdf-parser.cpp
|
||||
+++ b/src/extension/internal/pdfinput/pdf-parser.cpp
|
||||
@@ -817,11 +817,11 @@ void PdfParser::opSetExtGState(Object args[], int /*numArgs*/)
|
||||
_POPPLER_FREE(obj3);
|
||||
if (_POPPLER_CALL_ARGS_DEREF(obj3, obj2.dictLookup, "G").isStream()) {
|
||||
if (_POPPLER_CALL_ARGS_DEREF(obj4, obj3.streamGetDict()->lookup, "Group").isDict()) {
|
||||
- GfxColorSpace *blendingColorSpace = nullptr;
|
||||
+ std::unique_ptr<GfxColorSpace> blendingColorSpace;
|
||||
GBool isolated = gFalse;
|
||||
GBool knockout = gFalse;
|
||||
if (!_POPPLER_CALL_ARGS_DEREF(obj5, obj4.dictLookup, "CS").isNull()) {
|
||||
- blendingColorSpace = GfxColorSpace::parse(nullptr, &obj5, nullptr, state);
|
||||
+ blendingColorSpace = std::unique_ptr<GfxColorSpace>(GfxColorSpace::parse(nullptr, &obj5, nullptr, state));
|
||||
}
|
||||
_POPPLER_FREE(obj5);
|
||||
if (_POPPLER_CALL_ARGS_DEREF(obj5, obj4.dictLookup, "I").isBool()) {
|
||||
@@ -842,7 +842,7 @@ void PdfParser::opSetExtGState(Object args[], int /*numArgs*/)
|
||||
}
|
||||
}
|
||||
}
|
||||
- doSoftMask(&obj3, alpha, blendingColorSpace, isolated, knockout, funcs[0], &backdropColor);
|
||||
+ doSoftMask(&obj3, alpha, blendingColorSpace.get(), isolated, knockout, funcs[0], &backdropColor);
|
||||
if (funcs[0]) {
|
||||
delete funcs[0];
|
||||
}
|
||||
@@ -927,9 +927,6 @@ void PdfParser::doSoftMask(Object *str, GBool alpha,
|
||||
alpha, transferFunc, backdropColor);
|
||||
--formDepth;
|
||||
|
||||
- if (blendingColorSpace) {
|
||||
- delete blendingColorSpace;
|
||||
- }
|
||||
_POPPLER_FREE(obj1);
|
||||
}
|
||||
|
||||
@@ -946,42 +943,43 @@ void PdfParser::opSetRenderingIntent(Object /*args*/[], int /*numArgs*/)
|
||||
*
|
||||
* Maintains a cache for named color spaces to avoid expensive re-parsing.
|
||||
*/
|
||||
-GfxColorSpace *PdfParser::lookupColorSpaceCopy(Object &arg)
|
||||
+std::unique_ptr<GfxColorSpace> PdfParser::lookupColorSpaceCopy(Object &arg)
|
||||
{
|
||||
assert(!arg.isNull());
|
||||
- GfxColorSpace *colorSpace = nullptr;
|
||||
|
||||
if (char const *name = arg.isName() ? arg.getName() : nullptr) {
|
||||
auto const cache_name = std::to_string(formDepth) + "-" + name;
|
||||
- if ((colorSpace = colorSpacesCache[cache_name].get())) {
|
||||
- return colorSpace->copy();
|
||||
+ if (auto cached = colorSpacesCache[cache_name].get()) {
|
||||
+ return std::unique_ptr<GfxColorSpace>(cached->copy());
|
||||
}
|
||||
|
||||
- Object obj = res->lookupColorSpace(name);
|
||||
- if (obj.isNull()) {
|
||||
- colorSpace = GfxColorSpace::parse(res, &arg, nullptr, state);
|
||||
+ std::unique_ptr<GfxColorSpace> colorSpace;
|
||||
+ if (auto obj = res->lookupColorSpace(name); !obj.isNull()) {
|
||||
+ colorSpace = std::unique_ptr<GfxColorSpace>(GfxColorSpace::parse(res, &obj, nullptr, state));
|
||||
} else {
|
||||
- colorSpace = GfxColorSpace::parse(res, &obj, nullptr, state);
|
||||
+ colorSpace = std::unique_ptr<GfxColorSpace>(GfxColorSpace::parse(res, &arg, nullptr, state));
|
||||
}
|
||||
|
||||
if (colorSpace && colorSpace->getMode() != csPattern) {
|
||||
- colorSpacesCache[cache_name].reset(colorSpace->copy());
|
||||
+ colorSpacesCache[cache_name] = std::unique_ptr<GfxColorSpace>(colorSpace->copy());
|
||||
}
|
||||
+
|
||||
+ return colorSpace;
|
||||
} else {
|
||||
// We were passed in an object directly.
|
||||
- colorSpace = GfxColorSpace::parse(res, &arg, nullptr, state);
|
||||
+ return std::unique_ptr<GfxColorSpace>(GfxColorSpace::parse(res, &arg, nullptr, state));
|
||||
}
|
||||
- return colorSpace;
|
||||
}
|
||||
|
||||
/**
|
||||
* Look up pattern/gradients from the GfxResource dictionary
|
||||
*/
|
||||
-GfxPattern *PdfParser::lookupPattern(Object *obj, GfxState *state)
|
||||
+std::unique_ptr<GfxPattern> PdfParser::lookupPattern(Object *obj, GfxState *state)
|
||||
{
|
||||
- if (!obj->isName())
|
||||
- return nullptr;
|
||||
- return res->lookupPattern(obj->getName(), nullptr, state);
|
||||
+ if (!obj->isName()) {
|
||||
+ return {};
|
||||
+ }
|
||||
+ return std::unique_ptr<GfxPattern>(res->lookupPattern(obj->getName(), nullptr, state));
|
||||
}
|
||||
|
||||
// TODO not good that numArgs is ignored but args[] is used:
|
||||
@@ -990,7 +988,7 @@ void PdfParser::opSetFillGray(Object args[], int /*numArgs*/)
|
||||
GfxColor color;
|
||||
builder->beforeStateChange(state);
|
||||
state->setFillPattern(nullptr);
|
||||
- state->setFillColorSpace(new GfxDeviceGrayColorSpace());
|
||||
+ state->setFillColorSpace(_POPPLER_CONSUME_UNIQPTR_ARG(std::make_unique<GfxDeviceGrayColorSpace>()));
|
||||
color.c[0] = dblToCol(args[0].getNum());
|
||||
state->setFillColor(&color);
|
||||
builder->updateStyle(state);
|
||||
@@ -1002,7 +1000,7 @@ void PdfParser::opSetStrokeGray(Object args[], int /*numArgs*/)
|
||||
GfxColor color;
|
||||
builder->beforeStateChange(state);
|
||||
state->setStrokePattern(nullptr);
|
||||
- state->setStrokeColorSpace(new GfxDeviceGrayColorSpace());
|
||||
+ state->setStrokeColorSpace(_POPPLER_CONSUME_UNIQPTR_ARG(std::make_unique<GfxDeviceGrayColorSpace>()));
|
||||
color.c[0] = dblToCol(args[0].getNum());
|
||||
state->setStrokeColor(&color);
|
||||
builder->updateStyle(state);
|
||||
@@ -1015,7 +1013,7 @@ void PdfParser::opSetFillCMYKColor(Object args[], int /*numArgs*/)
|
||||
int i;
|
||||
builder->beforeStateChange(state);
|
||||
state->setFillPattern(nullptr);
|
||||
- state->setFillColorSpace(new GfxDeviceCMYKColorSpace());
|
||||
+ state->setFillColorSpace(_POPPLER_CONSUME_UNIQPTR_ARG(std::make_unique<GfxDeviceCMYKColorSpace>()));
|
||||
for (i = 0; i < 4; ++i) {
|
||||
color.c[i] = dblToCol(args[i].getNum());
|
||||
}
|
||||
@@ -1029,7 +1027,7 @@ void PdfParser::opSetStrokeCMYKColor(Object args[], int /*numArgs*/)
|
||||
GfxColor color;
|
||||
builder->beforeStateChange(state);
|
||||
state->setStrokePattern(nullptr);
|
||||
- state->setStrokeColorSpace(new GfxDeviceCMYKColorSpace());
|
||||
+ state->setStrokeColorSpace(_POPPLER_CONSUME_UNIQPTR_ARG(std::make_unique<GfxDeviceCMYKColorSpace>()));
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
color.c[i] = dblToCol(args[i].getNum());
|
||||
}
|
||||
@@ -1043,7 +1041,7 @@ void PdfParser::opSetFillRGBColor(Object args[], int /*numArgs*/)
|
||||
GfxColor color;
|
||||
builder->beforeStateChange(state);
|
||||
state->setFillPattern(nullptr);
|
||||
- state->setFillColorSpace(new GfxDeviceRGBColorSpace());
|
||||
+ state->setFillColorSpace(_POPPLER_CONSUME_UNIQPTR_ARG(std::make_unique<GfxDeviceRGBColorSpace>()));
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
color.c[i] = dblToCol(args[i].getNum());
|
||||
}
|
||||
@@ -1056,7 +1054,7 @@ void PdfParser::opSetStrokeRGBColor(Object args[], int /*numArgs*/) {
|
||||
GfxColor color;
|
||||
builder->beforeStateChange(state);
|
||||
state->setStrokePattern(nullptr);
|
||||
- state->setStrokeColorSpace(new GfxDeviceRGBColorSpace());
|
||||
+ state->setStrokeColorSpace(_POPPLER_CONSUME_UNIQPTR_ARG(std::make_unique<GfxDeviceRGBColorSpace>()));
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
color.c[i] = dblToCol(args[i].getNum());
|
||||
}
|
||||
@@ -1068,14 +1066,14 @@ void PdfParser::opSetStrokeRGBColor(Object args[], int /*numArgs*/) {
|
||||
void PdfParser::opSetFillColorSpace(Object args[], int numArgs)
|
||||
{
|
||||
assert(numArgs >= 1);
|
||||
- GfxColorSpace *colorSpace = lookupColorSpaceCopy(args[0]);
|
||||
+ auto colorSpace = lookupColorSpaceCopy(args[0]);
|
||||
builder->beforeStateChange(state);
|
||||
state->setFillPattern(nullptr);
|
||||
|
||||
if (colorSpace) {
|
||||
GfxColor color;
|
||||
- state->setFillColorSpace(colorSpace);
|
||||
colorSpace->getDefaultColor(&color);
|
||||
+ state->setFillColorSpace(_POPPLER_CONSUME_UNIQPTR_ARG(colorSpace));
|
||||
state->setFillColor(&color);
|
||||
builder->updateStyle(state);
|
||||
} else {
|
||||
@@ -1089,14 +1087,14 @@ void PdfParser::opSetStrokeColorSpace(Object args[], int numArgs)
|
||||
assert(numArgs >= 1);
|
||||
builder->beforeStateChange(state);
|
||||
|
||||
- GfxColorSpace *colorSpace = lookupColorSpaceCopy(args[0]);
|
||||
+ auto colorSpace = lookupColorSpaceCopy(args[0]);
|
||||
|
||||
state->setStrokePattern(nullptr);
|
||||
|
||||
if (colorSpace) {
|
||||
GfxColor color;
|
||||
- state->setStrokeColorSpace(colorSpace);
|
||||
colorSpace->getDefaultColor(&color);
|
||||
+ state->setStrokeColorSpace(_POPPLER_CONSUME_UNIQPTR_ARG(colorSpace));
|
||||
state->setStrokeColor(&color);
|
||||
builder->updateStyle(state);
|
||||
} else {
|
||||
@@ -1159,7 +1157,7 @@ void PdfParser::opSetFillColorN(Object args[], int numArgs) {
|
||||
builder->updateStyle(state);
|
||||
}
|
||||
if (auto pattern = lookupPattern(&(args[numArgs - 1]), state)) {
|
||||
- state->setFillPattern(pattern);
|
||||
+ state->setFillPattern(_POPPLER_CONSUME_UNIQPTR_ARG(pattern));
|
||||
builder->updateStyle(state);
|
||||
}
|
||||
|
||||
@@ -1202,7 +1200,7 @@ void PdfParser::opSetStrokeColorN(Object args[], int numArgs) {
|
||||
builder->updateStyle(state);
|
||||
}
|
||||
if (auto pattern = lookupPattern(&(args[numArgs - 1]), state)) {
|
||||
- state->setStrokePattern(pattern);
|
||||
+ state->setStrokePattern(_POPPLER_CONSUME_UNIQPTR_ARG(pattern));
|
||||
builder->updateStyle(state);
|
||||
}
|
||||
|
||||
@@ -1579,11 +1577,11 @@ void PdfParser::doShadingPatternFillFallback(GfxShadingPattern *sPat,
|
||||
// TODO not good that numArgs is ignored but args[] is used:
|
||||
void PdfParser::opShFill(Object args[], int /*numArgs*/)
|
||||
{
|
||||
- GfxShading *shading = nullptr;
|
||||
GfxPath *savedPath = nullptr;
|
||||
bool savedState = false;
|
||||
|
||||
- if (!(shading = res->lookupShading(args[0].getName(), nullptr, state))) {
|
||||
+ auto shading = std::unique_ptr<GfxShading>(res->lookupShading(args[0].getName(), nullptr, state));
|
||||
+ if (!shading) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1615,19 +1613,19 @@ void PdfParser::opShFill(Object args[], int /*numArgs*/)
|
||||
// do shading type-specific operations
|
||||
switch (shading->getType()) {
|
||||
case 1: // Function-based shading
|
||||
- doFunctionShFill(static_cast<GfxFunctionShading *>(shading));
|
||||
+ doFunctionShFill(static_cast<GfxFunctionShading *>(shading.get()));
|
||||
break;
|
||||
case 2: // Axial shading
|
||||
case 3: // Radial shading
|
||||
- builder->addClippedFill(shading, stateToAffine(state));
|
||||
+ builder->addClippedFill(shading.get(), stateToAffine(state));
|
||||
break;
|
||||
case 4: // Free-form Gouraud-shaded triangle mesh
|
||||
case 5: // Lattice-form Gouraud-shaded triangle mesh
|
||||
- doGouraudTriangleShFill(static_cast<GfxGouraudTriangleShading *>(shading));
|
||||
+ doGouraudTriangleShFill(static_cast<GfxGouraudTriangleShading *>(shading.get()));
|
||||
break;
|
||||
case 6: // Coons patch mesh
|
||||
case 7: // Tensor-product patch mesh
|
||||
- doPatchMeshShFill(static_cast<GfxPatchMeshShading *>(shading));
|
||||
+ doPatchMeshShFill(static_cast<GfxPatchMeshShading *>(shading.get()));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1636,8 +1634,6 @@ void PdfParser::opShFill(Object args[], int /*numArgs*/)
|
||||
restoreState();
|
||||
state->setPath(savedPath);
|
||||
}
|
||||
-
|
||||
- delete shading;
|
||||
}
|
||||
|
||||
void PdfParser::doFunctionShFill(GfxFunctionShading *shading) {
|
||||
@@ -2528,7 +2524,7 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg)
|
||||
|
||||
} else {
|
||||
// get color space and color map
|
||||
- GfxColorSpace *colorSpace;
|
||||
+ std::unique_ptr<GfxColorSpace> colorSpace;
|
||||
_POPPLER_CALL_ARGS(obj1, dict->lookup, "ColorSpace");
|
||||
if (obj1.isNull()) {
|
||||
_POPPLER_FREE(obj1);
|
||||
@@ -2537,13 +2533,11 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg)
|
||||
if (!obj1.isNull()) {
|
||||
colorSpace = lookupColorSpaceCopy(obj1);
|
||||
} else if (csMode == streamCSDeviceGray) {
|
||||
- colorSpace = new GfxDeviceGrayColorSpace();
|
||||
+ colorSpace = std::make_unique<GfxDeviceGrayColorSpace>();
|
||||
} else if (csMode == streamCSDeviceRGB) {
|
||||
- colorSpace = new GfxDeviceRGBColorSpace();
|
||||
+ colorSpace = std::make_unique<GfxDeviceRGBColorSpace>();
|
||||
} else if (csMode == streamCSDeviceCMYK) {
|
||||
- colorSpace = new GfxDeviceCMYKColorSpace();
|
||||
- } else {
|
||||
- colorSpace = nullptr;
|
||||
+ colorSpace = std::make_unique<GfxDeviceCMYKColorSpace>();
|
||||
}
|
||||
_POPPLER_FREE(obj1);
|
||||
if (!colorSpace) {
|
||||
@@ -2554,10 +2548,9 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg)
|
||||
_POPPLER_FREE(obj1);
|
||||
_POPPLER_CALL_ARGS(obj1, dict->lookup, "D");
|
||||
}
|
||||
- GfxImageColorMap *colorMap = new GfxImageColorMap(bits, &obj1, colorSpace);
|
||||
+ auto colorMap = std::make_unique<GfxImageColorMap>(bits, &obj1, _POPPLER_CONSUME_UNIQPTR_ARG(colorSpace));
|
||||
_POPPLER_FREE(obj1);
|
||||
if (!colorMap->isOk()) {
|
||||
- delete colorMap;
|
||||
goto err1;
|
||||
}
|
||||
|
||||
@@ -2568,7 +2561,7 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg)
|
||||
int maskWidth = 0;
|
||||
int maskHeight = 0;
|
||||
maskInvert = gFalse;
|
||||
- GfxImageColorMap *maskColorMap = nullptr;
|
||||
+ std::unique_ptr<GfxImageColorMap> maskColorMap;
|
||||
_POPPLER_CALL_ARGS(maskObj, dict->lookup, "Mask");
|
||||
_POPPLER_CALL_ARGS(smaskObj, dict->lookup, "SMask");
|
||||
Dict* maskDict;
|
||||
@@ -2624,7 +2617,7 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg)
|
||||
_POPPLER_FREE(obj1);
|
||||
_POPPLER_CALL_ARGS(obj1, maskDict->lookup, "CS");
|
||||
}
|
||||
- GfxColorSpace *maskColorSpace = lookupColorSpaceCopy(obj1);
|
||||
+ auto maskColorSpace = lookupColorSpaceCopy(obj1);
|
||||
_POPPLER_FREE(obj1);
|
||||
if (!maskColorSpace || maskColorSpace->getMode() != csDeviceGray) {
|
||||
goto err1;
|
||||
@@ -2634,10 +2627,9 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg)
|
||||
_POPPLER_FREE(obj1);
|
||||
_POPPLER_CALL_ARGS(obj1, maskDict->lookup, "D");
|
||||
}
|
||||
- maskColorMap = new GfxImageColorMap(maskBits, &obj1, maskColorSpace);
|
||||
+ maskColorMap = std::make_unique<GfxImageColorMap>(maskBits, &obj1, _POPPLER_CONSUME_UNIQPTR_ARG(maskColorSpace));
|
||||
_POPPLER_FREE(obj1);
|
||||
if (!maskColorMap->isOk()) {
|
||||
- delete maskColorMap;
|
||||
goto err1;
|
||||
}
|
||||
//~ handle the Matte entry
|
||||
@@ -2718,17 +2710,15 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg)
|
||||
|
||||
// draw it
|
||||
if (haveSoftMask) {
|
||||
- builder->addSoftMaskedImage(state, str, width, height, colorMap, interpolate,
|
||||
- maskStr, maskWidth, maskHeight, maskColorMap, maskInterpolate);
|
||||
- delete maskColorMap;
|
||||
+ builder->addSoftMaskedImage(state, str, width, height, colorMap.get(), interpolate,
|
||||
+ maskStr, maskWidth, maskHeight, maskColorMap.get(), maskInterpolate);
|
||||
} else if (haveExplicitMask) {
|
||||
- builder->addMaskedImage(state, str, width, height, colorMap, interpolate,
|
||||
+ builder->addMaskedImage(state, str, width, height, colorMap.get(), interpolate,
|
||||
maskStr, maskWidth, maskHeight, maskInvert, maskInterpolate);
|
||||
} else {
|
||||
- builder->addImage(state, str, width, height, colorMap, interpolate,
|
||||
- haveColorKeyMask ? maskColors : static_cast<int *>(nullptr));
|
||||
+ builder->addImage(state, str, width, height, colorMap.get(), interpolate,
|
||||
+ haveColorKeyMask ? maskColors : nullptr);
|
||||
}
|
||||
- delete colorMap;
|
||||
|
||||
_POPPLER_FREE(maskObj);
|
||||
_POPPLER_FREE(smaskObj);
|
||||
@@ -2746,7 +2736,6 @@ void PdfParser::doForm(Object *str, double *offset)
|
||||
{
|
||||
Dict *dict;
|
||||
GBool transpGroup, isolated, knockout;
|
||||
- GfxColorSpace *blendingColorSpace;
|
||||
Object matrixObj, bboxObj;
|
||||
double m[6], bbox[4];
|
||||
Object resObj;
|
||||
@@ -2812,12 +2801,12 @@ void PdfParser::doForm(Object *str, double *offset)
|
||||
|
||||
// check for a transparency group
|
||||
transpGroup = isolated = knockout = gFalse;
|
||||
- blendingColorSpace = nullptr;
|
||||
+ std::unique_ptr<GfxColorSpace> blendingColorSpace;
|
||||
if (_POPPLER_CALL_ARGS_DEREF(obj1, dict->lookup, "Group").isDict()) {
|
||||
if (_POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "S").isName("Transparency")) {
|
||||
transpGroup = gTrue;
|
||||
if (!_POPPLER_CALL_ARGS_DEREF(obj3, obj1.dictLookup, "CS").isNull()) {
|
||||
- blendingColorSpace = GfxColorSpace::parse(nullptr, &obj3, nullptr, state);
|
||||
+ blendingColorSpace = std::unique_ptr<GfxColorSpace>(GfxColorSpace::parse(nullptr, &obj3, nullptr, state));
|
||||
}
|
||||
_POPPLER_FREE(obj3);
|
||||
if (_POPPLER_CALL_ARGS_DEREF(obj3, obj1.dictLookup, "I").isBool()) {
|
||||
@@ -2835,12 +2824,9 @@ void PdfParser::doForm(Object *str, double *offset)
|
||||
|
||||
// draw it
|
||||
++formDepth;
|
||||
- doForm1(str, resDict, m, bbox, transpGroup, gFalse, blendingColorSpace, isolated, knockout);
|
||||
+ doForm1(str, resDict, m, bbox, transpGroup, gFalse, blendingColorSpace.get(), isolated, knockout);
|
||||
--formDepth;
|
||||
|
||||
- if (blendingColorSpace) {
|
||||
- delete blendingColorSpace;
|
||||
- }
|
||||
_POPPLER_FREE(resObj);
|
||||
}
|
||||
|
||||
diff --git a/src/extension/internal/pdfinput/pdf-parser.h b/src/extension/internal/pdfinput/pdf-parser.h
|
||||
index c7c10caefed..8325ea24364 100644
|
||||
--- a/src/extension/internal/pdfinput/pdf-parser.h
|
||||
+++ b/src/extension/internal/pdfinput/pdf-parser.h
|
||||
@@ -137,7 +137,7 @@ public:
|
||||
void loadPatternColorProfiles(Dict *resources);
|
||||
void loadColorProfile();
|
||||
void loadColorSpaceProfile(GfxColorSpace *space, Object *obj);
|
||||
- GfxPattern *lookupPattern(Object *obj, GfxState *state);
|
||||
+ std::unique_ptr<GfxPattern> lookupPattern(Object *obj, GfxState *state);
|
||||
|
||||
std::shared_ptr<CairoFontEngine> getFontEngine();
|
||||
|
||||
@@ -176,7 +176,7 @@ private:
|
||||
//! Caches color spaces by name
|
||||
std::map<std::string, std::unique_ptr<GfxColorSpace>> colorSpacesCache;
|
||||
|
||||
- GfxColorSpace *lookupColorSpaceCopy(Object &);
|
||||
+ std::unique_ptr<GfxColorSpace> lookupColorSpaceCopy(Object &);
|
||||
|
||||
void setDefaultApproximationPrecision(); // init color deltas
|
||||
void pushOperator(const char *name);
|
||||
diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
|
||||
index 481aefadf46..8f03aa17779 100644
|
||||
--- a/src/extension/internal/pdfinput/poppler-transition-api.h
|
||||
+++ b/src/extension/internal/pdfinput/poppler-transition-api.h
|
||||
@@ -15,6 +15,12 @@
|
||||
#include <glib/poppler-features.h>
|
||||
#include <poppler/UTF.h>
|
||||
|
||||
+#if POPPLER_CHECK_VERSION(24, 10, 0)
|
||||
+#define _POPPLER_CONSUME_UNIQPTR_ARG(value) std::move(value)
|
||||
+#else
|
||||
+#define _POPPLER_CONSUME_UNIQPTR_ARG(value) value.release()
|
||||
+#endif
|
||||
+
|
||||
#if POPPLER_CHECK_VERSION(24, 5, 0)
|
||||
#define _POPPLER_HAS_UNICODE_BOM(value) (hasUnicodeByteOrderMark(value->toStr()))
|
||||
#define _POPPLER_HAS_UNICODE_BOMLE(value) (hasUnicodeByteOrderMarkLE(value->toStr()))
|
||||
--
|
||||
GitLab
|
||||
|
||||
@ -1,59 +0,0 @@
|
||||
From 0399372ec240d23e0e70548237a541f2b5bf0f34 Mon Sep 17 00:00:00 2001
|
||||
From: KrIr17 <elendil.krir17@gmail.com>
|
||||
Date: Tue, 5 Nov 2024 00:40:15 +0100
|
||||
Subject: [PATCH] Fix building with Poppler 24.11
|
||||
|
||||
Poppler 24.11 no longer sets the default value for faceIndex to 0 in
|
||||
`FoFiTrueType::make()` and `FoFiTrueType::load()` [1], so we do it
|
||||
on our end instead.
|
||||
|
||||
Fixes https://gitlab.com/inkscape/inkscape/-/issues/5370
|
||||
|
||||
[1] https://gitlab.freedesktop.org/poppler/poppler/-/commit/94467509a013dd5cf46c942baa598f2b296571f4
|
||||
---
|
||||
.../internal/pdfinput/poppler-cairo-font-engine.cpp | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp b/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp
|
||||
index 34a8eed682d..728b1d1aac4 100644
|
||||
--- a/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp
|
||||
+++ b/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp
|
||||
@@ -419,9 +419,9 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref, FT_Li
|
||||
FoFiTrueType *ff;
|
||||
#endif
|
||||
if (!font_data.empty()) {
|
||||
- ff = FoFiTrueType::make((fontchar)font_data.data(), font_data.size());
|
||||
+ ff = FoFiTrueType::make((fontchar)font_data.data(), font_data.size(), 0);
|
||||
} else {
|
||||
- ff = FoFiTrueType::load(fileName.c_str());
|
||||
+ ff = FoFiTrueType::load(fileName.c_str(), 0);
|
||||
}
|
||||
if (!ff) {
|
||||
goto err2;
|
||||
@@ -444,9 +444,9 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref, FT_Li
|
||||
FoFiTrueType *ff;
|
||||
#endif
|
||||
if (!font_data.empty()) {
|
||||
- ff = FoFiTrueType::make((fontchar)font_data.data(), font_data.size());
|
||||
+ ff = FoFiTrueType::make((fontchar)font_data.data(), font_data.size(), 0);
|
||||
} else {
|
||||
- ff = FoFiTrueType::load(fileName.c_str());
|
||||
+ ff = FoFiTrueType::load(fileName.c_str(), 0);
|
||||
}
|
||||
if (!ff) {
|
||||
error(errSyntaxError, -1, "failed to load truetype font\n");
|
||||
@@ -512,9 +512,9 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref, FT_Li
|
||||
FoFiTrueType *ff;
|
||||
#endif
|
||||
if (!font_data.empty()) {
|
||||
- ff = FoFiTrueType::make((fontchar)font_data.data(), font_data.size());
|
||||
+ ff = FoFiTrueType::make((fontchar)font_data.data(), font_data.size(), 0);
|
||||
} else {
|
||||
- ff = FoFiTrueType::load(fileName.c_str());
|
||||
+ ff = FoFiTrueType::load(fileName.c_str(), 0);
|
||||
}
|
||||
if (ff) {
|
||||
if (ff->isOpenTypeCFF()) {
|
||||
--
|
||||
GitLab
|
||||
|
||||
@ -1,53 +0,0 @@
|
||||
From c9046810d899a408bfbd489aad91872b1203ee6d Mon Sep 17 00:00:00 2001
|
||||
From: KrIr17 <elendil.krir17@gmail.com>
|
||||
Date: Thu, 5 Dec 2024 15:03:47 +0100
|
||||
Subject: [PATCH] Fix building with poppler 24.12.0
|
||||
|
||||
Fixes https://gitlab.com/inkscape/inkscape/-/issues/5415
|
||||
---
|
||||
src/extension/internal/pdfinput/pdf-parser.cpp | 4 +++-
|
||||
src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
|
||||
2 files changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
|
||||
index 28000a87b0c..9ea30b90a48 100644
|
||||
--- a/src/extension/internal/pdfinput/pdf-parser.cpp
|
||||
+++ b/src/extension/internal/pdfinput/pdf-parser.cpp
|
||||
@@ -2403,6 +2403,7 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg)
|
||||
int bits;
|
||||
GBool interpolate;
|
||||
StreamColorSpaceMode csMode;
|
||||
+ GBool hasAlpha;
|
||||
GBool mask;
|
||||
GBool invert;
|
||||
Object maskObj, smaskObj;
|
||||
@@ -2414,7 +2415,8 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg)
|
||||
// get info from the stream
|
||||
bits = 0;
|
||||
csMode = streamCSNone;
|
||||
- str->getImageParams(&bits, &csMode);
|
||||
+ hasAlpha = false;
|
||||
+ str->_POPPLER_GET_IMAGE_PARAMS(&bits, &csMode, &hasAlpha);
|
||||
|
||||
// get stream dict
|
||||
dict = str->getDict();
|
||||
diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
|
||||
index 8f03aa17779..b7a54828e74 100644
|
||||
--- a/src/extension/internal/pdfinput/poppler-transition-api.h
|
||||
+++ b/src/extension/internal/pdfinput/poppler-transition-api.h
|
||||
@@ -39,6 +39,12 @@
|
||||
#define _POPPLER_FUNCTION_TYPE_STITCHING 3
|
||||
#endif
|
||||
|
||||
+#if POPPLER_CHECK_VERSION(24,12,0)
|
||||
+#define _POPPLER_GET_IMAGE_PARAMS(bits, csMode, hasAlpha) getImageParams(bits, csMode, hasAlpha)
|
||||
+#else
|
||||
+#define _POPPLER_GET_IMAGE_PARAMS(bits, csMode, hasAlpha) getImageParams(bits, csMode)
|
||||
+#endif
|
||||
+
|
||||
#if POPPLER_CHECK_VERSION(22, 4, 0)
|
||||
#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
|
||||
#else
|
||||
--
|
||||
GitLab
|
||||
|
||||
@ -1,179 +0,0 @@
|
||||
From 5c4c6d116dae5250d75d34a45f0d9220824d2e20 Mon Sep 17 00:00:00 2001
|
||||
From: KrIr17 <elendil.krir17@gmail.com>
|
||||
Date: Sun, 9 Feb 2025 22:52:53 +0530
|
||||
Subject: [PATCH] Fix building with poppler 25.02.0
|
||||
|
||||
1. `getCodeToGIDMap`, `getCIDToGID`, `getCIDToGIDMap` are now `std::vector`
|
||||
|
||||
2. `pdfDocEncodingToUTF16` returns an `std::string`
|
||||
---
|
||||
.../pdfinput/poppler-cairo-font-engine.cpp | 50 +++++++++++++++----
|
||||
.../pdfinput/poppler-transition-api.h | 20 +++++---
|
||||
3 files changed, 63 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp b/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp
|
||||
index 728b1d1aac4..bd1d4e49367 100644
|
||||
--- a/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp
|
||||
+++ b/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp
|
||||
@@ -405,14 +405,22 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref, FT_Li
|
||||
break;
|
||||
case fontCIDType2:
|
||||
case fontCIDType2OT:
|
||||
+#if POPPLER_CHECK_VERSION(25,2,0)
|
||||
+ if (!gfxcid->getCIDToGID().empty()) {
|
||||
+ const auto src = gfxcid->getCIDToGID();
|
||||
+ codeToGID = std::move(src);
|
||||
+ }
|
||||
+#else
|
||||
if (gfxcid->getCIDToGID()) {
|
||||
n = gfxcid->getCIDToGIDLen();
|
||||
if (n) {
|
||||
- const int *src = gfxcid->getCIDToGID();
|
||||
+ const auto src = gfxcid->getCIDToGID();
|
||||
codeToGID.reserve(n);
|
||||
codeToGID.insert(codeToGID.begin(), src, src + n);
|
||||
}
|
||||
- } else {
|
||||
+ }
|
||||
+#endif
|
||||
+ else {
|
||||
#if POPPLER_CHECK_VERSION(22, 1, 0)
|
||||
std::unique_ptr<FoFiTrueType> ff;
|
||||
#else
|
||||
@@ -427,13 +435,18 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref, FT_Li
|
||||
goto err2;
|
||||
}
|
||||
#if POPPLER_CHECK_VERSION(22, 1, 0)
|
||||
- int *src = gfxcid->getCodeToGIDMap(ff.get(), &n);
|
||||
+ auto src = gfxcid->_POPPLER_GET_CODE_TO_GID_MAP(ff.get(), &n);
|
||||
#else
|
||||
- int *src = gfxcid->getCodeToGIDMap(ff, &n);
|
||||
+ auto src = gfxcid->_POPPLER_GET_CODE_TO_GID_MAP(ff, &n);
|
||||
#endif
|
||||
+
|
||||
+#if POPPLER_CHECK_VERSION(25,2,0)
|
||||
+ codeToGID = std::move(src);
|
||||
+#else
|
||||
codeToGID.reserve(n);
|
||||
codeToGID.insert(codeToGID.begin(), src, src + n);
|
||||
gfree(src);
|
||||
+#endif
|
||||
}
|
||||
/* Fall through */
|
||||
case fontTrueType:
|
||||
@@ -455,13 +468,17 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref, FT_Li
|
||||
/* This might be set already for the CIDType2 case */
|
||||
if (fontType == fontTrueType || fontType == fontTrueTypeOT) {
|
||||
#if POPPLER_CHECK_VERSION(22, 1, 0)
|
||||
- int *src = gfx8bit->getCodeToGIDMap(ff.get());
|
||||
+ auto src = gfx8bit->getCodeToGIDMap(ff.get());
|
||||
#else
|
||||
- int *src = gfx8bit->getCodeToGIDMap(ff);
|
||||
+ auto src = gfx8bit->getCodeToGIDMap(ff);
|
||||
#endif
|
||||
+#if POPPLER_CHECK_VERSION(25,2,0)
|
||||
+ codeToGID = std::move(src);
|
||||
+#else
|
||||
codeToGID.reserve(256);
|
||||
codeToGID.insert(codeToGID.begin(), src, src + 256);
|
||||
gfree(src);
|
||||
+#endif
|
||||
}
|
||||
font_face = getFreeTypeFontFace(fontEngine, lib, fileName, std::move(font_data));
|
||||
if (!font_face) {
|
||||
@@ -479,10 +496,14 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref, FT_Li
|
||||
ff1c = FoFiType1C::load(fileName.c_str());
|
||||
}
|
||||
if (ff1c) {
|
||||
- int *src = ff1c->getCIDToGIDMap(&n);
|
||||
+ auto src = ff1c->_POPPLER_GET_CID_TO_GID_MAP(&n);
|
||||
+#if POPPLER_CHECK_VERSION(25,2,0)
|
||||
+ codeToGID = std::move(src);
|
||||
+#else
|
||||
codeToGID.reserve(n);
|
||||
codeToGID.insert(codeToGID.begin(), src, src + n);
|
||||
gfree(src);
|
||||
+#endif
|
||||
delete ff1c;
|
||||
}
|
||||
}
|
||||
@@ -495,14 +516,21 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref, FT_Li
|
||||
break;
|
||||
|
||||
case fontCIDType0COT:
|
||||
+#if POPPLER_CHECK_VERSION(25,2,0)
|
||||
+ if (!gfxcid->getCIDToGID().empty()) {
|
||||
+ const auto src = gfxcid->getCIDToGID();
|
||||
+ codeToGID = std::move(src);
|
||||
+ }
|
||||
+#else
|
||||
if (gfxcid->getCIDToGID()) {
|
||||
n = gfxcid->getCIDToGIDLen();
|
||||
if (n) {
|
||||
- const int *src = gfxcid->getCIDToGID();
|
||||
+ const auto src = gfxcid->getCIDToGID();
|
||||
codeToGID.reserve(n);
|
||||
codeToGID.insert(codeToGID.begin(), src, src + n);
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
if (codeToGID.empty()) {
|
||||
if (!useCIDs) {
|
||||
@@ -518,10 +546,14 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref, FT_Li
|
||||
}
|
||||
if (ff) {
|
||||
if (ff->isOpenTypeCFF()) {
|
||||
- int *src = ff->getCIDToGIDMap(&n);
|
||||
+ auto src = ff1c->_POPPLER_GET_CID_TO_GID_MAP(&n);
|
||||
+#if POPPLER_CHECK_VERSION(25,2,0)
|
||||
+ codeToGID = std::move(src);
|
||||
+#else
|
||||
codeToGID.reserve(n);
|
||||
codeToGID.insert(codeToGID.begin(), src, src + n);
|
||||
gfree(src);
|
||||
+#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
|
||||
index b7a54828e74..a67132ba6bd 100644
|
||||
--- a/src/extension/internal/pdfinput/poppler-transition-api.h
|
||||
+++ b/src/extension/internal/pdfinput/poppler-transition-api.h
|
||||
@@ -15,6 +15,20 @@
|
||||
#include <glib/poppler-features.h>
|
||||
#include <poppler/UTF.h>
|
||||
|
||||
+#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()
|
||||
+#else
|
||||
+#define _POPPLER_GET_CODE_TO_GID_MAP(ff, len) getCodeToGIDMap(ff, len)
|
||||
+#define _POPPLER_GET_CID_TO_GID_MAP(len) getCIDToGIDMap(len)
|
||||
+#endif
|
||||
+
|
||||
+#if POPPLER_CHECK_VERSION(24,12,0)
|
||||
+#define _POPPLER_GET_IMAGE_PARAMS(bits, csMode, hasAlpha) getImageParams(bits, csMode, hasAlpha)
|
||||
+#else
|
||||
+#define _POPPLER_GET_IMAGE_PARAMS(bits, csMode, hasAlpha) getImageParams(bits, csMode)
|
||||
+#endif
|
||||
+
|
||||
#if POPPLER_CHECK_VERSION(24, 10, 0)
|
||||
#define _POPPLER_CONSUME_UNIQPTR_ARG(value) std::move(value)
|
||||
#else
|
||||
@@ -39,12 +53,6 @@
|
||||
#define _POPPLER_FUNCTION_TYPE_STITCHING 3
|
||||
#endif
|
||||
|
||||
-#if POPPLER_CHECK_VERSION(24,12,0)
|
||||
-#define _POPPLER_GET_IMAGE_PARAMS(bits, csMode, hasAlpha) getImageParams(bits, csMode, hasAlpha)
|
||||
-#else
|
||||
-#define _POPPLER_GET_IMAGE_PARAMS(bits, csMode, hasAlpha) getImageParams(bits, csMode)
|
||||
-#endif
|
||||
-
|
||||
#if POPPLER_CHECK_VERSION(22, 4, 0)
|
||||
#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
|
||||
#else
|
||||
--
|
||||
GitLab
|
||||
|
||||
@ -1,123 +0,0 @@
|
||||
From https://gitlab.com/inkscape/inkscape/-/merge_requests/7264
|
||||
|
||||
From 97bd8f29a61e691ceea98ca2444b974cf4256ae0 Mon Sep 17 00:00:00 2001
|
||||
From: Rafael Siejakowski <rs@rs-math.net>
|
||||
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.
|
||||
|
||||
Backported from MR 7261
|
||||
https://gitlab.com/inkscape/inkscape/-/merge_requests/7261
|
||||
|
||||
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 01d7bf6ef0e..0d31eda16f4 100644
|
||||
--- a/src/extension/internal/pdfinput/pdf-parser.cpp
|
||||
+++ b/src/extension/internal/pdfinput/pdf-parser.cpp
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
+#include <memory>
|
||||
#include <mutex> // std::call_once()
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@@ -686,7 +687,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;
|
||||
@@ -744,13 +744,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<char *>("Default")) || obj2.isName(const_cast<char *>("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) {
|
||||
@@ -763,12 +764,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");
|
||||
@@ -790,8 +793,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);
|
||||
@@ -835,9 +837,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 <glib/poppler-features.h>
|
||||
#include <poppler/UTF.h>
|
||||
|
||||
+#if POPPLER_CHECK_VERSION(25, 6, 0)
|
||||
+#define _POPPLER_DECLARE_TRANSFER_FUNCTION_VECTOR(name) std::vector<std::unique_ptr<Function>> 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
|
||||
|
||||
@ -1,135 +0,0 @@
|
||||
https://gitlab.com/inkscape/inkscape/-/merge_requests/7321
|
||||
|
||||
From 7f4f106b5438be1546052ebeebcfe3e8196d5884 Mon Sep 17 00:00:00 2001
|
||||
From: KrIr17 <elendil.krir17@gmail.com>
|
||||
Date: Sun, 6 Jul 2025 15:42:13 +0200
|
||||
Subject: [PATCH] Fix building with Poppler 25.07.0
|
||||
|
||||
Fix building issues with
|
||||
|
||||
1. [`GfxState::shift()`](https://gitlab.freedesktop.org/poppler/poppler/-/commit/71bf5552d448a6fdb666f2b61764b61ca197617d)
|
||||
|
||||
2. [`FoFiTrueType::make` and `FoFiType1C::make`](FoFiTrueType::make)
|
||||
|
||||
3. Fix typo from 5c4c6d116dae5250d75d34a45f0d9220824d2e20
|
||||
---
|
||||
src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++--
|
||||
.../pdfinput/poppler-cairo-font-engine.cpp | 16 +++++++++++-----
|
||||
.../internal/pdfinput/poppler-transition-api.h | 14 ++++++++++++++
|
||||
3 files changed, 27 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
|
||||
index f46d12f72e5..4071e464a44 100644
|
||||
--- a/src/extension/internal/pdfinput/pdf-parser.cpp
|
||||
+++ b/src/extension/internal/pdfinput/pdf-parser.cpp
|
||||
@@ -2322,11 +2322,11 @@ void PdfParser::doShowText(GooString *s) {
|
||||
state->textTransformDelta(originX, originY, &tOriginX, &tOriginY);
|
||||
|
||||
// In Gfx.cc this is drawChar(...)
|
||||
- builder->addChar(state, state->getCurX() + riseX, state->getCurY() + riseY,
|
||||
+ builder->addChar(state, state->_POPPLER_GET_CUR_TEXT_X() + riseX, state->_POPPLER_GET_CUR_TEXT_Y() + riseY,
|
||||
dx, dy, tOriginX, tOriginY, code, n, u, uLen);
|
||||
|
||||
// Move onto next unicode character.
|
||||
- state->shift(tdx, tdy);
|
||||
+ state->_POPPLER_TEXT_SHIFT_WITH_USER_COORDS(tdx, tdy);
|
||||
p += n;
|
||||
len -= n;
|
||||
}
|
||||
diff --git a/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp b/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp
|
||||
index bd1d4e49367..cfc6961f629 100644
|
||||
--- a/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp
|
||||
+++ b/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp
|
||||
@@ -316,7 +316,11 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref, FT_Li
|
||||
#endif
|
||||
char **enc;
|
||||
const char *name;
|
||||
+#if POPPLER_CHECK_VERSION(25, 7, 0)
|
||||
+ std::unique_ptr<FoFiType1C> ff1c;
|
||||
+#else
|
||||
FoFiType1C *ff1c;
|
||||
+#endif
|
||||
std::optional<FreeTypeFontFace> font_face;
|
||||
std::vector<int> codeToGID;
|
||||
bool substitute = false;
|
||||
@@ -427,7 +431,7 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref, FT_Li
|
||||
FoFiTrueType *ff;
|
||||
#endif
|
||||
if (!font_data.empty()) {
|
||||
- ff = FoFiTrueType::make((fontchar)font_data.data(), font_data.size(), 0);
|
||||
+ ff = _POPPLER_FOFI_TRUETYPE_MAKE(font_data, 0);
|
||||
} else {
|
||||
ff = FoFiTrueType::load(fileName.c_str(), 0);
|
||||
}
|
||||
@@ -457,7 +461,7 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref, FT_Li
|
||||
FoFiTrueType *ff;
|
||||
#endif
|
||||
if (!font_data.empty()) {
|
||||
- ff = FoFiTrueType::make((fontchar)font_data.data(), font_data.size(), 0);
|
||||
+ ff = _POPPLER_FOFI_TRUETYPE_MAKE(font_data, 0);
|
||||
} else {
|
||||
ff = FoFiTrueType::load(fileName.c_str(), 0);
|
||||
}
|
||||
@@ -491,7 +495,7 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref, FT_Li
|
||||
case fontCIDType0C:
|
||||
if (!useCIDs) {
|
||||
if (!font_data.empty()) {
|
||||
- ff1c = FoFiType1C::make((fontchar)font_data.data(), font_data.size());
|
||||
+ ff1c = _POPPLER_FOFI_TYPE1C_MAKE(font_data);
|
||||
} else {
|
||||
ff1c = FoFiType1C::load(fileName.c_str());
|
||||
}
|
||||
@@ -504,7 +508,9 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref, FT_Li
|
||||
codeToGID.insert(codeToGID.begin(), src, src + n);
|
||||
gfree(src);
|
||||
#endif
|
||||
+#if !(POPPLER_CHECK_VERSION(25, 7, 0))
|
||||
delete ff1c;
|
||||
+#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -540,13 +546,13 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref, FT_Li
|
||||
FoFiTrueType *ff;
|
||||
#endif
|
||||
if (!font_data.empty()) {
|
||||
- ff = FoFiTrueType::make((fontchar)font_data.data(), font_data.size(), 0);
|
||||
+ ff = _POPPLER_FOFI_TRUETYPE_MAKE(font_data, 0);
|
||||
} else {
|
||||
ff = FoFiTrueType::load(fileName.c_str(), 0);
|
||||
}
|
||||
if (ff) {
|
||||
if (ff->isOpenTypeCFF()) {
|
||||
- auto src = ff1c->_POPPLER_GET_CID_TO_GID_MAP(&n);
|
||||
+ auto src = ff->_POPPLER_GET_CID_TO_GID_MAP(&n);
|
||||
#if POPPLER_CHECK_VERSION(25,2,0)
|
||||
codeToGID = std::move(src);
|
||||
#else
|
||||
diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
|
||||
index d04412757bc..866b630bb67 100644
|
||||
--- a/src/extension/internal/pdfinput/poppler-transition-api.h
|
||||
+++ b/src/extension/internal/pdfinput/poppler-transition-api.h
|
||||
@@ -15,6 +15,20 @@
|
||||
#include <glib/poppler-features.h>
|
||||
#include <poppler/UTF.h>
|
||||
|
||||
+#if POPPLER_CHECK_VERSION(25, 7, 0)
|
||||
+#define _POPPLER_TEXT_SHIFT_WITH_USER_COORDS(dx, dy) textShiftWithUserCoords(dx, dy)
|
||||
+#define _POPPLER_FOFI_TRUETYPE_MAKE(font_data, faceIndex) FoFiTrueType::make(std::span(font_data), faceIndex)
|
||||
+#define _POPPLER_FOFI_TYPE1C_MAKE(font_data) FoFiType1C::make(std::span(font_data))
|
||||
+#define _POPPLER_GET_CUR_TEXT_X() getCurTextX()
|
||||
+#define _POPPLER_GET_CUR_TEXT_Y() getCurTextY()
|
||||
+#else
|
||||
+#define _POPPLER_TEXT_SHIFT_WITH_USER_COORDS(dx, dy) shift(dx, dy)
|
||||
+#define _POPPLER_FOFI_TRUETYPE_MAKE(font_data, faceIndex) FoFiTrueType::make((fontchar)font_data.data(), font_data.size(), faceIndex)
|
||||
+#define _POPPLER_FOFI_TYPE1C_MAKE(font_data) FoFiType1C::make((fontchar)font_data.data(), font_data.size())
|
||||
+#define _POPPLER_GET_CUR_TEXT_X() getCurX()
|
||||
+#define _POPPLER_GET_CUR_TEXT_Y() getCurY()
|
||||
+#endif
|
||||
+
|
||||
#if POPPLER_CHECK_VERSION(25, 6, 0)
|
||||
#define _POPPLER_DECLARE_TRANSFER_FUNCTION_VECTOR(name) std::vector<std::unique_ptr<Function>> name(4)
|
||||
#define _POPPLER_DELETE_TRANSFER_FUNCTION(name) name.reset()
|
||||
--
|
||||
GitLab
|
||||
|
||||
@ -1,109 +0,0 @@
|
||||
From b60d81745016b5f20d4c6aec6d073b8a6f3e499c Mon Sep 17 00:00:00 2001
|
||||
From: mike kowalski <michal_kowalski@hotmail.com>
|
||||
Date: Tue, 2 Sep 2025 07:17:25 -0700
|
||||
Subject: [PATCH] Fix build with poppler 25.09.0
|
||||
|
||||
API changes: double* -> std::array necessitates fixes in Inkscape.
|
||||
The goal is to make it build with older poppler versions too.
|
||||
---
|
||||
src/extension/internal/pdfinput/pdf-parser.cpp | 3 +--
|
||||
src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp | 2 +-
|
||||
src/extension/internal/pdfinput/poppler-utils.cpp | 4 ++++
|
||||
src/extension/internal/pdfinput/poppler-utils.h | 4 ++++
|
||||
src/extension/internal/pdfinput/svg-builder.cpp | 4 ++--
|
||||
5 files changed, 12 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
|
||||
index 50d5e8ef8e1..1bdd0c6374c 100644
|
||||
--- a/src/extension/internal/pdfinput/pdf-parser.cpp
|
||||
+++ b/src/extension/internal/pdfinput/pdf-parser.cpp
|
||||
@@ -1656,12 +1656,11 @@ void PdfParser::doFunctionShFill1(GfxFunctionShading *shading,
|
||||
GfxColor color0M, color1M, colorM0, colorM1, colorMM;
|
||||
GfxColor colors2[4];
|
||||
double functionColorDelta = colorDeltas[pdfFunctionShading-1];
|
||||
- const double *matrix;
|
||||
double xM, yM;
|
||||
int nComps, i, j;
|
||||
|
||||
nComps = shading->getColorSpace()->getNComps();
|
||||
- matrix = shading->getMatrix();
|
||||
+ const auto& matrix = shading->getMatrix();
|
||||
|
||||
// compare the four corner colors
|
||||
for (i = 0; i < 4; ++i) {
|
||||
diff --git a/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp b/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp
|
||||
index cfc6961f629..986c19e1d81 100644
|
||||
--- a/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp
|
||||
+++ b/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp
|
||||
@@ -633,7 +633,7 @@ static cairo_status_t _init_type3_glyph(cairo_scaled_font_t *scaled_font, cairo_
|
||||
|
||||
info = (type3_font_info_t *)cairo_font_face_get_user_data(cairo_scaled_font_get_font_face(scaled_font),
|
||||
&type3_font_key);
|
||||
- const double *mat = info->font->getFontBBox();
|
||||
+ const auto& mat = info->font->getFontBBox();
|
||||
extents->ascent = mat[3]; /* y2 */
|
||||
extents->descent = -mat[3]; /* -y1 */
|
||||
extents->height = extents->ascent + extents->descent;
|
||||
diff --git a/src/extension/internal/pdfinput/poppler-utils.cpp b/src/extension/internal/pdfinput/poppler-utils.cpp
|
||||
index 6af37ce7f95..a50f59001bb 100644
|
||||
--- a/src/extension/internal/pdfinput/poppler-utils.cpp
|
||||
+++ b/src/extension/internal/pdfinput/poppler-utils.cpp
|
||||
@@ -39,6 +39,10 @@ Geom::Affine ctmToAffine(const double *ctm)
|
||||
return Geom::Affine(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
|
||||
}
|
||||
|
||||
+Geom::Affine ctmToAffine(const std::array<double, 6>& ctm) {
|
||||
+ return ctmToAffine(ctm.data());
|
||||
+}
|
||||
+
|
||||
void ctmout(const char *label, const double *ctm)
|
||||
{
|
||||
std::cout << "C:" << label << ":" << ctm[0] << "," << ctm[1] << "," << ctm[2] << "," << ctm[3] << "," << ctm[4]
|
||||
diff --git a/src/extension/internal/pdfinput/poppler-utils.h b/src/extension/internal/pdfinput/poppler-utils.h
|
||||
index 705665a8cd6..55c7ae4da54 100644
|
||||
--- a/src/extension/internal/pdfinput/poppler-utils.h
|
||||
+++ b/src/extension/internal/pdfinput/poppler-utils.h
|
||||
@@ -13,6 +13,7 @@
|
||||
#ifndef POPPLER_UTILS_H
|
||||
#define POPPLER_UTILS_H
|
||||
|
||||
+#include <array>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
@@ -36,7 +37,10 @@ class Ref;
|
||||
class XRef;
|
||||
|
||||
Geom::Affine stateToAffine(GfxState *state);
|
||||
+// this function is for Poppler older than v25.09.0
|
||||
Geom::Affine ctmToAffine(const double *ctm);
|
||||
+// this flavor is for Poppler v25.09.0 and above
|
||||
+Geom::Affine ctmToAffine(const std::array<double, 6>& ctm);
|
||||
|
||||
void ctmout(const char *label, const double *ctm);
|
||||
void affout(const char *label, Geom::Affine affine);
|
||||
diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
|
||||
index d612602738f..fbc39653c38 100644
|
||||
--- a/src/extension/internal/pdfinput/svg-builder.cpp
|
||||
+++ b/src/extension/internal/pdfinput/svg-builder.cpp
|
||||
@@ -1136,7 +1136,7 @@ gchar *SvgBuilder::_createTilingPattern(GfxTilingPattern *tiling_pattern,
|
||||
pattern_node->setAttribute("patternUnits", "userSpaceOnUse");
|
||||
// Set pattern tiling
|
||||
// FIXME: don't ignore XStep and YStep
|
||||
- const double *bbox = tiling_pattern->getBBox();
|
||||
+ const auto& bbox = tiling_pattern->getBBox();
|
||||
pattern_node->setAttributeSvgDouble("x", 0.0);
|
||||
pattern_node->setAttributeSvgDouble("y", 0.0);
|
||||
pattern_node->setAttributeSvgDouble("width", bbox[2] - bbox[0]);
|
||||
@@ -1367,7 +1367,7 @@ void SvgBuilder::updateFont(GfxState *state, std::shared_ptr<CairoFont> cairo_fo
|
||||
|
||||
auto new_font_size = state->getFontSize();
|
||||
if (font->getType() == fontType3) {
|
||||
- const double *font_matrix = font->getFontMatrix();
|
||||
+ const auto& font_matrix = font->getFontMatrix();
|
||||
if (font_matrix[0] != 0.0) {
|
||||
new_font_size *= font_matrix[3] / font_matrix[0];
|
||||
}
|
||||
--
|
||||
GitLab
|
||||
|
||||
@ -1,213 +0,0 @@
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
# Remember to check the release notes for a 'Important Changes for Packagers'
|
||||
# section, e.g. https://inkscape.org/doc/release_notes/1.4/Inkscape_1.4.html#Important_Changes_for_Packagers.
|
||||
|
||||
PYTHON_COMPAT=( python3_{10..13} )
|
||||
PYTHON_REQ_USE="xml(+)"
|
||||
|
||||
inherit cmake flag-o-matic xdg toolchain-funcs python-single-r1
|
||||
|
||||
MY_P="${P/_/}"
|
||||
DESCRIPTION="SVG based generic vector-drawing program"
|
||||
HOMEPAGE="https://inkscape.org/ https://gitlab.com/inkscape/inkscape/"
|
||||
|
||||
if [[ ${PV} = 9999* ]]; then
|
||||
inherit git-r3
|
||||
EGIT_REPO_URI="https://gitlab.com/inkscape/inkscape.git"
|
||||
else
|
||||
SRC_URI="https://media.inkscape.org/dl/resources/file/${MY_P}.tar.xz"
|
||||
KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~loong ppc ppc64 ~riscv ~sparc x86"
|
||||
fi
|
||||
|
||||
S="${WORKDIR}/${MY_P}"
|
||||
|
||||
LICENSE="GPL-2 LGPL-2.1"
|
||||
SLOT="0"
|
||||
IUSE="cdr dia exif graphicsmagick imagemagick inkjar jpeg openmp postscript readline sourceview spell svg2 test visio wpg X"
|
||||
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
||||
# Lots of test failures which need investigating, bug #871621
|
||||
RESTRICT="!test? ( test ) test"
|
||||
|
||||
BDEPEND="
|
||||
dev-util/glib-utils
|
||||
>=sys-devel/gettext-0.17
|
||||
virtual/pkgconfig
|
||||
test? ( virtual/imagemagick-tools )
|
||||
"
|
||||
COMMON_DEPEND="${PYTHON_DEPS}
|
||||
>=app-text/poppler-0.57.0:=[cairo]
|
||||
>=dev-cpp/cairomm-1.12:0
|
||||
>=dev-cpp/glibmm-2.58:2
|
||||
dev-cpp/gtkmm:3.0
|
||||
>=dev-cpp/pangomm-2.40:1.4
|
||||
>=dev-libs/boehm-gc-7.1:=
|
||||
dev-libs/boost:=[stacktrace(-)]
|
||||
dev-libs/double-conversion:=
|
||||
>=dev-libs/glib-2.41
|
||||
>=dev-libs/libsigc++-2.8:2
|
||||
>=dev-libs/libxml2-2.7.4:=
|
||||
>=dev-libs/libxslt-1.1.25
|
||||
dev-libs/popt
|
||||
media-gfx/potrace
|
||||
media-libs/libepoxy
|
||||
media-libs/fontconfig
|
||||
media-libs/freetype:2
|
||||
media-libs/lcms:2
|
||||
media-libs/libpng:0=
|
||||
sci-libs/gsl:=
|
||||
>=x11-libs/pango-1.44
|
||||
x11-libs/gtk+:3[X?]
|
||||
X? ( x11-libs/libX11 )
|
||||
$(python_gen_cond_dep '
|
||||
dev-python/appdirs[${PYTHON_USEDEP}]
|
||||
dev-python/cachecontrol[${PYTHON_USEDEP}]
|
||||
dev-python/cssselect[${PYTHON_USEDEP}]
|
||||
dev-python/filelock[${PYTHON_USEDEP}]
|
||||
dev-python/lockfile[${PYTHON_USEDEP}]
|
||||
dev-python/lxml[${PYTHON_USEDEP}]
|
||||
dev-python/pillow[jpeg?,tiff,webp,${PYTHON_USEDEP}]
|
||||
dev-python/tinycss2[${PYTHON_USEDEP}]
|
||||
media-gfx/scour[${PYTHON_USEDEP}]
|
||||
')
|
||||
cdr? (
|
||||
app-text/libwpg:0.3
|
||||
dev-libs/librevenge
|
||||
media-libs/libcdr
|
||||
)
|
||||
exif? ( media-libs/libexif )
|
||||
imagemagick? (
|
||||
!graphicsmagick? ( media-gfx/imagemagick:=[cxx] )
|
||||
graphicsmagick? ( media-gfx/graphicsmagick:=[cxx] )
|
||||
)
|
||||
jpeg? ( media-libs/libjpeg-turbo:= )
|
||||
readline? ( sys-libs/readline:= )
|
||||
sourceview? ( x11-libs/gtksourceview:4 )
|
||||
spell? ( app-text/gspell:= )
|
||||
visio? (
|
||||
app-text/libwpg:0.3
|
||||
dev-libs/librevenge
|
||||
media-libs/libvisio
|
||||
)
|
||||
wpg? (
|
||||
app-text/libwpg:0.3
|
||||
dev-libs/librevenge
|
||||
)
|
||||
"
|
||||
# These only use executables provided by these packages
|
||||
# See share/extensions for more details. inkscape can tell you to
|
||||
# install these so we could of course just not depend on those and rely
|
||||
# on that.
|
||||
RDEPEND="${COMMON_DEPEND}
|
||||
$(python_gen_cond_dep '
|
||||
dev-python/numpy[${PYTHON_USEDEP}]
|
||||
')
|
||||
dia? ( app-office/dia )
|
||||
postscript? ( app-text/ghostscript-gpl )
|
||||
"
|
||||
DEPEND="${COMMON_DEPEND}
|
||||
test? ( dev-cpp/gtest )
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-1.4-gcc15.patch
|
||||
"${FILESDIR}"/${PN}-1.4-poppler-24.10-fix-backport.patch
|
||||
"${FILESDIR}"/${P}-poppler-24.{11,12}.0.patch # bugs 943499, 946597
|
||||
"${FILESDIR}"/${P}-poppler-25.{02,06,07,09}.0.patch # bugs 949531, 957137, 962278
|
||||
"${FILESDIR}"/${P}-cmake4.patch
|
||||
)
|
||||
|
||||
pkg_pretend() {
|
||||
[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
|
||||
python-single-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ ${PV} = 9999* ]]; then
|
||||
git-r3_src_unpack
|
||||
else
|
||||
default
|
||||
fi
|
||||
[[ -d "${S}" ]] || mv -v "${WORKDIR}/${P/_/-}_202"?-??-* "${S}" || die
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
rm -r src/3rdparty/2geom/tests || die # bug 958419
|
||||
cmake_src_prepare
|
||||
sed -i "/install.*COPYING/d" CMakeScripts/ConfigCPack.cmake || die
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
# ODR violation (https://gitlab.com/inkscape/lib2geom/-/issues/71, bug #859628)
|
||||
filter-lto
|
||||
# Aliasing unsafe (bug #310393)
|
||||
append-flags -fno-strict-aliasing
|
||||
|
||||
local mycmakeargs=(
|
||||
# -DWITH_LPETOOL # Compile with LPE Tool and experimental LPEs enabled
|
||||
-DWITH_NLS=ON
|
||||
-DENABLE_POPPLER=ON
|
||||
-DENABLE_POPPLER_CAIRO=ON
|
||||
-DWITH_PROFILING=OFF
|
||||
-DWITH_INTERNAL_2GEOM=ON
|
||||
-DBUILD_TESTING=$(usex test)
|
||||
-DWITH_LIBCDR=$(usex cdr)
|
||||
-DWITH_IMAGE_MAGICK=$(usex imagemagick $(usex !graphicsmagick)) # requires ImageMagick 6, only IM must be enabled
|
||||
-DWITH_GRAPHICS_MAGICK=$(usex graphicsmagick $(usex imagemagick)) # both must be enabled to use GraphicsMagick
|
||||
-DWITH_GNU_READLINE=$(usex readline)
|
||||
-DWITH_GSPELL=$(usex spell)
|
||||
-DWITH_JEMALLOC=OFF
|
||||
-DENABLE_LCMS=ON
|
||||
-DWITH_OPENMP=$(usex openmp)
|
||||
-DBUILD_SHARED_LIBS=ON
|
||||
-DWITH_GSOURCEVIEW=$(usex sourceview)
|
||||
-DWITH_SVG2=$(usex svg2)
|
||||
-DWITH_LIBVISIO=$(usex visio)
|
||||
-DWITH_LIBWPG=$(usex wpg)
|
||||
-DWITH_X11=$(usex X)
|
||||
)
|
||||
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
src_test() {
|
||||
CMAKE_SKIP_TESTS=(
|
||||
# render_text*: needs patched Cairo / maybe upstream changes
|
||||
# not yet in a release.
|
||||
# test_lpe/test_lpe64: precision differences b/c of new GCC?
|
||||
# cli_export-png-color-mode-gray-8_png_check_output: ditto?
|
||||
render_test-use
|
||||
render_test-glyph-y-pos
|
||||
render_text-glyphs-combining
|
||||
render_text-glyphs-vertical
|
||||
render_test-rtl-vertical
|
||||
test_lpe
|
||||
test_lpe64
|
||||
cli_export-png-color-mode-gray-8_png_check_output
|
||||
)
|
||||
|
||||
# bug #871621
|
||||
cmake_src_compile tests
|
||||
cmake_src_test -j1
|
||||
}
|
||||
|
||||
src_install() {
|
||||
cmake_src_install
|
||||
|
||||
find "${ED}" -type f -name "*.la" -delete || die
|
||||
find "${ED}"/usr/share/man -type f -maxdepth 3 -name '*.bz2' -exec bzip2 -d {} \; || die
|
||||
find "${ED}"/usr/share/man -type f -maxdepth 3 -name '*.gz' -exec gzip -d {} \; || die
|
||||
|
||||
local extdir="${ED}"/usr/share/${PN}/extensions
|
||||
if [[ -e "${extdir}" ]] && [[ -n $(find "${extdir}" -mindepth 1) ]]; then
|
||||
python_fix_shebang "${ED}"/usr/share/${PN}/extensions
|
||||
python_optimize "${ED}"/usr/share/${PN}/extensions
|
||||
fi
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user