2022-10-26 10:51:44 +11:00
|
|
|
{ lib
|
2021-01-04 12:02:21 +11:00
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
|
|
|
|
, pkg-config
|
2022-10-18 17:00:13 +11:00
|
|
|
, alsaLib
|
|
|
|
, dbus
|
2021-01-04 12:02:21 +11:00
|
|
|
, openssl
|
|
|
|
|
|
|
|
# GUI
|
|
|
|
, withGui ? true
|
|
|
|
, copyDesktopItems
|
|
|
|
, makeDesktopItem
|
|
|
|
, gtk3
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2021-02-01 08:45:20 +11:00
|
|
|
inherit (lib) optional optionals;
|
2021-01-04 12:02:21 +11:00
|
|
|
in
|
|
|
|
|
|
|
|
assert withGui -> gtk3.meta.available;
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "psst";
|
2022-10-18 17:00:13 +11:00
|
|
|
version = "20221012.d70ed81";
|
2021-01-04 12:02:21 +11:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jpochyla";
|
|
|
|
repo = "psst";
|
2022-10-18 17:00:13 +11:00
|
|
|
rev = "d70ed8104533dc15bc36b989ba8428872c9b578f";
|
|
|
|
hash = "sha256-ZKhHN0ruLb6ZVKkrKv/YawRsVop6SP1QF/nrtkmA8P8=";
|
2021-01-04 12:02:21 +11:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
2022-10-18 17:00:13 +11:00
|
|
|
cargoSha256 = "sha256-zH6+EV78FDVOYEFXk0f54pH2Su0QpK1I0bHqzIiMdBo=";
|
2021-01-04 12:02:21 +11:00
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ]
|
|
|
|
++ optional withGui copyDesktopItems;
|
|
|
|
|
2022-10-18 17:00:13 +11:00
|
|
|
buildInputs = [ alsaLib dbus openssl ]
|
2021-01-04 12:02:21 +11:00
|
|
|
++ optional withGui gtk3;
|
|
|
|
|
|
|
|
cargoBuildFlags = optionals (!withGui) [
|
|
|
|
"--workspace"
|
|
|
|
"--exclude"
|
|
|
|
"psst-gui"
|
|
|
|
];
|
|
|
|
|
|
|
|
# Unable to exclude targets from the check phase as it doesn't respect
|
|
|
|
# `cargoBuildFlags`; to save from attempting to build the GUI without meaning
|
|
|
|
# to, don't bother checking for CLI-only builds.
|
|
|
|
# https://github.com/NixOS/nixpkgs/blob/77d190f10931c1d06d87bf6d772bf65346c71777/pkgs/build-support/rust/default.nix#L241
|
|
|
|
doCheck = withGui;
|
|
|
|
|
|
|
|
desktopItems = optionals withGui [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = pname;
|
|
|
|
desktopName = "psst";
|
|
|
|
genericName = "Spotify Player";
|
2022-03-01 11:15:16 +11:00
|
|
|
categories = [ "AudioVideo" "Audio" "Network" "Player" ];
|
2021-01-04 12:02:21 +11:00
|
|
|
comment = "Spotify client with native GUI";
|
|
|
|
exec = "psst-gui";
|
2022-03-01 11:15:16 +11:00
|
|
|
keywords = [ "spotify" "music" ];
|
2021-01-04 12:02:21 +11:00
|
|
|
icon = "spotify";
|
|
|
|
type = "Application";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-02-01 08:45:20 +11:00
|
|
|
meta = with lib; {
|
2021-01-04 12:02:21 +11:00
|
|
|
description = "Fast and multi-platform Spotify client with native GUI ";
|
|
|
|
homepage = "https://github.com/jpochyla/psst";
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|