pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/inkscape Support poppler 0.58



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b3a56be9c955
branches:  trunk
changeset: 367994:b3a56be9c955
user:      prlw1 <prlw1%pkgsrc.org@localhost>
date:      Sat Sep 09 21:48:56 2017 +0000

description:
Support poppler 0.58
https://gitlab.com/inkscape/inkscape/commit/9418824967eb4c53371ef8588243fed4cab496e0

diffstat:

 graphics/inkscape/Makefile                                                     |     4 +-
 graphics/inkscape/distinfo                                                     |     7 +-
 graphics/inkscape/patches/patch-CMakeScripts_DefineDependsandFlags.cmake       |    18 +
 graphics/inkscape/patches/patch-config.h.cmake                                 |    17 +
 graphics/inkscape/patches/patch-src_extension_internal_pdfinput_pdf-input.cpp  |    28 +
 graphics/inkscape/patches/patch-src_extension_internal_pdfinput_pdf-parser.cpp |  1324 +++++++++-
 6 files changed, 1392 insertions(+), 6 deletions(-)

diffs (truncated from 1449 to 300 lines):

diff -r bcffa2e645b8 -r b3a56be9c955 graphics/inkscape/Makefile
--- a/graphics/inkscape/Makefile        Sat Sep 09 20:12:49 2017 +0000
+++ b/graphics/inkscape/Makefile        Sat Sep 09 21:48:56 2017 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.152 2017/09/04 20:20:54 ryoon Exp $
+# $NetBSD: Makefile,v 1.153 2017/09/09 21:48:56 prlw1 Exp $
 
 DISTNAME=      inkscape-0.92.1
-PKGREVISION=   8
+PKGREVISION=   9
 CATEGORIES=    graphics
 MASTER_SITES=  https://media.inkscape.org/dl/resources/file/
 EXTRACT_SUFX=  .tar.bz2
diff -r bcffa2e645b8 -r b3a56be9c955 graphics/inkscape/distinfo
--- a/graphics/inkscape/distinfo        Sat Sep 09 20:12:49 2017 +0000
+++ b/graphics/inkscape/distinfo        Sat Sep 09 21:48:56 2017 +0000
@@ -1,16 +1,19 @@
-$NetBSD: distinfo,v 1.60 2017/08/24 09:07:12 jperkin Exp $
+$NetBSD: distinfo,v 1.61 2017/09/09 21:48:56 prlw1 Exp $
 
 SHA1 (inkscape-0.92.1.tar.bz2) = bede1252b344dc08abb6736084364d8125a6dffc
 RMD160 (inkscape-0.92.1.tar.bz2) = 5748920692ac64bb3e1822b7cb9e96c727b23c55
 SHA512 (inkscape-0.92.1.tar.bz2) = f8f3bfb812a214216c3ffac7064a4619f847cf9810417c782481dba12e6c6a44123c8b8a9289fbf5287f2e6b6df39a641d94a000d842faee5ff808eec86187a0
 Size (inkscape-0.92.1.tar.bz2) = 31222684 bytes
+SHA1 (patch-CMakeScripts_DefineDependsandFlags.cmake) = 4052c5a9f6f96afaac715f282f14d082b5d19bcf
 SHA1 (patch-CMakeScripts_Pod2man.cmake) = 6176956791ae3e8eb007345e5ec19100812bdeb8
 SHA1 (patch-ag) = 6b6000f3940ec6db9404a206f9757928c1d5740b
 SHA1 (patch-aj) = 31d6cc8bb179629023bd04bcac0fd935b2c9636d
 SHA1 (patch-ap) = 412509a03d26e925548e3371529a1273db958611
 SHA1 (patch-aq) = fb7de44d33fdc5895ce84ca8d44ff6a6c328c402
+SHA1 (patch-config.h.cmake) = 1dcc7237fba3dbdfd7993ea2f5a2176785fb561e
 SHA1 (patch-src_CMakeLists.txt) = 47c2a225667b6e5554ab579df1cb323742bcd08c
