1 |
commit: 2f8d66d7600d62428c4b0e762c4732590607b2ef |
2 |
Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Apr 20 20:17:44 2021 +0000 |
4 |
Commit: Matthew Thode <prometheanfire <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Apr 20 20:17:57 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f8d66d7 |
7 |
|
8 |
gnome-extra/gnome-integration-spotify: fix dbus integration |
9 |
|
10 |
Closes: https://bugs.gentoo.org/782433 |
11 |
Package-Manager: Portage-3.0.17, Repoman-3.0.2 |
12 |
RepoMan-Options: --force |
13 |
Signed-off-by: Matthew Thode <prometheanfire <AT> gentoo.org> |
14 |
|
15 |
...-integration-spotify-command-line-parsing.patch | 11 ++++++ |
16 |
...ome-integration-spotify-correct-interface.patch | 23 +++++++++++++ |
17 |
.../files/gnome-integration-spotify-use-glib.patch | 40 ++++++++++++++++++++++ |
18 |
...> gnome-integration-spotify-20140907-r2.ebuild} | 8 ++++- |
19 |
4 files changed, 81 insertions(+), 1 deletion(-) |
20 |
|
21 |
diff --git a/gnome-extra/gnome-integration-spotify/files/gnome-integration-spotify-command-line-parsing.patch b/gnome-extra/gnome-integration-spotify/files/gnome-integration-spotify-command-line-parsing.patch |
22 |
new file mode 100644 |
23 |
index 00000000000..505a155f32e |
24 |
--- /dev/null |
25 |
+++ b/gnome-extra/gnome-integration-spotify/files/gnome-integration-spotify-command-line-parsing.patch |
26 |
@@ -0,0 +1,11 @@ |
27 |
+--- spotify-dbus.py_orig 2021-04-12 11:11:00.710360694 +0200 |
28 |
++++ spotify-dbus.py 2021-04-12 11:53:06.208197383 +0200 |
29 |
+@@ -632,7 +636,7 @@ |
30 |
+ self.action_trigger('play') |
31 |
+ |
32 |
+ # Play/pause (0.6) |
33 |
+- elif '--playpause' or 'playpause' in sys.argv: |
34 |
++ elif '--playpause' in sys.argv or 'playpause' in sys.argv: |
35 |
+ self.action_trigger('playpause') |
36 |
+ |
37 |
+ # Stop |
38 |
|
39 |
diff --git a/gnome-extra/gnome-integration-spotify/files/gnome-integration-spotify-correct-interface.patch b/gnome-extra/gnome-integration-spotify/files/gnome-integration-spotify-correct-interface.patch |
40 |
new file mode 100644 |
41 |
index 00000000000..bf59f89077b |
42 |
--- /dev/null |
43 |
+++ b/gnome-extra/gnome-integration-spotify/files/gnome-integration-spotify-correct-interface.patch |
44 |
@@ -0,0 +1,23 @@ |
45 |
+--- spotify-dbus.py_orig 2021-04-12 11:11:00.710360694 +0200 |
46 |
++++ spotify-dbus.py 2021-04-12 11:50:55.946631871 +0200 |
47 |
+@@ -227,8 +227,7 @@ |
48 |
+ if self.debug == True: |
49 |
+ print("Opening " + param + "...") |
50 |
+ |
51 |
+- window = self.get_window() |
52 |
+- window._openLink(param) |
53 |
++ self.player.OpenUri(param) |
54 |
+ |
55 |
+ # Action listener |
56 |
+ def action_listener(self, id = 0, action = ''): |
57 |
+@@ -322,8 +321,8 @@ |
58 |
+ # Get the player object |
59 |
+ def get_player(self): |
60 |
+ try: |
61 |
+- proxyobj = self.bus.get_object('org.mpris.MediaPlayer2.spotify', '/') |
62 |
+- pl = dbus.Interface(proxyobj, 'org.freedesktop.MediaPlayer2') |
63 |
++ proxyobj = self.bus.get_object('org.mpris.MediaPlayer2.spotify', '/org/mpris/MediaPlayer2') |
64 |
++ pl = dbus.Interface(proxyobj, 'org.mpris.MediaPlayer2.Player') |
65 |
+ except dbus.DBusException: |
66 |
+ pl = False |
67 |
+ |
68 |
|
69 |
diff --git a/gnome-extra/gnome-integration-spotify/files/gnome-integration-spotify-use-glib.patch b/gnome-extra/gnome-integration-spotify/files/gnome-integration-spotify-use-glib.patch |
70 |
new file mode 100644 |
71 |
index 00000000000..a247aaaeb2a |
72 |
--- /dev/null |
73 |
+++ b/gnome-extra/gnome-integration-spotify/files/gnome-integration-spotify-use-glib.patch |
74 |
@@ -0,0 +1,40 @@ |
75 |
+--- spotify-dbus.py_orig 2021-04-12 11:11:00.710360694 +0200 |
76 |
++++ spotify-dbus.py 2021-04-12 11:23:16.895644502 +0200 |
77 |
+@@ -39,7 +39,7 @@ |
78 |
+ import sys |
79 |
+ import dbus |
80 |
+ import time |
81 |
+-from gi.repository import GObject |
82 |
++from gi.repository import GLib |
83 |
+ import hashlib |
84 |
+ import sys |
85 |
+ if (sys.version_info) < (3, 0): |
86 |
+@@ -146,8 +146,8 @@ |
87 |
+ interface.connect_to_signal('ActionInvoked', self.action_listener) |
88 |
+ |
89 |
+ interface.connect_to_signal('NotificationClosed', self.action_dismisser) |
90 |
+- GObject.threads_init() |
91 |
+- GObject.timeout_add(self.timeout * 10, self.action_listener) |
92 |
++ GLib.threads_init() |
93 |
++ GLib.timeout_add(self.timeout * 10, self.action_listener) |
94 |
+ |
95 |
+ return self.nid |
96 |
+ |
97 |
+@@ -532,7 +532,7 @@ |
98 |
+ self.locale = locale |
99 |
+ |
100 |
+ # loop must be global to can quit from listener |
101 |
+- self.loop = GObject.MainLoop() |
102 |
++ self.loop = GLib.MainLoop() |
103 |
+ |
104 |
+ # Prepare loop for interactive notifications or daemon mode |
105 |
+ self.dloop = DBusGMainLoop() |
106 |
+@@ -606,7 +606,7 @@ |
107 |
+ |
108 |
+ # Start loop listening for track changes |
109 |
+ try: |
110 |
+- GObject.timeout_add(100, self.change_listener) |
111 |
++ GLib.timeout_add(100, self.change_listener) |
112 |
+ self.loop.run() |
113 |
+ except KeyboardInterrupt: |
114 |
+ print('Stopping daemon...') |
115 |
|
116 |
diff --git a/gnome-extra/gnome-integration-spotify/gnome-integration-spotify-20140907-r1.ebuild b/gnome-extra/gnome-integration-spotify/gnome-integration-spotify-20140907-r2.ebuild |
117 |
similarity index 81% |
118 |
rename from gnome-extra/gnome-integration-spotify/gnome-integration-spotify-20140907-r1.ebuild |
119 |
rename to gnome-extra/gnome-integration-spotify/gnome-integration-spotify-20140907-r2.ebuild |
120 |
index f574ffecc96..049a2479a33 100644 |
121 |
--- a/gnome-extra/gnome-integration-spotify/gnome-integration-spotify-20140907-r1.ebuild |
122 |
+++ b/gnome-extra/gnome-integration-spotify/gnome-integration-spotify-20140907-r2.ebuild |
123 |
@@ -1,4 +1,4 @@ |
124 |
-# Copyright 1999-2020 Gentoo Authors |
125 |
+# Copyright 1999-2021 Gentoo Authors |
126 |
# Distributed under the terms of the GNU General Public License v2 |
127 |
|
128 |
EAPI=6 |
129 |
@@ -28,6 +28,12 @@ RDEPEND="${DEPEND} |
130 |
x11-misc/xdotool |
131 |
x11-apps/xwininfo" |
132 |
|
133 |
+PATCHES=( |
134 |
+ "${FILESDIR}/gnome-integration-spotify-command-line-parsing.patch" |
135 |
+ "${FILESDIR}/gnome-integration-spotify-correct-interface.patch" |
136 |
+ "${FILESDIR}/gnome-integration-spotify-use-glib.patch" |
137 |
+) |
138 |
+ |
139 |
src_install() { |
140 |
dobin spotify-dbus.py |
141 |
python_replicate_script "${ED}"/usr/bin/spotify-dbus.py |