git.iko.soy/typeable/nixpkgs
on master help sign in
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

commit6dd858dc300d0f185ca916d90d862927c7bd07cb authorДамјан Георгиевски <gdamjan@gmail.com> dateMon 7 Sep 2020, 11:59 (6 years ago) parent86ff1e4
2 files changed+37−4
pkgs/servers/uwsgi/0001-no-ext-session-php_session.h-on-NixOS.patch+29 pkgs/servers/uwsgi/default.nix+8−4
pkgs/servers/uwsgi/0001-no-ext-session-php_session.h-on-NixOS.patchnew file+29
@@ -0,0 +1,29 @@
1+From 6b9b3559d8ce59eda6c5cd6f04224cebaaa5d0ea Mon Sep 17 00:00:00 2001
2+From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE?=
3+ =?UTF-8?q?=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?=
4+ <gdamjan@gmail.com>
5+Date: Tue, 8 Sep 2020 17:11:39 +0200
6+Subject: [PATCH] no ext/session/php_session.h on NixOS
7+
8+on NixOS php_session.h is in its own package, and is not installed in
9+ext/session/
10+---
11+ plugins/php/common.h | 2 +-
12+ 1 file changed, 1 insertion(+), 1 deletion(-)
13+
14+diff --git a/plugins/php/common.h b/plugins/php/common.h
15+index 9bf1c069..be93f519 100644
16+--- a/plugins/php/common.h
17++++ b/plugins/php/common.h
18+@@ -10,7 +10,7 @@
19+ #endif
20+ #include "ext/standard/info.h"
21+
22+-#include "ext/session/php_session.h"
23++#include "php_session.h"
24+
25+ #include <uwsgi.h>
26+
27+--
28+2.28.0
29+
pkgs/servers/uwsgi/default.nix+8−4
@@ -38,8 +38,12 @@ let php-embed = php.override {
3838 (lib.nameValuePair "php" {
3939 # usage: https://uwsgi-docs.readthedocs.io/en/latest/PHP.html#running-php-apps-with-nginx
4040 path = "plugins/php";
41− inputs = [ php-embed ] ++ php-embed.buildInputs;
42− NIX_CFLAGS_LINK = [ "-L${libmysqlclient}/lib/mysql" ];
41+ inputs = [
42+ php-embed
43+ php-embed.extensions.session
44+ php-embed.extensions.session.dev
45+ php-embed.unwrapped.dev
46+ ] ++ php-embed.unwrapped.buildInputs;
4347 })
4448 ];
4549
@@ -61,6 +65,8 @@ stdenv.mkDerivation rec {
6165 sha256 = "0256v72b7zr6ds4srpaawk1px3bp0djdwm239w3wrxpw7dzk1gjn";
6266 };
6367
68+ patches = [ ./0001-no-ext-session-php_session.h-on-NixOS.patch ];
69+
6470 nativeBuildInputs = [ python3 pkgconfig ];
6571
6672 buildInputs = [ jansson pcre ]
@@ -94,8 +100,6 @@ stdenv.mkDerivation rec {
94100 ${lib.concatMapStringsSep "\n" (x: x.install or "") needed}
95101 '';
96102
97− NIX_CFLAGS_LINK = toString (lib.optional withSystemd "-lsystemd" ++ lib.concatMap (x: x.NIX_CFLAGS_LINK or []) needed);
98−
99103 meta = with stdenv.lib; {
100104 homepage = "https://uwsgi-docs.readthedocs.org/en/latest/";
101105 description = "A fast, self-healing and developer/sysadmin-friendly application container server coded in pure C";