1
0
forked from ports/contrib

inkscape: fix build with new poppler

This commit is contained in:
Danny Rawlins 2022-09-30 08:44:29 +10:00
parent 470c5ca744
commit 5824e3cd9f
4 changed files with 103 additions and 13 deletions

@ -108,9 +108,9 @@ drwxr-xr-x root/root usr/lib/cmake/2Geom/
-rw-r--r-- root/root usr/lib/cmake/2Geom/2GeomTargets.cmake
drwxr-xr-x root/root usr/lib/inkscape/
-rwxr-xr-x root/root usr/lib/inkscape/libinkscape_base.so
-rwxr-xr-x root/root usr/lib/inkscape/libpoppler.so.124
lrwxrwxrwx root/root usr/lib/lib2geom.so -> lib2geom.so.1.1.0
-rwxr-xr-x root/root usr/lib/lib2geom.so.1.1.0
-rwxr-xr-x root/root usr/lib/libpoppler.so.121
drwxr-xr-x root/root usr/lib/pkgconfig/
-rw-r--r-- root/root usr/lib/pkgconfig/2geom.pc
drwxr-xr-x root/root usr/share/

@ -1,6 +1,7 @@
untrusted comment: verify with /etc/ports/contrib.pub
RWSagIOpLGJF3wYZVhZDAUbgR/1i4TS2NZyD3NAUYcIJKVsSs+Xwi+YL/nyo4lfRwz+/GRgy9bhOUcBczDwyd4M7Rdi0NZx2KQI=
SHA256 (Pkgfile) = b8d77aab76218a2acfdcae76fa8e5b1ecaa82ef7eabed6cee268bd453924e0ba
SHA256 (.footprint) = 2ef23924b61800a6a8f37282a295c3139e1bc1b26584cfd5e1f0aabbdbec956c
RWSagIOpLGJF3wPkvZnMcdhXll7gn7aBz8eKP9omJYor5H0+ddzaXVHvjcItInNwixzOE4lD+J5fobASSg70R3d4PBkz33xs5g0=
SHA256 (Pkgfile) = 67e291813b6553ae19da01c292b4c4ee0b0e0cd63300674410fdd3554225cc63
SHA256 (.footprint) = e3992719796fdb52a298792e4b593d56808b2f5aa51772d8ae752819119b88bf
SHA256 (inkscape-1.2_2022-05-15_dc2aedaf03.tar.xz) = 8d9b31142554945664edfefe2d6b55910a5099765f7176a71107c34f1dcde6ad
SHA256 (poppler-22.05.0.tar.xz) = a969ced458e050d6202367bd7427054e2bd19bae39e8f969910d3b9151abf958
SHA256 (poppler-22.09.0.tar.xz) = d7a8f748211359cadb774ba3e18ecda6464b34027045c0648eb30d5852a41e2e
SHA256 (inkscape-1.2.1-poppler-22.09.0.patch) = 5e847d11c1c42db717ad39bc03708e3b855f0e0a99ee4ac8d97f5bfe4af8985c

@ -7,11 +7,12 @@ name=inkscape
_name=inkscape-INKSCAPE
version=1.2.1
_version=1.2_2022-05-15_dc2aedaf03
_pversion=22.05.0
_psoversion=121
release=1
_pversion=22.09.0
_psoversion=124
release=2
source=(https://media.inkscape.org/dl/resources/file/inkscape-$_version.tar.xz
https://poppler.freedesktop.org/poppler-$_pversion.tar.xz)
https://poppler.freedesktop.org/poppler-$_pversion.tar.xz
inkscape-1.2.1-poppler-22.09.0.patch)
poppler() {
cmake -S poppler-$_pversion -B build-poppler -G Ninja \
@ -33,18 +34,23 @@ poppler() {
cmake --build build-poppler
DESTDIR=$SRC/poppler cmake --install build-poppler
install -D -t $PKG/usr/lib $SRC/poppler/usr/lib/libpoppler.so.$_psoversion
install -D -t $PKG/usr/lib/inkscape $SRC/poppler/usr/lib/libpoppler.so.$_psoversion
export CXXFLAGS+=" -I$SRC/poppler/usr/include -I$SRC/poppler/usr/include/poppler"
export PKG_CONFIG_PATH="$SRC/poppler/usr/lib/pkgconfig:$PKG_CONFIG_PATH"
}
build() {
[ ! -e "/usr/lib/libpoppler.so.$_psoversion" ] && poppler
#[ ! -e "/usr/lib/inkscape/libpoppler.so.$_psoversion" ] &&
poppler
# https://gitlab.com/inkscape/inkscape/-/merge_requests/4719
patch -d $name-$_version -p1 -i $SRC/inkscape-1.2.1-poppler-22.09.0.patch
# https://gitlab.gnome.org/GNOME/glib/-/issues/2331
CFLAGS+=' -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_46 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_66'
CXXFLAGS+=' -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_46 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_66'
CFLAGS+=' -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_46 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_66 -L/usr/lib/inkscape'
CXXFLAGS+=' -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_46 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_66 -L/usr/lib/inkscape'
export LDFLAGS+=" -Wl,-rpath=/usr/lib/inkscape"
cmake -S $name-$_version -B build -G Ninja \
-D CMAKE_INSTALL_PREFIX=/usr \

@ -0,0 +1,83 @@
From fb00794923d19cfbb2ca4adca3ae8971553a06be Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
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<double>& GfxState::getLineDash(double*)’
1506 | const std::vector<double> &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<double> &getLineDash(double *start)
```
... and the setLineDash interface:
````
- void setLineDash(double *dash, int length, double start);
+ void setLineDash(std::vector<double> &&dash, double start);
```
Signed-off-by: Sam James <sam@gentoo.org>
---
src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
src/extension/internal/pdfinput/svg-builder.cpp | 9 ++++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
index cca1e84096..80d64c9b86 100644
--- 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<double> (dash, dash + length), args[1].getNum());
+#else
state->setLineDash(dash, length, args[1].getNum());
+#endif
builder->updateStyle(state);
}
diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
index 12f71dd921..9fc56fe63c 100644
--- a/src/extension/internal/pdfinput/svg-builder.cpp
+++ b/src/extension/internal/pdfinput/svg-builder.cpp
@@ -389,10 +389,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<double> &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++ ) {
--
GitLab