librespot: unbreak on darwin

This commit is contained in:
figsoda 2022-12-16 23:39:35 -05:00
parent 067bfc6c90
commit f01c9db412

View file

@ -1,6 +1,17 @@
{ lib, stdenv, fetchFromGitHub, rustPlatform, pkg-config, openssl, withRodio ? true { lib
, withALSA ? true, alsa-lib ? null, withPulseAudio ? false, libpulseaudio ? null , rustPlatform
, withPortAudio ? false, portaudio ? null }: , fetchFromGitHub
, pkg-config
, stdenv
, openssl
, withALSA ? true
, alsa-lib
, withPortAudio ? false
, portaudio
, withPulseAudio ? false
, libpulseaudio
, withRodio ? true
}:
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "librespot"; pname = "librespot";
@ -15,26 +26,26 @@ rustPlatform.buildRustPackage rec {
cargoSha256 = "sha256-tbDlWP0sUIa0W9HhdYNOvo9cGeqFemclhA7quh7f/Rw="; cargoSha256 = "sha256-tbDlWP0sUIa0W9HhdYNOvo9cGeqFemclhA7quh7f/Rw=";
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.isDarwin [
rustPlatform.bindgenHook
];
buildInputs = [ openssl ] ++ lib.optional withALSA alsa-lib buildInputs = [ openssl ]
++ lib.optional withPulseAudio libpulseaudio ++ lib.optional withALSA alsa-lib
++ lib.optional withPortAudio portaudio; ++ lib.optional withPortAudio portaudio
++ lib.optional withPulseAudio libpulseaudio;
buildNoDefaultFeatures = true; buildNoDefaultFeatures = true;
buildFeatures = lib.optional withRodio "rodio-backend" buildFeatures = lib.optional withRodio "rodio-backend"
++ lib.optional withALSA "alsa-backend" ++ lib.optional withALSA "alsa-backend"
++ lib.optional withPulseAudio "pulseaudio-backend" ++ lib.optional withPortAudio "portaudio-backend"
++ lib.optional withPortAudio "portaudio-backend"; ++ lib.optional withPulseAudio "pulseaudio-backend";
doCheck = false;
meta = with lib; { meta = with lib; {
description = "Open Source Spotify client library and playback daemon"; description = "Open Source Spotify client library and playback daemon";
homepage = "https://github.com/librespot-org/librespot"; homepage = "https://github.com/librespot-org/librespot";
changelog = "https://github.com/librespot-org/librespot/blob/v${version}/CHANGELOG.md";
license = with licenses; [ mit ]; license = with licenses; [ mit ];
maintainers = with maintainers; [ bennofs ]; maintainers = with maintainers; [ bennofs ];
platforms = platforms.unix;
broken = stdenv.isDarwin; # never built on Hydra https://hydra.nixos.org/job/nixpkgs/trunk/librespot.x86_64-darwin
}; };
} }