Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 44 additions & 36 deletions pkgs/by-name/sp/spotifyd/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,76 +2,84 @@
lib,
stdenv,
config,
fetchFromGitHub,
rustPackages,
pkg-config,
openssl,
withALSA ? stdenv.hostPlatform.isLinux,
alsa-lib,
withJack ? stdenv.hostPlatform.isLinux,
apple-sdk_11,
cmake,
dbus,
fetchFromGitHub,
libjack2,
withPulseAudio ? config.pulseaudio or stdenv.hostPlatform.isLinux,
libpulseaudio,
withPortAudio ? stdenv.hostPlatform.isDarwin,
portaudio,
withMpris ? stdenv.hostPlatform.isLinux,
withKeyring ? true,
dbus,
withPipe ? true,
nix-update-script,
testers,
openssl,
pkg-config,
portaudio,
rustPlatform,
spotifyd,
testers,
withALSA ? stdenv.hostPlatform.isLinux,
withJack ? stdenv.hostPlatform.isLinux,
withMpris ? stdenv.hostPlatform.isLinux,
withPortAudio ? stdenv.hostPlatform.isDarwin,
withPulseAudio ? config.pulseaudio or stdenv.hostPlatform.isLinux,
}:

rustPackages.rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage rec {
pname = "spotifyd";
version = "0.3.5-unstable-2024-12-27";
version = "0.4.0";

src = fetchFromGitHub {
owner = "Spotifyd";
repo = "spotifyd";
rev = "c6e6af449b75225224158aeeef64de485db1139e";
hash = "sha256-0HDrnEeqynb4vtJBnXyItprJkP+ZOAKIBP68Ht9xr2c=";
tag = "v${version}";
hash = "sha256-YBh5lcHXqYjyo/MjNNxnycY5AXjvlu+2gAzG6gM4Gjc=";
};

cargoHash = "sha256-bRO7cK+BlAUEr6DlK7GSJf/WNoCM4SYq/lZ8e9ENJZw=";
useFetchCargoVendor = true;
cargoHash = "sha256-waZ9XNYZ/scyMsNT7bZYqN4Ch4GbuQtwxAYaWTjNZwg=";

nativeBuildInputs = [ pkg-config ];
nativeBuildInputs = [
cmake
pkg-config
rustPlatform.bindgenHook
];

buildInputs =
lib.optionals stdenv.hostPlatform.isLinux [ openssl ]
lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_11 ]
++ lib.optionals stdenv.hostPlatform.isLinux [ openssl ]
# The `dbus_mpris` feature works on other platforms, but only requires `dbus` on Linux
++ lib.optional (withMpris && stdenv.hostPlatform.isLinux) dbus
++ lib.optional (withALSA || withJack) alsa-lib
++ lib.optional withJack libjack2
++ lib.optional withPulseAudio libpulseaudio
++ lib.optional withPortAudio portaudio
# The `dbus_keying` feature works on other platforms, but only requires
# `dbus` on Linux
++ lib.optional ((withMpris || withKeyring) && stdenv.hostPlatform.isLinux) dbus;
++ lib.optional withPortAudio portaudio;

# `aws-lc-sys` fails with this enabled
hardeningDisable = [ "strictoverflow" ];

buildNoDefaultFeatures = true;
buildFeatures =
lib.optional withALSA "alsa_backend"
++ lib.optional withJack "rodiojack_backend"
++ lib.optional withPulseAudio "pulseaudio_backend"
++ lib.optional withPortAudio "portaudio_backend"
++ lib.optional withMpris "dbus_mpris"
++ lib.optional withPipe "pipe_backend"
++ lib.optional withKeyring "dbus_keyring";
++ lib.optional withPortAudio "portaudio_backend"
++ lib.optional withPulseAudio "pulseaudio_backend";

doCheck = false;
checkFlags = lib.optionals stdenv.hostPlatform.isDarwin [
# `assertion failed: shell.is_some()`
# Internally it's trying to query the user's shell through `dscl`. This is bad
# https://github.com/Spotifyd/spotifyd/blob/8777c67988508d3623d3f6b81c9379fb071ac7dd/src/utils.rs#L45-L47
"--skip=utils::tests::test_ffi_discovery"
];

passthru = {
tests.version = testers.testVersion {
package = spotifyd;
version = builtins.head (lib.splitString "-" version);
};
updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; };
tests.version = testers.testVersion { package = spotifyd; };
updateScript = nix-update-script { };
};

meta = {
description = "Open source Spotify client running as a UNIX daemon";
homepage = "https://spotifyd.rs/";
changelog = "https://github.com/Spotifyd/spotifyd/blob/${src.rev}/CHANGELOG.md";
changelog = "https://github.com/Spotifyd/spotifyd/releases/tag/${src.tag}";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [
anderslundstedt
Expand Down