-SHA1 (patch-src_extension_internal_pdfinput_pdf-parser.cpp) = 7a1aab18cc36756fad1cddbb18cab1ef1431f590
+SHA1 (patch-src_extension_internal_pdfinput_pdf-input.cpp) = 437cb3a461df047fef3c91e86c89cdcf15ef9965
+SHA1 (patch-src_extension_internal_pdfinput_pdf-parser.cpp) = ebb2ad7862ac6d97a8dc40be27b7560defcc80fe
 SHA1 (patch-src_extension_internal_pdfinput_pdf-parser.h) = ba408f45544853f9323f8bd879bd55604072bb7a
 SHA1 (patch-src_io_inkjar.cpp) = 060d59225cfe7b66db5e9f41e76860df9ce12d01
 SHA1 (patch-src_trace_siox.cpp) = daeff4626dace6997f64ab9c96b0bfb304e724c8
diff -r bcffa2e645b8 -r b3a56be9c955 graphics/inkscape/patches/patch-CMakeScripts_DefineDependsandFlags.cmake
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/inkscape/patches/patch-CMakeScripts_DefineDependsandFlags.cmake  Sat Sep 09 21:48:56 2017 +0000
@@ -0,0 +1,18 @@
+$NetBSD: patch-CMakeScripts_DefineDependsandFlags.cmake,v 1.1 2017/09/09 21:48:56 prlw1 Exp $
+
+Support poppler 0.58
+https://gitlab.com/inkscape/inkscape/commit/9418824967eb4c53371ef8588243fed4cab496e0
+
+--- CMakeScripts/DefineDependsandFlags.cmake.orig      2017-02-13 23:46:57.000000000 +0000
++++ CMakeScripts/DefineDependsandFlags.cmake
+@@ -126,6 +126,10 @@ if(ENABLE_POPPLER)
+               POPPLER_VERSION VERSION_EQUAL   "0.29.0")
+           set(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API ON)
+       endif()
++      if(POPPLER_VERSION VERSION_GREATER "0.58.0" OR
++              POPPLER_VERSION VERSION_EQUAL   "0.58.0")
++            set(POPPLER_NEW_OBJECT_API ON)
++      endif()
+     else()
+       set(ENABLE_POPPLER_CAIRO OFF)
+     endif()
diff -r bcffa2e645b8 -r b3a56be9c955 graphics/inkscape/patches/patch-config.h.cmake
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/inkscape/patches/patch-config.h.cmake    Sat Sep 09 21:48:56 2017 +0000
@@ -0,0 +1,17 @@
+$NetBSD: patch-config.h.cmake,v 1.1 2017/09/09 21:48:56 prlw1 Exp $
+
+Support poppler 0.58
+https://gitlab.com/inkscape/inkscape/commit/9418824967eb4c53371ef8588243fed4cab496e0
+
+--- config.h.cmake.orig        2017-02-13 23:46:57.000000000 +0000
++++ config.h.cmake
+@@ -149,6 +149,9 @@
+ /* Use color space API from Poppler >= 0.29.0 */
+ #cmakedefine POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API 1
+ 
++/* Use object API from Poppler >= 0.58.0 */
++#cmakedefine POPPLER_NEW_OBJECT_API 1
++
+ /* Define to 1 if you have the `pow' function. */
+ #cmakedefine HAVE_POW 1
+ 
diff -r bcffa2e645b8 -r b3a56be9c955 graphics/inkscape/patches/patch-src_extension_internal_pdfinput_pdf-input.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_pdf-input.cpp     Sat Sep 09 21:48:56 2017 +0000
@@ -0,0 +1,28 @@
+$NetBSD: patch-src_extension_internal_pdfinput_pdf-input.cpp,v 1.1 2017/09/09 21:48:56 prlw1 Exp $
+
+Support poppler 0.58
+https://gitlab.com/inkscape/inkscape/commit/9418824967eb4c53371ef8588243fed4cab496e0
+
+--- src/extension/internal/pdfinput/pdf-input.cpp.orig 2017-02-13 23:46:57.000000000 +0000
++++ src/extension/internal/pdfinput/pdf-input.cpp
+@@ -840,14 +840,20 @@ PdfInput::open(::Inkscape::Extension::In
+         }
+ 
+         // Parse the document structure
++#if defined(POPPLER_NEW_OBJECT_API)
++        Object obj = page->getContents();
++#else
+         Object obj;
+         page->getContents(&obj);
++#endif
+         if (!obj.isNull()) {
+             pdf_parser->parse(&obj);
+         }
+ 
+         // Cleanup
++#if !defined(POPPLER_NEW_OBJECT_API)
+         obj.free();
++#endif
+         delete pdf_parser;
+         delete builder;
+         g_free(docname);
diff -r bcffa2e645b8 -r b3a56be9c955 graphics/inkscape/patches/patch-src_extension_internal_pdfinput_pdf-parser.cpp
--- a/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_pdf-parser.cpp    Sat Sep 09 20:12:49 2017 +0000
+++ b/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_pdf-parser.cpp    Sat Sep 09 21:48:56 2017 +0000
@@ -1,6 +1,8 @@
-$NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.5 2015/02/03 13:55:12 adam Exp $
+$NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.6 2017/09/09 21:48:56 prlw1 Exp $
 
