nixpkgs/pkgs/by-name/mp/mpris-scrobbler/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

81 lines
1.6 KiB
Nix
Raw Normal View History

2022-11-28 13:38:47 +00:00
{ lib
, stdenv
, 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
}:
stdenv.mkDerivation rec {
pname = "mpris-scrobbler";
2024-05-05 23:19:51 +00:00
version = "0.5.3";
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=";
};
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" ""
'';
nativeBuildInputs = [
m4
meson
ninja
pkg-config
scdoc
];
buildInputs = [
curl
dbus
json_c
libevent
];
2022-11-28 13:38:47 +00:00
mesonFlags = [
"-Dversion=${version}"
];
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"
]);
2022-11-28 13:38:47 +00:00
passthru = {
updateScript = nix-update-script { };
};
meta = with lib; {
description = "Minimalistic scrobbler for ListenBrainz, libre.fm, & last.fm";
homepage = "https://github.com/mariusor/mpris-scrobbler";
license = licenses.mit;
maintainers = with maintainers; [ emantor ];
platforms = platforms.unix;
2024-10-30 18:00:16 +00:00
mainProgram = "mpris-scrobbler";
};
}