about summary refs log tree commit diff
path: root/pkgs/servers/uwsgi
diff options
context:
space:
mode:
authorVladimír Čunát <v@cunat.cz>2020-12-21 22:48:19 +0100
committerVladimír Čunát <v@cunat.cz>2020-12-21 22:48:19 +0100
commit583470209f9d51f1c6884e0afb5a9949ac988bcd (patch)
tree859366082b662773760b2bf629277d866687c4a4 /pkgs/servers/uwsgi
parent4de10624f6ef48b72fe6edf14ac5e0f2e0de5669 (diff)
Revert "Merge #97536: uwsgi: fix compiling and linking"
This reverts commit df4d0b03efe967e07b227edc004169701e39fd3e, reversing
changes made to b333263534e23f6e5a394193c5cb2c5f793f6525.

It didn't even evaluate!
Diffstat (limited to 'pkgs/servers/uwsgi')
-rw-r--r--pkgs/servers/uwsgi/additional-php-ldflags.patch13
-rw-r--r--pkgs/servers/uwsgi/default.nix30
-rw-r--r--pkgs/servers/uwsgi/no-ext-session-php_session.h-on-NixOS.patch29
3 files changed, 5 insertions, 67 deletions
diff --git a/pkgs/servers/uwsgi/additional-php-ldflags.patch b/pkgs/servers/uwsgi/additional-php-ldflags.patch
deleted file mode 100644
index 8549d5c2d03cf..0000000000000
--- a/pkgs/servers/uwsgi/additional-php-ldflags.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/plugins/php/uwsgiplugin.py b/plugins/php/uwsgiplugin.py
-index d930c44e..2fcbc22a 100644
---- a/plugins/php/uwsgiplugin.py
-+++ b/plugins/php/uwsgiplugin.py
-@@ -17,6 +17,8 @@ php_version = os.popen(PHPPATH + ' --version').read().rstrip().split('.')[0]
- CFLAGS = [os.popen(PHPPATH + ' --includes').read().rstrip(), '-Wno-sign-compare']
- LDFLAGS = os.popen(PHPPATH + ' --ldflags').read().rstrip().split()
- 
-+LDFLAGS.append(os.environ.get('UWSGICONFIG_PHP_LDFLAGS', []))
-+
- if ld_run_path:
-     LDFLAGS.append('-L%s' % ld_run_path)
-     os.environ['LD_RUN_PATH'] = ld_run_path
diff --git a/pkgs/servers/uwsgi/default.nix b/pkgs/servers/uwsgi/default.nix
index 18f2846b47db9..39a3113eb410b 100644
--- a/pkgs/servers/uwsgi/default.nix
+++ b/pkgs/servers/uwsgi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, nixosTests, lib, fetchurl, pkgconfig, jansson, pcre
+{ stdenv, lib, fetchurl, pkgconfig, jansson, pcre
 # plugins: list of strings, eg. [ "python2" "python3" ]
 , plugins ? []
 , pam, withPAM ? stdenv.isLinux
@@ -38,12 +38,8 @@ 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.extensions.session
-                        php-embed.extensions.session.dev
-                        php-embed.unwrapped.dev
-                    ] ++ php-embed.unwrapped.buildInputs;
+                    inputs = [ php-embed ] ++ php-embed.buildInputs;
+                    NIX_CFLAGS_LINK = [ "-L${libmysqlclient}/lib/mysql" ];
                   })
                 ];
 
@@ -65,11 +61,6 @@ stdenv.mkDerivation rec {
     sha256 = "0256v72b7zr6ds4srpaawk1px3bp0djdwm239w3wrxpw7dzk1gjn";
   };
 
-  patches = [
-        ./no-ext-session-php_session.h-on-NixOS.patch
-        ./additional-php-ldflags.patch
-  ];
-
   nativeBuildInputs = [ python3 pkgconfig ];
 
   buildInputs =  [ jansson pcre ]
@@ -92,16 +83,6 @@ stdenv.mkDerivation rec {
     substituteAll ${./nixos.ini} buildconf/nixos.ini
   '';
 
-  # this is a hack to make the php plugin link with session.so (which on nixos is a separate package)
-  # the hack works in coordination with ./additional-php-ldflags.patch
-  UWSGICONFIG_PHP_LDFLAGS = lib.optionalString (builtins.any (x: x.name == "php") needed)
-        lib.concatStringsSep "," [
-            "-Wl"
-            "-rpath=${php-embed.extensions.session}/lib/php/extensions/"
-            "--library-path=${php-embed.extensions.session}/lib/php/extensions/"
-            "-l:session.so"
-        ];
-
   buildPhase = ''
     mkdir -p $pluginDir
     python3 uwsgiconfig.py --build nixos
@@ -113,6 +94,8 @@ 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";
@@ -120,7 +103,4 @@ stdenv.mkDerivation rec {
     maintainers = with maintainers; [ abbradar schneefux globin ];
     platforms = platforms.unix;
   };
-
-  passthru.tests.uwsgi = nixosTests.uwsgi;
-
 }
diff --git a/pkgs/servers/uwsgi/no-ext-session-php_session.h-on-NixOS.patch b/pkgs/servers/uwsgi/no-ext-session-php_session.h-on-NixOS.patch
deleted file mode 100644
index bde8f4fda1dc5..0000000000000
--- a/pkgs/servers/uwsgi/no-ext-session-php_session.h-on-NixOS.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-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?=
- <gdamjan@gmail.com>
-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 <uwsgi.h>
- 
--- 
-2.28.0
-