kde-plasma/khotkeys: Fix build with cmake-3.9
authorAndreas Sturmlechner <asturm@gentoo.org>
Sat, 22 Jul 2017 07:33:46 +0000 (09:33 +0200)
committerAndreas Sturmlechner <asturm@gentoo.org>
Sat, 22 Jul 2017 07:36:17 +0000 (09:36 +0200)
Reported-by: Perfect Gentleman <perfect007gentleman@gmail.com>
Gentoo-bug: 625744

Package-Manager: Portage-2.3.6, Repoman-2.3.1

kde-plasma/khotkeys/files/khotkeys-5.10.4-cmake-3.9.patch [new file with mode: 0644]
kde-plasma/khotkeys/khotkeys-5.10.4.ebuild

diff --git a/kde-plasma/khotkeys/files/khotkeys-5.10.4-cmake-3.9.patch b/kde-plasma/khotkeys/files/khotkeys-5.10.4-cmake-3.9.patch
new file mode 100644 (file)
index 0000000..541a184
--- /dev/null
@@ -0,0 +1,60 @@
+From db3a04289d0f33285c3ca2d8fc05fc5bb45d608f Mon Sep 17 00:00:00 2001
+From: Heiko Becker <heirecka@exherbo.org>
+Date: Wed, 19 Jul 2017 22:28:32 +0200
+Subject: Make sure the dbus xml interface file exists before it's used
+
+Summary:
+This started to happen with cmake 3.9, producing this erorr:
+*** No rule to make target 'app/org.kde.khotkeys.xml', needed by
+'kcm_hotkeys/khotkeys_interface.cpp'."
+
+Test Plan: Builds fine with cmake 3.9.
+
+Reviewers: #plasma
+
+Subscribers: plasma-devel
+
+Tags: #plasma
+
+Differential Revision: https://phabricator.kde.org/D6792
+---
+ app/CMakeLists.txt         | 8 ++++++--
+ kcm_hotkeys/CMakeLists.txt | 1 +
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
+index 0e6609f..2c1485e 100644
+--- a/app/CMakeLists.txt
++++ b/app/CMakeLists.txt
+@@ -1,10 +1,14 @@
+ ########### next target ###############
++set(dbus_interface_name org.kde.khotkeys.xml)
+ set(kded_khotkeys_PART_SRCS 
+         kded.cpp
+-        ${CMAKE_CURRENT_BINARY_DIR}/org.kde.khotkeys.xml)
++        ${CMAKE_CURRENT_BINARY_DIR}/${dbus_interface_name})
+-qt5_generate_dbus_interface(kded.h org.kde.khotkeys.xml )
++qt5_generate_dbus_interface(kded.h ${dbus_interface_name})
++set(dbus_interface_xml ${CMAKE_CURRENT_BINARY_DIR}/${dbus_interface_name})
++
++add_custom_target(khotkeysdbusinterface ALL DEPENDS ${dbus_interface_name})
+ add_library(kded_khotkeys MODULE ${kded_khotkeys_PART_SRCS})
+ set_target_properties(kded_khotkeys PROPERTIES OUTPUT_NAME khotkeys)
+diff --git a/kcm_hotkeys/CMakeLists.txt b/kcm_hotkeys/CMakeLists.txt
+index f0ef3d3..0df2b5c 100644
+--- a/kcm_hotkeys/CMakeLists.txt
++++ b/kcm_hotkeys/CMakeLists.txt
+@@ -82,6 +82,7 @@ add_library(
+     MODULE
+     ${kcm_hotkeys_PART_SRCS}
+     )
++add_dependencies(kcm_hotkeys khotkeysdbusinterface)
+ target_compile_definitions(kcm_hotkeys PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}")
+-- 
+cgit v0.11.2
+
index 95b8eaf17fd02e63298692b8987d2b17b6de415c..aab836444049fe1825b95204a88216b6f41e7b70 100644 (file)
@@ -44,3 +44,5 @@ DEPEND="${COMMON_DEPEND}
        x11-libs/libXtst
        x11-proto/xproto
 "
+
+PATCHES=( "${FILESDIR}/${P}-cmake-3.9.patch" )