about summary refs log tree commit diff
path: root/pkgs/by-name/rr/rrdtool/package.nix
blob: 733b981e424734ee760e3b142b1d167a003fc821 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
  lib,
  stdenv,
  fetchFromGitHub,
  fetchpatch,
  autoreconfHook,
  gettext,
  perl,
  pkg-config,
  libxml2,
  pango,
  cairo,
  groff,
  tcl,
  darwin,
}:

perl.pkgs.toPerlModule (
  stdenv.mkDerivation rec {
    pname = "rrdtool";
    version = "1.9.0";

    src = fetchFromGitHub {
      owner = "oetiker";
      repo = "rrdtool-1.x";
      rev = "v${version}";
      hash = "sha256-CPbSu1mosNlfj2nqiNVH14a5C5njkfvJM8ix3X3aP8E=";
    };

    # Fix darwin build
    patches = lib.optional stdenv.isDarwin (fetchpatch {
      url = "https://github.com/oetiker/rrdtool-1.x/pull/1262.patch";
      hash = "sha256-aP0rmDlILn6VC8Tg7HpRXbxL9+KD/PRTbXnbQ7HgPEg=";
    });

    nativeBuildInputs = [
      pkg-config
      autoreconfHook
    ];

    buildInputs =
      [
        gettext
        perl
        libxml2
        pango
        cairo
        groff
      ]
      ++ lib.optionals stdenv.isDarwin [
        tcl
        darwin.apple_sdk.frameworks.ApplicationServices
      ];

    postInstall = ''
      # for munin and rrdtool support
      mkdir -p $out/${perl.libPrefix}
      mv $out/lib/perl/5* $out/${perl.libPrefix}
    '';

    meta = with lib; {
      homepage = "https://oss.oetiker.ch/rrdtool/";
      description = "High performance logging in Round Robin Databases";
      license = licenses.gpl2Only;
      platforms = platforms.linux ++ platforms.darwin;
      maintainers = with maintainers; [ pSub ];
    };
  }
)