From ef8698bef17b34d85e2054d687096c0c6a973c264837b41541d9af1701c0a872 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Wed, 3 Jul 2024 05:06:24 +0000 Subject: [PATCH] - added patches fix https://gitlab.com/inkscape/inkscape/-/commit/96ca7a6c215aa14336b52753f56244dc8796ec43 + inkscape-poppler-24.05.0.patch fix https://gitlab.com/inkscape/inkscape/-/commit/877fc26483f74f951eab516f1b57b136780a8c78 + inkscape-poppler-c++20-2.patch fix https://gitlab.com/inkscape/inkscape/-/commit/1798e9c13b786f3d077ba0132592c4d5c1d1fb9b + inkscape-poppler-c++20.patch OBS-URL: https://build.opensuse.org/package/show/graphics/inkscape?expand=0&rev=117 --- inkscape-poppler-24.05.0.patch | 46 ++++++++++++++++++++ inkscape-poppler-c++20-2.patch | 13 ++++++ inkscape-poppler-c++20.patch | 76 ++++++++++++++++++++++++++++++++++ inkscape.changes | 11 +++++ inkscape.spec | 6 +++ 5 files changed, 152 insertions(+) create mode 100644 inkscape-poppler-24.05.0.patch create mode 100644 inkscape-poppler-c++20-2.patch create mode 100644 inkscape-poppler-c++20.patch diff --git a/inkscape-poppler-24.05.0.patch b/inkscape-poppler-24.05.0.patch new file mode 100644 index 0000000..82fe07a --- /dev/null +++ b/inkscape-poppler-24.05.0.patch @@ -0,0 +1,46 @@ +Index: inkscape-1.3.2_2023-11-25_091e20ef0f/src/extension/internal/pdfinput/poppler-transition-api.h +=================================================================== +--- inkscape-1.3.2_2023-11-25_091e20ef0f.orig/src/extension/internal/pdfinput/poppler-transition-api.h ++++ inkscape-1.3.2_2023-11-25_091e20ef0f/src/extension/internal/pdfinput/poppler-transition-api.h +@@ -13,6 +13,15 @@ + #define SEEN_POPPLER_TRANSITION_API_H + + #include ++#include ++ ++#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(22, 4, 0) + #define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get()) +Index: inkscape-1.3.2_2023-11-25_091e20ef0f/src/extension/internal/pdfinput/poppler-utils.cpp +=================================================================== +--- inkscape-1.3.2_2023-11-25_091e20ef0f.orig/src/extension/internal/pdfinput/poppler-utils.cpp ++++ inkscape-1.3.2_2023-11-25_091e20ef0f/src/extension/internal/pdfinput/poppler-utils.cpp +@@ -12,6 +12,8 @@ + + #include "poppler-utils.h" + ++#include ++ + #include "2geom/affine.h" + #include "GfxFont.h" + #include "GfxState.h" +@@ -563,10 +565,10 @@ std::string getDictString(Dict *dict, co + */ + 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); + } diff --git a/inkscape-poppler-c++20-2.patch b/inkscape-poppler-c++20-2.patch new file mode 100644 index 0000000..30b74c5 --- /dev/null +++ b/inkscape-poppler-c++20-2.patch @@ -0,0 +1,13 @@ +Index: inkscape-1.3.2_2023-11-25_091e20ef0f/src/ui/dialog/filter-effects-dialog.cpp +=================================================================== +--- inkscape-1.3.2_2023-11-25_091e20ef0f.orig/src/ui/dialog/filter-effects-dialog.cpp ++++ inkscape-1.3.2_2023-11-25_091e20ef0f/src/ui/dialog/filter-effects-dialog.cpp +@@ -202,7 +202,7 @@ public: + template< typename T> class ComboWithTooltip : public Gtk::EventBox + { + public: +- ComboWithTooltip(T default_value, const Util::EnumDataConverter& c, const SPAttr a = SPAttr::INVALID, char* tip_text = nullptr) ++ ComboWithTooltip(T const default_value, Util::EnumDataConverter const &c, SPAttr const a = SPAttr::INVALID, char* tip_text = nullptr) + { + if (tip_text) { + set_tooltip_text(tip_text); diff --git a/inkscape-poppler-c++20.patch b/inkscape-poppler-c++20.patch new file mode 100644 index 0000000..09be8f2 --- /dev/null +++ b/inkscape-poppler-c++20.patch @@ -0,0 +1,76 @@ +Index: inkscape-1.3.2_2023-11-25_091e20ef0f/CMakeLists.txt +=================================================================== +--- inkscape-1.3.2_2023-11-25_091e20ef0f.orig/CMakeLists.txt ++++ inkscape-1.3.2_2023-11-25_091e20ef0f/CMakeLists.txt +@@ -18,9 +18,9 @@ message("Binary Dir: ${CMAKE_CURRENT_BIN + # ----------------------------------------------------------------------------- + # 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 ++# set(CMAKE_CXX_EXTENSIONS OFF) # enforces -std=c++20 instead of -std=gnu++20 + # TODO: build currently fails with it as we actually depend on GNU compiler extensions... + + list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeScripts/Modules") +Index: inkscape-1.3.2_2023-11-25_091e20ef0f/_clang-format +=================================================================== +--- inkscape-1.3.2_2023-11-25_091e20ef0f.orig/_clang-format ++++ inkscape-1.3.2_2023-11-25_091e20ef0f/_clang-format +@@ -103,7 +103,7 @@ SpacesInContainerLiterals: false + SpacesInCStyleCastParentheses: false + SpacesInParentheses: false + SpacesInSquareBrackets: false +-Standard: c++17 ++Standard: c++20 + StatementMacros: [] + TypenameMacros: [] + TabWidth: 4 +Index: inkscape-1.3.2_2023-11-25_091e20ef0f/src/ui/knot/knot-holder-entity.cpp +=================================================================== +--- inkscape-1.3.2_2023-11-25_091e20ef0f.orig/src/ui/knot/knot-holder-entity.cpp ++++ inkscape-1.3.2_2023-11-25_091e20ef0f/src/ui/knot/knot-holder-entity.cpp +@@ -329,7 +329,7 @@ PatternKnotHolderEntityScale::knot_set(G + double scale_x = std::clamp(new_extent[X] / _cached_diagonal[X], _cached_min_scale, 1e9); + double scale_y = std::clamp(new_extent[Y] / _cached_diagonal[Y], _cached_min_scale, 1e9); + +- Affine new_transform = (state & GDK_CONTROL_MASK) ? Scale(lerp(0.5, scale_x, scale_y)) ++ Affine new_transform = (state & GDK_CONTROL_MASK) ? Scale((scale_x + scale_y) * 0.5) + : Scale(scale_x, scale_y); + + // 2. Calculate offset to keep pattern origin aligned +Index: inkscape-1.3.2_2023-11-25_091e20ef0f/src/ui/tools/pencil-tool.cpp +=================================================================== +--- inkscape-1.3.2_2023-11-25_091e20ef0f.orig/src/ui/tools/pencil-tool.cpp ++++ inkscape-1.3.2_2023-11-25_091e20ef0f/src/ui/tools/pencil-tool.cpp +@@ -17,7 +17,11 @@ + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + +-#include // For std::accumulate ++#include "pencil-tool.h" ++ ++#include // std::lerp ++#include // std::accumulate ++ + #include + #include + +@@ -26,7 +30,6 @@ + #include <2geom/sbasis-to-bezier.h> + #include <2geom/svg-path-parser.h> + +-#include "pencil-tool.h" + + #include "context-fns.h" + #include "desktop.h" +@@ -814,7 +817,7 @@ void PencilTool::_addFreehandPoint(Geom: + min = max; + } + double dezoomify_factor = 0.05 * 1000 / _desktop->current_zoom(); +- double const pressure_shrunk = pressure * (max - min) + min; // C++20 -> use std::lerp() ++ double const pressure_shrunk = std::lerp(min, max, pressure); + double pressure_computed = std::abs(pressure_shrunk * dezoomify_factor); + double pressure_computed_scaled = std::abs(pressure_computed * _desktop->getDocument()->getDocumentScale().inverse()[Geom::X]); + if (p != this->p[this->_npoints - 1]) { diff --git a/inkscape.changes b/inkscape.changes index edc9e30..cf769ac 100644 --- a/inkscape.changes +++ b/inkscape.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Tue Jul 2 15:12:33 UTC 2024 - pgajdos@suse.com + +- added patches + fix https://gitlab.com/inkscape/inkscape/-/commit/96ca7a6c215aa14336b52753f56244dc8796ec43 + + inkscape-poppler-24.05.0.patch + fix https://gitlab.com/inkscape/inkscape/-/commit/877fc26483f74f951eab516f1b57b136780a8c78 + + inkscape-poppler-c++20-2.patch + fix https://gitlab.com/inkscape/inkscape/-/commit/1798e9c13b786f3d077ba0132592c4d5c1d1fb9b + + inkscape-poppler-c++20.patch + ------------------------------------------------------------------- Thu Apr 18 14:13:05 UTC 2024 - Dominique Leuenberger diff --git a/inkscape.spec b/inkscape.spec index b34c996..e38b311 100644 --- a/inkscape.spec +++ b/inkscape.spec @@ -36,6 +36,12 @@ Source99: https://inkscape.org/~MarcJeanmougin/gpg#/%name.keyring Patch0: inkscape-poppler-24.03.0.patch # PATCH-FIX-UPSTREAM Patch1: https://gitlab.com/inkscape/inkscape/-/merge_requests/6089.patch#/inkscape-libxml2.12.patch +# https://gitlab.com/inkscape/inkscape/-/commit/1798e9c13b786f3d077ba0132592c4d5c1d1fb9b +Patch2: inkscape-poppler-c++20.patch +# https://gitlab.com/inkscape/inkscape/-/commit/96ca7a6c215aa14336b52753f56244dc8796ec43 +Patch3: inkscape-poppler-24.05.0.patch +# https://gitlab.com/inkscape/inkscape/-/commit/877fc26483f74f951eab516f1b57b136780a8c78 +Patch4: inkscape-poppler-c++20-2.patch BuildRequires: cmake BuildRequires: double-conversion-devel