[122134] trunk/dports/graphics/inkscape-devel

devans at macports.org devans at macports.org
Tue Jul 15 11:03:30 PDT 2014


Revision: 122134
          https://trac.macports.org/changeset/122134
Author:   devans at macports.org
Date:     2014-07-15 11:03:30 -0700 (Tue, 15 Jul 2014)
Log Message:
-----------
inkscape-devel: add +revenge variant, experimental upstream patch to build with latest libcdr, libvisio, libwpg based on librevenge.

Modified Paths:
--------------
    trunk/dports/graphics/inkscape-devel/Portfile

Added Paths:
-----------
    trunk/dports/graphics/inkscape-devel/files/
    trunk/dports/graphics/inkscape-devel/files/patch-librevenge.diff

Modified: trunk/dports/graphics/inkscape-devel/Portfile
===================================================================
--- trunk/dports/graphics/inkscape-devel/Portfile	2014-07-15 17:32:35 UTC (rev 122133)
+++ trunk/dports/graphics/inkscape-devel/Portfile	2014-07-15 18:03:30 UTC (rev 122134)
@@ -56,6 +56,16 @@
     ui_msg "--->  Fetching source from bzr repository: this may take a while"
 }
 
+variant revenge description {Experimental upstream patch to build with latest libcdr, libvisio, libwpg based on librevenge} {
+    patchfiles-append   patch-librevenge.diff
+    depends_lib-delete  port:libcdr \
+                        port:libvisio \
+                        port:libwpg
+    depends_lib-append  port:libcdr-0.1 \
+                        port:libvisio-0.1 \
+                        port:libwpg-0.3
+}
+
 variant python26 conflicts python27 description {Configure to use Python version 2.6} {
     depends_lib-append \
         port:py26-lxml \

Added: trunk/dports/graphics/inkscape-devel/files/patch-librevenge.diff
===================================================================
--- trunk/dports/graphics/inkscape-devel/files/patch-librevenge.diff	                        (rev 0)
+++ trunk/dports/graphics/inkscape-devel/files/patch-librevenge.diff	2014-07-15 18:03:30 UTC (rev 122134)
@@ -0,0 +1,294 @@
+=== modified file 'configure.ac'
+--- configure.ac	2014-06-03 15:38:31 +0000
++++ configure.ac	2014-06-15 09:24:33 +0000
+@@ -531,28 +531,14 @@
+ with_libwpg=no
+ 
+ if test "x$enable_wpg" = "xyes"; then
+-	PKG_CHECK_MODULES(LIBWPG01, libwpg-0.1 libwpg-stream-0.1, with_libwpg01=yes, with_libwpg01=no)
+-	if test "x$with_libwpg01" = "xyes"; then
+-		AC_DEFINE(WITH_LIBWPG01,1,[Build in libwpg 0.1.x])
+-		with_libwpg=yes
+-		AC_SUBST(LIBWPG_LIBS, $LIBWPG01_LIBS)
+-		AC_SUBST(LIBWPG_CFLAGS, $LIBWPG01_CFLAGS)
+-	fi
+-
+-	PKG_CHECK_MODULES(LIBWPG02, libwpg-0.2 libwpd-0.9 libwpd-stream-0.9, with_libwpg02=yes, with_libwpg02=no)
+-	if test "x$with_libwpg02" = "xyes"; then
+-		AC_DEFINE(WITH_LIBWPG02,1,[Build in libwpg 0.2.x])
+-		with_libwpg=yes
+-		AC_SUBST(LIBWPG_LIBS, $LIBWPG02_LIBS)
+-		AC_SUBST(LIBWPG_CFLAGS, $LIBWPG02_CFLAGS)
+-	fi
++	PKG_CHECK_MODULES(LIBWPG, libwpg-0.3 librevenge-0.0 librevenge-stream-0.0, with_libwpg=yes, with_libwpg=no)
+ 
+ 	if test "x$with_libwpg" = "xyes"; then
+ 		AC_DEFINE(WITH_LIBWPG,1,[Build in libwpg])
+ 	fi
+ fi
+-AM_CONDITIONAL(WITH_LIBWPG01, test "x$with_libwpg01" = "xyes")
+-AM_CONDITIONAL(WITH_LIBWPG02, test "x$with_libwpg02" = "xyes")
++AC_SUBST(LIBWPG_LIBS)
++AC_SUBST(LIBWPG_CFLAGS)
+ AM_CONDITIONAL(WITH_LIBWPG, test "x$with_libwpg" = "xyes")
+ 
+ dnl ********************************
+@@ -566,7 +552,7 @@
+ with_libvisio=no
+ 
+ if test "x$enable_visio" = "xyes"; then
+-	PKG_CHECK_MODULES(LIBVISIO, libvisio-0.0 >= 0.0.20 libwpd-0.9 libwpd-stream-0.9 libwpg-0.2, with_libvisio=yes, with_libvisio=no)
++	PKG_CHECK_MODULES(LIBVISIO, libvisio-0.1 librevenge-0.0 librevenge-stream-0.0, with_libvisio=yes, with_libvisio=no)
+ 
+ 	if test "x$with_libvisio" = "xyes"; then
+ 		AC_DEFINE(WITH_LIBVISIO,1,[Build in libvisio])
+@@ -587,7 +573,7 @@
+ with_libcdr=no
+ 
+ if test "x$enable_cdr" = "xyes"; then
+-	PKG_CHECK_MODULES(LIBCDR, libcdr-0.0 >= 0.0.3 libwpd-0.9 libwpd-stream-0.9 libwpg-0.2, with_libcdr=yes, with_libcdr=no)
++	PKG_CHECK_MODULES(LIBCDR, libcdr-0.1 librevenge-0.0 librevenge-stream-0.0, with_libcdr=yes, with_libcdr=no)
+ 
+ 	if test "x$with_libcdr" = "xyes"; then
+ 		AC_DEFINE(WITH_LIBCDR,1,[Build in libcdr])
+
+=== modified file 'src/extension/internal/cdr-input.cpp'
+--- src/extension/internal/cdr-input.cpp	2013-10-27 16:33:32 +0000
++++ src/extension/internal/cdr-input.cpp	2014-06-15 09:24:33 +0000
+@@ -24,7 +24,7 @@
+ #include <cstring>
+ 
+ #include <libcdr/libcdr.h>
+-#include <libwpd-stream/libwpd-stream.h>
++#include <librevenge-stream/librevenge-stream.h>
+ 
+ #include <gtkmm/alignment.h>
+ #include <gtkmm/comboboxtext.h>
+@@ -60,7 +60,7 @@
+ 
+ class CdrImportDialog : public Gtk::Dialog {
+ public:
+-     CdrImportDialog(const std::vector<WPXString> &vec);
++     CdrImportDialog(const std::vector<librevenge::RVNGString> &vec);
+      virtual ~CdrImportDialog();
+ 
+      bool showDialog();
+@@ -86,12 +86,12 @@
+      class Gtk::VBox * vbox2;
+      class Gtk::Widget * _previewArea;
+ 
+-     const std::vector<WPXString> &_vec;   // Document to be imported
++     const std::vector<librevenge::RVNGString> &_vec;   // Document to be imported
+      unsigned _current_page;  // Current selected page
+      int _preview_width, _preview_height;    // Size of the preview area
+ };
+ 
+-CdrImportDialog::CdrImportDialog(const std::vector<WPXString> &vec)
++CdrImportDialog::CdrImportDialog(const std::vector<librevenge::RVNGString> &vec)
+      : _vec(vec), _current_page(1)
+ {
+      int num_pages = _vec.size();
+@@ -210,14 +210,16 @@
+ 
+ SPDocument *CdrInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri)
+ {
+-     WPXFileStream input(uri);
++     librevenge::RVNGFileStream input(uri);
+ 
+      if (!libcdr::CDRDocument::isSupported(&input)) {
+           return NULL;
+      }
+ 
+-     libcdr::CDRStringVector output;
+-     if (!libcdr::CDRDocument::generateSVG(&input, output)) {
++     librevenge::RVNGStringVector output;
++     librevenge::RVNGSVGDrawingGenerator generator(output, "svg");
++
++     if (!libcdr::CDRDocument::parse(&input, &generator)) {
+           return NULL;
+      }
+ 
+@@ -225,9 +227,9 @@
+           return NULL;
+      }
+ 
+-     std::vector<WPXString> tmpSVGOutput;
++     std::vector<librevenge::RVNGString> tmpSVGOutput;
+      for (unsigned i=0; i<output.size(); ++i) {
+-          WPXString tmpString("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n");
++          librevenge::RVNGString tmpString("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n");
+           tmpString.append(output[i]);
+           tmpSVGOutput.push_back(tmpString);
+      }
+
+=== modified file 'src/extension/internal/vsd-input.cpp'
+--- src/extension/internal/vsd-input.cpp	2013-10-24 15:03:01 +0000
++++ src/extension/internal/vsd-input.cpp	2014-06-15 09:24:33 +0000
+@@ -24,7 +24,7 @@
+ #include <cstring>
+ 
+ #include <libvisio/libvisio.h>
+-#include <libwpd-stream/libwpd-stream.h>
++#include <librevenge-stream/librevenge-stream.h>
+ 
+ #include <gtkmm/alignment.h>
+ #include <gtkmm/comboboxtext.h>
+@@ -59,7 +59,7 @@
+ 
+ class VsdImportDialog : public Gtk::Dialog {
+ public:
+-     VsdImportDialog(const std::vector<WPXString> &vec);
++     VsdImportDialog(const std::vector<librevenge::RVNGString> &vec);
+      virtual ~VsdImportDialog();
+ 
+      bool showDialog();
+@@ -85,12 +85,12 @@
+      class Gtk::VBox * vbox2;
+      class Gtk::Widget * _previewArea;
+ 
+-     const std::vector<WPXString> &_vec;   // Document to be imported
++     const std::vector<librevenge::RVNGString> &_vec;   // Document to be imported
+      unsigned _current_page;  // Current selected page
+      int _preview_width, _preview_height;    // Size of the preview area
+ };
+ 
+-VsdImportDialog::VsdImportDialog(const std::vector<WPXString> &vec)
++VsdImportDialog::VsdImportDialog(const std::vector<librevenge::RVNGString> &vec)
+      : _vec(vec), _current_page(1)
+ {
+      int num_pages = _vec.size();
+@@ -209,14 +209,16 @@
+ 
+ SPDocument *VsdInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri)
+ {
+-     WPXFileStream input(uri);
++     librevenge::RVNGFileStream input(uri);
+ 
+      if (!libvisio::VisioDocument::isSupported(&input)) {
+           return NULL;
+      }
+ 
+-     libvisio::VSDStringVector output;
+-     if (!libvisio::VisioDocument::generateSVG(&input, output)) {
++     librevenge::RVNGStringVector output;
++     librevenge::RVNGSVGDrawingGenerator generator(output, "svg");
++
++     if (!libvisio::VisioDocument::parse(&input, &generator)) {
+           return NULL;
+      }
+ 
+@@ -224,9 +226,9 @@
+           return NULL;
+      }
+ 
+-     std::vector<WPXString> tmpSVGOutput;
++     std::vector<librevenge::RVNGString> tmpSVGOutput;
+      for (unsigned i=0; i<output.size(); ++i) {
+-          WPXString tmpString("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n");
++          librevenge::RVNGString tmpString("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n");
+           tmpString.append(output[i]);
+           tmpSVGOutput.push_back(tmpString);
+      }
+
+=== modified file 'src/extension/internal/wpg-input.cpp'
+--- src/extension/internal/wpg-input.cpp	2014-03-27 01:33:44 +0000
++++ src/extension/internal/wpg-input.cpp	2014-06-15 09:24:33 +0000
+@@ -52,17 +52,8 @@
+ #include "util/units.h"
+ #include <cstring>
+ 
+-// Take a guess and fallback to 0.1.x if no configure has run
+-#if !defined(WITH_LIBWPG01) && !defined(WITH_LIBWPG02)
+-#define WITH_LIBWPG01 1
+-#endif
+-
+ #include "libwpg/libwpg.h"
+-#if WITH_LIBWPG01
+-#include "libwpg/WPGStreamImplementation.h"
+-#elif WITH_LIBWPG02
+-#include "libwpd-stream/libwpd-stream.h"
+-#endif
++#include "librevenge-stream/librevenge-stream.h"
+ 
+ using namespace libwpg;
+ 
+@@ -73,17 +64,9 @@
+ 
+ SPDocument *WpgInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri)
+ {
+-#if WITH_LIBWPG01
+-    WPXInputStream* input = new libwpg::WPGFileStream(uri);
+-#elif WITH_LIBWPG02
+-    WPXInputStream* input = new WPXFileStream(uri);
+-#endif
+-    if (input->isOLEStream()) {
+-#if WITH_LIBWPG01
+-        WPXInputStream* olestream = input->getDocumentOLEStream();
+-#elif WITH_LIBWPG02
+-        WPXInputStream* olestream = input->getDocumentOLEStream("PerfectOffice_MAIN");
+-#endif
++    librevenge::RVNGInputStream* input = new librevenge::RVNGFileStream(uri);
++    if (input->isStructured()) {
++        librevenge::RVNGInputStream* olestream = input->getSubStreamByName("PerfectOffice_MAIN");
+         if (olestream) {
+             delete input;
+             input = olestream;
+@@ -98,15 +81,17 @@
+         return NULL;
+     }
+ 
+-#if WITH_LIBWPG01
+-    libwpg::WPGString output;
+-#elif WITH_LIBWPG02
+-    WPXString output;
+-#endif
+-    if (!libwpg::WPGraphics::generateSVG(input, output)) {
++	librevenge::RVNGStringVector vec;
++	librevenge::RVNGSVGDrawingGenerator generator(vec, "");
++
++	if (!libwpg::WPGraphics::parse(input, &generator) || vec.empty() || vec[0].empty())
++ 	{
+         delete input;
+         return NULL;
+-    }
++ 	}
++
++    librevenge::RVNGString output("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n");
++	output.append(vec[0]);
+ 
+     //printf("I've got a doc: \n%s", painter.document.c_str());
+ 
+
+=== modified file 'src/ui/dialog/symbols.cpp'
+--- src/ui/dialog/symbols.cpp	2014-06-13 16:06:01 +0000
++++ src/ui/dialog/symbols.cpp	2014-06-15 09:24:33 +0000
+@@ -63,7 +63,7 @@
+ 
+ #ifdef WITH_LIBVISIO
+ #include <libvisio/libvisio.h>
+-#include <libwpd-stream/libwpd-stream.h>
++#include <librevenge-stream/librevenge-stream.h>
+ #endif
+ 
+ #include "verbs.h"
+@@ -495,14 +495,16 @@
+ // Read Visio stencil files
+ SPDocument* read_vss( gchar* fullname, gchar* filename ) {
+ 
+-  WPXFileStream input(fullname);
++  librevenge::RVNGFileStream input(fullname);
+ 
+   if (!libvisio::VisioDocument::isSupported(&input)) {
+     return NULL;
+   }
+ 
+-  libvisio::VSDStringVector output;
+-  if (!libvisio::VisioDocument::generateSVGStencils(&input, output)) {
++  librevenge::RVNGStringVector output;
++  librevenge::RVNGSVGDrawingGenerator generator(output, "svg");
++
++  if (!libvisio::VisioDocument::parseStencils(&input, &generator)) {
+     return NULL;
+   }
+ 
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140715/86b3754c/attachment.html>


More information about the macports-changes mailing list