inkscape: fix build with poppler>=0.29 (patch from Arch).

This commit is contained in:
Juan RP 2015-01-18 11:03:50 +01:00
parent d72a92b7df
commit 7fb0554a0f
2 changed files with 101 additions and 1 deletions

View File

@ -0,0 +1,96 @@
--- configure.ac 2014-06-20 21:38:59 +0000
+++ configure.ac 2014-12-10 20:32:33 +0000
@@ -593,6 +593,11 @@
AC_DEFINE(POPPLER_EVEN_NEWER_COLOR_SPACE_API, 1, [Use even newer color space API from Poppler >= 0.26.0])
fi
+PKG_CHECK_MODULES(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API, poppler >= 0.29.0, popplernewernewcolorspaceapi=yes, popplernewernewcolorspaceapi=no)
+if test "x$popplernewernewcolorspaceapi" = "xyes"; then
+ AC_DEFINE(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API, 1, [Use even newer new color space API from Poppler >= 0.29.0])
+fi
+
# Poppler's b604a008 commit changes this
AC_MSG_CHECKING([whether Poppler's GfxPatch no longer uses GfxColor])
popplergfxcolor="no"
--- src/extension/internal/pdfinput/pdf-parser.cpp 2014-06-03 15:44:09 +0000
+++ src/extension/internal/pdfinput/pdf-parser.cpp 2014-12-10 20:32:30 +0000
@@ -860,7 +860,9 @@
blendingColorSpace = NULL;
isolated = knockout = gFalse;
if (!obj4.dictLookup(const_cast<char*>("CS"), &obj5)->isNull()) {
-#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
+#if defined(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API)
+ blendingColorSpace = GfxColorSpace::parse(NULL, &obj5, NULL, NULL);
+#elif defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
blendingColorSpace = GfxColorSpace::parse(&obj5, NULL, NULL);
#elif defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
blendingColorSpace = GfxColorSpace::parse(&obj5, NULL);
@@ -1085,7 +1087,13 @@
state->setFillPattern(NULL);
res->lookupColorSpace(args[0].getName(), &obj);
-#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
+#if defined(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API)
+ if (obj.isNull()) {
+ colorSpace = GfxColorSpace::parse(NULL, &args[0], NULL, NULL);
+ } else {
+ colorSpace = GfxColorSpace::parse(NULL, &obj, NULL, NULL);
+ }
+#elif defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
if (obj.isNull()) {
colorSpace = GfxColorSpace::parse(&args[0], NULL, NULL);
} else {
@@ -1126,7 +1134,13 @@
state->setStrokePattern(NULL);
res->lookupColorSpace(args[0].getName(), &obj);
-#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
+#if defined(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API)
+ if (obj.isNull()) {
+ colorSpace = GfxColorSpace::parse(NULL, &args[0], NULL, NULL);
+ } else {
+ colorSpace = GfxColorSpace::parse(NULL, &obj, NULL, NULL);
+ }
+#elif defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
if (obj.isNull()) {
colorSpace = GfxColorSpace::parse(&args[0], NULL, NULL);
} else {
@@ -2756,8 +2770,10 @@
}
}
if (!obj1.isNull()) {
-#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
- colorSpace = GfxColorSpace::parse(&obj1, NULL, NULL);
+#if defined(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API)
+ colorSpace = GfxColorSpace::parse(NULL, &obj1, NULL, NULL);
+#elif defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
+ colorSpace = GfxColorSpace::parse(&obj1, NULL, NULL);
#elif defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
colorSpace = GfxColorSpace::parse(&obj1, NULL);
#else
@@ -2847,8 +2863,10 @@
obj2.free();
}
}
-#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
- GfxColorSpace *maskColorSpace = GfxColorSpace::parse(&obj1, NULL, NULL);
+#if defined(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API)
+ GfxColorSpace *maskColorSpace = GfxColorSpace::parse(NULL, &obj1, NULL, NULL);
+#elif defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
+ GfxColorSpace *maskColorSpace = GfxColorSpace::parse(&obj1, NULL, NULL);
#elif defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
maskColorSpace = GfxColorSpace::parse(&obj1, NULL);
#else
@@ -3040,7 +3058,9 @@
if (obj1.dictLookup(const_cast<char*>("S"), &obj2)->isName(const_cast<char*>("Transparency"))) {
transpGroup = gTrue;
if (!obj1.dictLookup(const_cast<char*>("CS"), &obj3)->isNull()) {
-#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
+#if defined(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API)
+ blendingColorSpace = GfxColorSpace::parse(NULL, &obj3, NULL, NULL);
+#elif defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
blendingColorSpace = GfxColorSpace::parse(&obj3, NULL, NULL);
#elif defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
blendingColorSpace = GfxColorSpace::parse(&obj3, NULL);

View File

@ -4,7 +4,7 @@ version=0.48.5
revision=5
build_style=gnu-configure
configure_args="--enable-lcms --enable-poppler-cairo"
hostmakedepends="pkg-config intltool"
hostmakedepends="automake gettext-devel glib-devel pkg-config intltool"
makedepends="
popt-devel libpng-devel>=1.6 gsl-devel gc-devel>=7.4 gtkmm2-devel libxslt-devel
lcms2-devel poppler-glib-devel>=0.30 boost-devel>=1.54 libmagick-devel>=6.8.9"
@ -15,3 +15,7 @@ homepage="http://inkscape.org/"
license="GPL-2, LGPL-2.1"
distfiles="$SOURCEFORGE_SITE/$pkgname/$pkgname-$version.tar.bz2"
checksum=2b6ce684f9f2a0691ab454656424555cbda131db78e13973360684bc833ad969
pre_configure() {
autoreconf -fi
}