1{ stdenv, buildPythonPackage, fetchPypi, isPy3k, which
2, django, django_tagging, whisper, pycairo, cairocffi, ldap, memcached, pytz, urllib3, scandir
3}:
4if django.version != "1.8.18"
5|| django_tagging.version != "0.4.3"
6then throw "graphite-web should be build with django_1_8 and django_tagging_0_4_3"
7else buildPythonPackage rec {
8 pname = "graphite-web";
9 version = "1.1.3";
10
11 disabled = isPy3k;
12
13 src = fetchPypi {
14 inherit pname version;
15 sha256 = "0nvyq1859abdch2l90avsjk9vb03s7wgxgrjsqvjhf2b9c1ncsfh";
16 };
17
18 propagatedBuildInputs = [
19 django django_tagging whisper pycairo cairocffi
20 ldap memcached pytz urllib3 scandir
21 ];
22
23 postInstall = ''
24 wrapProgram $out/bin/run-graphite-devel-server.py \
25 --prefix PATH : ${which}/bin
26 '';
27
28 preConfigure = ''
29 # graphite is configured by storing a local_settings.py file inside the
30 # graphite python package. Since that package is stored in the immutable
31 # Nix store we can't modify it. So how do we configure graphite?
32 #
33 # First of all we rename "graphite.local_settings" to
34 # "graphite_local_settings" so that the settings are not looked up in the
35 # graphite package anymore. Secondly we place a directory containing a
36 # graphite_local_settings.py on the PYTHONPATH in the graphite module
37 # <nixpkgs/nixos/modules/services/monitoring/graphite.nix>.
38 substituteInPlace webapp/graphite/settings.py \
39 --replace "graphite.local_settings" " graphite_local_settings"
40
41 substituteInPlace webapp/graphite/settings.py \
42 --replace "join(WEBAPP_DIR, 'content')" "join('$out', 'webapp', 'content')"
43 '';
44
45 # error: invalid command 'test'
46 doCheck = false;
47
48 meta = with stdenv.lib; {
49 homepage = http://graphite.wikidot.com/;
50 description = "Enterprise scalable realtime graphing";
51 maintainers = with maintainers; [ rickynils offline basvandijk ];
52 license = licenses.asl20;
53 };
54}