From 2eb54f3c9167d11c4cbc8bb1f0c382583e8fa993 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Thu, 5 May 2016 20:38:09 -0500 Subject: [PATCH] 5.21.0-2 - pull in phonon-related path fix (reviewboard#127829) - update URL, support bootstrap, add %check --- kf5-knotifyconfig.spec | 41 ++++++++++++++++++++++++--- knotifyconfig-reviewboard127829.patch | 32 +++++++++++++++++++++ 2 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 knotifyconfig-reviewboard127829.patch diff --git a/kf5-knotifyconfig.spec b/kf5-knotifyconfig.spec index 0f27071..f31431a 100644 --- a/kf5-knotifyconfig.spec +++ b/kf5-knotifyconfig.spec @@ -1,12 +1,20 @@ %global framework knotifyconfig +## uncomment to enable bootstrap mode +#global bootstrap 1 + +## currently includes no tests +#if !0%{?bootstrap} +#global tests 1 +#endif + Name: kf5-%{framework} Version: 5.21.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: KDE Frameworks 5 Tier 3 module for KNotify configuration License: LGPLv2+ -URL: http://projects.kde.org/knotifyconfig +URL: https://quickgit.kde.org/?p=%{framework}.git %global versiondir %(echo %{version} | cut -d. -f1-2) %global revision %(echo %{version} | cut -d. -f3) @@ -17,6 +25,10 @@ URL: http://projects.kde.org/knotifyconfig %endif Source0: http://download.kde.org/%{stable}/frameworks/%{versiondir}/%{framework}-%{version}.tar.xz +## upstream patches +# https://git.reviewboard.kde.org/r/127829/ +Patch100: knotifyconfig-reviewboard127829.patch + BuildRequires: extra-cmake-modules >= %{version} BuildRequires: kf5-kcompletion-devel >= %{version} BuildRequires: kf5-kconfig-devel >= %{version} @@ -29,6 +41,11 @@ BuildRequires: kf5-kxmlgui-devel >= %{version} BuildRequires: kf5-rpm-macros >= %{version} BuildRequires: phonon-qt5-devel BuildRequires: qt5-qtbase-devel +%if 0%{?tests} +BuildRequires: dbus-x11 +BuildRequires: time +BuildRequires: xorg-x11-server-Xvfb +%endif Requires: kf5-filesystem >= %{version} @@ -45,12 +62,14 @@ developing applications that use %{name}. %prep -%setup -q -n %{framework}-%{version} +%autosetup -n %{framework}-%{version} -p1 + %build mkdir %{_target_platform} pushd %{_target_platform} -%{cmake_kf5} .. +%{cmake_kf5} .. \ + -DBUILD_TESTING:BOOL=%{?tests:ON}%{!?tests:OFF} popd make %{?_smp_mflags} -C %{_target_platform} @@ -61,6 +80,16 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform} %find_lang knotifyconfig5_qt --with-qt --all-name +%check +%if 0%{?tests} +export CTEST_OUTPUT_ON_FAILURE=1 +xvfb-run -a \ +dbus-launch --exit-with-session \ +time \ +make test ARGS="--output-on-failure --timeout 10" -C %{_target_platform} ||: +%endif + + %post -p /sbin/ldconfig %postun -p /sbin/ldconfig @@ -78,6 +107,10 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform} %changelog +* Thu May 05 2016 Rex Dieter - 5.21.0-2 +- pull in phonon-related path fix (reviewboard#127829) +- update URL, support bootstrap, add %%check + * Mon Apr 04 2016 Rex Dieter - 5.21.0-1 - KDE Frameworks 5.21.0 diff --git a/knotifyconfig-reviewboard127829.patch b/knotifyconfig-reviewboard127829.patch new file mode 100644 index 0000000..98d57b9 --- /dev/null +++ b/knotifyconfig-reviewboard127829.patch @@ -0,0 +1,32 @@ +diff --git a/src/knotifyconfigactionswidget.cpp b/src/knotifyconfigactionswidget.cpp +index 98286c4d0e8a7deec5d35986a261222931afb60d..38578919b8bbb94debf9ba7986ed6b77eec0dc91 100644 +--- a/src/knotifyconfigactionswidget.cpp ++++ b/src/knotifyconfigactionswidget.cpp +@@ -133,14 +133,19 @@ void KNotifyConfigActionsWidget::save(KNotifyConfigElement *config) + + void KNotifyConfigActionsWidget::slotPlay() + { +- QUrl soundURL = QUrl(m_ui.Sound_select->text()); // this CTOR accepts both absolute paths (/usr/share/sounds/blabla.ogg and blabla.ogg) w/o screwing the scheme +- if (soundURL.isRelative() && !soundURL.toString().startsWith('/')) { // QUrl considers url.scheme.isEmpty() == url.isRelative() +- const QString soundString = soundURL.toString(); +- // we need a way to get the application name in order to ba able to do this : +- /*QString search = QString("%1/sounds/%2").arg(config->appname).arg(soundFile); +- search = locate("data", search); +- if ( search.isEmpty() )*/ +- soundURL = QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, "sounds/" + soundString)); ++ const QString soundFilename = m_ui.Sound_select->text(); ++ QUrl soundURL; ++ const auto dataLocations = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation); ++ foreach (const QString &dataLocation, dataLocations) { ++ soundURL = QUrl::fromUserInput(soundFilename, ++ dataLocation + "/sounds", ++ QUrl::AssumeLocalFile); ++ if (soundURL.isLocalFile() && QFile::exists(soundURL.toLocalFile())) { ++ break; ++ } else if (!soundURL.isLocalFile() && soundURL.isValid()) { ++ break; ++ } ++ soundURL.clear(); + } + #if HAVE_PHONON + Phonon::MediaObject *media = Phonon::createPlayer(Phonon::NotificationCategory, soundURL);