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";
|
2022-11-28 13:38:47 +00:00
|
|
|
version = "0.5.0";
|
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}";
|
|
|
|
sha256 = "sha256-HUEUkVL5d6FD698k8iSCJMNeSo8vGJCsExJW/E0EWpQ=";
|
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.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}"
|
|
|
|
];
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [
|
|
|
|
"-Wno-sometimes-uninitialized"
|
|
|
|
"-Wno-tautological-pointer-compare"
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
"-Wno-array-bounds"
|
|
|
|
"-Wno-free-nonheap-object"
|
|
|
|
"-Wno-stringop-truncation"
|
|
|
|
]);
|
|
|
|
|
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; {
|
2021-01-07 15:39:21 +00:00
|
|
|
description = "Minimalistic scrobbler for 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;
|
2021-01-07 15:39:21 +00:00
|
|
|
};
|
|
|
|
}
|