git: fcf990eaf36a - main - audio/sayonara: enable PulseAudio, repair Python scripts

From: Adriaan de Groot <adridg_at_FreeBSD.org>
Date: Tue, 11 Jun 2024 22:05:31 UTC
The branch main has been updated by adridg:

URL: https://cgit.FreeBSD.org/ports/commit/?id=fcf990eaf36a6e26ef5eade77248c24ea9164e9f

commit fcf990eaf36a6e26ef5eade77248c24ea9164e9f
Author:     Adriaan de Groot <adridg@FreeBSD.org>
AuthorDate: 2024-06-11 21:56:45 +0000
Commit:     Adriaan de Groot <adridg@FreeBSD.org>
CommitDate: 2024-06-11 22:05:29 +0000

    audio/sayonara: enable PulseAudio, repair Python scripts
    
    Sayonara did not have a dependency on GStreamer PulseAudio plugins,
    so it would use only ALSA for output. PA is installed anyway in
    desktop systems, so enable the plugin. Thanks Harald for the
    simple patch.
    
    While here, repair the Python scripts, which need pydbus --
    add the dependency, then repair the code to work with the
    version of pydbus that we have in ports.
    
    Reported-by:    Harald Schmalzbauer <bugzilla.freebsd@omnilan.de>
    PR:             279568
---
 audio/sayonara/Makefile                            |  4 +++-
 audio/sayonara/files/patch-src_DBus_sayonara-ctl   | 20 ++++++++++++++++++++
 audio/sayonara/files/patch-src_DBus_sayonara-query | 20 ++++++++++++++++++++
 3 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/audio/sayonara/Makefile b/audio/sayonara/Makefile
index 70a43737ab04..71dd7a862b2e 100644
--- a/audio/sayonara/Makefile
+++ b/audio/sayonara/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	sayonara
 DISTVERSION=	1.10.0
 DISTVERSIONSUFFIX=	-stable1
+PORTREVISION=	1
 CATEGORIES=	audio
 
 MAINTAINER=	adridg@FreeBSD.org
@@ -12,11 +13,12 @@ LICENSE_FILE=	${WRKSRC}/COPYING
 
 LIB_DEPENDS=	libtag.so:audio/taglib \
 		libmtp.so:multimedia/libmtp
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}dbus>0:devel/py-dbus@${PY_FLAVOR}
 
 USES=		cmake compiler:c++11-lib desktop-file-utils gnome gstreamer pkgconfig \
 		qt:5 python shebangfix
 USE_GNOME=	glib20
-USE_GSTREAMER=	flac libav mpg123 ogg opus vorbis
+USE_GSTREAMER=	flac libav mpg123 ogg opus pulse vorbis
 USE_QT=		dbus core gui network sql sql-sqlite3:run svg widgets xml \
 		buildtools:build qmake:build linguisttools:build \
 		testlib:build
diff --git a/audio/sayonara/files/patch-src_DBus_sayonara-ctl b/audio/sayonara/files/patch-src_DBus_sayonara-ctl
new file mode 100644
index 000000000000..9b7d1b1b198c
--- /dev/null
+++ b/audio/sayonara/files/patch-src_DBus_sayonara-ctl
@@ -0,0 +1,20 @@
+--- src/DBus/sayonara-ctl.orig	2024-06-11 21:55:30 UTC
++++ src/DBus/sayonara-ctl
+@@ -5,7 +5,7 @@ import sys
+ import argparse
+ 
+ try:
+-    from pydbus import SessionBus
++    from dbus import SessionBus
+ except ImportError as e:
+     print("Cannot find pydbus module. Please install first")
+     sys.exit(1)
+@@ -38,7 +38,7 @@ def main():
+     bus = SessionBus()
+     try:
+         global gSayonaraInstance
+-        gSayonaraInstance = bus.get(
++        gSayonaraInstance = bus.get_object(
+             "org.mpris.MediaPlayer2.sayonara",  # Bus name
+             "/org/mpris/MediaPlayer2"           # Object path
+         )
diff --git a/audio/sayonara/files/patch-src_DBus_sayonara-query b/audio/sayonara/files/patch-src_DBus_sayonara-query
new file mode 100644
index 000000000000..8f8baec0a714
--- /dev/null
+++ b/audio/sayonara/files/patch-src_DBus_sayonara-query
@@ -0,0 +1,20 @@
+--- src/DBus/sayonara-query.orig	2024-06-11 21:55:30 UTC
++++ src/DBus/sayonara-query
+@@ -4,7 +4,7 @@ import sys
+ import argparse
+ 
+ try:
+-    from pydbus import SessionBus
++    from dbus import SessionBus
+ except ImportError as e:
+     print("Cannot find pydbus module. Please install first")
+     sys.exit(1)
+@@ -77,7 +77,7 @@ def main():
+     bus = SessionBus()
+ 
+     try:
+-        sayonara = bus.get(
++        sayonara = bus.get_object(
+             'org.mpris.MediaPlayer2.sayonara',  # Bus name
+             '/org/mpris/MediaPlayer2'           # Object path
+         )