Kaydet (Commit) b6f9eeb9 authored tarafından Miklos Vajna's avatar Miklos Vajna

external: bundle pdfium

Initial use case is to avoid creating a whole Draw document + a poppler
process for each and every PDF image we load in a document.

The MSVC patch is only to support MSVC 2013, as upstream already moved
to MSVC 2015.

Change-Id: I3c9dbac3e3de9f2e874ca4cfec0a9dd8a388b87c
Reviewed-on: https://gerrit.libreoffice.org/34022Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst af35c02a
...@@ -195,6 +195,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_host.mk $(SRCDIR)/download.lst $(SRCDIR) ...@@ -195,6 +195,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_host.mk $(SRCDIR)/download.lst $(SRCDIR)
$(call fetch_Optional,ORCUS,ORCUS_TARBALL) \ $(call fetch_Optional,ORCUS,ORCUS_TARBALL) \
$(call fetch_Optional,OWNCLOUD_ANDROID_LIB,OWNCLOUD_ANDROID_LIB_TARBALL) \ $(call fetch_Optional,OWNCLOUD_ANDROID_LIB,OWNCLOUD_ANDROID_LIB_TARBALL) \
$(call fetch_Optional,PAGEMAKER,PAGEMAKER_TARBALL) \ $(call fetch_Optional,PAGEMAKER,PAGEMAKER_TARBALL) \
PDFIUM_TARBALL \
$(call fetch_Optional,POPPLER,POPPLER_TARBALL) \ $(call fetch_Optional,POPPLER,POPPLER_TARBALL) \
$(call fetch_Optional,POSTGRESQL,POSTGRESQL_TARBALL) \ $(call fetch_Optional,POSTGRESQL,POSTGRESQL_TARBALL) \
$(call fetch_Optional,PYTHON,PYTHON_TARBALL) \ $(call fetch_Optional,PYTHON,PYTHON_TARBALL) \
......
...@@ -4058,4 +4058,15 @@ $(call gb_LinkTarget_set_include,$(1), \ ...@@ -4058,4 +4058,15 @@ $(call gb_LinkTarget_set_include,$(1), \
$(call gb_LinkTarget_use_libraries,$(1),clew) $(call gb_LinkTarget_use_libraries,$(1),clew)
endef endef
define gb_LinkTarget__use_pdfium
$(call gb_LinkTarget_set_include,$(1),\
-I$(call gb_UnpackedTarball_get_dir,pdfium)/public \
$$(INCLUDE) \
)
$(call gb_LinkTarget_use_libraries,$(1),pdfium)
endef
$(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo,\
pdfium \
))
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:
...@@ -138,6 +138,7 @@ export OWNCLOUD_ANDROID_LIB_MD5SUM := 593f0aa47bf2efc0efda2d28fae063b2 ...@@ -138,6 +138,7 @@ export OWNCLOUD_ANDROID_LIB_MD5SUM := 593f0aa47bf2efc0efda2d28fae063b2
export OWNCLOUD_ANDROID_LIB_TARBALL := owncloud-android-library-0.9.4-no-binary-deps.tar.gz export OWNCLOUD_ANDROID_LIB_TARBALL := owncloud-android-library-0.9.4-no-binary-deps.tar.gz
export PAGEMAKER_MD5SUM := 5c4985a68be0b79d3f809da5e12b143c export PAGEMAKER_MD5SUM := 5c4985a68be0b79d3f809da5e12b143c
export PAGEMAKER_TARBALL := libpagemaker-0.0.3.tar.bz2 export PAGEMAKER_TARBALL := libpagemaker-0.0.3.tar.bz2
export PDFIUM_TARBALL := 9ac66c71463f9440e3ccc996c5e66556-pdfium-3004.tar.bz2
export PIXMAN_TARBALL := e80ebae4da01e77f68744319f01d52a3-pixman-0.34.0.tar.gz export PIXMAN_TARBALL := e80ebae4da01e77f68744319f01d52a3-pixman-0.34.0.tar.gz
export PNG_MD5SUM := 897ccec1ebfb0922e83c2bfaa1be8748 export PNG_MD5SUM := 897ccec1ebfb0922e83c2bfaa1be8748
export PNG_TARBALL := libpng-1.6.28.tar.gz export PNG_TARBALL := libpng-1.6.28.tar.gz
......
...@@ -88,6 +88,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\ ...@@ -88,6 +88,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\
$(call gb_Helper_optional,ORCUS,liborcus) \ $(call gb_Helper_optional,ORCUS,liborcus) \
$(call gb_Helper_optional,OWNCLOUD_ANDROID_LIB,owncloud-android-lib) \ $(call gb_Helper_optional,OWNCLOUD_ANDROID_LIB,owncloud-android-lib) \
$(call gb_Helper_optional,PAGEMAKER,libpagemaker) \ $(call gb_Helper_optional,PAGEMAKER,libpagemaker) \
pdfium \
$(call gb_Helper_optional,POPPLER,poppler) \ $(call gb_Helper_optional,POPPLER,poppler) \
$(call gb_Helper_optional,POSTGRESQL,postgresql) \ $(call gb_Helper_optional,POSTGRESQL,postgresql) \
$(call gb_Helper_optional,PYTHON,$(if $(filter $(PYTHON_VERSION_MINOR),3),python33,python3)) \ $(call gb_Helper_optional,PYTHON,$(if $(filter $(PYTHON_VERSION_MINOR),3),python33,python3)) \
......
This diff is collapsed.
# -*- 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:
# -*- 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,pdfium))
$(eval $(call gb_Module_add_targets,pdfium,\
Library_pdfium \
UnpackedTarball_pdfium \
))
# vim: set noet sw=4 ts=4:
External package containing pdfium.
"Insert -> Picture -> From File..." uses this library when a PDF file is
selected.
How to update the tarball:
version=$(git for-each-ref|grep chromium/|tail -n 1|sed 's|.*/||')
git archive --prefix=pdfium/ --format=tar origin/chromium/${version} > pdfium-${version}.tar
bzip2 pdfium-${version}.tar
checksum=$(md5sum pdfium-${version}.tar.bz2|sed 's| .*||')
mv pdfium-${version}.tar.bz2 ${checksum}-pdfium-${version}.tar.bz2
# -*- 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/.
#
pdfium_patches :=
pdfium_patches += visibility.patch.1
pdfium_patches += msvc.patch.1
$(eval $(call gb_UnpackedTarball_UnpackedTarball,pdfium))
$(eval $(call gb_UnpackedTarball_set_tarball,pdfium,$(PDFIUM_TARBALL)))
$(eval $(call gb_UnpackedTarball_add_patches,pdfium,\
$(foreach patch,$(pdfium_patches),external/pdfium/$(patch)) \
))
$(eval $(call gb_UnpackedTarball_set_post_action,pdfium,\
mv third_party/bigint/BigInteger.cc third_party/bigint/BigInteger.cpp && \
mv third_party/bigint/BigIntegerUtils.cc third_party/bigint/BigIntegerUtils.cpp && \
mv third_party/bigint/BigUnsigned.cc third_party/bigint/BigUnsigned.cpp && \
mv third_party/bigint/BigUnsignedInABase.cc third_party/bigint/BigUnsignedInABase.cpp \
))
# vim: set noet sw=4 ts=4:
This diff is collapsed.
diff --git a/public/fpdfview.h b/public/fpdfview.h
index 7378d5f..6d37d9e 100644
--- a/public/fpdfview.h
+++ b/public/fpdfview.h
@@ -126,14 +126,20 @@ typedef struct _FS_RECTF_ {
// Const Pointer to FS_RECTF structure.
typedef const FS_RECTF* FS_LPCRECTF;
-#if defined(_WIN32) && defined(FPDFSDK_EXPORTS)
-// On Windows system, functions are exported in a DLL
+#if defined(PDFIUM_DLLIMPLEMENTATION)
+#ifdef _WIN32
#define DLLEXPORT __declspec(dllexport)
-#define STDCALL __stdcall
#else
-#define DLLEXPORT
-#define STDCALL
+#define DLLEXPORT __attribute__ ((visibility("default")))
+#endif
+#else
+#ifdef _WIN32
+#define DLLEXPORT __declspec(dllimport)
+#else
+#define DLLEXPORT __attribute__ ((visibility("default")))
#endif
+#endif
+#define STDCALL
// Exported Functions
#ifdef __cplusplus
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment