about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/audio/spotify-player/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-09-01 11:51:02 +0000
committerAlyssa Ross <hi@alyssa.is>2023-09-01 11:51:02 +0000
commitaa4353b499e6950b7333578f936455a628145c31 (patch)
treec6332cedece2327a18d08794755b3fc0f9f1905b /nixpkgs/pkgs/applications/audio/spotify-player/default.nix
parentac456d475f4e50818499b804359355c0f3b4bbf7 (diff)
parent52185f4d76c18d8348f963795dfed1de018e8dfe (diff)
downloadnixlib-aa4353b499e6950b7333578f936455a628145c31.tar
nixlib-aa4353b499e6950b7333578f936455a628145c31.tar.gz
nixlib-aa4353b499e6950b7333578f936455a628145c31.tar.bz2
nixlib-aa4353b499e6950b7333578f936455a628145c31.tar.lz
nixlib-aa4353b499e6950b7333578f936455a628145c31.tar.xz
nixlib-aa4353b499e6950b7333578f936455a628145c31.tar.zst
nixlib-aa4353b499e6950b7333578f936455a628145c31.zip
Merge https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/applications/audio/spotify-player/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/audio/spotify-player/default.nix58
1 files changed, 41 insertions, 17 deletions
diff --git a/nixpkgs/pkgs/applications/audio/spotify-player/default.nix b/nixpkgs/pkgs/applications/audio/spotify-player/default.nix
index 4c5417ab99fc..963cbe3252ea 100644
--- a/nixpkgs/pkgs/applications/audio/spotify-player/default.nix
+++ b/nixpkgs/pkgs/applications/audio/spotify-player/default.nix
@@ -4,12 +4,30 @@
 , pkg-config
 , openssl
 , cmake
+# deps for audio backends
 , alsa-lib
+, libpulseaudio
+, portaudio
+, libjack2
+, SDL2
+, gst_all_1
 , dbus
 , fontconfig
 , libsixel
+
+# build options
+, withStreaming ? true
+, withDaemon ? true
+, withAudioBackend ? "rodio" # alsa, pulseaudio, rodio, portaudio, jackaudio, rodiojack, sdl
+, withMediaControl ? true
+, withLyrics ? true
+, withImage ? true
+, withNotify ? true
+, withSixel ? true
 }:
 
+assert lib.assertOneOf "withAudioBackend" withAudioBackend [ "" "alsa" "pulseaudio" "rodio" "portaudio" "jackaudio" "rodiojack" "sdl" "gstreamer" ];
+
 rustPlatform.buildRustPackage rec {
   pname = "spotify-player";
   version = "0.15.0";
@@ -30,31 +48,37 @@ rustPlatform.buildRustPackage rec {
 
   buildInputs = [
     openssl
-    alsa-lib
     dbus
     fontconfig
-    libsixel
-  ];
+  ]
+    ++ lib.optionals withSixel [ libsixel ]
+    ++ lib.optionals (withAudioBackend == "alsa") [ alsa-lib ]
+    ++ lib.optionals (withAudioBackend == "pulseaudio") [ libpulseaudio ]
+    ++ lib.optionals (withAudioBackend == "rodio") [ alsa-lib ]
+    ++ lib.optionals (withAudioBackend == "portaudio") [ portaudio ]
+    ++ lib.optionals (withAudioBackend == "jackaudio") [ libjack2 ]
+    ++ lib.optionals (withAudioBackend == "rodiojack") [ alsa-lib libjack2 ]
+    ++ lib.optionals (withAudioBackend == "sdl") [ SDL2 ]
+    ++ lib.optionals (withAudioBackend == "gstreamer") [ gst_all_1.gstreamer gst_all_1.gst-devtools gst_all_1.gst-plugins-base gst_all_1.gst-plugins-good ];
 
   buildNoDefaultFeatures = true;
 
-  buildFeatures = [
-    "rodio-backend"
-    "media-control"
-    "image"
-    "lyric-finder"
-    "daemon"
-    "notify"
-    "streaming"
-    "sixel"
-  ];
+  buildFeatures = [ ]
+    ++ lib.optionals (withAudioBackend != "") [ "${withAudioBackend}-backend" ]
+    ++ lib.optionals withMediaControl [ "media-control" ]
+    ++ lib.optionals withImage [ "image" ]
+    ++ lib.optionals withLyrics [ "lyric-finder" ]
+    ++ lib.optionals withDaemon [ "daemon" ]
+    ++ lib.optionals withNotify [ "notify" ]
+    ++ lib.optionals withStreaming [ "streaming" ]
+    ++ lib.optionals withSixel [ "sixel" ];
 
-  meta = with lib; {
-    description = "A command driven spotify player";
+  meta = {
+    description = "A terminal spotify player that has feature parity with the official client";
     homepage = "https://github.com/aome510/spotify-player";
     changelog = "https://github.com/aome510/spotify-player/releases/tag/v${version}";
     mainProgram = "spotify_player";
-    license = licenses.mit;
-    maintainers = with maintainers; [ dit7ya ];
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ dit7ya xyven1 ];
   };
 }