2022-06-26 10:26:21 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-04-26 19:14:03 +00:00
|
|
|
, buildPythonPackage
|
2023-02-02 18:25:31 +00:00
|
|
|
, python
|
2022-06-26 10:26:21 +00:00
|
|
|
, cairocffi
|
2021-04-05 15:23:46 +00:00
|
|
|
, django
|
|
|
|
, django_tagging
|
2023-02-02 18:25:31 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
2021-04-05 15:23:46 +00:00
|
|
|
, gunicorn
|
2023-02-02 18:25:31 +00:00
|
|
|
, mock
|
2021-04-05 15:23:46 +00:00
|
|
|
, pyparsing
|
2022-06-26 10:26:21 +00:00
|
|
|
, python-memcached
|
|
|
|
, pythonOlder
|
|
|
|
, pytz
|
|
|
|
, six
|
|
|
|
, txamqp
|
|
|
|
, urllib3
|
2021-04-05 15:23:46 +00:00
|
|
|
, whisper
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2021-04-05 15:23:46 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "graphite-web";
|
2022-06-26 10:26:21 +00:00
|
|
|
version = "1.1.10";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "graphite-project";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
|
|
|
hash = "sha256-2HgCBKwLfxJLKMopoIdsEW5k/j3kNAiifWDnJ98a7Qo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2022-4730.CVE-2022-4729.CVE-2022-4728.part-1.patch";
|
|
|
|
url = "https://github.com/graphite-project/graphite-web/commit/9c626006eea36a9fd785e8f811359aebc9774970.patch";
|
|
|
|
sha256 = "sha256-JMmdhLqsaRhUG2FsH+yPNl+cR7O2YLfKFliL2GU0aAk=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2022-4730.CVE-2022-4729.CVE-2022-4728.part-2.patch";
|
|
|
|
url = "https://github.com/graphite-project/graphite-web/commit/2f178f490e10efc03cd1d27c72f64ecab224eb23.patch";
|
|
|
|
sha256 = "sha256-NL7K5uekf3NlLa58aFFRPJT9ktjqBeNlWC4Htd0fRQ0=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-06-26 10:26:21 +00:00
|
|
|
cairocffi
|
2021-04-05 15:23:46 +00:00
|
|
|
django
|
|
|
|
django_tagging
|
|
|
|
gunicorn
|
|
|
|
pyparsing
|
2022-06-26 10:26:21 +00:00
|
|
|
python-memcached
|
|
|
|
pytz
|
|
|
|
six
|
|
|
|
txamqp
|
|
|
|
urllib3
|
2021-04-05 15:23:46 +00:00
|
|
|
whisper
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "Django>=1.8,<3.1" "Django" \
|
|
|
|
--replace "django-tagging==0.4.3" "django-tagging"
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Carbon-s default installation is /opt/graphite. This env variable ensures
|
2022-06-26 10:26:21 +00:00
|
|
|
# carbon is installed as a regular Python module.
|
|
|
|
GRAPHITE_NO_PREFIX = "True";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace webapp/graphite/settings.py \
|
|
|
|
--replace "join(WEBAPP_DIR, 'content')" "join('$out', 'webapp', 'content')"
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
checkInputs = [ mock ];
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
pushd webapp/
|
|
|
|
# avoid confusion with installed module
|
|
|
|
rm -r graphite
|
|
|
|
# redis not practical in test environment
|
|
|
|
substituteInPlace tests/test_tags.py \
|
|
|
|
--replace test_redis_tagdb _dont_test_redis_tagdb
|
|
|
|
|
|
|
|
DJANGO_SETTINGS_MODULE=tests.settings ${python.interpreter} manage.py test
|
|
|
|
popd
|
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"graphite"
|
|
|
|
];
|
2021-04-05 15:23:46 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Enterprise scalable realtime graphing";
|
2022-06-26 10:26:21 +00:00
|
|
|
homepage = "http://graphiteapp.org/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2022-06-26 10:26:21 +00:00
|
|
|
maintainers = with maintainers; [ offline basvandijk ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|