From 30e6753d9a7aaee55ee5e5d8c9ee37e8394104fb Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Fri, 5 Jan 2024 22:37:48 +0100 Subject: [PATCH] Default to PortAudio backend on non-Linux - macOS homebrew[0], NetBSD pkgsrc[1], FreeBSD[2] and OpenBSD[3] ports diable default features and do not reenable "alsa_backend" by default - macOS CI builds do not use it - Windows has no ALSA They all do, however, enable "portaudio_backend" to use PortAudio by default. Reflect that such that the aforementioned four platforms/operating systems do not have to override features whilst making ALSA Linux-only by default. I am not sure what backend is used on Windows by default, but PortAudio aught to work there; certainly better than ALSA. 0: https://github.com/Homebrew/homebrew-core/blob/master/Formula/s/spotifyd.rb 1: http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/audio/spotifyd/Makefile?rev=1.2&content-type=text/x-cvsweb-markup 2: https://cgit.freebsd.org/ports/tree/audio/spotifyd/Makefile 3: http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/audio/spotifyd/Makefile?rev=1.6&content-type=text/x-cvsweb-markup --- Cargo.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 184d9677..4d74a4c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,11 +51,14 @@ env_logger = "0.10" alsa_backend = ["librespot-playback/alsa-backend", "alsa"] dbus_keyring = ["keyring"] dbus_mpris = ["dbus", "dbus-tokio", "dbus-crossroads", "rspotify"] -default = ["alsa_backend"] +default = ["portaudio_backend"] portaudio_backend = ["librespot-playback/portaudio-backend"] pulseaudio_backend = ["librespot-playback/pulseaudio-backend"] rodio_backend = ["librespot-playback/rodio-backend"] +[target."cfg(target_os = \"linux\)".features] +default = ["alsa_backend"] + [package.metadata.deb] depends = "$auto, systemd, pulseaudio" features = ["pulseaudio_backend", "dbus_keyring", "dbus_mpris"]