-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
contrib/inkscape: rebuild against poppler 24.05
- Loading branch information
1 parent
f0a955a
commit 7291616
Showing
4 changed files
with
83 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
needed for string starts_with in poppler | ||
-- | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -18,7 +18,7 @@ | ||
# ----------------------------------------------------------------------------- | ||
# CMake Configuration | ||
# ----------------------------------------------------------------------------- | ||
-set(CMAKE_CXX_STANDARD 17) | ||
+set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
# set(CMAKE_CXX_EXTENSIONS OFF) # enforces -std=c++17 instead of -std=gnu++17 | ||
# TODO: build currently fails with it as we actually depend on GNU compiler extensions... |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
Patch-Source: https://gitlab.com/inkscape/inkscape/-/merge_requests/6403 | ||
-- | ||
From 96ca7a6c215aa14336b52753f56244dc8796ec43 Mon Sep 17 00:00:00 2001 | ||
From: Heiko Becker <[email protected]> | ||
Date: Fri, 3 May 2024 14:52:00 +0200 | ||
Subject: [PATCH] Fix build with poppler >= 24.05.0 | ||
|
||
GooString::hasUnicodeMarkerLE and GooString::hasUnicodeMarker were | ||
rename and moved to UTF.h [1][2] | ||
|
||
[1] https://gitlab.freedesktop.org/poppler/poppler/-/commit/98fabb298b0e8eaef9193bbce68c99c85473a314 | ||
[2] https://gitlab.freedesktop.org/poppler/poppler/-/commit/1f06dca08c32ed18c3030530d98a0e30d41dd7a2 | ||
--- | ||
src/extension/internal/pdfinput/poppler-transition-api.h | 9 +++++++++ | ||
src/extension/internal/pdfinput/poppler-utils.cpp | 6 ++++-- | ||
2 files changed, 13 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h | ||
index 58aa1ec921d..481aefadf46 100644 | ||
--- a/src/extension/internal/pdfinput/poppler-transition-api.h | ||
+++ b/src/extension/internal/pdfinput/poppler-transition-api.h | ||
@@ -13,6 +13,15 @@ | ||
#define SEEN_POPPLER_TRANSITION_API_H | ||
|
||
#include <glib/poppler-features.h> | ||
+#include <poppler/UTF.h> | ||
+ | ||
+#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())) | ||
+#else | ||
+#define _POPPLER_HAS_UNICODE_BOM(value) (value->hasUnicodeMarker()) | ||
+#define _POPPLER_HAS_UNICODE_BOMLE(value) (value->hasUnicodeMarkerLE()) | ||
+#endif | ||
|
||
#if POPPLER_CHECK_VERSION(24, 3, 0) | ||
#define _POPPLER_FUNCTION_TYPE_SAMPLED Function::Type::Sampled | ||
diff --git a/src/extension/internal/pdfinput/poppler-utils.cpp b/src/extension/internal/pdfinput/poppler-utils.cpp | ||
index 78d90c66c9d..c02815f64b9 100644 | ||
--- a/src/extension/internal/pdfinput/poppler-utils.cpp | ||
+++ b/src/extension/internal/pdfinput/poppler-utils.cpp | ||
@@ -12,6 +12,8 @@ | ||
|
||
#include "poppler-utils.h" | ||
|
||
+#include <poppler/UTF.h> | ||
+ | ||
#include "2geom/affine.h" | ||
#include "GfxFont.h" | ||
#include "GfxState.h" | ||
@@ -563,10 +565,10 @@ std::string getDictString(Dict *dict, const char *key) | ||
*/ | ||
std::string getString(const GooString *value) | ||
{ | ||
- if (value->hasUnicodeMarker()) { | ||
+ if (_POPPLER_HAS_UNICODE_BOM(value)) { | ||
return g_convert(value->getCString () + 2, value->getLength () - 2, | ||
"UTF-8", "UTF-16BE", NULL, NULL, NULL); | ||
- } else if (value->hasUnicodeMarkerLE()) { | ||
+ } else if (_POPPLER_HAS_UNICODE_BOMLE(value)) { | ||
return g_convert(value->getCString () + 2, value->getLength () - 2, | ||
"UTF-8", "UTF-16LE", NULL, NULL, NULL); | ||
} | ||
-- | ||
GitLab | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters