summaryrefslogtreecommitdiffstats
path: root/external/libodfgen
diff options
context:
space:
mode:
Diffstat (limited to 'external/libodfgen')
-rw-r--r--external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.158
-rw-r--r--external/libodfgen/ExternalPackage_libodfgen.mk22
-rw-r--r--external/libodfgen/ExternalProject_libodfgen.mk54
-rw-r--r--external/libodfgen/Library_odfgen.mk56
-rw-r--r--external/libodfgen/Makefile7
-rw-r--r--external/libodfgen/Module_libodfgen.mk31
-rw-r--r--external/libodfgen/README1
-rw-r--r--external/libodfgen/UnpackedTarball_libodfgen.mk40
-rw-r--r--external/libodfgen/c++11.patch44
-rw-r--r--external/libodfgen/libodfgen-bundled-soname.patch.012
-rw-r--r--external/libodfgen/rpath.patch10
11 files changed, 335 insertions, 0 deletions
diff --git a/external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.1 b/external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.1
new file mode 100644
index 000000000..1fc4e6b9d
--- /dev/null
+++ b/external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.1
@@ -0,0 +1,58 @@
+From 68e0c8e4c834df57bc9a0e8da72151f69ff5e7a6 Mon Sep 17 00:00:00 2001
+From: David Tardon <dtardon@redhat.com>
+Date: Fri, 12 Aug 2016 12:50:39 +0200
+Subject: [PATCH] tdf#101077 make double->string conversion locale-agnostic
+
+---
+ src/OdsGenerator.cxx | 19 +++++++++++++++++--
+ 1 file changed, 17 insertions(+), 2 deletions(-)
+
+diff --git a/src/OdsGenerator.cxx b/src/OdsGenerator.cxx
+index 52e135e..8cb7203 100644
+--- a/src/OdsGenerator.cxx
++++ b/src/OdsGenerator.cxx
+@@ -26,6 +26,8 @@
+
+ #include <librevenge/librevenge.h>
+
++#include <iomanip>
++#include <locale>
+ #include <map>
+ #include <stack>
+ #include <sstream>
+@@ -46,6 +48,19 @@
+ #include "OdcGenerator.hxx"
+ #include "OdfGenerator.hxx"
+
++namespace
++{
++
++librevenge::RVNGString makePreciseStr(const double value)
++{
++ std::ostringstream os;
++ os.imbue(std::locale::classic());
++ os << std::fixed << std::setprecision(8) << value;
++ return os.str().c_str();
++}
++
++}
++
+ class OdsGeneratorPrivate : public OdfGenerator
+ {
+ public:
+@@ -968,10 +983,10 @@ void OdsGenerator::openSheetCell(const librevenge::RVNGPropertyList &propList)
+ // we need the maximum precision here, so we must avoid getStr() when possible
+ librevenge::RVNGString value;
+ if (propList["librevenge:value"]->getUnit()==librevenge::RVNG_GENERIC)
+- value.sprintf("%.8f", propList["librevenge:value"]->getDouble());
++ value = makePreciseStr(propList["librevenge:value"]->getDouble());
+ else if (propList["librevenge:value"]->getUnit()==librevenge::RVNG_PERCENT)
+ {
+- value.sprintf("%.8f", propList["librevenge:value"]->getDouble()*100.);
++ value = makePreciseStr(propList["librevenge:value"]->getDouble()*100.);
+ value.append('%');
+ }
+ else
+--
+2.7.4
+
diff --git a/external/libodfgen/ExternalPackage_libodfgen.mk b/external/libodfgen/ExternalPackage_libodfgen.mk
new file mode 100644
index 000000000..f2df2a623
--- /dev/null
+++ b/external/libodfgen/ExternalPackage_libodfgen.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,libodfgen,libodfgen))
+
+$(eval $(call gb_ExternalPackage_use_external_project,libodfgen,libodfgen))
+
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,libodfgen,$(LIBO_LIB_FOLDER)/libodfgen-0.1.1.dylib,src/.libs/libodfgen-0.1.1.dylib))
+else ifeq ($(OS),WNT)
+$(eval $(call gb_ExternalPackage_add_file,libodfgen,$(LIBO_LIB_FOLDER)/libodfgen-0.1.dll,src/.libs/libodfgen-0.1.dll))
+else ifeq ($(DISABLE_DYNLOADING),)
+$(eval $(call gb_ExternalPackage_add_file,libodfgen,$(LIBO_LIB_FOLDER)/libodfgen-0.1-lo.so.1,src/.libs/libodfgen-0.1-lo.so.1.0.$(ODFGEN_VERSION_MICRO)))
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libodfgen/ExternalProject_libodfgen.mk b/external/libodfgen/ExternalProject_libodfgen.mk
new file mode 100644
index 000000000..679598542
--- /dev/null
+++ b/external/libodfgen/ExternalProject_libodfgen.mk
@@ -0,0 +1,54 @@
+# -*- 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,libodfgen))
+
+$(eval $(call gb_ExternalProject_use_autoconf,libodfgen,build))
+
+$(eval $(call gb_ExternalProject_register_targets,libodfgen,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,libodfgen,\
+ revenge \
+))
+
+$(call gb_ExternalProject_get_state_target,libodfgen,build) :
+ $(call gb_Trace_StartRange,libodfgen,EXTERNAL)
+ $(call gb_ExternalProject_run,build,\
+ export PKG_CONFIG="" \
+ && ./configure \
+ --with-pic \
+ $(if $(DISABLE_DYNLOADING), \
+ --enable-static --disable-shared \
+ , \
+ --enable-shared --disable-static \
+ ) \
+ $(if $(ENABLE_DEBUG),--enable-debug,--disable-debug) \
+ --disable-werror \
+ --disable-weffc \
+ --without-docs \
+ --with-sharedptr=c++11 \
+ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
+ CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CPPFLAGS="$(CPPFLAGS) $(if $(SYSTEM_REVENGE),,$(if $(filter-out MSC,$(COM)),-DLIBREVENGE_VISIBILITY))" \
+ $(if $(filter LINUX,$(OS)),$(if $(SYSTEM_REVENGE),, \
+ 'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
+ -Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN')) \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ $(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/.libs/libodfgen-0.1.1.dylib \
+ ) \
+ )
+ $(call gb_Trace_EndRange,libodfgen,EXTERNAL)
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libodfgen/Library_odfgen.mk b/external/libodfgen/Library_odfgen.mk
new file mode 100644
index 000000000..946fa9081
--- /dev/null
+++ b/external/libodfgen/Library_odfgen.mk
@@ -0,0 +1,56 @@
+# -*- 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,odfgen))
+
+$(eval $(call gb_Library_use_unpacked,odfgen,libodfgen))
+
+$(eval $(call gb_Library_use_externals,odfgen,\
+ revenge \
+))
+
+$(eval $(call gb_Library_set_warnings_disabled,odfgen))
+
+$(eval $(call gb_Library_set_include,odfgen,\
+ -I$(call gb_UnpackedTarball_get_dir,libodfgen)/inc \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_Library_add_defs,odfgen,\
+ -DDLL_EXPORT \
+ -DLIBODFGEN_BUILD \
+ -DNDEBUG \
+ -DSHAREDPTR_STD \
+ -DPACKAGE=\"libodfgen\" \
+ -DVERSION=\"0.1.$(ODFGEN_VERSION_MICRO)\" \
+))
+
+$(eval $(call gb_Library_add_generated_exception_objects,odfgen,\
+ UnpackedTarball/libodfgen/src/DocumentElement \
+ UnpackedTarball/libodfgen/src/FillManager \
+ UnpackedTarball/libodfgen/src/FilterInternal \
+ UnpackedTarball/libodfgen/src/FontStyle \
+ UnpackedTarball/libodfgen/src/GraphicFunctions \
+ UnpackedTarball/libodfgen/src/GraphicStyle \
+ UnpackedTarball/libodfgen/src/InternalHandler \
+ UnpackedTarball/libodfgen/src/ListStyle \
+ UnpackedTarball/libodfgen/src/OdcGenerator \
+ UnpackedTarball/libodfgen/src/OdfGenerator \
+ UnpackedTarball/libodfgen/src/OdgGenerator \
+ UnpackedTarball/libodfgen/src/OdpGenerator \
+ UnpackedTarball/libodfgen/src/OdsGenerator \
+ UnpackedTarball/libodfgen/src/OdtGenerator \
+ UnpackedTarball/libodfgen/src/PageSpan \
+ UnpackedTarball/libodfgen/src/SectionStyle \
+ UnpackedTarball/libodfgen/src/SheetStyle \
+ UnpackedTarball/libodfgen/src/TableStyle \
+ UnpackedTarball/libodfgen/src/TextRunStyle \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libodfgen/Makefile b/external/libodfgen/Makefile
new file mode 100644
index 000000000..e4968cf85
--- /dev/null
+++ b/external/libodfgen/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/libodfgen/Module_libodfgen.mk b/external/libodfgen/Module_libodfgen.mk
new file mode 100644
index 000000000..c10727402
--- /dev/null
+++ b/external/libodfgen/Module_libodfgen.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,libodfgen))
+
+$(eval $(call gb_Module_add_targets,libodfgen,\
+ UnpackedTarball_libodfgen \
+))
+
+ifeq ($(COM),MSC)
+
+$(eval $(call gb_Module_add_targets,libodfgen,\
+ Library_odfgen \
+))
+
+else
+
+$(eval $(call gb_Module_add_targets,libodfgen,\
+ ExternalPackage_libodfgen \
+ ExternalProject_libodfgen \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libodfgen/README b/external/libodfgen/README
new file mode 100644
index 000000000..01454e0d9
--- /dev/null
+++ b/external/libodfgen/README
@@ -0,0 +1 @@
+From [https://sourceforge.net/p/libwpd/wiki/libodfgen/]. Library to generate ODT and ODG documents from librevenge API calls.
diff --git a/external/libodfgen/UnpackedTarball_libodfgen.mk b/external/libodfgen/UnpackedTarball_libodfgen.mk
new file mode 100644
index 000000000..c4ea2939f
--- /dev/null
+++ b/external/libodfgen/UnpackedTarball_libodfgen.mk
@@ -0,0 +1,40 @@
+# -*- 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,libodfgen))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libodfgen,$(ODFGEN_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,libodfgen,0))
+
+$(eval $(call gb_UnpackedTarball_update_autoconf_configs,libodfgen))
+
+ifeq ($(SYSTEM_REVENGE),)
+$(eval $(call gb_UnpackedTarball_add_patches,libodfgen, \
+ external/libodfgen/rpath.patch \
+))
+endif
+
+ifneq ($(OS),MACOSX)
+ifneq ($(OS),WNT)
+$(eval $(call gb_UnpackedTarball_add_patches,libodfgen, \
+ external/libodfgen/libodfgen-bundled-soname.patch.0 \
+))
+endif
+endif
+
+# * external/libodfgen/c++11.patch: obsoleted upstream by
+# <https://sourceforge.net/p/libwpd/libodfgen/ci/e11112e50562de4f3252227bfba175ededf82194/>
+# "boost::shared_ptr -> std::shared_ptr"
+$(eval $(call gb_UnpackedTarball_add_patches,libodfgen, \
+ external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.1 \
+ external/libodfgen/c++11.patch \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libodfgen/c++11.patch b/external/libodfgen/c++11.patch
new file mode 100644
index 000000000..f41d1a166
--- /dev/null
+++ b/external/libodfgen/c++11.patch
@@ -0,0 +1,44 @@
+# Add -std=c++11 before existing CXXFLAGS, in case those already contain some -std= (which will thus
+# override the preceding -std=c++11, which is likely what the caller passing in those CXXFLAGS
+# intends):
+#
+#--- configure.ac
+#+++ configure.ac
+#@@ -217,7 +217,7 @@
+# AS_IF([test "x$with_sharedptr" = "xc++11"], [
+# AC_MSG_CHECKING([for c++11 shared ptr])
+# save_CXXFLAGS="$CXXFLAGS"
+#- CXXFLAGS="$CXXFLAGS -std=c++11"
+#+ CXXFLAGS="-std=c++11 $CXXFLAGS"
+# AC_COMPILE_IFELSE([
+# AC_LANG_PROGRAM(
+# [[#include <memory>]],
+#@@ -241,7 +241,7 @@
+# AC_MSG_RESULT([no])
+# ], [
+# AC_MSG_RESULT([yes])
+#- CXXFLAGS="$CXXFLAGS -std=c++11"
+#+ CXXFLAGS="-std=c++11 $CXXFLAGS"
+# ])
+# ])
+# AS_IF([test "x$with_sharedptr" = "xtr1"], [
+--- configure
++++ configure
+@@ -16723,7 +16723,7 @@
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for c++11 shared ptr" >&5
+ $as_echo_n "checking for c++11 shared ptr... " >&6; }
+ save_CXXFLAGS="$CXXFLAGS"
+- CXXFLAGS="$CXXFLAGS -std=c++11"
++ CXXFLAGS="-std=c++11 $CXXFLAGS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+@@ -16780,7 +16780,7 @@
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+- CXXFLAGS="$CXXFLAGS -std=c++11"
++ CXXFLAGS="-std=c++11 $CXXFLAGS"
+
+ fi
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
diff --git a/external/libodfgen/libodfgen-bundled-soname.patch.0 b/external/libodfgen/libodfgen-bundled-soname.patch.0
new file mode 100644
index 000000000..052ba795e
--- /dev/null
+++ b/external/libodfgen/libodfgen-bundled-soname.patch.0
@@ -0,0 +1,12 @@
+diff -urN src/Makefile.in.orig src/Makefile.in
+--- src/Makefile.in.orig 2016-03-02 17:17:02.812606210 +0100
++++ src/Makefile.in 2016-03-02 17:17:25.176670151 +0100
+@@ -355,7 +355,7 @@
+ AM_CXXFLAGS = -I$(top_srcdir)/inc/ $(REVENGE_CFLAGS) $(DEBUG_CXXFLAGS) -DLIBODFGEN_BUILD
+ libodfgen_@LIBODFGEN_MAJOR_VERSION@_@LIBODFGEN_MINOR_VERSION@_la_LIBADD = @LIBODFGEN_WIN32_RESOURCE@ $(REVENGE_LIBS)
+ libodfgen_@LIBODFGEN_MAJOR_VERSION@_@LIBODFGEN_MINOR_VERSION@_la_DEPENDENCIES = @LIBODFGEN_WIN32_RESOURCE@
+-libodfgen_@LIBODFGEN_MAJOR_VERSION@_@LIBODFGEN_MINOR_VERSION@_la_LDFLAGS = $(version_info) -export-dynamic -no-undefined
++libodfgen_@LIBODFGEN_MAJOR_VERSION@_@LIBODFGEN_MINOR_VERSION@_la_LDFLAGS = $(version_info) -export-dynamic -no-undefined -release lo
+ libodfgen_@LIBODFGEN_MAJOR_VERSION@_@LIBODFGEN_MINOR_VERSION@_la_SOURCES = \
+ DocumentElement.cxx \
+ DocumentElement.hxx \
diff --git a/external/libodfgen/rpath.patch b/external/libodfgen/rpath.patch
new file mode 100644
index 000000000..698cf5dca
--- /dev/null
+++ b/external/libodfgen/rpath.patch
@@ -0,0 +1,10 @@
+--- configure
++++ configure
+@@ -13940,6 +13940,7 @@
+ esac
+ ;;
+ esac
++hardcode_libdir_flag_spec_CXX=
+ ;;
+
+ lynxos*)