From fd018e990b57b7decf495ee783f8875befed6acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE?= =?UTF-8?q?=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?= Date: Mon, 7 Sep 2020 11:59:17 +0200 Subject: [PATCH] uwsgi: set UWSGICONFIG_PHPPATH to the php.dev store uwsgi needs to run php-config to get the include path. set the UWSGICONFIG_PHPPATH to the php-config in the php.dev store. Patch common.h to directly include php_session.h (since it's a separate package on nixos). NIX_CFLAGS_LINK was removed since it doesn't seem to be used at all https://github.com/unbit/uwsgi/blob/master/plugins/php/common.h --- ...o-ext-session-php_session.h-on-NixOS.patch | 29 +++++++++++++++++++ pkgs/servers/uwsgi/default.nix | 12 +++++--- 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 pkgs/servers/uwsgi/0001-no-ext-session-php_session.h-on-NixOS.patch diff --git a/pkgs/servers/uwsgi/0001-no-ext-session-php_session.h-on-NixOS.patch b/pkgs/servers/uwsgi/0001-no-ext-session-php_session.h-on-NixOS.patch new file mode 100644 index 000000000000000..bde8f4fda1dc5ea --- /dev/null +++ b/pkgs/servers/uwsgi/0001-no-ext-session-php_session.h-on-NixOS.patch @@ -0,0 +1,29 @@ +From 6b9b3559d8ce59eda6c5cd6f04224cebaaa5d0ea Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE?= + =?UTF-8?q?=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?= + +Date: Tue, 8 Sep 2020 17:11:39 +0200 +Subject: [PATCH] no ext/session/php_session.h on NixOS + +on NixOS php_session.h is in its own package, and is not installed in +ext/session/ +--- + plugins/php/common.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/php/common.h b/plugins/php/common.h +index 9bf1c069..be93f519 100644 +--- a/plugins/php/common.h ++++ b/plugins/php/common.h +@@ -10,7 +10,7 @@ + #endif + #include "ext/standard/info.h" + +-#include "ext/session/php_session.h" ++#include "php_session.h" + + #include + +-- +2.28.0 + diff --git a/pkgs/servers/uwsgi/default.nix b/pkgs/servers/uwsgi/default.nix index 39a3113eb410bca..bb2742ecba8e029 100644 --- a/pkgs/servers/uwsgi/default.nix +++ b/pkgs/servers/uwsgi/default.nix @@ -38,8 +38,12 @@ let php-embed = php.override { (lib.nameValuePair "php" { # usage: https://uwsgi-docs.readthedocs.io/en/latest/PHP.html#running-php-apps-with-nginx path = "plugins/php"; - inputs = [ php-embed ] ++ php-embed.buildInputs; - NIX_CFLAGS_LINK = [ "-L${libmysqlclient}/lib/mysql" ]; + inputs = [ + php-embed + php-embed.extensions.session + php-embed.extensions.session.dev + php-embed.unwrapped.dev + ] ++ php-embed.unwrapped.buildInputs; }) ]; @@ -61,6 +65,8 @@ stdenv.mkDerivation rec { sha256 = "0256v72b7zr6ds4srpaawk1px3bp0djdwm239w3wrxpw7dzk1gjn"; }; + patches = [ ./0001-no-ext-session-php_session.h-on-NixOS.patch ]; + nativeBuildInputs = [ python3 pkgconfig ]; buildInputs = [ jansson pcre ] @@ -94,8 +100,6 @@ stdenv.mkDerivation rec { ${lib.concatMapStringsSep "\n" (x: x.install or "") needed} ''; - NIX_CFLAGS_LINK = toString (lib.optional withSystemd "-lsystemd" ++ lib.concatMap (x: x.NIX_CFLAGS_LINK or []) needed); - meta = with stdenv.lib; { homepage = "https://uwsgi-docs.readthedocs.org/en/latest/"; description = "A fast, self-healing and developer/sysadmin-friendly application container server coded in pure C";