summaryrefslogtreecommitdiffstats
path: root/external/liborcus
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--external/liborcus/ExternalPackage_liborcus.mk22
-rw-r--r--external/liborcus/ExternalProject_liborcus.mk124
-rw-r--r--external/liborcus/Library_orcus-parser.mk72
-rw-r--r--external/liborcus/Library_orcus.mk155
-rw-r--r--external/liborcus/Makefile7
-rw-r--r--external/liborcus/Module_liborcus.mk32
-rw-r--r--external/liborcus/README2
-rw-r--r--external/liborcus/UnpackedTarball_liborcus.mk31
-rw-r--r--external/liborcus/gcc9.patch.027
-rw-r--r--external/liborcus/inc/pch/precompiled_orcus-parser.cxx12
-rw-r--r--external/liborcus/inc/pch/precompiled_orcus-parser.hxx92
-rw-r--r--external/liborcus/inc/pch/precompiled_orcus.cxx12
-rw-r--r--external/liborcus/inc/pch/precompiled_orcus.hxx112
-rw-r--r--external/liborcus/libtool.patch.011
-rw-r--r--external/liborcus/rpath.patch.010
-rw-r--r--external/liborcus/win_path_utf16.patch33
-rw-r--r--external/liborcus/windows-constants-hack.patch15
17 files changed, 769 insertions, 0 deletions
diff --git a/external/liborcus/ExternalPackage_liborcus.mk b/external/liborcus/ExternalPackage_liborcus.mk
new file mode 100644
index 0000000000..4adfcb247b
--- /dev/null
+++ b/external/liborcus/ExternalPackage_liborcus.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,liborcus,liborcus))
+
+$(eval $(call gb_ExternalPackage_use_external_project,liborcus,liborcus))
+
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,liborcus,$(LIBO_LIB_FOLDER)/liborcus-0.18.0.dylib,src/liborcus/.libs/liborcus-0.18.0.dylib))
+$(eval $(call gb_ExternalPackage_add_file,liborcus,$(LIBO_LIB_FOLDER)/liborcus-parser-0.18.0.dylib,src/parser/.libs/liborcus-parser-0.18.0.dylib))
+else ifeq ($(DISABLE_DYNLOADING),)
+$(eval $(call gb_ExternalPackage_add_file,liborcus,$(LIBO_LIB_FOLDER)/liborcus-0.18.so.0,src/liborcus/.libs/liborcus-0.18.so.0.0.0))
+$(eval $(call gb_ExternalPackage_add_file,liborcus,$(LIBO_LIB_FOLDER)/liborcus-parser-0.18.so.0,src/parser/.libs/liborcus-parser-0.18.so.0.0.0))
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/liborcus/ExternalProject_liborcus.mk b/external/liborcus/ExternalProject_liborcus.mk
new file mode 100644
index 0000000000..7f2e5f2408
--- /dev/null
+++ b/external/liborcus/ExternalProject_liborcus.mk
@@ -0,0 +1,124 @@
+# -*- 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,liborcus))
+
+$(eval $(call gb_ExternalProject_use_autoconf,liborcus,build))
+
+$(eval $(call gb_ExternalProject_use_externals,liborcus, \
+ boost_headers \
+ boost_filesystem \
+ boost_iostreams \
+ boost_system \
+ mdds_headers \
+ zlib \
+))
+
+$(eval $(call gb_ExternalProject_register_targets,liborcus,\
+ build \
+))
+
+# Must be built with debug GNU C++ library if --enable-dbgutil has
+# caused the LO code to be built thus.
+
+# The LIBS setting for Android is needed to get the orcus-xml-dump
+# executable to build successfully. We obviously don't actually need
+# that executable on Android, but we don't want to bother with
+# patching out building it for Android.
+
+#$(if $(filter MSC,$(COM)),CPPFLAGS+="-DBOOST_ALL_NO_LIB") CXXFLAGS+="$(BOOST_CXXFLAGS))
+
+liborcus_LIBS=
+ifneq ($(SYSTEM_ZLIB),)
+liborcus_LIBS+=-lz
+endif
+ifneq ($(SYSTEM_BOOST),)
+liborcus_LIBS+=$(BOOST_SYSTEM_LIB) $(BOOST_IOSTREAMS_LIB) $(BOOST_FILESYSTEM_LIB)
+else
+liborcus_LIBS+=-L$(gb_StaticLibrary_WORKDIR) -lboost_system -lboost_iostreams -lboost_filesystem
+endif
+ifeq ($(OS),ANDROID)
+liborcus_LIBS+=$(gb_STDLIBS)
+endif
+
+liborcus_CPPFLAGS=$(CPPFLAGS)
+ifeq ($(SYSTEM_ZLIB),)
+liborcus_CPPFLAGS+=$(ZLIB_CFLAGS)
+endif
+#
+# OSes that use the GNU C++ library need to use -D_GLIBCXX_DEBUG in
+# sync with the rest of LibreOffice, i.e. depending on
+# --enable-dbgutil. Note that although Android doesn't use the GNU C
+# library (glibc), the NDK does offer the GNU C++ library as one of
+# the C++ libraries available, and we use it.
+#
+liborcus_CPPFLAGS+=$(gb_COMPILERDEFS_STDLIB_DEBUG)
+
+liborcus_CXXFLAGS=$(CXXFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX) $(CXXFLAGS_CXX11) -DBOOST_SYSTEM_NO_DEPRECATED
+liborcus_LDFLAGS=$(LDFLAGS) $(gb_LTOFLAGS)
+liborcus_CXXFLAGS+=$(call gb_ExternalProject_get_build_flags,liborcus)
+liborcus_LDFLAGS+=$(call gb_ExternalProject_get_link_flags,liborcus)
+ifeq ($(COM),MSC)
+liborcus_CXXFLAGS+=$(BOOST_CXXFLAGS)
+endif
+ifeq ($(SYSTEM_BOOST),)
+liborcus_CXXFLAGS+=${BOOST_CPPFLAGS}
+else
+liborcus_LDFLAGS+=$(BOOST_LDFLAGS)
+endif
+ifneq (,$(PTHREAD_LIBS))
+liborcus_LDFLAGS+=$(PTHREAD_LIBS)
+endif
+
+ifeq ($(OS),LINUX)
+liborcus_LDFLAGS+=-Wl,-z,origin -Wl,-rpath,\$$$$ORIGIN
+endif
+
+$(call gb_ExternalProject_get_state_target,liborcus,build) :
+ $(call gb_Trace_StartRange,liborcus,EXTERNAL)
+ $(call gb_ExternalProject_run,build,\
+ $(if $(liborcus_LIBS),LIBS='$(liborcus_LIBS)') \
+ $(if $(liborcus_CXXFLAGS),CXXFLAGS='$(liborcus_CXXFLAGS)') \
+ $(if $(liborcus_CPPFLAGS),CPPFLAGS='$(liborcus_CPPFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS)') \
+ $(if $(liborcus_LDFLAGS),LDFLAGS='$(liborcus_LDFLAGS)') \
+ MDDS_CFLAGS='$(MDDS_CFLAGS)' \
+ MDDS_LIBS=' ' \
+ MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
+ --with-pic \
+ $(if $(DISABLE_DYNLOADING), \
+ --enable-static --disable-shared \
+ , \
+ --enable-shared --disable-static \
+ ) \
+ $(if $(ENABLE_DEBUG),--enable-debug,--disable-debug) \
+ --disable-spreadsheet-model \
+ --without-tools \
+ --without-benchmark \
+ --without-doc-example \
+ --disable-python \
+ --disable-werror \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
+ $(if $(SYSTEM_BOOST),,\
+ --with-boost=$(WORKDIR)/UnpackedTarball/boost \
+ boost_cv_lib_iostreams=yes \
+ boost_cv_lib_system=yes \
+ boost_cv_lib_filesystem=yes \
+ ) \
+ $(gb_CONFIGURE_PLATFORMS) \
+ && $(if $(verbose),V=1) \
+ $(MAKE) \
+ $(if $(filter MACOSX,$(OS)),\
+ && $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \
+ $(EXTERNAL_WORKDIR)/src/liborcus/.libs/liborcus-0.18.0.dylib \
+ $(EXTERNAL_WORKDIR)/src/parser/.libs/liborcus-parser-0.18.0.dylib \
+ ) \
+ )
+ $(call gb_Trace_EndRange,liborcus,EXTERNAL)
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/liborcus/Library_orcus-parser.mk b/external/liborcus/Library_orcus-parser.mk
new file mode 100644
index 0000000000..b7b459f36b
--- /dev/null
+++ b/external/liborcus/Library_orcus-parser.mk
@@ -0,0 +1,72 @@
+# -*- 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,orcus-parser))
+
+$(eval $(call gb_Library_use_unpacked,orcus-parser,liborcus))
+
+$(eval $(call gb_Library_use_externals,orcus-parser,\
+ boost_headers \
+ boost_filesystem \
+ boost_system \
+ mdds_headers \
+ zlib \
+))
+
+$(eval $(call gb_Library_set_warnings_disabled,orcus-parser))
+
+$(eval $(call gb_Library_set_precompiled_header,orcus-parser,external/liborcus/inc/pch/precompiled_orcus-parser))
+
+$(eval $(call gb_Library_set_include,orcus-parser,\
+ -I$(call gb_UnpackedTarball_get_dir,liborcus)/include \
+ -I$(call gb_UnpackedTarball_get_dir,liborcus)/src/include \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_Library_add_defs,orcus-parser,\
+ -DBOOST_ALL_NO_LIB \
+ -D__ORCUS_PSR_BUILDING_DLL \
+))
+
+# Needed when building against MSVC in C++17 mode, as
+# workdir/UnpackedTarball/liborcus/include/orcus/global.hpp uses std::unary_function:
+$(eval $(call gb_Library_add_defs,orcus-parser, \
+ -D_HAS_AUTO_PTR_ETC=1 \
+))
+
+$(eval $(call gb_Library_set_generated_cxx_suffix,orcus-parser,cpp))
+
+$(eval $(call gb_Library_add_generated_exception_objects,orcus-parser,\
+ UnpackedTarball/liborcus/src/parser/base64 \
+ UnpackedTarball/liborcus/src/parser/cell_buffer \
+ UnpackedTarball/liborcus/src/parser/css_parser_base \
+ UnpackedTarball/liborcus/src/parser/css_types \
+ UnpackedTarball/liborcus/src/parser/csv_parser_base \
+ UnpackedTarball/liborcus/src/parser/exception \
+ UnpackedTarball/liborcus/src/parser/json_global \
+ UnpackedTarball/liborcus/src/parser/json_parser_base \
+ UnpackedTarball/liborcus/src/parser/json_parser_thread \
+ UnpackedTarball/liborcus/src/parser/parser_base \
+ UnpackedTarball/liborcus/src/parser/parser_global \
+ UnpackedTarball/liborcus/src/parser/sax_parser_base \
+ UnpackedTarball/liborcus/src/parser/sax_token_parser \
+ UnpackedTarball/liborcus/src/parser/sax_token_parser_thread \
+ UnpackedTarball/liborcus/src/parser/stream \
+ UnpackedTarball/liborcus/src/parser/string_pool \
+ UnpackedTarball/liborcus/src/parser/tokens \
+ UnpackedTarball/liborcus/src/parser/types \
+ UnpackedTarball/liborcus/src/parser/utf8 \
+ UnpackedTarball/liborcus/src/parser/xml_namespace \
+ UnpackedTarball/liborcus/src/parser/xml_writer \
+ UnpackedTarball/liborcus/src/parser/yaml_parser_base \
+ UnpackedTarball/liborcus/src/parser/zip_archive \
+ UnpackedTarball/liborcus/src/parser/zip_archive_stream \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/liborcus/Library_orcus.mk b/external/liborcus/Library_orcus.mk
new file mode 100644
index 0000000000..28ef136122
--- /dev/null
+++ b/external/liborcus/Library_orcus.mk
@@ -0,0 +1,155 @@
+# -*- 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,orcus))
+
+$(eval $(call gb_Library_use_unpacked,orcus,liborcus))
+
+$(eval $(call gb_Library_use_externals,orcus,\
+ boost_headers \
+ boost_filesystem \
+ boost_iostreams \
+ boost_system \
+ mdds_headers \
+ zlib \
+))
+
+$(eval $(call gb_Library_set_warnings_disabled,orcus))
+
+$(eval $(call gb_Library_set_precompiled_header,orcus,external/liborcus/inc/pch/precompiled_orcus))
+
+$(eval $(call gb_Library_set_include,orcus,\
+ -I$(call gb_UnpackedTarball_get_dir,liborcus)/include \
+ -I$(call gb_UnpackedTarball_get_dir,liborcus)/src/include \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_Library_add_defs,orcus,\
+ -DBOOST_ALL_NO_LIB \
+ -D__ORCUS_BUILDING_DLL \
+ -D__ORCUS_GNUMERIC \
+ -D__ORCUS_ODS \
+ -D__ORCUS_XLSX \
+ -D__ORCUS_XLS_XML \
+))
+
+# Needed when building against MSVC in C++17 mode, as
+# workdir/UnpackedTarball/liborcus/src/liborcus/css_document_tree.cpp uses std::unary_function:
+$(eval $(call gb_Library_add_defs,orcus, \
+ -D_HAS_AUTO_PTR_ETC=1 \
+))
+
+$(eval $(call gb_Library_use_libraries,orcus,\
+ orcus-parser \
+))
+
+$(eval $(call gb_Library_set_generated_cxx_suffix,orcus,cpp))
+
+$(eval $(call gb_Library_add_generated_exception_objects,orcus,\
+ UnpackedTarball/liborcus/src/liborcus/config \
+ UnpackedTarball/liborcus/src/liborcus/css_document_tree \
+ UnpackedTarball/liborcus/src/liborcus/css_selector \
+ UnpackedTarball/liborcus/src/liborcus/detection_result \
+ UnpackedTarball/liborcus/src/liborcus/dom_tree \
+ UnpackedTarball/liborcus/src/liborcus/format_detection \
+ UnpackedTarball/liborcus/src/liborcus/formula_result \
+ UnpackedTarball/liborcus/src/liborcus/gnumeric_cell_context \
+ UnpackedTarball/liborcus/src/liborcus/gnumeric_context \
+ UnpackedTarball/liborcus/src/liborcus/gnumeric_detection_handler \
+ UnpackedTarball/liborcus/src/liborcus/gnumeric_filter_context \
+ UnpackedTarball/liborcus/src/liborcus/gnumeric_handler \
+ UnpackedTarball/liborcus/src/liborcus/gnumeric_names_context \
+ UnpackedTarball/liborcus/src/liborcus/gnumeric_namespace_types \
+ UnpackedTarball/liborcus/src/liborcus/gnumeric_sheet_context \
+ UnpackedTarball/liborcus/src/liborcus/gnumeric_styles_context \
+ UnpackedTarball/liborcus/src/liborcus/gnumeric_tokens \
+ UnpackedTarball/liborcus/src/liborcus/gnumeric_types \
+ UnpackedTarball/liborcus/src/liborcus/gnumeric_value_format_parser \
+ UnpackedTarball/liborcus/src/liborcus/info \
+ UnpackedTarball/liborcus/src/liborcus/interface \
+ UnpackedTarball/liborcus/src/liborcus/json_document_tree \
+ UnpackedTarball/liborcus/src/liborcus/json_map_tree \
+ UnpackedTarball/liborcus/src/liborcus/json_structure_mapper \
+ UnpackedTarball/liborcus/src/liborcus/json_structure_tree \
+ UnpackedTarball/liborcus/src/liborcus/json_util \
+ UnpackedTarball/liborcus/src/liborcus/measurement \
+ UnpackedTarball/liborcus/src/liborcus/number_utils \
+ UnpackedTarball/liborcus/src/liborcus/odf_document_styles_context \
+ UnpackedTarball/liborcus/src/liborcus/odf_helper \
+ UnpackedTarball/liborcus/src/liborcus/odf_namespace_types \
+ UnpackedTarball/liborcus/src/liborcus/odf_number_format_context \
+ UnpackedTarball/liborcus/src/liborcus/odf_para_context \
+ UnpackedTarball/liborcus/src/liborcus/odf_style_context \
+ UnpackedTarball/liborcus/src/liborcus/odf_styles_context \
+ UnpackedTarball/liborcus/src/liborcus/odf_styles \
+ UnpackedTarball/liborcus/src/liborcus/odf_tokens \
+ UnpackedTarball/liborcus/src/liborcus/ods_content_xml_context \
+ UnpackedTarball/liborcus/src/liborcus/ods_dde_links_context \
+ UnpackedTarball/liborcus/src/liborcus/ods_session_data \
+ UnpackedTarball/liborcus/src/liborcus/ooxml_content_types \
+ UnpackedTarball/liborcus/src/liborcus/ooxml_global \
+ UnpackedTarball/liborcus/src/liborcus/ooxml_namespace_types \
+ UnpackedTarball/liborcus/src/liborcus/ooxml_schemas \
+ UnpackedTarball/liborcus/src/liborcus/ooxml_tokens \
+ UnpackedTarball/liborcus/src/liborcus/ooxml_types \
+ UnpackedTarball/liborcus/src/liborcus/opc_context \
+ UnpackedTarball/liborcus/src/liborcus/opc_reader \
+ UnpackedTarball/liborcus/src/liborcus/orcus_csv \
+ UnpackedTarball/liborcus/src/liborcus/orcus_gnumeric \
+ UnpackedTarball/liborcus/src/liborcus/orcus_import_ods \
+ UnpackedTarball/liborcus/src/liborcus/orcus_import_xlsx \
+ UnpackedTarball/liborcus/src/liborcus/orcus_json \
+ UnpackedTarball/liborcus/src/liborcus/orcus_ods \
+ UnpackedTarball/liborcus/src/liborcus/orcus_xlsx \
+ UnpackedTarball/liborcus/src/liborcus/orcus_xls_xml \
+ UnpackedTarball/liborcus/src/liborcus/orcus_xml \
+ UnpackedTarball/liborcus/src/liborcus/orcus_xml_impl \
+ UnpackedTarball/liborcus/src/liborcus/orcus_xml_map_def \
+ UnpackedTarball/liborcus/src/liborcus/session_context \
+ UnpackedTarball/liborcus/src/liborcus/spreadsheet_iface_util \
+ UnpackedTarball/liborcus/src/liborcus/spreadsheet_impl_types \
+ UnpackedTarball/liborcus/src/liborcus/spreadsheet_interface \
+ UnpackedTarball/liborcus/src/liborcus/spreadsheet_types \
+ UnpackedTarball/liborcus/src/liborcus/string_helper \
+ UnpackedTarball/liborcus/src/liborcus/xlsx_autofilter_context \
+ UnpackedTarball/liborcus/src/liborcus/xlsx_conditional_format_context \
+ UnpackedTarball/liborcus/src/liborcus/xlsx_drawing_context \
+ UnpackedTarball/liborcus/src/liborcus/xlsx_handler \
+ UnpackedTarball/liborcus/src/liborcus/xlsx_helper \
+ UnpackedTarball/liborcus/src/liborcus/xls_xml_context \
+ UnpackedTarball/liborcus/src/liborcus/xls_xml_detection_handler \
+ UnpackedTarball/liborcus/src/liborcus/xls_xml_handler \
+ UnpackedTarball/liborcus/src/liborcus/xls_xml_namespace_types \
+ UnpackedTarball/liborcus/src/liborcus/xls_xml_tokens \
+ UnpackedTarball/liborcus/src/liborcus/xlsx_pivot_context \
+ UnpackedTarball/liborcus/src/liborcus/xlsx_revision_context \
+ UnpackedTarball/liborcus/src/liborcus/xlsx_session_data \
+ UnpackedTarball/liborcus/src/liborcus/xlsx_shared_strings_context \
+ UnpackedTarball/liborcus/src/liborcus/xlsx_sheet_context \
+ UnpackedTarball/liborcus/src/liborcus/xlsx_styles_context \
+ UnpackedTarball/liborcus/src/liborcus/xlsx_table_context \
+ UnpackedTarball/liborcus/src/liborcus/xlsx_types \
+ UnpackedTarball/liborcus/src/liborcus/xlsx_workbook_context \
+ UnpackedTarball/liborcus/src/liborcus/xml_context_base \
+ UnpackedTarball/liborcus/src/liborcus/xml_context_global \
+ UnpackedTarball/liborcus/src/liborcus/xml_element_types \
+ UnpackedTarball/liborcus/src/liborcus/xml_element_validator \
+ UnpackedTarball/liborcus/src/liborcus/xml_empty_context \
+ UnpackedTarball/liborcus/src/liborcus/xml_map_tree \
+ UnpackedTarball/liborcus/src/liborcus/xml_simple_stream_handler \
+ UnpackedTarball/liborcus/src/liborcus/xml_stream_handler \
+ UnpackedTarball/liborcus/src/liborcus/xml_stream_parser \
+ UnpackedTarball/liborcus/src/liborcus/xml_structure_mapper \
+ UnpackedTarball/liborcus/src/liborcus/xml_structure_tree \
+ UnpackedTarball/liborcus/src/liborcus/xml_util \
+ UnpackedTarball/liborcus/src/liborcus/xpath_parser \
+ UnpackedTarball/liborcus/src/liborcus/yaml_document_tree \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/liborcus/Makefile b/external/liborcus/Makefile
new file mode 100644
index 0000000000..e4968cf85f
--- /dev/null
+++ b/external/liborcus/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/liborcus/Module_liborcus.mk b/external/liborcus/Module_liborcus.mk
new file mode 100644
index 0000000000..e75b983bac
--- /dev/null
+++ b/external/liborcus/Module_liborcus.mk
@@ -0,0 +1,32 @@
+# -*- 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,liborcus))
+
+$(eval $(call gb_Module_add_targets,liborcus,\
+ UnpackedTarball_liborcus \
+))
+
+ifeq ($(COM),MSC)
+
+$(eval $(call gb_Module_add_targets,liborcus,\
+ Library_orcus \
+ Library_orcus-parser \
+))
+
+else # !MSC
+
+$(eval $(call gb_Module_add_targets,liborcus,\
+ ExternalPackage_liborcus \
+ ExternalProject_liborcus \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/liborcus/README b/external/liborcus/README
new file mode 100644
index 0000000000..54e882663c
--- /dev/null
+++ b/external/liborcus/README
@@ -0,0 +1,2 @@
+[https://gitlab.com/orcus/orcus]
+"Collection of parsers and import filters for spreadsheet documents."
diff --git a/external/liborcus/UnpackedTarball_liborcus.mk b/external/liborcus/UnpackedTarball_liborcus.mk
new file mode 100644
index 0000000000..3de24f0135
--- /dev/null
+++ b/external/liborcus/UnpackedTarball_liborcus.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,liborcus))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,liborcus,$(ORCUS_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,liborcus,1))
+
+$(eval $(call gb_UnpackedTarball_update_autoconf_configs,liborcus))
+
+$(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
+ external/liborcus/rpath.patch.0 \
+ external/liborcus/gcc9.patch.0 \
+ external/liborcus/libtool.patch.0 \
+))
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
+ external/liborcus/windows-constants-hack.patch \
+ external/liborcus/win_path_utf16.patch \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/liborcus/gcc9.patch.0 b/external/liborcus/gcc9.patch.0
new file mode 100644
index 0000000000..da404038e6
--- /dev/null
+++ b/external/liborcus/gcc9.patch.0
@@ -0,0 +1,27 @@
+--- include/orcus/types.hpp
++++ include/orcus/types.hpp
+@@ -8,6 +8,14 @@
+ #ifndef INCLUDED_ORCUS_TYPES_HPP
+ #define INCLUDED_ORCUS_TYPES_HPP
+
++#ifdef __GNUC__
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wpragmas" // for old GCC
++#pragma GCC diagnostic ignored "-Wunknown-warning-option" // for Clang
++#pragma GCC diagnostic ignored "-Wdeprecated-copy"
++#pragma GCC diagnostic ignored "-Wshadow"
++#endif
++
+ #include <cstdint>
+ #include <cstdlib>
+ #include <vector>
+@@ -629,5 +637,9 @@ ORCUS_PSR_DLLPUBLIC extern const xml_token_t XML_UNKNOWN_TOKEN;
+
+ }
+
++#ifdef __GNUC__
++#pragma GCC diagnostic pop
++#endif
++
+ #endif
+ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/external/liborcus/inc/pch/precompiled_orcus-parser.cxx b/external/liborcus/inc/pch/precompiled_orcus-parser.cxx
new file mode 100644
index 0000000000..b93db182c3
--- /dev/null
+++ b/external/liborcus/inc/pch/precompiled_orcus-parser.cxx
@@ -0,0 +1,12 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+#include "precompiled_orcus-parser.hxx"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/external/liborcus/inc/pch/precompiled_orcus-parser.hxx b/external/liborcus/inc/pch/precompiled_orcus-parser.hxx
new file mode 100644
index 0000000000..9d800f45b2
--- /dev/null
+++ b/external/liborcus/inc/pch/precompiled_orcus-parser.hxx
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+/*
+ This file has been autogenerated by update_pch.sh. It is possible to edit it
+ manually (such as when an include file has been moved/renamed/removed). All such
+ manual changes will be rewritten by the next run of update_pch.sh (which presumably
+ also fixes all possible problems, so it's usually better to use it).
+
+ Generated on 2023-01-24 17:21:40 using:
+ ./bin/update_pch external/liborcus orcus-parser --cutoff=1 --exclude:system --include:module --include:local
+
+ If after updating build fails, use the following command to locate conflicting headers:
+ ./bin/update_pch_bisect ./external/liborcus/inc/pch/precompiled_orcus-parser.hxx "make external/liborcus.build" --find-conflicts
+*/
+
+#include <sal/config.h>
+#if PCH_LEVEL >= 1
+#include <algorithm>
+#include <cassert>
+#include <cctype>
+#include <cmath>
+#include <codecvt>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <deque>
+#include <fstream>
+#include <iomanip>
+#include <iostream>
+#include <iterator>
+#include <limits>
+#include <locale>
+#include <memory>
+#include <sstream>
+#include <stdexcept>
+#include <string_view>
+#include <tuple>
+#include <unordered_map>
+#include <unordered_set>
+#include <vector>
+#include <zconf.h>
+#include <zlib.h>
+#include <boost/archive/iterators/base64_from_binary.hpp>
+#include <boost/archive/iterators/binary_from_base64.hpp>
+#include <boost/archive/iterators/transform_width.hpp>
+#include <boost/filesystem.hpp>
+#include <boost/interprocess/file_mapping.hpp>
+#include <boost/interprocess/mapped_region.hpp>
+#include <boost/pool/object_pool.hpp>
+#endif // PCH_LEVEL >= 1
+#if PCH_LEVEL >= 2
+#endif // PCH_LEVEL >= 2
+#if PCH_LEVEL >= 3
+#include <mdds/global.hpp>
+#include <mdds/sorted_string_map.hpp>
+#include <orcus/base64.hpp>
+#include <orcus/cell_buffer.hpp>
+#include <orcus/css_parser_base.hpp>
+#include <orcus/css_types.hpp>
+#include <orcus/csv_parser_base.hpp>
+#include <orcus/detail/parser_token_buffer.hpp>
+#include <orcus/exception.hpp>
+#include <orcus/json_global.hpp>
+#include <orcus/json_parser.hpp>
+#include <orcus/json_parser_base.hpp>
+#include <orcus/json_parser_thread.hpp>
+#include <orcus/parser_base.hpp>
+#include <orcus/parser_global.hpp>
+#include <orcus/sax_parser_base.hpp>
+#include <orcus/sax_token_parser.hpp>
+#include <orcus/sax_token_parser_thread.hpp>
+#include <orcus/stream.hpp>
+#include <orcus/string_pool.hpp>
+#include <orcus/tokens.hpp>
+#include <orcus/types.hpp>
+#include <orcus/xml_namespace.hpp>
+#include <orcus/xml_writer.hpp>
+#include <orcus/yaml_parser_base.hpp>
+#include <orcus/zip_archive.hpp>
+#include <orcus/zip_archive_stream.hpp>
+#endif // PCH_LEVEL >= 3
+#if PCH_LEVEL >= 4
+#endif // PCH_LEVEL >= 4
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/external/liborcus/inc/pch/precompiled_orcus.cxx b/external/liborcus/inc/pch/precompiled_orcus.cxx
new file mode 100644
index 0000000000..03b0cdf029
--- /dev/null
+++ b/external/liborcus/inc/pch/precompiled_orcus.cxx
@@ -0,0 +1,12 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+#include "precompiled_orcus.hxx"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/external/liborcus/inc/pch/precompiled_orcus.hxx b/external/liborcus/inc/pch/precompiled_orcus.hxx
new file mode 100644
index 0000000000..0c2e3ffd17
--- /dev/null
+++ b/external/liborcus/inc/pch/precompiled_orcus.hxx
@@ -0,0 +1,112 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+/*
+ This file has been autogenerated by update_pch.sh. It is possible to edit it
+ manually (such as when an include file has been moved/renamed/removed). All such
+ manual changes will be rewritten by the next run of update_pch.sh (which presumably
+ also fixes all possible problems, so it's usually better to use it).
+
+ Generated on 2023-01-24 17:20:59 using:
+ ./bin/update_pch external/liborcus orcus --cutoff=1 --exclude:system --include:module --include:local
+
+ If after updating build fails, use the following command to locate conflicting headers:
+ ./bin/update_pch_bisect ./external/liborcus/inc/pch/precompiled_orcus.hxx "make external/liborcus.build" --find-conflicts
+*/
+
+#include <sal/config.h>
+#if PCH_LEVEL >= 1
+#include <algorithm>
+#include <cassert>
+#include <codecvt>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <deque>
+#include <fstream>
+#include <functional>
+#include <iostream>
+#include <iterator>
+#include <limits>
+#include <locale>
+#include <map>
+#include <memory>
+#include <optional>
+#include <ostream>
+#include <sstream>
+#include <stdexcept>
+#include <string>
+#include <string_view>
+#include <unordered_map>
+#include <unordered_set>
+#include <vector>
+#include <boost/current_function.hpp>
+#include <boost/filesystem.hpp>
+#include <boost/iostreams/filter/gzip.hpp>
+#include <boost/iostreams/filtering_stream.hpp>
+#include <boost/pool/object_pool.hpp>
+#endif // PCH_LEVEL >= 1
+#if PCH_LEVEL >= 2
+#endif // PCH_LEVEL >= 2
+#if PCH_LEVEL >= 3
+#include <mdds/global.hpp>
+#include <mdds/sorted_string_map.hpp>
+#include <orcus/config.hpp>
+#include <orcus/css_document_tree.hpp>
+#include <orcus/css_parser.hpp>
+#include <orcus/css_selector.hpp>
+#include <orcus/csv_parser.hpp>
+#include <orcus/dom_tree.hpp>
+#include <orcus/exception.hpp>
+#include <orcus/format_detection.hpp>
+#include <orcus/info.hpp>
+#include <orcus/interface.hpp>
+#include <orcus/json_document_tree.hpp>
+#include <orcus/json_global.hpp>
+#include <orcus/json_parser.hpp>
+#include <orcus/json_structure_tree.hpp>
+#include <orcus/measurement.hpp>
+#include <orcus/orcus_csv.hpp>
+#include <orcus/orcus_gnumeric.hpp>
+#include <orcus/orcus_import_ods.hpp>
+#include <orcus/orcus_import_xlsx.hpp>
+#include <orcus/orcus_json.hpp>
+#include <orcus/orcus_ods.hpp>
+#include <orcus/orcus_xls_xml.hpp>
+#include <orcus/orcus_xlsx.hpp>
+#include <orcus/orcus_xml.hpp>
+#include <orcus/parser_base.hpp>
+#include <orcus/parser_global.hpp>
+#include <orcus/sax_ns_parser.hpp>
+#include <orcus/sax_parser.hpp>
+#include <orcus/sax_parser_base.hpp>
+#include <orcus/sax_token_parser.hpp>
+#include <orcus/spreadsheet/export_interface.hpp>
+#include <orcus/spreadsheet/import_interface.hpp>
+#include <orcus/spreadsheet/import_interface_pivot.hpp>
+#include <orcus/spreadsheet/import_interface_styles.hpp>
+#include <orcus/spreadsheet/import_interface_view.hpp>
+#include <orcus/spreadsheet/styles.hpp>
+#include <orcus/spreadsheet/types.hpp>
+#include <orcus/stream.hpp>
+#include <orcus/string_pool.hpp>
+#include <orcus/threaded_sax_token_parser.hpp>
+#include <orcus/tokens.hpp>
+#include <orcus/xml_namespace.hpp>
+#include <orcus/xml_structure_tree.hpp>
+#include <orcus/xml_writer.hpp>
+#include <orcus/yaml_document_tree.hpp>
+#include <orcus/yaml_parser.hpp>
+#include <orcus/zip_archive.hpp>
+#include <orcus/zip_archive_stream.hpp>
+#endif // PCH_LEVEL >= 3
+#if PCH_LEVEL >= 4
+#endif // PCH_LEVEL >= 4
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/external/liborcus/libtool.patch.0 b/external/liborcus/libtool.patch.0
new file mode 100644
index 0000000000..663dbd8099
--- /dev/null
+++ b/external/liborcus/libtool.patch.0
@@ -0,0 +1,11 @@
+--- ltmain.sh.orig 2020-09-09 21:20:23.069433984 -0400
++++ ltmain.sh 2020-09-09 21:27:13.168073996 -0400
+@@ -7373,7 +7373,7 @@
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
+- -specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus)
++ -specs=*|-fsanitize=*|-fuse-ld=*|--ld-path=*|-static-*|-fcilkplus)
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
+ func_append compile_command " $arg"
diff --git a/external/liborcus/rpath.patch.0 b/external/liborcus/rpath.patch.0
new file mode 100644
index 0000000000..e7a33e693d
--- /dev/null
+++ b/external/liborcus/rpath.patch.0
@@ -0,0 +1,10 @@
+--- configure
++++ configure
+@@ -14007,6 +14007,7 @@
+ esac
+ ;;
+ esac
++hardcode_libdir_flag_spec_CXX=
+ ;;
+
+ lynxos*)
diff --git a/external/liborcus/win_path_utf16.patch b/external/liborcus/win_path_utf16.patch
new file mode 100644
index 0000000000..0a6781e728
--- /dev/null
+++ b/external/liborcus/win_path_utf16.patch
@@ -0,0 +1,33 @@
+diff --git a/src/parser/stream.cpp b/src/parser/stream.cpp
+index 00395f59ff25..8f385fb8965a 100644
+--- a/src/parser/stream.cpp
++++ b/src/parser/stream.cpp
+@@ -147,6 +147,14 @@ std::tuple<std::string_view, size_t, size_t> find_line_with_offset(std::string_v
+ return std::make_tuple(line, line_num, offset_on_line);
+ }
+
++#ifdef _WIN32
++std::wstring to_wstring(std::string_view s)
++{
++ std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> conversion;
++ return conversion.from_bytes(s.data(), s.data() + s.size());
++}
++#endif
++
+ } // anonymous namespace
+
+ struct file_content::impl
+@@ -162,8 +170,13 @@ struct file_content::impl
+ impl() : content_size(0), content(nullptr) {}
+
+ impl(std::string_view filepath) :
++#ifdef _WIN32
++ content_size(fs::file_size(to_wstring(filepath))),
++ mapped_file(to_wstring(filepath).c_str(), bip::read_only),
++#else
+ content_size(fs::file_size(std::string{filepath}.c_str())),
+ mapped_file(std::string{filepath}.c_str(), bip::read_only),
++#endif
+ mapped_region(mapped_file, bip::read_only, 0, content_size),
+ content(nullptr)
+ {
diff --git a/external/liborcus/windows-constants-hack.patch b/external/liborcus/windows-constants-hack.patch
new file mode 100644
index 0000000000..28cf0997a1
--- /dev/null
+++ b/external/liborcus/windows-constants-hack.patch
@@ -0,0 +1,15 @@
+diff --git a/src/liborcus/info.cpp b/src/liborcus/info.cpp
+index ae571f5..539ce18 100644
+--- a/src/liborcus/info.cpp
++++ b/src/liborcus/info.cpp
+@@ -7,7 +7,9 @@
+
+ #include "orcus/info.hpp"
+
+-#include "constants.inl"
++#define ORCUS_MAJOR_VERSION 0
++#define ORCUS_MINOR_VERSION 19
++#define ORCUS_MICRO_VERSION 2
+
+ namespace orcus {
+