graphite: override django and django_tagging

instead of depending on specific versions in the django_tagging_0_4_3
and graphite_web derivations.

This should fix: https://github.com/NixOS/nixpkgs/pull/30277#discussion_r145393088

This was joint work of @basvandijk and @layus at NixCon 2017.
This commit is contained in:
Guillaume Maudoux 2017-11-01 01:09:39 +01:00 committed by Bas van Dijk
parent b51aa7b6d8
commit 7325ad9ab7
2 changed files with 26 additions and 11 deletions

View File

@ -467,7 +467,15 @@ in {
];
})
(mkIf cfg.web.enable {
(mkIf cfg.web.enable (let
python27' = pkgs.python27.override {
packageOverrides = self: super: {
django = self.django_1_8;
django_tagging = self.django_tagging_0_4_3;
};
};
pythonPackages = python27'.pkgs;
in {
systemd.services.graphiteWeb = {
description = "Graphite Web Interface";
wantedBy = [ "multi-user.target" ];
@ -477,8 +485,8 @@ in {
PYTHONPATH = let
penv = pkgs.python.buildEnv.override {
extraLibs = [
pkgs.python27Packages.graphite_web
pkgs.python27Packages.pysqlite
pythonPackages.graphite_web
pythonPackages.pysqlite
];
};
penvPack = "${penv}/${pkgs.python.sitePackages}";
@ -516,17 +524,17 @@ in {
fi
# Only collect static files when graphite_web changes.
if ! [ "${dataDir}/current_graphite_web" -ef "${pkgs.python27Packages.graphite_web}" ]; then
if ! [ "${dataDir}/current_graphite_web" -ef "${pythonPackages.graphite_web}" ]; then
mkdir -p ${staticDir}
${pkgs.pythonPackages.django_1_8}/bin/django-admin.py collectstatic --noinput --clear
chown -R graphite:graphite ${staticDir}
ln -sfT "${pkgs.python27Packages.graphite_web}" "${dataDir}/current_graphite_web"
ln -sfT "${pythonPackages.graphite_web}" "${dataDir}/current_graphite_web"
fi
'';
};
environment.systemPackages = [ pkgs.python27Packages.graphite_web ];
})
environment.systemPackages = [ pythonPackages.graphite_web ];
}))
(mkIf cfg.api.enable {
systemd.services.graphiteApi = {

View File

@ -8093,14 +8093,17 @@ in {
django_tagging = callPackage ../development/python-modules/django_tagging { };
django_tagging_0_4_3 = self.django_tagging.overrideAttrs (attrs: rec {
django_tagging_0_4_3 = if
self.django != self.django_1_8
then throw "django_tagging_0_4_3 should be build with django_1_8"
else (callPackage ../development/python-modules/django_tagging {}).overrideAttrs (attrs: rec {
name = "django-tagging-0.4.3";
src = pkgs.fetchurl {
url = "mirror://pypi/d/django-tagging/${name}.tar.gz";
sha256 = "0617azpmp6jpg3d88v2ir97qrc9aqcs2s9gyvv9bgf2cp55khxhs";
};
propagatedBuildInputs = with self; [ django_1_8 ];
propagatedBuildInputs = with self; [ django ];
});
django_classytags = buildPythonPackage rec {
@ -22835,7 +22838,11 @@ EOF
};
};
graphite_web = buildPythonPackage rec {
graphite_web = if
self.django != self.django_1_8
|| self.django_tagging != self.django_tagging_0_4_3
then throw "graphite_web should be build with django_1_8 and django_tagging_0_4_3"
else buildPythonPackage rec {
name = "graphite-web-${version}";
disabled = isPy3k;
version = graphiteVersion;
@ -22846,7 +22853,7 @@ EOF
};
propagatedBuildInputs = with self; [
django_1_8 django_tagging_0_4_3 whisper pycairo cairocffi
django django_tagging whisper pycairo cairocffi
ldap memcached pytz urllib3 scandir
];