From 1e54261f3de895fcf2a1e13db216f496b8510997 Mon Sep 17 00:00:00 2001 From: Ben Wolsieffer Date: Sat, 3 Oct 2020 18:58:17 -0400 Subject: [PATCH] uwsgi: fix cross-compilation --- pkgs/servers/uwsgi/default.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/uwsgi/default.nix b/pkgs/servers/uwsgi/default.nix index bd74a628877..3bd8f3f0ec0 100644 --- a/pkgs/servers/uwsgi/default.nix +++ b/pkgs/servers/uwsgi/default.nix @@ -14,13 +14,13 @@ let php-embed = php.override { }; pythonPlugin = pkg : lib.nameValuePair "python${if pkg.isPy2 then "2" else "3"}" { - interpreter = pkg.interpreter; + interpreter = pkg.pythonForBuild.interpreter; path = "plugins/python"; inputs = [ pkg ncurses ]; install = '' install -Dm644 uwsgidecorators.py $out/${pkg.sitePackages}/uwsgidecorators.py - ${pkg.executable} -m compileall $out/${pkg.sitePackages}/ - ${pkg.executable} -O -m compileall $out/${pkg.sitePackages}/ + ${pkg.pythonForBuild.executable} -m compileall $out/${pkg.sitePackages}/ + ${pkg.pythonForBuild.executable} -O -m compileall $out/${pkg.sitePackages}/ ''; }; @@ -91,6 +91,13 @@ stdenv.mkDerivation rec { inherit python2 python3; }; + postPatch = '' + for f in uwsgiconfig.py plugins/*/uwsgiplugin.py; do + substituteInPlace "$f" \ + --replace pkg-config "$PKG_CONFIG" + done + ''; + configurePhase = '' export pluginDir=$out/lib/uwsgi substituteAll ${./nixos.ini} buildconf/nixos.ini