nixpkgs/pkgs/applications/audio/ncspot/default.nix

50 lines
1.5 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchFromGitHub, rustPlatform, pkg-config, ncurses, openssl, libiconv
2019-10-18 10:20:00 +01:00
, withALSA ? true, alsaLib ? null
, withPulseAudio ? false, libpulseaudio ? null
, withPortAudio ? false, portaudio ? null
2020-03-14 08:39:00 +00:00
, withMPRIS ? false, dbus ? null
2019-10-18 10:20:00 +01:00
}:
let
features = [ "cursive/pancurses-backend" ]
++ lib.optional withALSA "alsa_backend"
++ lib.optional withPulseAudio "pulseaudio_backend"
2020-03-14 08:39:00 +00:00
++ lib.optional withPortAudio "portaudio_backend"
++ lib.optional withMPRIS "mpris";
2019-10-18 10:20:00 +01:00
in
rustPlatform.buildRustPackage rec {
2019-11-26 09:20:00 +00:00
pname = "ncspot";
version = "0.5.0";
2019-10-18 10:20:00 +01:00
src = fetchFromGitHub {
owner = "hrkfdn";
repo = "ncspot";
rev = "v${version}";
sha256 = "1h1il2mzngxmcsl169431lwzl0skv420arg9i06856r5wil37jf7";
2019-10-18 10:20:00 +01:00
};
cargoSha256 = "13yn7l4hhl48lbpj0zsbraqzkkz6knc373j6rcf8d1p4z76yili4";
2019-10-18 10:20:00 +01:00
cargoBuildFlags = [ "--no-default-features" "--features" "${lib.concatStringsSep "," features}" ];
nativeBuildInputs = [ pkg-config ];
cargoPatches = [ ./bump-security-framework-crate.patch ];
2019-10-18 10:20:00 +01:00
buildInputs = [ ncurses openssl ]
++ lib.optional stdenv.isDarwin libiconv
2019-10-18 10:20:00 +01:00
++ lib.optional withALSA alsaLib
++ lib.optional withPulseAudio libpulseaudio
2020-03-14 08:39:00 +00:00
++ lib.optional withPortAudio portaudio
++ lib.optional withMPRIS dbus;
2019-10-18 10:20:00 +01:00
doCheck = false;
meta = with lib; {
description = "Cross-platform ncurses Spotify client written in Rust, inspired by ncmpc and the likes";
homepage = "https://github.com/hrkfdn/ncspot";
license = licenses.bsd2;
maintainers = [ maintainers.marsam ];
};
}