summaryrefslogtreecommitdiffstats
path: root/external/libmspub
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
commited5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch)
tree7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /external/libmspub
parentInitial commit. (diff)
downloadlibreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.tar.xz
libreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.zip
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--external/libmspub/ExternalProject_libmspub.mk47
-rw-r--r--external/libmspub/Makefile7
-rw-r--r--external/libmspub/Module_libmspub.mk17
-rw-r--r--external/libmspub/README3
-rw-r--r--external/libmspub/UnpackedTarball_libmspub.mk31
-rw-r--r--external/libmspub/libmspub_android_arm.patch.112
-rw-r--r--external/libmspub/stdint.patch10
-rw-r--r--external/libmspub/ubsan.patch12
8 files changed, 139 insertions, 0 deletions
diff --git a/external/libmspub/ExternalProject_libmspub.mk b/external/libmspub/ExternalProject_libmspub.mk
new file mode 100644
index 000000000..f84e5c9b2
--- /dev/null
+++ b/external/libmspub/ExternalProject_libmspub.mk
@@ -0,0 +1,47 @@
+# -*- 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,libmspub))
+
+$(eval $(call gb_ExternalProject_use_autoconf,libmspub,build))
+
+$(eval $(call gb_ExternalProject_register_targets,libmspub,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,libmspub,\
+ boost_headers \
+ icu \
+ revenge \
+ zlib \
+))
+
+$(call gb_ExternalProject_get_state_target,libmspub,build) :
+ $(call gb_Trace_StartRange,libmspub,EXTERNAL)
+ $(call gb_ExternalProject_run,build,\
+ export PKG_CONFIG="" \
+ && MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
+ --with-pic \
+ --enable-static \
+ --disable-shared \
+ --without-docs \
+ --disable-tools \
+ $(if $(ENABLE_DEBUG),--enable-debug,--disable-debug) \
+ --disable-werror \
+ --disable-weffc \
+ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
+ CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libmspub)" \
+ CPPFLAGS="$(CPPFLAGS) $(ICU_UCHAR_TYPE) $(BOOST_CPPFLAGS)" \
+ LDFLAGS="$(call gb_ExternalProject_get_link_flags,libmspub)" \
+ $(gb_CONFIGURE_PLATFORMS) \
+ && $(MAKE) \
+ )
+ $(call gb_Trace_EndRange,libmspub,EXTERNAL)
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libmspub/Makefile b/external/libmspub/Makefile
new file mode 100644
index 000000000..e4968cf85
--- /dev/null
+++ b/external/libmspub/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/libmspub/Module_libmspub.mk b/external/libmspub/Module_libmspub.mk
new file mode 100644
index 000000000..81ea7e91d
--- /dev/null
+++ b/external/libmspub/Module_libmspub.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,libmspub))
+
+$(eval $(call gb_Module_add_targets,libmspub,\
+ ExternalProject_libmspub \
+ UnpackedTarball_libmspub \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libmspub/README b/external/libmspub/README
new file mode 100644
index 000000000..5a6625fff
--- /dev/null
+++ b/external/libmspub/README
@@ -0,0 +1,3 @@
+Library parsing the Microsoft Publisher documents.
+
+[https://wiki.documentfoundation.org/DLP/Libraries/libmspub]
diff --git a/external/libmspub/UnpackedTarball_libmspub.mk b/external/libmspub/UnpackedTarball_libmspub.mk
new file mode 100644
index 000000000..287be540d
--- /dev/null
+++ b/external/libmspub/UnpackedTarball_libmspub.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,libmspub))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libmspub,$(MSPUB_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,libmspub,0))
+
+# * external/libmspub/stdint.patch is upstream at <https://gerrit.libreoffice.org/#/c/73814/>
+# "missing include":
+$(eval $(call gb_UnpackedTarball_add_patches,libmspub,\
+ external/libmspub/ubsan.patch \
+ external/libmspub/stdint.patch \
+))
+
+$(eval $(call gb_UnpackedTarball_update_autoconf_configs,libmspub))
+
+ifeq ($(ANDROID_APP_ABI),armeabi-v7a)
+$(eval $(call gb_UnpackedTarball_add_patches,libmspub, \
+ external/libmspub/libmspub_android_arm.patch.1 \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libmspub/libmspub_android_arm.patch.1 b/external/libmspub/libmspub_android_arm.patch.1
new file mode 100644
index 000000000..2d7d0e12c
--- /dev/null
+++ b/external/libmspub/libmspub_android_arm.patch.1
@@ -0,0 +1,12 @@
+diff -ur libmspub.org/src/lib/libmspub_utils.cpp libmspub/src/lib/libmspub_utils.cpp
+--- libmspub.org/src/lib/libmspub_utils.cpp 2018-04-07 15:13:32.041792236 +0200
++++ libmspub/src/lib/libmspub_utils.cpp 2018-04-07 15:14:08.547790739 +0200
+@@ -29,7 +29,7 @@
+ {
+ va_list args;
+ va_start(args, format);
+- std::vfprintf(stderr, format, args);
++ vfprintf(stderr, format, args);
+ va_end(args);
+ }
+
diff --git a/external/libmspub/stdint.patch b/external/libmspub/stdint.patch
new file mode 100644
index 000000000..61f1dd122
--- /dev/null
+++ b/external/libmspub/stdint.patch
@@ -0,0 +1,10 @@
+--- src/lib/MSPUBMetaData.h
++++ src/lib/MSPUBMetaData.h
+@@ -13,6 +13,7 @@
+ #include <map>
+ #include <utility>
+ #include <vector>
++#include <stdint.h>
+
+ #include <librevenge/librevenge.h>
+
diff --git a/external/libmspub/ubsan.patch b/external/libmspub/ubsan.patch
new file mode 100644
index 000000000..b58249e18
--- /dev/null
+++ b/external/libmspub/ubsan.patch
@@ -0,0 +1,12 @@
+--- src/lib/MSPUBContentChunkType.h
++++ src/lib/MSPUBContentChunkType.h
+@@ -27,7 +27,8 @@
+ CELLS = 0x63,
+ FONT = 0x6C,
+ IMAGE_2K, //these don't exist in Pub 2k3 so their value in the enum is not used.
+- IMAGE_2K_DATA
++ IMAGE_2K_DATA,
++ MSPUBContentChunkType_dummy=0xFF // MSPUBParser.cpp:2359:9: runtime error: load of value 138, which is not a valid value for type 'libmspub::MSPUBContentChunkType'
+ };
+ } // namespace libmspub
+