summaryrefslogtreecommitdiffstats
path: root/external/libqxp
diff options
context:
space:
mode:
Diffstat (limited to 'external/libqxp')
-rw-r--r--external/libqxp/ExternalProject_libqxp.mk47
-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.mk20
-rw-r--r--external/libqxp/android-workaround.patch.149
6 files changed, 144 insertions, 0 deletions
diff --git a/external/libqxp/ExternalProject_libqxp.mk b/external/libqxp/ExternalProject_libqxp.mk
new file mode 100644
index 000000000..f1b63f6bf
--- /dev/null
+++ b/external/libqxp/ExternalProject_libqxp.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,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 \
+))
+
+$(call gb_ExternalProject_get_state_target,libqxp,build) :
+ $(call gb_Trace_StartRange,libqxp,EXTERNAL)
+ $(call gb_ExternalProject_run,build,\
+ export PKG_CONFIG="" \
+ && MAKE=$(MAKE) ./configure \
+ --with-pic \
+ --enable-static \
+ --disable-shared \
+ --without-docs \
+ --disable-tests \
+ --disable-tools \
+ --disable-debug \
+ --disable-werror \
+ --disable-weffc \
+ $(if $(gb_FULLDEPS),,--disable-dependency-tracking) \
+ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
+ CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ && $(MAKE) \
+ )
+ $(call gb_Trace_EndRange,libqxp,EXTERNAL)
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libqxp/Makefile b/external/libqxp/Makefile
new file mode 100644
index 000000000..e4968cf85
--- /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 000000000..8359683da
--- /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 000000000..6f13b86fe
--- /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 000000000..0ac69bc6f
--- /dev/null
+++ b/external/libqxp/UnpackedTarball_libqxp.mk
@@ -0,0 +1,20 @@
+# -*- 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_update_autoconf_configs,libqxp))
+
+$(eval $(call gb_UnpackedTarball_add_patches,libqxp, \
+ external/libqxp/android-workaround.patch.1 \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libqxp/android-workaround.patch.1 b/external/libqxp/android-workaround.patch.1
new file mode 100644
index 000000000..5c7529c20
--- /dev/null
+++ b/external/libqxp/android-workaround.patch.1
@@ -0,0 +1,49 @@
+--- libqxp.orig/src/lib/QXP4Parser.cpp 2017-08-28 10:12:26.009868397 +0200
++++ libqxp/src/lib/QXP4Parser.cpp 2017-08-28 10:12:39.577681705 +0200
+@@ -16,6 +16,7 @@
+ #include "QXP4Header.h"
+ #include "QXPCollector.h"
+ #include "QXPMemoryStream.h"
++#include "android-compat.h"
+
+ namespace libqxp
+ {
+--- libqxp.orig/src/lib/QXPParser.cpp 2017-08-28 10:11:14.074858068 +0200
++++ libqxp/src/lib/QXPParser.cpp 2017-08-28 10:18:04.849203430 +0200
+@@ -14,6 +14,7 @@
+
+ #include <cmath>
+ #include <memory>
++#include "android-compat.h"
+
+ namespace libqxp
+ {
+--- libqxp.orig/src/lib/QXPTypes.cpp 2017-08-26 08:38:40.000000000 +0200
++++ libqxp/src/lib/QXPTypes.cpp 2017-08-28 10:18:37.784749714 +0200
+@@ -11,6 +11,7 @@
+
+ #include <boost/math/constants/constants.hpp>
+ #include <cmath>
++#include "android-compat.h"
+
+ namespace libqxp
+ {
+--- libqxp.orig/src/lib/android-compat.h 1970-01-01 01:00:00.000000000 +0100
++++ libqxp/src/lib/android-compat.h 2017-08-28 10:21:36.766283262 +0200
+@@ -0,0 +1,16 @@
++#if defined(__ANDROID__)
++namespace std
++{
++template<typename T>
++T round(T x)
++{
++ return ::round(x);
++}
++
++template<typename T>
++T hypot(T x, T y)
++{
++ return ::hypot(x, y);
++}
++}
++#endif