3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/audio/librespot/default.nix

47 lines
1.4 KiB
Nix
Raw Normal View History

{ lib, fetchFromGitHub, rustPlatform, pkg-config, openssl, withRodio ? true
2020-07-29 08:30:48 +01:00
, withALSA ? true, alsaLib ? null, withPulseAudio ? false, libpulseaudio ? null
, withPortAudio ? false, portaudio ? null }:
2020-06-18 13:27:37 +01:00
rustPlatform.buildRustPackage rec {
pname = "librespot";
2021-05-02 13:26:40 +01:00
version = "0.1.6";
2020-06-18 13:27:37 +01:00
src = fetchFromGitHub {
owner = "librespot-org";
repo = "librespot";
rev = "v${version}";
2021-05-02 13:26:40 +01:00
sha256 = "153i9n3qwmmwc29f62cz8nbqrlry16iygvibm1sdnvpf0s6wk5f3";
2020-06-18 13:27:37 +01:00
};
2020-07-29 08:30:48 +01:00
cargoPatches = [ ./cargo-lock.patch ];
2021-05-02 13:26:40 +01:00
cargoSha256 = "11d64rpq4b5rdxk5wx0hhzgc6mvs6h2br0w3kfncfklp67vn3v4v";
2020-06-18 13:27:37 +01:00
2021-01-15 13:21:58 +00:00
cargoBuildFlags = with lib; [
2020-06-18 13:27:37 +01:00
"--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 = [ pkg-config ];
2020-06-18 13:27:37 +01:00
2021-01-15 13:21:58 +00:00
buildInputs = [ openssl ] ++ lib.optional withALSA alsaLib
++ lib.optional withPulseAudio libpulseaudio
++ lib.optional withPortAudio portaudio;
2020-06-18 13:27:37 +01:00
doCheck = false;
meta = with lib; {
2020-06-18 13:27:37 +01:00
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;
};
}