From dfbbff73bec2b172cb91ed4c3c92032d99130dd4 Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Sun, 15 Sep 2024 16:32:28 +0200 Subject: group-desktop: Unmask media-sound/mpd-mpris and mpv-plugin/mpv-mpris Additionally patch media-sound/mpd-mpris to support UNIX sockets since the last release from 2023 does not include this feature yet. --- .../package.accept_keywords/01-group-desktop | 2 + ...ing-unix-abstract-sockets-in-MPD_HOST.-47.patch | 59 ++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 group-desktop/patches/media-sound/mpd-mpris-0.4.1/0001-Allow-setting-unix-abstract-sockets-in-MPD_HOST.-47.patch (limited to 'group-desktop') diff --git a/group-desktop/package.accept_keywords/01-group-desktop b/group-desktop/package.accept_keywords/01-group-desktop index 0f42628..5723355 100644 --- a/group-desktop/package.accept_keywords/01-group-desktop +++ b/group-desktop/package.accept_keywords/01-group-desktop @@ -2,8 +2,10 @@ app-office/obsidian media-fonts/iosevka media-sound/listenbrainz-mpd media-sound/mpd +media-sound/mpd-mpris media-sound/whipper media-video/obs-studio +mpv-plugin/mpv-mpris net-misc/gallery-dl xfce-base/thunar diff --git a/group-desktop/patches/media-sound/mpd-mpris-0.4.1/0001-Allow-setting-unix-abstract-sockets-in-MPD_HOST.-47.patch b/group-desktop/patches/media-sound/mpd-mpris-0.4.1/0001-Allow-setting-unix-abstract-sockets-in-MPD_HOST.-47.patch new file mode 100644 index 0000000..80de249 --- /dev/null +++ b/group-desktop/patches/media-sound/mpd-mpris-0.4.1/0001-Allow-setting-unix-abstract-sockets-in-MPD_HOST.-47.patch @@ -0,0 +1,59 @@ +From 4a10c25567adab6a67edf6ee43f3ff0128068dd9 Mon Sep 17 00:00:00 2001 +From: Elliot Thomas +Date: Sun, 28 Jan 2024 20:58:08 +0000 +Subject: [PATCH] Allow setting unix/abstract sockets in MPD_HOST. (#47) + +* Change the network type to "unix" if the address taken from MPD_HOST starts with a slash. + +This more closely approximates the behaviour of libmpdclient. + +* Change the network type to unix also if addr starts with an at sign, + and account for this in embedded password handling code. + +This enables support for "abstract sockets", just like libmpdclient. + +* Add a link to the MPC documentation detailing the "--host" argument. + +This details how MPC parses the MPD_HOST environment variable. +--- + cmd/mpd-mpris/main.go | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/cmd/mpd-mpris/main.go b/cmd/mpd-mpris/main.go +index 8d5897b..9b8280c 100644 +--- a/cmd/mpd-mpris/main.go ++++ b/cmd/mpd-mpris/main.go +@@ -79,13 +79,17 @@ func main() { + flag.Parse() + password := getPassword() + if len(addr) == 0 { ++ // For a description of what can be in the the MPD_HOST environment variable, see: ++ // https://www.musicpd.org/doc/mpc/html/#cmdoption-host + env_host := os.Getenv("MPD_HOST") + if len(env_host) == 0 { + addr = "localhost" + detectLocalSocket() + } else { +- if strings.Index(env_host, "@") > -1 { +- addr_pwd := strings.Split(env_host, "@") ++ // When looking for the password delimiter, ignore the first character. ++ // An '@' sign at the start of the envvar signifies an "abstract socket" without password. ++ if strings.Index(env_host[1:], "@") > -1 { ++ addr_pwd := strings.SplitN(env_host, "@", 2) + // allow providing an alternative password on the command line + if len(password) == 0 { + password = addr_pwd[0] +@@ -94,6 +98,10 @@ func main() { + } else { + addr = env_host + } ++ // Check if addr refers to a path or abstract socket name and change network accordingly. ++ if strings.HasPrefix(addr, "/") || strings.HasPrefix(addr, "@") { ++ network = "unix" ++ } + } + } + +-- +2.46.0 + -- cgit v1.2.3-2-gb3c3