Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at gcc-offload 111 lines 2.5 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 python, 5 cairocffi, 6 django, 7 django-tagging, 8 fetchFromGitHub, 9 fetchpatch, 10 gunicorn, 11 mock, 12 pyparsing, 13 python-memcached, 14 pythonOlder, 15 pytz, 16 six, 17 txamqp, 18 urllib3, 19 whisper, 20 nixosTests, 21}: 22 23buildPythonPackage rec { 24 pname = "graphite-web"; 25 version = "1.1.10"; 26 format = "setuptools"; 27 28 disabled = pythonOlder "3.7"; 29 30 src = fetchFromGitHub { 31 owner = "graphite-project"; 32 repo = pname; 33 rev = version; 34 hash = "sha256-2HgCBKwLfxJLKMopoIdsEW5k/j3kNAiifWDnJ98a7Qo="; 35 }; 36 37 patches = [ 38 (fetchpatch { 39 name = "CVE-2022-4730.CVE-2022-4729.CVE-2022-4728.part-1.patch"; 40 url = "https://github.com/graphite-project/graphite-web/commit/9c626006eea36a9fd785e8f811359aebc9774970.patch"; 41 hash = "sha256-JMmdhLqsaRhUG2FsH+yPNl+cR7O2YLfKFliL2GU0aAk="; 42 }) 43 (fetchpatch { 44 name = "CVE-2022-4730.CVE-2022-4729.CVE-2022-4728.part-2.patch"; 45 url = "https://github.com/graphite-project/graphite-web/commit/2f178f490e10efc03cd1d27c72f64ecab224eb23.patch"; 46 hash = "sha256-NL7K5uekf3NlLa58aFFRPJT9ktjqBeNlWC4Htd0fRQ0="; 47 }) 48 ]; 49 50 propagatedBuildInputs = [ 51 cairocffi 52 django 53 django-tagging 54 gunicorn 55 pyparsing 56 python-memcached 57 pytz 58 six 59 txamqp 60 urllib3 61 whisper 62 ]; 63 64 postPatch = '' 65 substituteInPlace setup.py \ 66 --replace "Django>=1.8,<3.1" "Django" \ 67 --replace "django-tagging==0.4.3" "django-tagging" 68 ''; 69 70 # Carbon-s default installation is /opt/graphite. This env variable ensures 71 # carbon is installed as a regular Python module. 72 GRAPHITE_NO_PREFIX = "True"; 73 74 preConfigure = '' 75 substituteInPlace webapp/graphite/settings.py \ 76 --replace "join(WEBAPP_DIR, 'content')" "join('$out', 'webapp', 'content')" 77 ''; 78 79 checkInputs = [ mock ]; 80 checkPhase = '' 81 runHook preCheck 82 83 pushd webapp/ 84 # avoid confusion with installed module 85 rm -r graphite 86 # redis not practical in test environment 87 substituteInPlace tests/test_tags.py \ 88 --replace test_redis_tagdb _dont_test_redis_tagdb 89 90 DJANGO_SETTINGS_MODULE=tests.settings ${python.interpreter} manage.py test 91 popd 92 93 runHook postCheck 94 ''; 95 96 pythonImportsCheck = [ "graphite" ]; 97 98 passthru.tests = { 99 inherit (nixosTests) graphite; 100 }; 101 102 meta = with lib; { 103 description = "Enterprise scalable realtime graphing"; 104 homepage = "http://graphiteapp.org/"; 105 license = licenses.asl20; 106 maintainers = with maintainers; [ 107 offline 108 basvandijk 109 ]; 110 }; 111}