summary refs log tree commit diff
path: root/pkgs/development/python-modules/graphite-web/default.nix
blob: 8cbee4bff70861aa9e0bc219d7cde5bda34c168d (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
70
71
{ stdenv
, lib
, buildPythonPackage
, fetchPypi
, django
, python-memcached
, txamqp
, django_tagging
, gunicorn
, pytz
, pyparsing
, cairocffi
, whisper
, whitenoise
, urllib3
, six
}:

buildPythonPackage rec {
  pname = "graphite-web";
  version = "1.1.8";

  src = fetchPypi {
    inherit pname version;
    sha256 = "54240b0f1e069b53e2ce92d4e534e21b195fb0ebd64b6ad8a49c44284e3eb0b1";
  };

  patches = [
    ./update-django-tagging.patch
  ];

  postPatch = ''
    # https://github.com/graphite-project/graphite-web/pull/2701
    substituteInPlace setup.py \
      --replace "'scandir'" "'scandir; python_version < \"3.5\"'"
  '';

  propagatedBuildInputs = [
    django
    python-memcached
    txamqp
    django_tagging
    gunicorn
    pytz
    pyparsing
    cairocffi
    whisper
    whitenoise
    urllib3
    six
  ];

  # Carbon-s default installation is /opt/graphite. This env variable ensures
  # carbon is installed as a regular python module.
  GRAPHITE_NO_PREFIX="True";

  preConfigure = ''
    substituteInPlace webapp/graphite/settings.py \
      --replace "join(WEBAPP_DIR, 'content')" "join('$out', 'webapp', 'content')"
  '';

  pythonImportsCheck = [ "graphite" ];

  meta = with lib; {
    broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
    homepage = "http://graphiteapp.org/";
    description = "Enterprise scalable realtime graphing";
    maintainers = with maintainers; [ offline basvandijk ];
    license = licenses.asl20;
  };
}