commit:     c55bc022b110d21d69e47ea92303dadd736dfdad
Author:     Andrew Udvare <audvare <AT> gmail <DOT> com>
AuthorDate: Fri May  3 08:18:43 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jul 23 05:29:54 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c55bc022

net-irc/quassel: add patch for mpris script

>From https://github.com/quassel/quassel/pull/617

Signed-off-by: Andrew Udvare <audvare <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/36522
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/quassel-0.14.0-fix-mpris-script.patch    | 60 ++++++++++++++++++++++
 net-irc/quassel/quassel-0.14.0-r2.ebuild           |  1 +
 2 files changed, 61 insertions(+)

diff --git a/net-irc/quassel/files/quassel-0.14.0-fix-mpris-script.patch 
b/net-irc/quassel/files/quassel-0.14.0-fix-mpris-script.patch
new file mode 100644
index 000000000000..6477d946b306
--- /dev/null
+++ b/net-irc/quassel/files/quassel-0.14.0-fix-mpris-script.patch
@@ -0,0 +1,60 @@
+From c2ddbb99ed25c96e7f8eefd7eeff88f6d10c3875 Mon Sep 17 00:00:00 2001
+From: Andrew Udvare <audv...@gmail.com>
+Date: Fri, 3 May 2024 04:15:21 -0400
+Subject: [PATCH] data/scripts/mpris: update to use current MPRIS D-Bus
+ interface
+
+Update documentation
+Allow for . in the name of the player name
+Strip xesam: from the result
+---
+ data/scripts/mpris | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/data/scripts/mpris b/data/scripts/mpris
+index c483c7214a..ace8a573de 100755
+--- a/data/scripts/mpris
++++ b/data/scripts/mpris
+@@ -23,21 +23,21 @@
+ # Simple script to read metadata from mpris compatible mediaplayers via dbus.
+ #
+ # Run it like this:
+-# mpris amarok
++# mpris strawberry
+ #
+ # The script fills all fields exported by the player's dbusinterface.
+-# They are defined here: http://wiki.xmms2.xmms.se/wiki/MPRIS_Metadata
++# They are defined here: 
https://www.freedesktop.org/wiki/Specifications/mpris-spec/metadata/#fields
+ #
+ # To see which fields are actually available from your player,
+ # call something like this from a terminal:
+ #
+-# qdbus org.mpris.amarok /Player GetMetadata
++# qdbus org.mpris.MediaPlayer2.strawberry /org/mpris/MediaPlayer2 Metadata
+ # or
+-# qdbus org.mpris.vlc /Player GetMetadata
++# qdbus org.mpris.MediaPlayer2.mpv /org/mpris/MediaPlayer2 Metadata
+ # etc.
+-# 
++#
+ # Every field is available in the data hash 'd' via
+-# $d{"NAME_OF_FIELD"}
++# $d{"NAME_OF_FIELD"} (without the 'xesam:' prefix)
+ # To edit the output just change the marked line accordingly.
+ 
+ use strict;
+@@ -48,11 +48,11 @@ if($#ARGV < 0) {
+  exit 1;
+ }
+ 
+-die "Please don't use any special characters in playername." if($ARGV[0] =~ 
/[^\w\d_-]/);
++die "Please don't use any special characters in playername." if($ARGV[0] =~ 
/[^\.\w\d_-]/);
+ 
+-open(IN,"qdbus org.mpris.".$ARGV[0]." /Player GetMetadata|") or die "Couldn't 
get dbus result.";
++open(IN,"qdbus org.mpris.MediaPlayer2.".$ARGV[0]." /org/mpris/MediaPlayer2 
Metadata|") or die "Couldn't get dbus result.";
+ while(<IN>) {
+-      $d{$1} = $2 if(/^([^:]+):\s+([^\n]+)/);
++      $d{$1} = $2 if(/^xesam:([^:]+):\s+([^\n]+)/);
+ }
+ close IN;
+ 

diff --git a/net-irc/quassel/quassel-0.14.0-r2.ebuild 
b/net-irc/quassel/quassel-0.14.0-r2.ebuild
index af4e2d872c26..546741201071 100644
--- a/net-irc/quassel/quassel-0.14.0-r2.ebuild
+++ b/net-irc/quassel/quassel-0.14.0-r2.ebuild
@@ -106,6 +106,7 @@ PATCHES=(
        "${FILESDIR}/${P}-cxxflags.patch"
        "${FILESDIR}/${P}-fix-desktop-application-name.patch"
        "${FILESDIR}/${P}-fix-exec-script.patch"
+       "${FILESDIR}/${P}-fix-mpris-script.patch"
 )
 
 src_configure() {

Reply via email to