2022-11-28 13:38:47 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-01-07 15:39:21 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, nix-update-script
|
|
|
|
, curl
|
|
|
|
, dbus
|
|
|
|
, libevent
|
|
|
|
, m4
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, scdoc
|
|
|
|
, json_c
|
2021-02-01 08:05:09 +00:00
|
|
|
, xdg-utils
|
2021-01-07 15:39:21 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mpris-scrobbler";
|
2024-05-05 23:19:51 +00:00
|
|
|
version = "0.5.3";
|
2021-01-07 15:39:21 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-11-28 13:38:47 +00:00
|
|
|
owner = "mariusor";
|
|
|
|
repo = "mpris-scrobbler";
|
|
|
|
rev = "v${version}";
|
2024-05-05 23:19:51 +00:00
|
|
|
sha256 = "sha256-eeOhFkLyx+smZmKPTbVB1OiYkHdWk5v2rnOb9yCIuYE=";
|
2021-01-07 15:39:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/signon.c \
|
2021-02-01 08:05:09 +00:00
|
|
|
--replace "/usr/bin/xdg-open" "${xdg-utils}/bin/xdg-open"
|
2022-11-28 13:38:47 +00:00
|
|
|
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
|
|
substituteInPlace meson.build \
|
|
|
|
--replace "-Werror=format-truncation=0" "" \
|
|
|
|
--replace "-Wno-stringop-overflow" ""
|
2021-01-07 15:39:21 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
m4
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
scdoc
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
curl
|
|
|
|
dbus
|
|
|
|
json_c
|
|
|
|
libevent
|
|
|
|
];
|
|
|
|
|
2022-11-28 13:38:47 +00:00
|
|
|
mesonFlags = [
|
|
|
|
"-Dversion=${version}"
|
|
|
|
];
|
|
|
|
|
2023-02-20 15:17:34 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString ([
|
2022-12-23 16:57:29 +00:00
|
|
|
# Needed with GCC 12
|
|
|
|
"-Wno-error=address"
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2022-11-28 13:38:47 +00:00
|
|
|
"-Wno-sometimes-uninitialized"
|
|
|
|
"-Wno-tautological-pointer-compare"
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
|
|
"-Wno-array-bounds"
|
|
|
|
"-Wno-free-nonheap-object"
|
|
|
|
"-Wno-stringop-truncation"
|
2023-02-20 15:17:34 +00:00
|
|
|
]);
|
2022-11-28 13:38:47 +00:00
|
|
|
|
2021-01-07 15:39:21 +00:00
|
|
|
passthru = {
|
2022-12-25 22:11:14 +00:00
|
|
|
updateScript = nix-update-script { };
|
2021-01-07 15:39:21 +00:00
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2023-04-25 06:16:49 +00:00
|
|
|
description = "Minimalistic scrobbler for ListenBrainz, libre.fm, & last.fm";
|
2022-02-06 20:19:55 +00:00
|
|
|
homepage = "https://github.com/mariusor/mpris-scrobbler";
|
|
|
|
license = licenses.mit;
|
2021-01-07 15:39:21 +00:00
|
|
|
maintainers = with maintainers; [ emantor ];
|
2022-02-06 20:19:55 +00:00
|
|
|
platforms = platforms.unix;
|
2024-10-30 18:00:16 +00:00
|
|
|
mainProgram = "mpris-scrobbler";
|
2021-01-07 15:39:21 +00:00
|
|
|
};
|
|
|
|
}
|