Merge pull request #41968 from aneeshusa/enable-using-klaus-with-uwsgi

Enable using klaus with uwsgi
This commit is contained in:
Frederik Rietdijk 2018-06-14 09:14:18 +02:00 committed by GitHub
commit f784a8d925
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View file

@ -31,9 +31,7 @@ let
inherit python; inherit python;
}; };
penv = python.buildEnv.override { pythonEnv = python.withPackages (c.pythonPackages or (self: []));
extraLibs = (c.pythonPackages or (self: [])) pythonPackages;
};
uwsgiCfg = { uwsgiCfg = {
uwsgi = uwsgi =
@ -42,7 +40,7 @@ let
inherit plugins; inherit plugins;
} // removeAttrs c [ "type" "pythonPackages" ] } // removeAttrs c [ "type" "pythonPackages" ]
// optionalAttrs (python != null) { // optionalAttrs (python != null) {
pythonpath = "${penv}/${python.sitePackages}"; pythonpath = "${pythonEnv}/${python.sitePackages}";
env = env =
# Argh, uwsgi expects list of key-values there instead of a dictionary. # Argh, uwsgi expects list of key-values there instead of a dictionary.
let env' = c.env or []; let env' = c.env or [];
@ -51,7 +49,7 @@ let
then substring (stringLength "PATH=") (stringLength x) x then substring (stringLength "PATH=") (stringLength x) x
else null; else null;
oldPaths = filter (x: x != null) (map getPath env'); oldPaths = filter (x: x != null) (map getPath env');
in env' ++ [ "PATH=${optionalString (oldPaths != []) "${last oldPaths}:"}${penv}/bin" ]; in env' ++ [ "PATH=${optionalString (oldPaths != []) "${last oldPaths}:"}${pythonEnv}/bin" ];
} }
else if c.type == "emperor" else if c.type == "emperor"
then { then {

View file

@ -1,6 +1,6 @@
{ lib, python, fetchFromGitHub }: { lib, python, fetchFromGitHub }:
python.pkgs.buildPythonApplication rec { python.pkgs.buildPythonPackage rec {
pname = "klaus"; pname = "klaus";
version = "1.2.2"; version = "1.2.2";

View file

@ -1339,7 +1339,7 @@ with pkgs;
kisslicer = callPackage ../tools/misc/kisslicer { }; kisslicer = callPackage ../tools/misc/kisslicer { };
klaus = callPackage ../servers/web-apps/klaus { }; klaus = with pythonPackages; toPythonApplication klaus;
lcdproc = callPackage ../servers/monitoring/lcdproc { }; lcdproc = callPackage ../servers/monitoring/lcdproc { };

View file

@ -6929,6 +6929,8 @@ in {
kiwisolver = callPackage ../development/python-modules/kiwisolver { }; kiwisolver = callPackage ../development/python-modules/kiwisolver { };
klaus = callPackage ../development/python-modules/klaus {};
klein = callPackage ../development/python-modules/klein { }; klein = callPackage ../development/python-modules/klein { };
koji = callPackage ../development/python-modules/koji { }; koji = callPackage ../development/python-modules/koji { };