1{
2 lib,
3 stdenv,
4 fetchurl,
5 fetchpatch,
6 pkg-config,
7 meson,
8 ninja,
9 boost,
10 curl,
11 libgcrypt,
12 libmpdclient,
13 systemd,
14}:
15
16stdenv.mkDerivation rec {
17 pname = "mpdscribble";
18 version = "0.24";
19
20 src = fetchurl {
21 url = "https://www.musicpd.org/download/mpdscribble/${version}/mpdscribble-${version}.tar.xz";
22 sha256 = "sha256-9rTLp0izuH5wUnC0kjyOI+lMLgD+3VC+sUaNvi+yqOc=";
23 };
24
25 # Fix build issue on darwin; to be removed after the next release
26 patches = [
27 (fetchpatch {
28 name = "remove-empty-static-lib.patch";
29 url = "https://github.com/MusicPlayerDaemon/mpdscribble/commit/0dbcea25c81f3fdc608f71ef71a9784679fee17f.patch";
30 sha256 = "sha256-3wLfQvbwx+OFrCl5vMV7Zps4e4iEYFhqPiVCo5hDqgw=";
31 })
32 ];
33
34 postPatch = ''
35 sed '1i#include <ctime>' -i src/Log.cxx # gcc12
36 '';
37
38 nativeBuildInputs = [
39 pkg-config
40 meson
41 ninja
42 ];
43 buildInputs = [
44 libmpdclient
45 curl
46 boost
47 libgcrypt
48 ]
49 ++ lib.optional stdenv.hostPlatform.isLinux systemd;
50
51 meta = with lib; {
52 description = "MPD client which submits info about tracks being played to a scrobbler";
53 homepage = "https://www.musicpd.org/clients/mpdscribble/";
54 license = licenses.gpl2Plus;
55 maintainers = [ maintainers.sohalt ];
56 platforms = platforms.unix;
57 mainProgram = "mpdscribble";
58 };
59}