summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorAleksas Pantechovskis <alex.pantec@gmail.com>2017-08-27 22:10:14 +0300
committerDavid Tardon <dtardon@redhat.com>2017-08-28 08:20:47 +0200
commite59b5b1fc7266d56a17e387b8df0f6d6956e8ea5 (patch)
treebcf876537965bba8f7c3b9915a31fdde4236b809 /external
parentc8777a18792a292bcbcb536e72b25b390b49000e (diff)
integrate libqxp
Change-Id: Ic7479b82d09c1e36d28267434a77bf4bc158adfa Reviewed-on: https://gerrit.libreoffice.org/41612 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'external')
-rw-r--r--external/Module_external.mk1
-rw-r--r--external/libqxp/0001-add-missing-includes.patch.137
-rw-r--r--external/libqxp/0001-don-t-use-RVNGStringStream-in-the-main-lib.patch.189
-rw-r--r--external/libqxp/ExternalProject_libqxp.mk45
-rw-r--r--external/libqxp/Makefile7
-rw-r--r--external/libqxp/Module_libqxp.mk17
-rw-r--r--external/libqxp/README4
-rw-r--r--external/libqxp/UnpackedTarball_libqxp.mk29
-rw-r--r--external/libqxp/ubsan-visibility.patch11
9 files changed, 240 insertions, 0 deletions
diff --git a/external/Module_external.mk b/external/Module_external.mk
index 6a3ed4c2c3ba..f24a45442c22 100644
--- a/external/Module_external.mk
+++ b/external/Module_external.mk
@@ -88,6 +88,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\
$(call gb_Helper_optional,POPPLER,poppler) \
$(call gb_Helper_optional,POSTGRESQL,postgresql) \
$(call gb_Helper_optional,PYTHON,python3) \
+ $(call gb_Helper_optional,QXP,libqxp) \
$(call gb_Helper_optional,REDLAND,redland) \
$(call gb_Helper_optional,REVENGE,librevenge) \
$(call gb_Helper_optional,RHINO,rhino) \
diff --git a/external/libqxp/0001-add-missing-includes.patch.1 b/external/libqxp/0001-add-missing-includes.patch.1
new file mode 100644
index 000000000000..c5dbeb535fdf
--- /dev/null
+++ b/external/libqxp/0001-add-missing-includes.patch.1
@@ -0,0 +1,37 @@
+From 5658a197de7dd7827e6cb2ba9acd8ed7934e9e83 Mon Sep 17 00:00:00 2001
+From: Aleksas Pantechovskis <alex.pantec@gmail.com>
+Date: Sun, 27 Aug 2017 22:55:00 +0300
+Subject: [PATCH] add missing includes
+
+---
+ src/lib/QXPBlockParser.cpp | 1 +
+ src/lib/QXPContentCollector.cpp | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/src/lib/QXPBlockParser.cpp b/src/lib/QXPBlockParser.cpp
+index a9a8c9b..d0a58e7 100644
+--- a/src/lib/QXPBlockParser.cpp
++++ b/src/lib/QXPBlockParser.cpp
+@@ -13,6 +13,7 @@
+ #include <algorithm>
+ #include <memory>
+ #include <vector>
++#include <iterator>
+
+ #include "QXPHeader.h"
+ #include "QXPMemoryStream.h"
+diff --git a/src/lib/QXPContentCollector.cpp b/src/lib/QXPContentCollector.cpp
+index 0a5a2c9..6a227a6 100644
+--- a/src/lib/QXPContentCollector.cpp
++++ b/src/lib/QXPContentCollector.cpp
+@@ -11,6 +11,7 @@
+
+ #include <algorithm>
+ #include <utility>
++#include <iterator>
+
+ #include <boost/range/adaptor/reversed.hpp>
+ #include <boost/variant.hpp>
+--
+2.7.4
+
diff --git a/external/libqxp/0001-don-t-use-RVNGStringStream-in-the-main-lib.patch.1 b/external/libqxp/0001-don-t-use-RVNGStringStream-in-the-main-lib.patch.1
new file mode 100644
index 000000000000..40e4ee179ac8
--- /dev/null
+++ b/external/libqxp/0001-don-t-use-RVNGStringStream-in-the-main-lib.patch.1
@@ -0,0 +1,89 @@
+From 4118cfa23d2e251278a55f7fd44c246c84c41ab5 Mon Sep 17 00:00:00 2001
+From: Aleksas Pantechovskis <alex.pantec@gmail.com>
+Date: Sun, 27 Aug 2017 19:39:37 +0300
+Subject: [PATCH] don't use RVNGStringStream in the main lib
+
+librevenge-stream is not used in libreoffice
+---
+ src/lib/QXP4Parser.cpp | 4 ++--
+ src/lib/QXPBlockParser.cpp | 6 +++---
+ src/lib/QXPParser.cpp | 1 -
+ 3 files changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/src/lib/QXP4Parser.cpp b/src/lib/QXP4Parser.cpp
+index c748e3e..3e31951 100644
+--- a/src/lib/QXP4Parser.cpp
++++ b/src/lib/QXP4Parser.cpp
+@@ -15,11 +15,11 @@
+ #include "QXP4Deobfuscator.h"
+ #include "QXP4Header.h"
+ #include "QXPCollector.h"
++#include "QXPMemoryStream.h"
+
+ namespace libqxp
+ {
+
+-using librevenge::RVNGStringStream;
+ using std::make_shared;
+ using std::shared_ptr;
+
+@@ -123,7 +123,7 @@ bool QXP4Parser::parsePages(const std::shared_ptr<librevenge::RVNGInputStream> &
+ void QXP4Parser::parseColors(const std::shared_ptr<librevenge::RVNGInputStream> &docStream)
+ {
+ unsigned length = readU32(docStream, be);
+- auto stream = make_shared<RVNGStringStream>(readNBytes(docStream, length), length);
++ auto stream = make_shared<QXPMemoryStream>(readNBytes(docStream, length), length);
+
+ try
+ {
+diff --git a/src/lib/QXPBlockParser.cpp b/src/lib/QXPBlockParser.cpp
+index 58cecb9..a9a8c9b 100644
+--- a/src/lib/QXPBlockParser.cpp
++++ b/src/lib/QXPBlockParser.cpp
+@@ -15,12 +15,12 @@
+ #include <vector>
+
+ #include "QXPHeader.h"
++#include "QXPMemoryStream.h"
+
+ namespace libqxp
+ {
+
+ using librevenge::RVNGInputStream;
+-using librevenge::RVNGStringStream;
+ using std::make_shared;
+ using std::vector;
+
+@@ -36,7 +36,7 @@ std::shared_ptr<RVNGInputStream> QXPBlockParser::getBlock(const uint32_t index)
+ {
+ seek(m_input, (index - 1) * m_blockLength);
+ auto block = readNBytes(m_input, m_blockLength);
+- return make_shared<RVNGStringStream>(block, m_blockLength);
++ return make_shared<QXPMemoryStream>(block, m_blockLength);
+ }
+
+ std::shared_ptr<RVNGInputStream> QXPBlockParser::getChain(const uint32_t index)
+@@ -59,7 +59,7 @@ std::shared_ptr<RVNGInputStream> QXPBlockParser::getChain(const uint32_t index)
+ isBig = nextVal < 0;
+ next = abs(nextVal);
+ }
+- return make_shared<RVNGStringStream>(chain.data(), chain.size());
++ return make_shared<QXPMemoryStream>(chain.data(), chain.size());
+ }
+
+ }
+diff --git a/src/lib/QXPParser.cpp b/src/lib/QXPParser.cpp
+index 54abd7e..9dd90a8 100644
+--- a/src/lib/QXPParser.cpp
++++ b/src/lib/QXPParser.cpp
+@@ -18,7 +18,6 @@
+ namespace libqxp
+ {
+
+-using librevenge::RVNGStringStream;
+ using std::make_shared;
+
+ QXPParser::QXPParser(const std::shared_ptr<librevenge::RVNGInputStream> &input, librevenge::RVNGDrawingInterface *painter, const std::shared_ptr<QXPHeader> &header)
+--
+2.7.4
+
diff --git a/external/libqxp/ExternalProject_libqxp.mk b/external/libqxp/ExternalProject_libqxp.mk
new file mode 100644
index 000000000000..5bc0ac9d7fad
--- /dev/null
+++ b/external/libqxp/ExternalProject_libqxp.mk
@@ -0,0 +1,45 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,libqxp))
+
+$(eval $(call gb_ExternalProject_use_autoconf,libqxp,build))
+
+$(eval $(call gb_ExternalProject_register_targets,libqxp,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,libqxp,\
+ boost_headers \
+ icu \
+ revenge \
+ zlib \
+))
+
+$(call gb_ExternalProject_get_state_target,libqxp,build) :
+ $(call gb_ExternalProject_run,build,\
+ export PKG_CONFIG="" \
+ && MAKE=$(MAKE) ./configure \
+ --with-pic \
+ --enable-static \
+ --disable-shared \
+ --without-docs \
+ --disable-tools \
+ --disable-debug \
+ --disable-werror \
+ --disable-weffc \
+ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
+ CXXFLAGS="$(CXXFLAGS) $(CXXFLAGS_CXX11) $(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost))" \
+ REVENGE_GENERATORS_CFLAGS=' ' REVENGE_GENERATORS_LIBS=' ' REVENGE_STREAM_CFLAGS=' ' REVENGE_STREAM_LIBS=' ' \
+ ax_cv_cxx_compile_cxx11=yes \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ && $(MAKE) -C src/lib \
+ )
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libqxp/Makefile b/external/libqxp/Makefile
new file mode 100644
index 000000000000..e4968cf85fb6
--- /dev/null
+++ b/external/libqxp/Makefile
@@ -0,0 +1,7 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libqxp/Module_libqxp.mk b/external/libqxp/Module_libqxp.mk
new file mode 100644
index 000000000000..8359683da288
--- /dev/null
+++ b/external/libqxp/Module_libqxp.mk
@@ -0,0 +1,17 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libqxp))
+
+$(eval $(call gb_Module_add_targets,libqxp,\
+ ExternalProject_libqxp \
+ UnpackedTarball_libqxp \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libqxp/README b/external/libqxp/README
new file mode 100644
index 000000000000..6f13b86fed57
--- /dev/null
+++ b/external/libqxp/README
@@ -0,0 +1,4 @@
+libqxp is a library and a set of tools for reading and converting
+QuarkXPress file format. It supports versions 3.1-4.1 currently.
+
+[https://wiki.documentfoundation.org/DLP/Libraries/libqxp]
diff --git a/external/libqxp/UnpackedTarball_libqxp.mk b/external/libqxp/UnpackedTarball_libqxp.mk
new file mode 100644
index 000000000000..e20b7f94ecee
--- /dev/null
+++ b/external/libqxp/UnpackedTarball_libqxp.mk
@@ -0,0 +1,29 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,libqxp))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libqxp,$(QXP_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,libqxp,0))
+
+ifeq ($(COM_IS_CLANG),TRUE)
+ifneq ($(filter -fsanitize=%,$(CC)),)
+$(eval $(call gb_UnpackedTarball_add_patches,libqxp, \
+ external/libqxp/ubsan-visibility.patch \
+))
+endif
+endif
+
+$(eval $(call gb_UnpackedTarball_add_patches,libqxp, \
+ external/libqxp/0001-don-t-use-RVNGStringStream-in-the-main-lib.patch.1 \
+ external/libqxp/0001-add-missing-includes.patch.1 \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libqxp/ubsan-visibility.patch b/external/libqxp/ubsan-visibility.patch
new file mode 100644
index 000000000000..90ead2b844b2
--- /dev/null
+++ b/external/libqxp/ubsan-visibility.patch
@@ -0,0 +1,11 @@
+--- configure
++++ configure
+@@ -16787,7 +16787,7 @@
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fvisibility=hidden compiler flag" >&5
+ $as_echo_n "checking for -fvisibility=hidden compiler flag... " >&6; }
+ saved_CXXFLAGS="$CXXFLAGS"
+- CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
++ CXXFLAGS="$CXXFLAGS -fvisibility-ms-compat"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+