summaryrefslogtreecommitdiffstats
path: root/external/librevenge
diff options
context:
space:
mode:
Diffstat (limited to 'external/librevenge')
-rw-r--r--external/librevenge/ExternalPackage_librevenge.mk22
-rw-r--r--external/librevenge/ExternalProject_librevenge.mk50
-rw-r--r--external/librevenge/Library_revenge.mk48
-rw-r--r--external/librevenge/Makefile7
-rw-r--r--external/librevenge/Module_librevenge.mk31
-rw-r--r--external/librevenge/README3
-rw-r--r--external/librevenge/UnpackedTarball_librevenge.mk31
-rw-r--r--external/librevenge/librevenge-bundled-soname.patch.011
-rw-r--r--external/librevenge/rpath.patch11
-rw-r--r--external/librevenge/tdf63130-improve-perf.patch.080
10 files changed, 294 insertions, 0 deletions
diff --git a/external/librevenge/ExternalPackage_librevenge.mk b/external/librevenge/ExternalPackage_librevenge.mk
new file mode 100644
index 0000000000..4ed404c63e
--- /dev/null
+++ b/external/librevenge/ExternalPackage_librevenge.mk
@@ -0,0 +1,22 @@
+# -*- 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_ExternalPackage_ExternalPackage,librevenge,librevenge))
+
+$(eval $(call gb_ExternalPackage_use_external_project,librevenge,librevenge))
+
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,librevenge,$(LIBO_LIB_FOLDER)/librevenge-0.0.0.dylib,src/lib/.libs/librevenge-0.0.0.dylib))
+else ifeq ($(OS),WNT)
+$(eval $(call gb_ExternalPackage_add_file,librevenge,$(LIBO_LIB_FOLDER)/librevenge-0.0.dll,src/lib/.libs/librevenge-0.0.dll))
+else ifeq ($(DISABLE_DYNLOADING),)
+$(eval $(call gb_ExternalPackage_add_file,librevenge,$(LIBO_LIB_FOLDER)/librevenge-0.0-lo.so.0,src/lib/.libs/librevenge-0.0-lo.so.0.0.$(REVENGE_VERSION_MICRO)))
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/librevenge/ExternalProject_librevenge.mk b/external/librevenge/ExternalProject_librevenge.mk
new file mode 100644
index 0000000000..4e64d5534b
--- /dev/null
+++ b/external/librevenge/ExternalProject_librevenge.mk
@@ -0,0 +1,50 @@
+# -*- 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,librevenge))
+
+$(eval $(call gb_ExternalProject_use_autoconf,librevenge,build))
+
+$(eval $(call gb_ExternalProject_register_targets,librevenge,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,librevenge,\
+ boost_headers \
+))
+
+$(call gb_ExternalProject_get_state_target,librevenge,build) :
+ $(call gb_Trace_StartRange,librevenge,EXTERNAL)
+ $(call gb_ExternalProject_run,build,\
+ export PKG_CONFIG="" \
+ && $(gb_RUN_CONFIGURE) ./configure \
+ --with-pic \
+ $(if $(DISABLE_DYNLOADING), \
+ --disable-shared --enable-static, \
+ --enable-shared --disable-static) \
+ $(if $(ENABLE_DEBUG),--enable-debug,--disable-debug) \
+ --disable-werror \
+ --disable-weffc \
+ --disable-streams \
+ --disable-generators \
+ --without-docs \
+ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
+ CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,librevenge)" \
+ CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \
+ $(gb_CONFIGURE_PLATFORMS) \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
+ && $(MAKE) \
+ $(if $(filter MACOSX,$(OS)),\
+ && $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \
+ $(EXTERNAL_WORKDIR)/src/lib/.libs/librevenge-0.0.0.dylib \
+ ) \
+ )
+ $(call gb_Trace_EndRange,librevenge,EXTERNAL)
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/librevenge/Library_revenge.mk b/external/librevenge/Library_revenge.mk
new file mode 100644
index 0000000000..4250e4e577
--- /dev/null
+++ b/external/librevenge/Library_revenge.mk
@@ -0,0 +1,48 @@
+# -*- 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_Library_Library,revenge))
+
+$(eval $(call gb_Library_use_unpacked,revenge,librevenge))
+
+$(eval $(call gb_Library_use_externals,revenge,\
+ boost_headers \
+))
+
+$(eval $(call gb_Library_set_warnings_disabled,revenge))
+
+$(eval $(call gb_Library_set_include,revenge,\
+ -I$(call gb_UnpackedTarball_get_dir,librevenge)/inc \
+ $$(INCLUDE) \
+))
+
+# -DLIBREVENGE_STREAM_BUILD is present so that linker does not complain
+# about unresolved external symbol RVNGStream::~RVNGStream
+$(eval $(call gb_Library_add_defs,revenge,\
+ -DBOOST_ALL_NO_LIB \
+ -DDLL_EXPORT \
+ -DLIBREVENGE_BUILD \
+ -DLIBREVENGE_STREAM_BUILD \
+ -DNDEBUG \
+))
+
+$(eval $(call gb_Library_set_generated_cxx_suffix,revenge,cpp))
+
+$(eval $(call gb_Library_add_generated_exception_objects,revenge,\
+ UnpackedTarball/librevenge/src/lib/RVNGBinaryData \
+ UnpackedTarball/librevenge/src/lib/RVNGMemoryStream \
+ UnpackedTarball/librevenge/src/lib/RVNGProperty \
+ UnpackedTarball/librevenge/src/lib/RVNGPropertyList \
+ UnpackedTarball/librevenge/src/lib/RVNGPropertyListVector \
+ UnpackedTarball/librevenge/src/lib/RVNGString \
+ UnpackedTarball/librevenge/src/lib/RVNGStringVector \
+ UnpackedTarball/librevenge/src/lib/RVNGSVGDrawingGenerator \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/librevenge/Makefile b/external/librevenge/Makefile
new file mode 100644
index 0000000000..e4968cf85f
--- /dev/null
+++ b/external/librevenge/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/librevenge/Module_librevenge.mk b/external/librevenge/Module_librevenge.mk
new file mode 100644
index 0000000000..cd11805f0b
--- /dev/null
+++ b/external/librevenge/Module_librevenge.mk
@@ -0,0 +1,31 @@
+# -*- 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,librevenge))
+
+$(eval $(call gb_Module_add_targets,librevenge,\
+ UnpackedTarball_librevenge \
+))
+
+ifeq ($(COM),MSC)
+
+$(eval $(call gb_Module_add_targets,librevenge,\
+ Library_revenge \
+))
+
+else
+
+$(eval $(call gb_Module_add_targets,librevenge,\
+ ExternalPackage_librevenge \
+ ExternalProject_librevenge \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/librevenge/README b/external/librevenge/README
new file mode 100644
index 0000000000..23007ff99e
--- /dev/null
+++ b/external/librevenge/README
@@ -0,0 +1,3 @@
+From [http://sourceforge.net/p/libwpd/wiki/librevenge/]. A base library
+for writing document import filters. It has interfaces for text documents,
+vector graphics, spreadsheets and presentations.
diff --git a/external/librevenge/UnpackedTarball_librevenge.mk b/external/librevenge/UnpackedTarball_librevenge.mk
new file mode 100644
index 0000000000..5fcc2e33b0
--- /dev/null
+++ b/external/librevenge/UnpackedTarball_librevenge.mk
@@ -0,0 +1,31 @@
+# -*- 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,librevenge))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,librevenge,$(REVENGE_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_update_autoconf_configs,librevenge))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,librevenge,0))
+
+$(eval $(call gb_UnpackedTarball_add_patches,librevenge, \
+ external/librevenge/rpath.patch \
+ external/librevenge/tdf63130-improve-perf.patch.0 \
+))
+
+ifneq ($(OS),MACOSX)
+ifneq ($(OS),WNT)
+$(eval $(call gb_UnpackedTarball_add_patches,librevenge, \
+ external/librevenge/librevenge-bundled-soname.patch.0 \
+))
+endif
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/librevenge/librevenge-bundled-soname.patch.0 b/external/librevenge/librevenge-bundled-soname.patch.0
new file mode 100644
index 0000000000..d98630f0c6
--- /dev/null
+++ b/external/librevenge/librevenge-bundled-soname.patch.0
@@ -0,0 +1,11 @@
+--- src/lib/Makefile.in.orig 2015-08-07 11:57:42.256742305 +0200
++++ src/lib/Makefile.in 2015-08-07 11:58:11.818741799 +0200
+@@ -470,7 +470,7 @@
+ $(am__append_2)
+ librevenge_@RVNG_MAJOR_VERSION@_@RVNG_MINOR_VERSION@_la_LIBADD = @LIBREVENGE_WIN32_RESOURCE@
+ librevenge_@RVNG_MAJOR_VERSION@_@RVNG_MINOR_VERSION@_la_DEPENDENCIES = @LIBREVENGE_WIN32_RESOURCE@
+-librevenge_@RVNG_MAJOR_VERSION@_@RVNG_MINOR_VERSION@_la_LDFLAGS = $(version_info) -export-dynamic $(no_undefined)
++librevenge_@RVNG_MAJOR_VERSION@_@RVNG_MINOR_VERSION@_la_LDFLAGS = $(version_info) -export-dynamic $(no_undefined) -release lo
+ librevenge_@RVNG_MAJOR_VERSION@_@RVNG_MINOR_VERSION@_la_SOURCES = \
+ RVNGBinaryData.cpp \
+ RVNGMemoryStream.cpp \
diff --git a/external/librevenge/rpath.patch b/external/librevenge/rpath.patch
new file mode 100644
index 0000000000..c7d2100809
--- /dev/null
+++ b/external/librevenge/rpath.patch
@@ -0,0 +1,11 @@
+--- configure
++++ configure
+@@ -14983,6 +14983,8 @@
+ esac
+ ;;
+ esac
++hardcode_libdir_flag_spec_CXX=
++runpath_var=
+ ;;
+
+ lynxos*)
diff --git a/external/librevenge/tdf63130-improve-perf.patch.0 b/external/librevenge/tdf63130-improve-perf.patch.0
new file mode 100644
index 0000000000..02a8a6e1f9
--- /dev/null
+++ b/external/librevenge/tdf63130-improve-perf.patch.0
@@ -0,0 +1,80 @@
+--- inc/librevenge/RVNGString.h 2023-05-17 15:48:15.373159469 +0200
++++ inc/librevenge/RVNGString.h 2023-05-17 15:49:00.781411917 +0200
+@@ -22,6 +22,7 @@
+ #define RVNGSTRING_H
+
+ #include "librevenge-api.h"
++#include <string>
+
+ namespace librevenge
+ {
+@@ -36,6 +37,7 @@
+ RVNGString();
+ RVNGString(const RVNGString &other);
+ RVNGString(const char *str);
++ RVNGString(std::string&&);
+ ~RVNGString();
+
+ /** Create a new string from \a s as escaped XML.
+--- src/lib/RVNGBinaryData.cpp 2023-05-17 15:48:15.373159469 +0200
++++ src/lib/RVNGBinaryData.cpp 2023-05-17 15:49:00.773411873 +0200
+@@ -67,9 +67,9 @@
+ boost::archive::iterators::transform_width<std::vector<unsigned char>::const_iterator, 6, 8 > > base64_encoder;
+
+ // Encode the buffer and create a string
+- std::copy(
++ result.insert(result.begin(),
+ base64_encoder(source.begin()),
+- base64_encoder(source.end()), std::back_inserter(result));
++ base64_encoder(source.end()));
+
+ result.append(numPadding, '='); // add '=' for each padded character
+ }
+@@ -150,10 +150,10 @@
+ {
+ m_binaryDataImpl->makeUnique();
+
+- unsigned long previousSize = m_binaryDataImpl->m_ptr->m_buf.size();
+- m_binaryDataImpl->m_ptr->m_buf.reserve(previousSize + data.m_binaryDataImpl->m_ptr->m_buf.size());
+- for (unsigned long i = 0; i < data.m_binaryDataImpl->m_ptr->m_buf.size(); i++)
+- m_binaryDataImpl->m_ptr->m_buf.push_back(data.m_binaryDataImpl->m_ptr->m_buf[i]);
++ m_binaryDataImpl->m_ptr->m_buf.insert(
++ m_binaryDataImpl->m_ptr->m_buf.end(),
++ data.m_binaryDataImpl->m_ptr->m_buf.begin(),
++ data.m_binaryDataImpl->m_ptr->m_buf.end());
+ }
+
+ void RVNGBinaryData::appendBase64Data(const RVNGString &base64)
+@@ -231,8 +231,9 @@
+ const RVNGString RVNGBinaryData::getBase64Data() const
+ {
+ std::string base64;
++ base64.reserve(m_binaryDataImpl->m_ptr->m_buf.size() / 4 * 3);
+ convertToBase64(base64, m_binaryDataImpl->m_ptr->m_buf);
+- return RVNGString(base64.c_str());
++ return RVNGString(std::move(base64));
+ }
+
+ RVNGInputStream *RVNGBinaryData::getDataStream() const
+--- src/lib/RVNGString.cpp 2023-05-17 15:48:15.373159469 +0200
++++ src/lib/RVNGString.cpp 2023-05-17 15:49:00.773411873 +0200
+@@ -73,6 +73,7 @@
+ {
+ public:
+ RVNGStringImpl() : m_buf() {}
++ RVNGStringImpl(std::string&& str) : m_buf(std::move(str)) {}
+ bool empty() const
+ {
+ return m_buf.empty();
+@@ -157,6 +158,11 @@
+ m_stringImpl->m_buf = str;
+ }
+
++RVNGString::RVNGString(std::string&& str) :
++ m_stringImpl(new RVNGStringImpl(std::move(str)))
++{
++}
++
+ RVNGString RVNGString::escapeXML(const RVNGString &s)
+ {
+ RVNGString escaped;