kde-frameworks/knotifyconfig: Fix build with USE -phonon
authorAndreas Sturmlechner <asturm@gentoo.org>
Mon, 10 Dec 2018 19:45:26 +0000 (20:45 +0100)
committerAndreas Sturmlechner <asturm@gentoo.org>
Mon, 10 Dec 2018 19:45:26 +0000 (20:45 +0100)
Closes: https://bugs.gentoo.org/672866
Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
kde-frameworks/knotifyconfig/files/knotifyconfig-5.53.0-phonon-optional.patch [new file with mode: 0644]
kde-frameworks/knotifyconfig/knotifyconfig-5.53.0.ebuild

diff --git a/kde-frameworks/knotifyconfig/files/knotifyconfig-5.53.0-phonon-optional.patch b/kde-frameworks/knotifyconfig/files/knotifyconfig-5.53.0-phonon-optional.patch
new file mode 100644 (file)
index 0000000..0854b76
--- /dev/null
@@ -0,0 +1,48 @@
+From 78a1dcc794f57be993ada7c6f129586ebb6b181e Mon Sep 17 00:00:00 2001
+From: Heiko Becker <heirecka@exherbo.org>
+Date: Mon, 10 Dec 2018 16:15:08 +0100
+Subject: Fix build without Phonon
+
+Summary:
+f6d55baf5aa88eaab6b2f96c025064f081d13cea replaced ${PHONON_LIBS} with
+Phonon's imported target. This breaks in the case when Phonon isn't
+found or disabled via -DCMAKE_DISABLE_FIND_PACKAGES_Phonon4Qt5=TRUE
+because the imported target isn't known. It worked previously because
+${PHONON_LIBS} was just empty when Phonon wasn't available.
+
+Test Plan:
+Building without phonon works now and and it still builds
+with phonon available and successfully links to it.
+
+Subscribers: kde-frameworks-devel
+
+Tags: #frameworks
+
+Differential Revision: https://phabricator.kde.org/D17479
+---
+ src/CMakeLists.txt | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 3dd0039..b93cabc 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -27,9 +27,15 @@ target_link_libraries(KF5NotifyConfig
+         PRIVATE
+             KF5::I18n
+             KF5::KIOWidgets     # KUrlRequester
+-            Phonon::phonon4qt5
+             Qt5::DBus)
+ 
++if(HAVE_PHONON)
++    target_link_libraries(KF5NotifyConfig
++        PRIVATE
++            Phonon::phonon4qt5
++    )
++endif()
++
+ set_target_properties(KF5NotifyConfig PROPERTIES
+    VERSION      ${KNOTIFYCONFIG_VERSION_STRING}
+    SOVERSION    ${KNOTIFYCONFIG_SOVERSION}
+-- 
+cgit v1.1
index 7c834ad4baff198b787ab3e2a31cc6a939adfa37..65aca3a9a07b09e9d7376810fc4cbf9294a7feca 100644 (file)
@@ -22,3 +22,5 @@ RDEPEND="
        phonon? ( media-libs/phonon[qt5(+)] )
 "
 DEPEND="${RDEPEND}"
+
+PATCHES=( "${FILESDIR}/${P}-phonon-optional.patch" )