2023-04-09 05:07:30 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, pkg-config
|
|
|
|
, ncurses
|
|
|
|
, openssl
|
|
|
|
, Cocoa
|
2022-01-24 16:09:41 +00:00
|
|
|
, withALSA ? true, alsa-lib
|
2023-04-09 05:07:30 +00:00
|
|
|
, withClipboard ? true, libxcb, python3
|
|
|
|
, withCover ? false, ueberzug
|
2022-01-24 16:09:41 +00:00
|
|
|
, withPulseAudio ? false, libpulseaudio
|
|
|
|
, withPortAudio ? false, portaudio
|
2023-04-09 05:07:30 +00:00
|
|
|
, withMPRIS ? true, withNotify ? true, dbus
|
2019-10-18 09:20:00 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2019-11-26 09:20:00 +00:00
|
|
|
pname = "ncspot";
|
2023-07-24 00:00:03 +00:00
|
|
|
version = "0.13.4";
|
2019-10-18 09:20:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hrkfdn";
|
|
|
|
repo = "ncspot";
|
2020-07-18 02:26:03 +00:00
|
|
|
rev = "v${version}";
|
2023-07-24 00:00:03 +00:00
|
|
|
hash = "sha256-pYPUYy/ODzg9HN0/PTGZkV1NFBPmluhEwoJjYuZ6DTg=";
|
2019-10-18 09:20:00 +00:00
|
|
|
};
|
|
|
|
|
2023-07-24 00:00:03 +00:00
|
|
|
cargoHash = "sha256-FdXk6SzW0f3jkTfxMd8TMzfJGTRaZjG4qp56yHqDAuw=";
|
2019-10-18 09:20:00 +00:00
|
|
|
|
2023-04-09 05:07:30 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ]
|
|
|
|
++ lib.optional withClipboard python3;
|
2019-10-18 09:20:00 +00:00
|
|
|
|
2022-06-10 04:20:00 +00:00
|
|
|
buildInputs = [ ncurses ]
|
|
|
|
++ lib.optional stdenv.isLinux openssl
|
2021-06-10 02:57:09 +00:00
|
|
|
++ lib.optional withALSA alsa-lib
|
2023-04-09 05:07:30 +00:00
|
|
|
++ lib.optional withClipboard libxcb
|
|
|
|
++ lib.optional withCover ueberzug
|
2019-10-18 09:20:00 +00:00
|
|
|
++ lib.optional withPulseAudio libpulseaudio
|
2020-03-14 08:39:00 +00:00
|
|
|
++ lib.optional withPortAudio portaudio
|
2023-04-09 05:07:30 +00:00
|
|
|
++ lib.optional (withMPRIS || withNotify) dbus
|
|
|
|
++ lib.optional stdenv.isDarwin Cocoa;
|
|
|
|
|
|
|
|
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DNCURSES_UNCTRL_H_incl";
|
2019-10-18 09:20:00 +00:00
|
|
|
|
2021-10-27 02:43:09 +00:00
|
|
|
buildNoDefaultFeatures = true;
|
2023-04-09 05:07:30 +00:00
|
|
|
|
2021-10-27 02:43:09 +00:00
|
|
|
buildFeatures = [ "cursive/pancurses-backend" ]
|
|
|
|
++ lib.optional withALSA "alsa_backend"
|
2023-04-09 05:07:30 +00:00
|
|
|
++ lib.optional withClipboard "share_clipboard"
|
|
|
|
++ lib.optional withCover "cover"
|
2021-10-27 02:43:09 +00:00
|
|
|
++ lib.optional withPulseAudio "pulseaudio_backend"
|
|
|
|
++ lib.optional withPortAudio "portaudio_backend"
|
2023-04-09 05:07:30 +00:00
|
|
|
++ lib.optional withMPRIS "mpris"
|
|
|
|
++ lib.optional withNotify "notify";
|
2019-10-18 09:20:00 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Cross-platform ncurses Spotify client written in Rust, inspired by ncmpc and the likes";
|
|
|
|
homepage = "https://github.com/hrkfdn/ncspot";
|
2023-06-11 04:20:00 +00:00
|
|
|
changelog = "https://github.com/hrkfdn/ncspot/releases/tag/v${version}";
|
2019-10-18 09:20:00 +00:00
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = [ maintainers.marsam ];
|
|
|
|
};
|
|
|
|
}
|