depot/third_party/nixpkgs/pkgs/applications/audio/librespot/default.nix
Default email 2ce89355c3 Project import generated by Copybara.
GitOrigin-RevId: 22a81aa5fc15b2d41b12f7160a71cd4a9f3c3fa1
2020-06-15 17:56:04 +02:00

49 lines
1.4 KiB
Nix

{ stdenv, fetchFromGitHub, rustPlatform, pkgconfig, openssl
, withRodio ? true
, withALSA ? true, alsaLib ? null
, withPulseAudio ? false, libpulseaudio ? null
, withPortAudio ? false, portaudio ? null
}:
rustPlatform.buildRustPackage rec {
pname = "librespot";
version = "0.1.1";
src = fetchFromGitHub {
owner = "librespot-org";
repo = "librespot";
rev = "v${version}";
sha256 = "1sdbjv8w2mfpv82rx5iy4s532l1767vmlrg9d8khnvh8vrm2lshy";
};
cargoSha256 = "0zi50imjvalwl6pxl35qrmbg74j5xdfaws8v69am4g9agbfjvlms";
cargoBuildFlags = with stdenv.lib; [
"--no-default-features"
"--features"
(concatStringsSep "," (filter (x: x != "") [
(optionalString withRodio "rodio-backend")
(optionalString withALSA "alsa-backend")
(optionalString withPulseAudio "pulseaudio-backend")
(optionalString withPortAudio "portaudio-backend")
]))
];
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ openssl ]
++ stdenv.lib.optional withALSA alsaLib
++ stdenv.lib.optional withPulseAudio libpulseaudio
++ stdenv.lib.optional withPortAudio portaudio;
doCheck = false;
meta = with stdenv.lib; {
description = "Open Source Spotify client library and playback daemon";
homepage = "https://github.com/librespot-org/librespot";
license = with licenses; [ mit ];
maintainers = with maintainers; [ bennofs ];
platforms = platforms.unix;
};
}