Skip to content

Commit

Permalink
[calligra] Add fix for kio build failure with newer cmake. Contribute…
Browse files Browse the repository at this point in the history
…s to JB#46923
  • Loading branch information
xfade committed Aug 27, 2019
1 parent 96bbe74 commit e7c90c2
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rpm/calligra.spec
Expand Up @@ -37,6 +37,7 @@ Patch19: calligra-qtdbus.patch
Patch20: calligra-background.patch
Patch21: calligra-rtf.patch
Patch22: calligra-invalidate-cache.patch
Patch23: kio-cmake-fix.patch

%description
%{summary}.
Expand Down Expand Up @@ -190,6 +191,7 @@ BuildRequires: extra-cmake-modules >= 5.34.0
%patch20 -d upstream -p1
%patch21 -d upstream -p1
%patch22 -d upstream -p1
%patch23 -d kio -p1

%define build_kf5() cd %1 ; if [ ! -d build ] ; then mkdir build ; fi ; cd build ; if [ ! -e Makefile ] ; then CMAKE_PREFIX_PATH=%{_buildrootdir}/kf5/usr cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_RPATH=/usr/lib/calligra-kf5 %{?2} .. ; fi ; make %{?_smp_mflags} install DESTDIR=%{_buildrootdir}/kf5 ; cd ../.. ;
%build
Expand Down
55 changes: 55 additions & 0 deletions rpm/kio-cmake-fix.patch
@@ -0,0 +1,55 @@
From 781cfa4e2ba739ee864683a3c783572852f43984 Mon Sep 17 00:00:00 2001
From: Aleix Pol <aleixpol@kde.org>
Date: Thu, 6 Apr 2017 14:48:01 +0200
Subject: Generate a moc_predefs.h file for KIOCore

Summary:
Otherwise moc gets through wrong files in some platforms that have weird
preprocessor hacks to support large files on 32 bits systems.
This should be done by automoc.

See:
https://gitlab.kitware.com/cmake/cmake/issues/16640
https://bugreports.qt.io/browse/QTBUG-57796

BUG: 371721

Test Plan: Fixes build of KIO on ARM32 (flatpak)

Reviewers: #frameworks, dfaure, cgilles

Reviewed By: dfaure

Subscribers: #frameworks

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D5319
---
src/core/CMakeLists.txt | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 4da557e..559c14d 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -160,6 +160,16 @@ set_target_properties(KF5KIOCore PROPERTIES VERSION ${KIO_VERSION_STRING}
EXPORT_NAME KIOCore
)

+# this should be done by cmake, see bug 371721
+if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/moc_predefs.h
+ COMMAND "${CMAKE_CXX_COMPILER}" "-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp" > ${CMAKE_CURRENT_BINARY_DIR}/moc_predefs.h
+ )
+ set_property(TARGET KF5KIOCore APPEND PROPERTY AUTOMOC_MOC_OPTIONS --include ${CMAKE_CURRENT_BINARY_DIR}/moc_predefs.h)
+ set_property(TARGET KF5KIOCore APPEND PROPERTY AUTOGEN_TARGET_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_predefs.h)
+endif()
+
# Headers prefixed with KIO/
ecm_generate_headers(KIOCore_CamelCase_HEADERS
HEADER_NAMES
--
cgit v1.1

0 comments on commit e7c90c2

Please sign in to comment.