From b8f23688058053b84e25728556712a5573df0811 Mon Sep 17 00:00:00 2001 From: Damjan Georgievski Date: Sat, 29 Oct 2022 15:22:48 +0200 Subject: [PATCH] uwsgi: 2.0.20 -> 2.0.21 changelog: https://uwsgi-docs.readthedocs.io/en/latest/Changelog-2.0.21.html the `missing-arginfo-php8.patch` is removed, since it's already been merged upstream. additionally, when php is enabled, make sure uwsgi loads the ...php-with-extensions-/lib/php.ini file so that it will load all the extensions lastly, change the source to fetchFromGitHub, it seems the project web site is not that well maintained --- pkgs/servers/uwsgi/default.nix | 21 +++++--- pkgs/servers/uwsgi/missing-arginfo-php8.patch | 49 ------------------- 2 files changed, 14 insertions(+), 56 deletions(-) delete mode 100644 pkgs/servers/uwsgi/missing-arginfo-php8.patch diff --git a/pkgs/servers/uwsgi/default.nix b/pkgs/servers/uwsgi/default.nix index 2dc2c3230a82..95b89093a880 100644 --- a/pkgs/servers/uwsgi/default.nix +++ b/pkgs/servers/uwsgi/default.nix @@ -1,4 +1,4 @@ -{ stdenv, nixosTests, lib, fetchurl, pkg-config, jansson, pcre, libxcrypt +{ stdenv, nixosTests, lib, pkg-config, jansson, pcre, libxcrypt # plugins: list of strings, eg. [ "python2" "python3" ] , plugins ? [] , pam, withPAM ? stdenv.isLinux @@ -6,6 +6,7 @@ , libcap, withCap ? stdenv.isLinux , python2, python3, ncurses , ruby, php +, makeWrapper, fetchFromGitHub }: let php-embed = php.override { @@ -59,20 +60,21 @@ in stdenv.mkDerivation rec { pname = "uwsgi"; - version = "2.0.20"; + version = "2.0.21"; - src = fetchurl { - url = "https://projects.unbit.it/downloads/${pname}-${version}.tar.gz"; - sha256 = "1yfz5h07rxzrqf1rdj5fzhk47idgglxj7kqr8zl8lgcpv1kriaw8"; + src = fetchFromGitHub { + owner = "unbit"; + repo = "uwsgi"; + rev = version; + sha256 = "sha256-TUASYDyG+p1tlhmqi+ivaC7aW6UZBrPTFQUTYys5ICE="; }; patches = [ ./no-ext-session-php_session.h-on-NixOS.patch ./additional-php-ldflags.patch - ./missing-arginfo-php8.patch # https://github.com/unbit/uwsgi/issues/2356 ]; - nativeBuildInputs = [ python3 pkg-config ]; + nativeBuildInputs = [ python3 pkg-config makeWrapper ]; buildInputs = [ jansson pcre libxcrypt ] ++ lib.optional withPAM pam @@ -126,6 +128,11 @@ stdenv.mkDerivation rec { ${lib.concatMapStringsSep "\n" (x: x.install or "") needed} ''; + postFixup = lib.optionalString (builtins.any (x: x.name == "php") needed) + '' + wrapProgram $out/bin/uwsgi --set PHP_INI_SCAN_DIR ${php-embed}/lib + ''; + meta = with 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"; diff --git a/pkgs/servers/uwsgi/missing-arginfo-php8.patch b/pkgs/servers/uwsgi/missing-arginfo-php8.patch deleted file mode 100644 index 98a924e40279..000000000000 --- a/pkgs/servers/uwsgi/missing-arginfo-php8.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff --git a/plugins/php/php_plugin.c b/plugins/php/php_plugin.c -index ca0ef6c1..00c39b09 100644 ---- a/plugins/php/php_plugin.c -+++ b/plugins/php/php_plugin.c -@@ -257,6 +257,9 @@ PHP_MINIT_FUNCTION(uwsgi_php_minit) { - return SUCCESS; - } - -+ZEND_BEGIN_ARG_INFO_EX(arginfo_void, 0, 0, 0) -+ZEND_END_ARG_INFO() -+ - PHP_FUNCTION(uwsgi_version) { - RETURN_STRING(UWSGI_VERSION); - } -@@ -488,20 +491,20 @@ PHP_FUNCTION(uwsgi_signal) { - } - - zend_function_entry uwsgi_php_functions[] = { -- PHP_FE(uwsgi_version, NULL) -- PHP_FE(uwsgi_setprocname, NULL) -- PHP_FE(uwsgi_worker_id, NULL) -- PHP_FE(uwsgi_masterpid, NULL) -- PHP_FE(uwsgi_signal, NULL) -- -- PHP_FE(uwsgi_rpc, NULL) -- -- PHP_FE(uwsgi_cache_get, NULL) -- PHP_FE(uwsgi_cache_set, NULL) -- PHP_FE(uwsgi_cache_update, NULL) -- PHP_FE(uwsgi_cache_del, NULL) -- PHP_FE(uwsgi_cache_clear, NULL) -- PHP_FE(uwsgi_cache_exists, NULL) -+ PHP_FE(uwsgi_version, arginfo_void) -+ PHP_FE(uwsgi_setprocname, arginfo_void) -+ PHP_FE(uwsgi_worker_id, arginfo_void) -+ PHP_FE(uwsgi_masterpid, arginfo_void) -+ PHP_FE(uwsgi_signal, arginfo_void) -+ -+ PHP_FE(uwsgi_rpc, arginfo_void) -+ -+ PHP_FE(uwsgi_cache_get, arginfo_void) -+ PHP_FE(uwsgi_cache_set, arginfo_void) -+ PHP_FE(uwsgi_cache_update, arginfo_void) -+ PHP_FE(uwsgi_cache_del, arginfo_void) -+ PHP_FE(uwsgi_cache_clear, arginfo_void) -+ PHP_FE(uwsgi_cache_exists, arginfo_void) - { NULL, NULL, NULL}, - }; -