Gentoo Archives: gentoo-commits

From: Michael Palimaka <kensington@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-sound/cantata/, media-sound/cantata/files/
Date: Sat, 05 Nov 2016 15:43:08
Message-Id: 1478360570.54401847549e3a5ad53811646e63b69327a57376.kensington@gentoo
1 commit: 54401847549e3a5ad53811646e63b69327a57376
2 Author: Andreas Sturmlechner <andreas.sturmlechner <AT> gmail <DOT> com>
3 AuthorDate: Sat Oct 22 21:09:00 2016 +0000
4 Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 5 15:42:50 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=54401847
7
8 media-sound/cantata: Drop USE=kde,qt5 and simplify ebuild
9
10 Add fixes for MPRIS and >=Plasma-5.7
11 X not used with Qt5 - upstream commit c934ae9ed5b8aeb3d8ff6a6b108b3cfe4fb30dea
12
13 Package-Manager: portage-2.3.0
14
15 media-sound/cantata/cantata-2.0.1-r1.ebuild | 120 +++++++++++++++++++++
16 .../files/cantata-2.0.1-mpris-plasma57.patch | 46 ++++++++
17 .../cantata/files/cantata-2.0.1-mpris-true.patch | 100 +++++++++++++++++
18 .../cantata/files/cantata-2.0.1-qt5-no-X11.patch | 14 +++
19 4 files changed, 280 insertions(+)
20
21 diff --git a/media-sound/cantata/cantata-2.0.1-r1.ebuild b/media-sound/cantata/cantata-2.0.1-r1.ebuild
22 new file mode 100644
23 index 00000000..b04563d
24 --- /dev/null
25 +++ b/media-sound/cantata/cantata-2.0.1-r1.ebuild
26 @@ -0,0 +1,120 @@
27 +# Copyright 1999-2016 Gentoo Foundation
28 +# Distributed under the terms of the GNU General Public License v2
29 +# $Id$
30 +
31 +EAPI=6
32 +
33 +PLOCALES="cs de en_GB es fr hu ko pl ru zh_CN"
34 +inherit cmake-utils gnome2-utils l10n qmake-utils xdg
35 +
36 +DESCRIPTION="Featureful and configurable Qt client for the music player daemon (MPD)"
37 +HOMEPAGE="https://github.com/CDrummond/cantata"
38 +SRC_URI="https://github.com/CDrummond/cantata/releases/download/v${PV}/${P}.tar.bz2"
39 +
40 +LICENSE="GPL-2"
41 +SLOT="4"
42 +KEYWORDS="~amd64 ~x86"
43 +IUSE="cdda cddb http-server mtp musicbrainz replaygain taglib udisks"
44 +REQUIRED_USE="
45 + cdda? ( udisks || ( cddb musicbrainz ) )
46 + cddb? ( cdda taglib )
47 + mtp? ( taglib udisks )
48 + musicbrainz? ( cdda taglib )
49 + replaygain? ( taglib )
50 +"
51 +
52 +RDEPEND="
53 + dev-db/sqlite:3
54 + dev-qt/qtconcurrent:5
55 + dev-qt/qtcore:5
56 + dev-qt/qtdbus:5
57 + dev-qt/qtgui:5
58 + dev-qt/qtnetwork:5
59 + dev-qt/qtsql:5
60 + dev-qt/qtsvg:5
61 + dev-qt/qtwidgets:5
62 + dev-qt/qtxml:5
63 + sys-libs/zlib
64 + || ( kde-frameworks/breeze-icons:5 kde-frameworks/oxygen-icons:* )
65 + cdda? ( media-sound/cdparanoia )
66 + cddb? ( media-libs/libcddb )
67 + mtp? ( media-libs/libmtp )
68 + musicbrainz? ( media-libs/musicbrainz:5 )
69 + replaygain? (
70 + media-libs/libebur128
71 + media-sound/mpg123
72 + virtual/ffmpeg
73 + )
74 + taglib? (
75 + media-libs/taglib[asf(+),mp4(+)]
76 + media-libs/taglib-extras
77 + udisks? ( sys-fs/udisks:2 )
78 + )
79 +"
80 +DEPEND="${RDEPEND}
81 + dev-qt/linguist-tools:5
82 +"
83 +
84 +# cantata has no tests
85 +RESTRICT="test"
86 +
87 +PATCHES=(
88 + "${FILESDIR}/${P}-mpris-true.patch"
89 + "${FILESDIR}/${P}-mpris-plasma57.patch"
90 + "${FILESDIR}/${P}-qt5-no-X11.patch"
91 +)
92 +
93 +src_prepare() {
94 + cmake-utils_src_prepare
95 +
96 + # Unbundle 3rd party libs
97 + rm -rf 3rdparty/qtsingleapplication/ || die
98 + rm -rf 3rdparty/libebur128/ || die
99 + # qjson ebuild does not support Qt5 yet
100 + rm -rf 3rdparty/qjson/ || die
101 +
102 + l10n_find_plocales_changes 'po' '' '.po'
103 +}
104 +
105 +src_configure() {
106 + local langs="$(l10n_get_locales)"
107 +
108 + local mycmakeargs=(
109 + -DCANTATA_TRANSLATIONS="${langs// /;}"
110 + -DENABLE_CDPARANOIA=$(usex cdda)
111 + -DENABLE_CDDB=$(usex cddb)
112 + -DENABLE_HTTP_SERVER=$(usex http-server)
113 + -DENABLE_MTP=$(usex mtp)
114 + -DENABLE_MUSICBRAINZ=$(usex musicbrainz)
115 + -DENABLE_QT5=ON
116 + -DLCONVERT_EXECUTABLE="$(qt5_get_bindir)/lconvert"
117 + -DLRELEASE_EXECUTABLE="$(qt5_get_bindir)/lrelease"
118 + -DENABLE_FFMPEG=$(usex replaygain)
119 + -DENABLE_MPG123=$(usex replaygain)
120 + -DENABLE_TAGLIB=$(usex taglib)
121 + -DENABLE_TAGLIB_EXTRAS=$(usex taglib)
122 + -DENABLE_DEVICES_SUPPORT=$(usex udisks)
123 + -DENABLE_HTTP_STREAM_PLAYBACK=OFF
124 + -DENABLE_REMOTE_DEVICES=OFF
125 + -DENABLE_UDISKS2=ON
126 + -DUSE_SYSTEM_MENU_ICON=OFF
127 + )
128 +# -DENABLE_KDE=$(usex kde) # not yet ported to KF5
129 +
130 + cmake-utils_src_configure
131 +}
132 +
133 +pkg_preinst() {
134 + gnome2_icon_savelist
135 + xdg_pkg_preinst
136 +}
137 +
138 +pkg_postinst() {
139 + gnome2_icon_cache_update
140 + xdg_pkg_postinst
141 +}
142 +
143 +pkg_postrm() {
144 + gnome2_icon_cache_update
145 + xdg_pkg_postrm
146 +}
147
148 diff --git a/media-sound/cantata/files/cantata-2.0.1-mpris-plasma57.patch b/media-sound/cantata/files/cantata-2.0.1-mpris-plasma57.patch
149 new file mode 100644
150 index 00000000..3965b42
151 --- /dev/null
152 +++ b/media-sound/cantata/files/cantata-2.0.1-mpris-plasma57.patch
153 @@ -0,0 +1,46 @@
154 +Work-around KDE 5.7 MPRIS issues.
155 +
156 +diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp
157 +index cc2b532..37eec9e 100644
158 +--- a/gui/mainwindow.cpp
159 ++++ b/gui/mainwindow.cpp
160 +@@ -1410,8 +1410,8 @@ void MainWindow::setRating()
161 + }
162 + }
163 +
164 +-void MainWindow::readSettings()
165 +-{
166 ++void MainWindow::initMpris()
167 ++{
168 + #ifdef QT_QTDBUS_FOUND
169 + if (Settings::self()->mpris()) {
170 + if (!mpris) {
171 +@@ -1424,6 +1424,16 @@ void MainWindow::readSettings()
172 + mpris=0;
173 + }
174 + CurrentCover::self()->setEnabled(mpris || Settings::self()->showPopups() || 0!=Settings::self()->playQueueBackground() || Settings::self()->showCoverWidget());
175 ++ #endif
176 ++}
177 ++
178 ++void MainWindow::readSettings()
179 ++{
180 ++ #ifdef QT_QTDBUS_FOUND
181 ++ // It appears as if the KDE MPRIS code does not like the MPRIS interface to be setup before the window is visible.
182 ++ // to work-around this, initMpris in the next event loop iteration.
183 ++ // See #863
184 ++ QTimer::singleShot(0, this, SLOT(initMpris()));
185 + #else
186 + CurrentCover::self()->setEnabled(Settings::self()->showPopups() || 0!=Settings::self()->playQueueBackground() || Settings::self()->showCoverWidget());
187 + #endif
188 +diff --git a/gui/mainwindow.h b/gui/mainwindow.h
189 +index 6d6e960..aa3a80a 100644
190 +--- a/gui/mainwindow.h
191 ++++ b/gui/mainwindow.h
192 +@@ -268,6 +268,7 @@ public Q_SLOTS:
193 + private Q_SLOTS:
194 + void toggleContext();
195 + void toggleMenubar();
196 ++ void initMpris();
197 +
198 + private:
199 + int prevPage;
200
201 diff --git a/media-sound/cantata/files/cantata-2.0.1-mpris-true.patch b/media-sound/cantata/files/cantata-2.0.1-mpris-true.patch
202 new file mode 100644
203 index 00000000..c32f745
204 --- /dev/null
205 +++ b/media-sound/cantata/files/cantata-2.0.1-mpris-true.patch
206 @@ -0,0 +1,100 @@
207 +Always return true for MPRIS CanPlay, CanPause, etc.
208 +
209 +diff --git a/dbus/mpris.cpp b/dbus/mpris.cpp
210 +index 4736d19..45a539a 100644
211 +--- a/dbus/mpris.cpp
212 ++++ b/dbus/mpris.cpp
213 +@@ -65,6 +65,31 @@ Mpris::~Mpris()
214 + QDBusConnection::sessionBus().unregisterService("org.mpris.MediaPlayer2.cantata");
215 + }
216 +
217 ++void Mpris::Pause()
218 ++{
219 ++ if (MPDState_Playing==MPDStatus::self()->state()) {
220 ++ StdActions::self()->playPauseTrackAction->trigger();
221 ++ }
222 ++}
223 ++
224 ++void Mpris::Play()
225 ++{
226 ++ MPDStatus * const status = MPDStatus::self();
227 ++ if (status->playlistLength() && MPDState_Playing!=status->state()) {
228 ++ StdActions::self()->playPauseTrackAction->trigger();
229 ++ }
230 ++}
231 ++
232 ++QString Mpris::PlaybackStatus() const
233 ++{
234 ++ switch(MPDStatus::self()->state()) {
235 ++ case MPDState_Playing: return QLatin1String("Playing");
236 ++ case MPDState_Paused: return QLatin1String("Paused");
237 ++ default:
238 ++ case MPDState_Stopped: return QLatin1String("Stopped");
239 ++ }
240 ++}
241 ++
242 + qlonglong Mpris::Position() const
243 + {
244 + // Cant use MPDStatus, as we dont poll for track position, but use a timer instead!
245 +diff --git a/dbus/mpris.h b/dbus/mpris.h
246 +index 64a4fbe..a1578b9 100644
247 +--- a/dbus/mpris.h
248 ++++ b/dbus/mpris.h
249 +@@ -71,37 +71,15 @@ class Mpris : public QObject
250 + // org.mpris.MediaPlayer2.Player
251 + void Next() { StdActions::self()->nextTrackAction->trigger(); }
252 + void Previous() { StdActions::self()->prevTrackAction->trigger(); }
253 +- void Pause() {
254 +- if (MPDState_Playing==MPDStatus::self()->state()) {
255 +- StdActions::self()->playPauseTrackAction->trigger();
256 +- }
257 +- }
258 +-
259 ++ void Pause();
260 + void PlayPause() { StdActions::self()->playPauseTrackAction->trigger(); }
261 + void Stop() { StdActions::self()->stopPlaybackAction->trigger(); }
262 + void StopAfterCurrent() { StdActions::self()->stopAfterCurrentTrackAction->trigger(); }
263 +-
264 +- void Play() {
265 +- MPDStatus * const status = MPDStatus::self();
266 +-
267 +- if (status->playlistLength() && MPDState_Playing!=status->state()) {
268 +- StdActions::self()->playPauseTrackAction->trigger();
269 +- }
270 +- }
271 +-
272 ++ void Play();
273 + void Seek(qlonglong pos) { emit setSeekId(-1, pos/1000000); }
274 + void SetPosition(const QDBusObjectPath &, qlonglong pos) {emit setSeekId(-1, pos/1000000); }
275 + void OpenUri(const QString &) { }
276 +-
277 +- QString PlaybackStatus() {
278 +- switch(MPDStatus::self()->state()) {
279 +- case MPDState_Playing: return QLatin1String("Playing");
280 +- case MPDState_Paused: return QLatin1String("Paused");
281 +- default:
282 +- case MPDState_Stopped: return QLatin1String("Stopped");
283 +- }
284 +- }
285 +-
286 ++ QString PlaybackStatus() const;
287 + QString LoopStatus() { return MPDStatus::self()->repeat() ? QLatin1String("Playlist") : QLatin1String("None"); }
288 + void SetLoopStatus(const QString &s) { emit setRepeat(QLatin1String("None")!=s); }
289 + QVariantMap Metadata() const;
290 +@@ -115,11 +93,11 @@ class Mpris : public QObject
291 + double MinimumRate() const { return 1.0; }
292 + double MaximumRate() const { return 1.0; }
293 + bool CanControl() const { return true; }
294 +- bool CanPlay() const { return MPDState_Playing!=MPDStatus::self()->state() && MPDStatus::self()->playlistLength()>0; }
295 +- bool CanPause() const { return MPDState_Playing==MPDStatus::self()->state(); }
296 +- bool CanSeek() const { return -1!=MPDStatus::self()->songId(); }
297 +- bool CanGoNext() const { return MPDState_Stopped!=MPDStatus::self()->state() && MPDStatus::self()->playlistLength()>1; }
298 +- bool CanGoPrevious() const { return MPDState_Stopped!=MPDStatus::self()->state() && MPDStatus::self()->playlistLength()>1; }
299 ++ bool CanPlay() const { return true; }
300 ++ bool CanPause() const { return true; }
301 ++ bool CanSeek() const { return true; }
302 ++ bool CanGoNext() const { return true; }
303 ++ bool CanGoPrevious() const { return true; }
304 +
305 + // org.mpris.MediaPlayer2
306 + bool CanQuit() const { return true; }
307
308 diff --git a/media-sound/cantata/files/cantata-2.0.1-qt5-no-X11.patch b/media-sound/cantata/files/cantata-2.0.1-qt5-no-X11.patch
309 new file mode 100644
310 index 00000000..de90cd6
311 --- /dev/null
312 +++ b/media-sound/cantata/files/cantata-2.0.1-qt5-no-X11.patch
313 @@ -0,0 +1,14 @@
314 +diff --git a/support/CMakeLists.txt b/support/CMakeLists.txt
315 +index fcdaf5c..f6160f0 100644
316 +--- a/support/CMakeLists.txt
317 ++++ b/support/CMakeLists.txt
318 +@@ -89,7 +89,7 @@ if (NOT ENABLE_UBUNTU AND NOT ENABLE_WEB)
319 +
320 + add_library(support STATIC ${SUPPORT_MOC_SRCS} ${SUPPORT_SRCS} ${SUPPORT_UI_HDRS} ${SUPPORT_RC_SRCS})
321 +
322 +- if (X11_FOUND)
323 ++ if (NOT ENABLE_QT5 AND X11_FOUND)
324 + target_link_libraries(support ${X11_LIBRARIES})
325 +- endif (X11_FOUND)
326 ++ endif (NOT ENABLE_QT5 AND X11_FOUND)
327 + endif (NOT ENABLE_UBUNTU AND NOT ENABLE_WEB)