Skip to Content.
Sympa Menu

sm-commit - [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (f4832fb565db410cfbd43f90f0abe6efd0487c20)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org, sm-commit AT lists.sourcemage.org
  • Subject: [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (f4832fb565db410cfbd43f90f0abe6efd0487c20)
  • Date: Tue, 13 Aug 2024 08:52:49 +0000

GIT changes to master grimoire by Ismael Luceno <ismael AT sourcemage.org>:

graphics/inkscape/DETAILS | 8
graphics/inkscape/HISTORY | 11 +
graphics/inkscape/PRE_BUILD | 6
graphics/inkscape/patches/0001-include-missing-header-file.patch | 37
+++
graphics/inkscape/patches/0002-Fix-build-with-poppler-24.03.0.patch | 80
++++++++
graphics/inkscape/patches/0003-Fix-build-with-poppler-24.05.0.patch | 68
+++++++
graphics/inkscape/patches/0004-Up-C-version-to-C-20.patch | 95
++++++++++
7 files changed, 296 insertions(+), 9 deletions(-)

New commits:
commit f4832fb565db410cfbd43f90f0abe6efd0487c20
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

inkscape 1.3.2

diff --git a/graphics/inkscape/DETAILS b/graphics/inkscape/DETAILS
index 310476b..8fe7dcf 100755
--- a/graphics/inkscape/DETAILS
+++ b/graphics/inkscape/DETAILS
@@ -1,13 +1,13 @@
# Watch: https://inkscape.org/release/ /release/inkscape-([0-9.]+)/source/
. "$GRIMOIRE"/CMAKE_FUNCTIONS
SPELL=inkscape
- VERSION=1.1.2
- XVERSION=2022-02-04_0a00cf5339
- ITEM=31668
+ VERSION=1.3.2
+ XVERSION=2023-11-25_091e20ef0f
+ ITEM=44615
SOURCE=$SPELL-$VERSION.tar.xz
SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELL-${VERSION}_$XVERSION"
SOURCE_URL[0]="https://inkscape.org/gallery/item/$ITEM/$SOURCE";
-
SOURCE_HASH=sha512:55884f34e6fcc604027e7ea60f67702a658d3838332c1f3b56ec2cb05ab44992df0651ed741d6e7e807848366b24ee7415d0908ed1143b0bfb33ddbf26ae5c16
+
SOURCE_HASH=sha512:a6da4b676ba3e7f954f95e3916ce78ce358b49c8052795a52d478064ef02eeae0337b0a94e89b9752ea6824a5758d28072c2bbf83f1e9ee28daebd3b0ef87343
WEB_SITE=http://www.inkscape.org/
ENTERED=20031207
SECURITY_PATCH=2
diff --git a/graphics/inkscape/HISTORY b/graphics/inkscape/HISTORY
index 21947a5..007ba35 100644
--- a/graphics/inkscape/HISTORY
+++ b/graphics/inkscape/HISTORY
@@ -1,3 +1,14 @@
+2024-08-13 Ismael Luceno <ismael AT sourcemage.org>
+ * DETAILS: updated spell to 1.3.2
+ * patches/0001-include-missing-header-file.patch:
+ fixed build error due to missing include
+ * patches/0002-Fix-build-with-poppler-24.03.0.patch,
+ patches/0003-Fix-build-with-poppler-24.05.0.patch,
+ patches/0004-Up-C-version-to-C-20.patch:
+ fixed build against poppler >= 24.06.0
+ * PRE_BUILD: added apply_patch_dir;
+ removed patching of broken NULL usage in C++, not needed anymore
+
2022-11-08 Ismael Luceno <ismael AT sourcemage.org>
* DEPENDS: fixed typo in boost subdep

diff --git a/graphics/inkscape/PRE_BUILD b/graphics/inkscape/PRE_BUILD
index 8bd3147..c230ad1 100755
--- a/graphics/inkscape/PRE_BUILD
+++ b/graphics/inkscape/PRE_BUILD
@@ -1,7 +1,3 @@
default_pre_build &&
cd "$SOURCE_DIRECTORY" &&
-# XXX Inkscape wrongly uses NULL as a sentinel, which fails with musl
-# the C++ definition is generally problematic, so replace it with
nullptr.
-# See <https://ewontfix.com/11/> for more information.
-echo 'Replacing NULL with nullptr in C++ code:' &&
-find -name '*.[ch]pp' -print -exec sed -E -i 's/\<NULL\>/nullptr/g' {} +
+apply_patch_dir patches
diff --git a/graphics/inkscape/patches/0001-include-missing-header-file.patch
b/graphics/inkscape/patches/0001-include-missing-header-file.patch
new file mode 100644
index 0000000..f07b48a
--- /dev/null
+++ b/graphics/inkscape/patches/0001-include-missing-header-file.patch
@@ -0,0 +1,37 @@
+From a498a761b4cab79c56e173cce0794cd5c220c698 Mon Sep 17 00:00:00 2001
+From: Christian Hesse <mail AT eworm.de>
+Date: Fri, 17 Nov 2023 22:30:42 +0100
+Subject: [PATCH 1/4] include missing header file
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This fixes build error:
+```
+/build/inkscape/src/inkscape/src/object/uri.cpp: In constructor
‘Inkscape::URI::URI(const gchar*, const char*)’:
+/build/inkscape/src/inkscape/src/object/uri.cpp:86:9: error: ‘xmlFree’ was
not declared in this scope; did you mean ‘xmlFreeURI’?
+ 86 | xmlFree(full);
+```
+
+Origin: Upstream
+Upstream-Status: Backport [commit 694d8ae43d06efff21adebf377ce614d660b24cd]
+Signed-off-by: Ismael Luceno <ismael AT iodev.co.uk>
+---
+ src/object/uri.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/object/uri.h b/src/object/uri.h
+index 381adec58cf3..d5b211fe2b20 100644
+--- a/src/object/uri.h
++++ b/src/object/uri.h
+@@ -13,6 +13,7 @@
+ #define INKSCAPE_URI_H
+
+ #include <libxml/uri.h>
++#include <libxml/xmlmemory.h>
+ #include <memory>
+ #include <string>
+
+--
+2.44.0
+
diff --git
a/graphics/inkscape/patches/0002-Fix-build-with-poppler-24.03.0.patch
b/graphics/inkscape/patches/0002-Fix-build-with-poppler-24.03.0.patch
new file mode 100644
index 0000000..2e5688c
--- /dev/null
+++ b/graphics/inkscape/patches/0002-Fix-build-with-poppler-24.03.0.patch
@@ -0,0 +1,80 @@
+From 4330f33ea4a7bd18e5d2f359f8c8c2c45e7f0ad7 Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <asturm AT gentoo.org>
+Date: Mon, 4 Mar 2024 22:59:40 +0100
+Subject: [PATCH 2/4] 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 AT gentoo.org>
+
+Fixes https://gitlab.com/inkscape/inkscape/-/issues/4787
+
+Origin: Upstream
+Upstream-Status: Backport [commit f7e944575ea5247952d23f85dfa905cfa13f7b28]
+Signed-off-by: Ismael Luceno <ismael AT iodev.co.uk>
+---
+ .../internal/pdfinput/poppler-transition-api.h | 10 ++++++++++
+ src/extension/internal/pdfinput/svg-builder.cpp | 8 ++++----
+ 2 files changed, 14 insertions(+), 4 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h
b/src/extension/internal/pdfinput/poppler-transition-api.h
+index dc9e47e45bbc..9c94cc4a91e9 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,16 @@
+
+ #include <glib/poppler-features.h>
+
++#if POPPLER_CHECK_VERSION(24, 3, 0)
++#define _POPPLER_FUNCTION_TYPE_SAMPLED Function::Type::Sampled
++#define _POPPLER_FUNCTION_TYPE_EXPONENTIAL Function::Type::Exponential
++#define _POPPLER_FUNCTION_TYPE_STITCHING Function::Type::Stitching
++#else
++#define _POPPLER_FUNCTION_TYPE_SAMPLED 0
++#define _POPPLER_FUNCTION_TYPE_EXPONENTIAL 2
++#define _POPPLER_FUNCTION_TYPE_STITCHING 3
++#endif
++
+ #if POPPLER_CHECK_VERSION(22, 4, 0)
+ #define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
+ #else
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp
b/src/extension/internal/pdfinput/svg-builder.cpp
+index dcc0a19160f5..562daa1bdfd1 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -1158,9 +1158,9 @@ 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 ( type == 0 || type == 2 ) { // Sampled or exponential function
++ if (type == _POPPLER_FUNCTION_TYPE_SAMPLED || type ==
_POPPLER_FUNCTION_TYPE_EXPONENTIAL) {
+ GfxColor stop1, stop2;
+ if (!svgGetShadingColor(shading, 0.0, &stop1) ||
!svgGetShadingColor(shading, 1.0, &stop2)) {
+ return false;
+@@ -1168,7 +1168,7 @@ 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);
+ }
+- } else if ( type == 3 ) { // Stitching
++ } else if (type == _POPPLER_FUNCTION_TYPE_STITCHING) {
+ auto stitchingFunc = static_cast<_POPPLER_CONST
StitchingFunction*>(func);
+ const double *bounds = stitchingFunc->getBounds();
+ const double *encode = stitchingFunc->getEncode();
+@@ -1183,7 +1183,7 @@ 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 (stitchingFunc->getFunc(i)->getType() == 2) { // process
exponential fxn
++ if (stitchingFunc->getFunc(i)->getType() ==
_POPPLER_FUNCTION_TYPE_EXPONENTIAL) {
+ 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
+
diff --git
a/graphics/inkscape/patches/0003-Fix-build-with-poppler-24.05.0.patch
b/graphics/inkscape/patches/0003-Fix-build-with-poppler-24.05.0.patch
new file mode 100644
index 0000000..cd6dda0
--- /dev/null
+++ b/graphics/inkscape/patches/0003-Fix-build-with-poppler-24.05.0.patch
@@ -0,0 +1,68 @@
+From 1f23e9d105bd03f4c625bbbb06ce5524c6486895 Mon Sep 17 00:00:00 2001
+From: Heiko Becker <mail AT heiko-becker.de>
+Date: Fri, 3 May 2024 14:52:00 +0200
+Subject: [PATCH 3/4] 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
+
+Origin: Upstream
+Upstream-Status: Backport [commit 96ca7a6c215aa14336b52753f56244dc8796ec43]
+Signed-off-by: Ismael Luceno <ismael AT iodev.co.uk>
+---
+ 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 9c94cc4a91e9..e0841e04ee71 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 78d90c66c9de..c02815f64b94 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);
+ }
+--
+2.44.0
+
diff --git a/graphics/inkscape/patches/0004-Up-C-version-to-C-20.patch
b/graphics/inkscape/patches/0004-Up-C-version-to-C-20.patch
new file mode 100644
index 0000000..c96e7cb
--- /dev/null
+++ b/graphics/inkscape/patches/0004-Up-C-version-to-C-20.patch
@@ -0,0 +1,95 @@
+From 27b953f980d092d326a532d76278e31a9172a418 Mon Sep 17 00:00:00 2001
+From: Tavmjong Bah <tavmjong AT free.fr>
+Date: Tue, 26 Sep 2023 19:23:27 +0000
+Subject: [PATCH 4/4] Up C++ version to C++20.
+
+[ismael AT sourcemage.org: Needed to build against poppler >= 24.06.0]
+Origin: Upstream
+Upstream-Status: Backport [commit 1798e9c13b786f3d077ba0132592c4d5c1d1fb9b]
+Signed-off-by: Ismael Luceno <ismael AT iodev.co.uk>
+---
+ CMakeLists.txt | 4 ++--
+ _clang-format | 2 +-
+ src/ui/knot/knot-holder-entity.cpp | 2 +-
+ src/ui/tools/pencil-tool.cpp | 9 ++++++---
+ 4 files changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5c25ebb26bf0..7ced1f6f79d5 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -18,9 +18,9 @@ message("Binary Dir: ${CMAKE_CURRENT_BINARY_DIR}")
+ #
-----------------------------------------------------------------------------
+ # 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")
+diff --git a/_clang-format b/_clang-format
+index 39396fad65a6..48de4d2bd88b 100644
+--- a/_clang-format
++++ b/_clang-format
+@@ -103,7 +103,7 @@ SpacesInContainerLiterals: false
+ SpacesInCStyleCastParentheses: false
+ SpacesInParentheses: false
+ SpacesInSquareBrackets: false
+-Standard: c++17
++Standard: c++20
+ StatementMacros: []
+ TypenameMacros: []
+ TabWidth: 4
+diff --git a/src/ui/knot/knot-holder-entity.cpp
b/src/ui/knot/knot-holder-entity.cpp
+index 6672c0fb8b06..58e8368982a5 100644
+--- a/src/ui/knot/knot-holder-entity.cpp
++++ b/src/ui/knot/knot-holder-entity.cpp
+@@ -329,7 +329,7 @@ PatternKnotHolderEntityScale::knot_set(Geom::Point const
&p, Geom::Point const &
+ 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
+diff --git a/src/ui/tools/pencil-tool.cpp b/src/ui/tools/pencil-tool.cpp
+index 568606db8fc1..0284e4ebb051 100644
+--- a/src/ui/tools/pencil-tool.cpp
++++ b/src/ui/tools/pencil-tool.cpp
+@@ -17,7 +17,11 @@
+ * Released under GNU GPL v2+, read the file 'COPYING' for more information.
+ */
+
+-#include <numeric> // For std::accumulate
++#include "pencil-tool.h"
++
++#include <cmath> // std::lerp
++#include <numeric> // std::accumulate
++
+ #include <gdk/gdkkeysyms.h>
+ #include <glibmm/i18n.h>
+
+@@ -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::Point const &p,
guint /*state*/, bool l
+ 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]) {
+--
+2.44.0
+


  • [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (f4832fb565db410cfbd43f90f0abe6efd0487c20), Ismael Luceno, 08/13/2024

Archive powered by MHonArc 2.6.24.

Top of Page