[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - configure.ac distro-configs/LibreOfficeiOS.conf external/pdfium

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Tue Mar 16 18:34:55 UTC 2021


 configure.ac                                 |    2 +-
 distro-configs/LibreOfficeiOS.conf           |    2 +-
 external/pdfium/Library_pdfium.mk            |   14 ++++++++++++++
 external/pdfium/UnpackedTarball_pdfium.mk    |    2 ++
 external/pdfium/cg-instead-of-carbon.patch.1 |   13 +++++++++++++
 5 files changed, 31 insertions(+), 2 deletions(-)

New commits:
commit 8bf542a13aa7272e36462ac6000a13b3a018083f
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Mar 16 12:21:44 2021 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Tue Mar 16 19:34:19 2021 +0100

    Do build Pdfium for iOS, too
    
    For it to compile, the inclusion of <Carbon/Carbon.h> had to be
    replaced with <CoreGraphics/CoreGraphics.h>.
    
    This fixes the crash in
    https://github.com/CollaboraOnline/online/issues/1710 . I am not
    entirely sure yet whether the actual PDF import functionality now then
    works in the iOS app, though.
    
    Change-Id: Ie25e7c58632c0fdddb569d58217f23b26d1e5937
    Signed-off-by: Tor Lillqvist <tml at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112572
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>

diff --git a/configure.ac b/configure.ac
index bca3825a31ab..e36325456c82 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10994,7 +10994,7 @@ AC_SUBST([ENABLE_DCONF])
 # pdf import?
 AC_MSG_CHECKING([whether to build the PDF import feature])
 ENABLE_PDFIMPORT=
-if test $_os != Android -a $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then
+if test $_os != Android -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then
     AC_MSG_RESULT([yes])
     ENABLE_PDFIMPORT=TRUE
     AC_DEFINE(HAVE_FEATURE_PDFIMPORT)
diff --git a/distro-configs/LibreOfficeiOS.conf b/distro-configs/LibreOfficeiOS.conf
index 33471127e14f..c08cb87ce920 100644
--- a/distro-configs/LibreOfficeiOS.conf
+++ b/distro-configs/LibreOfficeiOS.conf
@@ -22,7 +22,7 @@
 --disable-kf5
 --disable-odk
 --disable-openssl
---disable-pdfium
+--disable-poppler
 --disable-python
 
 --without-tls
diff --git a/external/pdfium/Library_pdfium.mk b/external/pdfium/Library_pdfium.mk
index f08ff51a31a3..900c21b349b5 100644
--- a/external/pdfium/Library_pdfium.mk
+++ b/external/pdfium/Library_pdfium.mk
@@ -670,6 +670,20 @@ $(eval $(call gb_Library_use_system_darwin_frameworks,pdfium,\
 ))
 endif
 
+ifeq ($(OS),iOS)
+# fxge
+$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
+    UnpackedTarball/pdfium/core/fxge/apple/fx_apple_platform \
+    UnpackedTarball/pdfium/core/fxge/apple/fx_mac_impl \
+    UnpackedTarball/pdfium/core/fxge/apple/fx_quartz_device \
+))
+
+$(eval $(call gb_Library_use_system_darwin_frameworks,pdfium,\
+    CoreGraphics \
+    CoreFoundation \
+))
+endif
+
 ifeq ($(OS),ANDROID)
 # fxge
 $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
diff --git a/external/pdfium/UnpackedTarball_pdfium.mk b/external/pdfium/UnpackedTarball_pdfium.mk
index f4643376cee0..f1b02473a062 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -14,6 +14,8 @@ pdfium_patches += build.patch.1
 # Avoids Windows 8 build dependency.
 pdfium_patches += windows7.patch.1
 pdfium_patches += c++20-comparison.patch
+# Use CoreGraphics.h instead of Carbon.h
+pdfium_patches += cg-instead-of-carbon.patch.1
 
 $(eval $(call gb_UnpackedTarball_UnpackedTarball,pdfium))
 
diff --git a/external/pdfium/cg-instead-of-carbon.patch.1 b/external/pdfium/cg-instead-of-carbon.patch.1
new file mode 100644
index 000000000000..bd29af1b95c2
--- /dev/null
+++ b/external/pdfium/cg-instead-of-carbon.patch.1
@@ -0,0 +1,13 @@
+-*- Mode: Diff -*-
+--- a/core/fxge/apple/fx_quartz_device.h
++++ b/core/fxge/apple/fx_quartz_device.h
+@@ -7,7 +7,7 @@
+ #ifndef CORE_FXGE_APPLE_FX_QUARTZ_DEVICE_H_
+ #define CORE_FXGE_APPLE_FX_QUARTZ_DEVICE_H_
+ 
+-#include <Carbon/Carbon.h>
++#include <CoreGraphics/CoreGraphics.h>
+ 
+ #include "core/fxcrt/fx_system.h"
+ #include "core/fxge/cfx_gemodule.h"
+


More information about the Libreoffice-commits mailing list