@@ -0,0 +1,40 @@
1+{ stdenv, fetchFromGitHub, rustPlatform, pkgconfig, openssl
2+, withALSA ? true, alsaLib ? null
3+, withPulseAudio ? false, libpulseaudio ? null
4+, withPortAudio ? false, portaudio ? null
5+}:
6+
7+rustPlatform.buildRustPackage rec {
8+ pname = "spotifyd";
9+ version = "0.2.11";
10+
11+ src = fetchFromGitHub {
12+ owner = "Spotifyd";
13+ repo = "spotifyd";
14+ rev = "${version}";
15+ sha256 = "1iybk9xrrvhrcl2xl5r2xhyn1ydhrgwnnb8ldhsw5c16b32z03q1";
16+ };
17+
18+ cargoSha256 = "0879p1h32259schmy8j3xnwpw3sw80f8mrj8s6b5aihi3yyzz521";
19+
20+ cargoBuildFlags = [
21+ "--no-default-features"
22+ "--features"
23+ "${stdenv.lib.optionalString withALSA "alsa_backend,"}${stdenv.lib.optionalString withPulseAudio "pulseaudio_backend,"}${stdenv.lib.optionalString withPortAudio "portaudio_backend,"}"
24+ ];
25+
26+ nativeBuildInputs = [ pkgconfig ];
27+
28+ buildInputs = [ openssl ]
29+ ++ stdenv.lib.optional withALSA alsaLib
30+ ++ stdenv.lib.optional withPulseAudio libpulseaudio
31+ ++ stdenv.lib.optional withPortAudio portaudio;
32+
33+ meta = with stdenv.lib; {
34+ description = "An open source Spotify client running as a UNIX daemon";
35+ homepage = "https://github.com/Spotifyd/spotifyd";
36+ license = with licenses; [ gpl3 ];
37+ maintainers = [ maintainers.anderslundstedt ];
38+ platforms = platforms.unix;
39+ };
40+}