From 9bd6462666f34a213b756ff6fb274f94df2ebcc1 Mon Sep 17 00:00:00 2001 From: Heiko Irrgang Date: Fri, 8 Dec 2023 17:37:28 +0100 Subject: [PATCH] inkscape: fix missing include --- main/inkscape/0001-fix-missing-include.patch | 10 +++ .../0001-include-missing-header-file.patch | 33 --------- main/inkscape/poppler.22.09.0.patch | 73 ------------------- main/inkscape/spkgbuild | 7 +- 4 files changed, 16 insertions(+), 107 deletions(-) create mode 100644 main/inkscape/0001-fix-missing-include.patch delete mode 100644 main/inkscape/0001-include-missing-header-file.patch delete mode 100644 main/inkscape/poppler.22.09.0.patch diff --git a/main/inkscape/0001-fix-missing-include.patch b/main/inkscape/0001-fix-missing-include.patch new file mode 100644 index 000000000..4d0fc026b --- /dev/null +++ b/main/inkscape/0001-fix-missing-include.patch @@ -0,0 +1,10 @@ +--- src/src/object/uri.h 2023-11-30 08:59:15.418967908 +0100 ++++ src/src/object/uri.h 2023-11-30 08:59:47.408396638 +0100 +@@ -13,6 +13,7 @@ + #define INKSCAPE_URI_H + + #include ++#include + #include + #include + diff --git a/main/inkscape/0001-include-missing-header-file.patch b/main/inkscape/0001-include-missing-header-file.patch deleted file mode 100644 index 4e839e408..000000000 --- a/main/inkscape/0001-include-missing-header-file.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 694d8ae43d06efff21adebf377ce614d660b24cd Mon Sep 17 00:00:00 2001 -From: Christian Hesse -Date: Fri, 17 Nov 2023 22:30:42 +0100 -Subject: [PATCH 1/1] 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); -``` ---- - src/object/uri.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/object/uri.h b/src/object/uri.h -index 381adec58c..d5b211fe2b 100644 ---- a/src/object/uri.h -+++ b/src/object/uri.h -@@ -13,6 +13,7 @@ - #define INKSCAPE_URI_H - - #include -+#include - #include - #include - --- -2.42.1 - diff --git a/main/inkscape/poppler.22.09.0.patch b/main/inkscape/poppler.22.09.0.patch deleted file mode 100644 index 87583019d..000000000 --- a/main/inkscape/poppler.22.09.0.patch +++ /dev/null @@ -1,73 +0,0 @@ -https://gitlab.com/inkscape/inkscape/-/merge_requests/4719 - -From dce083204c62f1185ad079fc124f7fb40a1d0bb6 Mon Sep 17 00:00:00 2001 -From: Sam James -Date: Fri, 2 Sep 2022 06:21:28 +0100 -Subject: [PATCH] Fix build with Poppler 22.09.0 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -With Poppler 22.09.0, inkscape fails to build with: -``` -/var/tmp/portage/media-gfx/inkscape-1.2.1/work/inkscape-1.2.1/src/extension/internal/pdfinput/svg-builder.cpp:394:23: error: no matching function for call to ‘GfxState::getLineDash(double**, int*, double*)’ - 394 | state->getLineDash(&dash_pattern, &dash_length, &dash_start); - | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In file included from /var/tmp/portage/media-gfx/inkscape-1.2.1/work/inkscape-1.2.1/src/extension/internal/pdfinput/svg-builder.cpp:44: -/usr/include/poppler/GfxState.h:1506:32: note: candidate: ‘const std::vector& GfxState::getLineDash(double*)’ - 1506 | const std::vector &getLineDash(double *start) - | ^~~~~~~~~~~ -[...] -/var/tmp/portage/media-gfx/inkscape-1.2.1/work/inkscape-1.2.1/src/extension/internal/pdfinput/pdf-parser.cpp:700:21: error: no matching function for call to ‘GfxState::setLineDash(double*&, int&, double)’ - 700 | state->setLineDash(dash, length, args[1].getNum()); - | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -``` - -Poppler changed the getLineDash interface: -``` -- void getLineDash(double **dash, int *length, double *start) -+ const std::vector &getLineDash(double *start) -``` - -... and the setLineDash interface: -```` -- void setLineDash(double *dash, int length, double start); -+ void setLineDash(std::vector &&dash, double start); -``` - -Signed-off-by: Sam James ---- a/src/extension/internal/pdfinput/pdf-parser.cpp -+++ b/src/extension/internal/pdfinput/pdf-parser.cpp -@@ -697,7 +697,11 @@ void PdfParser::opSetDash(Object args[], int /*numArgs*/) - _POPPLER_FREE(obj); - } - } -+#if POPPLER_CHECK_VERSION(22, 9, 0) -+ state->setLineDash(std::vector (*dash, length), args[1].getNum()); -+#else - state->setLineDash(dash, length, args[1].getNum()); -+#endif - builder->updateStyle(state); - } - ---- a/src/extension/internal/pdfinput/svg-builder.cpp -+++ b/src/extension/internal/pdfinput/svg-builder.cpp -@@ -388,10 +388,17 @@ void SvgBuilder::_setStrokeStyle(SPCSSAttr *css, GfxState *state) { - sp_repr_css_set_property(css, "stroke-miterlimit", os_ml.str().c_str()); - - // Line dash -- double *dash_pattern; - int dash_length; - double dash_start; -+#if POPPLER_CHECK_VERSION(22, 9, 0) -+ const double *dash_pattern; -+ const std::vector &dash = state->getLineDash(&dash_start); -+ dash_pattern = dash.data(); -+ dash_length = dash.size(); -+#else -+ double *dash_pattern; - state->getLineDash(&dash_pattern, &dash_length, &dash_start); -+#endif - if ( dash_length > 0 ) { - Inkscape::CSSOStringStream os_array; - for ( int i = 0 ; i < dash_length ; i++ ) { diff --git a/main/inkscape/spkgbuild b/main/inkscape/spkgbuild index 682825c5f..6917205cc 100755 --- a/main/inkscape/spkgbuild +++ b/main/inkscape/spkgbuild @@ -4,9 +4,14 @@ name=inkscape version=1.3.1 release=1 -source="https://media.inkscape.org/dl/resources/file/$name-$version.tar.xz" +source="https://media.inkscape.org/dl/resources/file/$name-$version.tar.xz +0001-fix-missing-include.patch" build() { + cd $name-${version}_* + patch -Np1 -i $SRC/0001-fix-missing-include.patch + cd .. + cmake -S $name-${version}_* -B build -G Ninja \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=lib \