-Object.h is included in pdf-parser.h -- see patch for pdf-parser.h.
+- Object.h is included in pdf-parser.h -- see patch for pdf-parser.h.
+- Support poppler 0.58
+  https://gitlab.com/inkscape/inkscape/commit/9418824967eb4c53371ef8588243fed4cab496e0
 
 --- src/extension/internal/pdfinput/pdf-parser.cpp.orig        2014-06-09 13:24:41.000000000 +0000
 +++ src/extension/internal/pdfinput/pdf-parser.cpp
@@ -13,3 +15,1321 @@
  #include "Array.h"
  #include "Dict.h"
  #include "Stream.h"
+@@ -414,13 +414,21 @@ void PdfParser::parse(Object *obj, GBool
+ 
+   if (obj->isArray()) {
+     for (int i = 0; i < obj->arrayGetLength(); ++i) {
++#if defined(POPPLER_NEW_OBJECT_API)
++      obj2 = obj->arrayGet(i);
++#else
+       obj->arrayGet(i, &obj2);
++#endif
+       if (!obj2.isStream()) {
+       error(errInternal, -1, "Weird page contents");
++#if !defined(POPPLER_NEW_OBJECT_API)
+       obj2.free();
++#endif
+       return;
+       }
++#if !defined(POPPLER_NEW_OBJECT_API)
+       obj2.free();
++#endif
+     }
+   } else if (!obj->isStream()) {
+       error(errInternal, -1, "Weird page contents");
+@@ -439,7 +447,11 @@ void PdfParser::go(GBool /*topLevel*/)
+ 
+   // scan a sequence of objects
+   int numArgs = 0;
++#if defined(POPPLER_NEW_OBJECT_API)
++  obj = parser->getObj();
++#else
+   parser->getObj(&obj);
++#endif
+   while (!obj.isEOF()) {
+ 
+     // got a command - execute it
+@@ -457,14 +469,20 @@ void PdfParser::go(GBool /*topLevel*/)
+       // Run the operation
+       execOp(&obj, args, numArgs);
+ 
++#if !defined(POPPLER_NEW_OBJECT_API)
+       obj.free();
+       for (int i = 0; i < numArgs; ++i)
+       args[i].free();
++#endif
+       numArgs = 0;
+ 
+     // got an argument - save it
+     } else if (numArgs < maxArgs) {
++#if defined(POPPLER_NEW_OBJECT_API)
++      args[numArgs++] = std::move(obj);
++#else
+       args[numArgs++] = obj;
++#endif
+ 
+     // too many arguments - something is wrong
+     } else {
+@@ -475,13 +493,21 @@ void PdfParser::go(GBool /*topLevel*/)
+       printf("\n");
+       fflush(stdout);
+       }
++#if !defined(POPPLER_NEW_OBJECT_API)
+       obj.free();
++#endif
+     }
+ 
+     // grab the next object
++#if defined(POPPLER_NEW_OBJECT_API)
++    obj = parser->getObj();
++#else
+     parser->getObj(&obj);
++#endif
+   }
++#if !defined(POPPLER_NEW_OBJECT_API)
+   obj.free();
++#endif
+ 
+   // args at end with no command
+   if (numArgs > 0) {
+@@ -495,8 +521,10 @@ void PdfParser::go(GBool /*topLevel*/)
+       printf("\n");
+       fflush(stdout);
+     }
++#if !defined(POPPLER_NEW_OBJECT_API)
+     for (int i = 0; i < numArgs; ++i)
+       args[i].free();
++#endif
+   }
+ }
+ 
+@@ -692,9 +720,13 @@ void PdfParser::opSetDash(Object args[],
+   if (length != 0) {
+     dash = (double *)gmallocn(length, sizeof(double));
+     for (int i = 0; i < length; ++i) {
++#if defined(POPPLER_NEW_OBJECT_API)
++      dash[i] = a->get(i).getNum();
++#else
+       Object obj;
+       dash[i] = a->get(i, &obj)->getNum();
+       obj.free();
++#endif
+     }
+   }
+   state->setLineDash(dash, length, args[1].getNum());
+@@ -744,12 +776,18 @@ void PdfParser::opSetExtGState(Object ar
+   GBool haveBackdropColor = gFalse;
+   GBool alpha = gFalse;
+ 
++#if defined(POPPLER_NEW_OBJECT_API)
++  if ((obj1 = res->lookupGState(args[0].getName())).isNull()) {
++#else
+   if (!res->lookupGState(args[0].getName(), &obj1)) {
++#endif
+     return;
+   }
+   if (!obj1.isDict()) {
+     error(errSyntaxError, getPos(), "ExtGState '{0:s}' is wrong type"), args[0].getName();
++#if !defined(POPPLER_NEW_OBJECT_API)
+     obj1.free();
++#endif
+     return;
+   }
+   if (printCommands) {
+@@ -759,7 +797,11 @@ void PdfParser::opSetExtGState(Object ar
+   }
+ 
+   // transparency support: blend mode, fill/stroke opacity
++#if defined(POPPLER_NEW_OBJECT_API)
++  if (!((obj2 = obj1.dictLookup(const_cast<char*>("BM"))).isNull())) {
++#else
+   if (!obj1.dictLookup(const_cast<char*>("BM"), &obj2)->isNull()) {
++#endif
+     GfxBlendMode mode = gfxBlendNormal;
+     if (state->parseBlendMode(&obj2, &mode)) {
+       state->setBlendMode(mode);
+@@ -767,40 +809,71 @@ void PdfParser::opSetExtGState(Object ar
+       error(errSyntaxError, getPos(), "Invalid blend mode in ExtGState");
+     }
+   }
++#if defined(POPPLER_NEW_OBJECT_API)
++  if ((obj2 = obj1.dictLookup(const_cast<char*>("ca"))).isNum()) {
++#else
+   obj2.free();
+   if (obj1.dictLookup(const_cast<char*>("ca"), &obj2)->isNum()) {
++#endif
+     state->setFillOpacity(obj2.getNum());
+   }
++#if defined(POPPLER_NEW_OBJECT_API)
++  if ((obj2 = obj1.dictLookup(const_cast<char*>("CA"))).isNum()) {
++#else
+   obj2.free();
+   if (obj1.dictLookup(const_cast<char*>("CA"), &obj2)->isNum()) {
++#endif
+     state->setStrokeOpacity(obj2.getNum());
+   }
++#if !defined(POPPLER_NEW_OBJECT_API)
+   obj2.free();
++#endif
+ 
+   // fill/stroke overprint
+   GBool haveFillOP = gFalse;
++#if defined(POPPLER_NEW_OBJECT_API)
++  if ((haveFillOP = (obj2 = obj1.dictLookup(const_cast<char*>("op"))).isBool())) {
++#else
+   if ((haveFillOP = (obj1.dictLookup(const_cast<char*>("op"), &obj2)->isBool()))) {
++#endif
+     state->setFillOverprint(obj2.getBool());
+   }
++#if defined(POPPLER_NEW_OBJECT_API)
++  if ((obj2 = obj1.dictLookup(const_cast<char*>("OP"))).isBool()) {
++#else



Home | Main Index | Thread Index | Old Index