2022-12-02 08:20:57 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-01-09 10:05:03 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, nix-update-script
|
|
|
|
, curl
|
|
|
|
, dbus
|
|
|
|
, libevent
|
|
|
|
, m4
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, scdoc
|
|
|
|
, json_c
|
2021-02-05 17:12:51 +00:00
|
|
|
, xdg-utils
|
2021-01-09 10:05:03 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mpris-scrobbler";
|
2022-12-02 08:20:57 +00:00
|
|
|
version = "0.5.0";
|
2021-01-09 10:05:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-12-02 08:20:57 +00:00
|
|
|
owner = "mariusor";
|
|
|
|
repo = "mpris-scrobbler";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-HUEUkVL5d6FD698k8iSCJMNeSo8vGJCsExJW/E0EWpQ=";
|
2021-01-09 10:05:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/signon.c \
|
2021-02-05 17:12:51 +00:00
|
|
|
--replace "/usr/bin/xdg-open" "${xdg-utils}/bin/xdg-open"
|
2022-12-02 08:20:57 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace meson.build \
|
|
|
|
--replace "-Werror=format-truncation=0" "" \
|
|
|
|
--replace "-Wno-stringop-overflow" ""
|
2021-01-09 10:05:03 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
m4
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
scdoc
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
curl
|
|
|
|
dbus
|
|
|
|
json_c
|
|
|
|
libevent
|
|
|
|
];
|
|
|
|
|
2022-12-02 08:20:57 +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-09 10:05:03 +00:00
|
|
|
passthru = {
|
2022-12-28 21:21:41 +00:00
|
|
|
updateScript = nix-update-script { };
|
2021-01-09 10:05:03 +00:00
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-01-09 10:05:03 +00:00
|
|
|
description = "Minimalistic scrobbler for libre.fm & last.fm";
|
2022-02-10 20:34:41 +00:00
|
|
|
homepage = "https://github.com/mariusor/mpris-scrobbler";
|
|
|
|
license = licenses.mit;
|
2021-01-09 10:05:03 +00:00
|
|
|
maintainers = with maintainers; [ emantor ];
|
2022-02-10 20:34:41 +00:00
|
|
|
platforms = platforms.unix;
|
2021-01-09 10:05:03 +00:00
|
|
|
};
|
|
|
|
}
|