From e8ee4144556efe3656f9b13f6f375c4a2fc92cd7 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: Wed, 1 Dec 2021 15:03:01 +0100 Subject: [PATCH 1/4] uwsgi bump version to 2.0.20, compatible with php8 uwsgi 2.0.19.1 fails to compile with php8 https://uwsgi-docs.readthedocs.io/en/latest/Changelog-2.0.20.html --- pkgs/servers/uwsgi/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/uwsgi/default.nix b/pkgs/servers/uwsgi/default.nix index c6c65d58e356..42a2671b1ab7 100644 --- a/pkgs/servers/uwsgi/default.nix +++ b/pkgs/servers/uwsgi/default.nix @@ -59,11 +59,11 @@ in stdenv.mkDerivation rec { pname = "uwsgi"; - version = "2.0.19.1"; + version = "2.0.20"; src = fetchurl { url = "https://projects.unbit.it/downloads/${pname}-${version}.tar.gz"; - sha256 = "0256v72b7zr6ds4srpaawk1px3bp0djdwm239w3wrxpw7dzk1gjn"; + sha256 = "1yfz5h07rxzrqf1rdj5fzhk47idgglxj7kqr8zl8lgcpv1kriaw8"; }; patches = [ From f403517f58c4f3da1dab43724b80fb410e81d567 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: Wed, 1 Dec 2021 15:03:36 +0100 Subject: [PATCH 2/4] uwsgi: the php 8.x library is just libphp.so, not libphp8 patch taken from the archlinux PKGBUILD https://github.com/archlinux/svntogit-community/blob/dc8835dbc3f1735f5eb0ccdcd877d60446cccec2/trunk/PKGBUILD#L106 --- pkgs/servers/uwsgi/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/uwsgi/default.nix b/pkgs/servers/uwsgi/default.nix index 42a2671b1ab7..03730adc4c59 100644 --- a/pkgs/servers/uwsgi/default.nix +++ b/pkgs/servers/uwsgi/default.nix @@ -91,12 +91,15 @@ stdenv.mkDerivation rec { inherit python2 python3; }; + php8 = builtins.head (builtins.splitVersion php.version) == "8"; + php8_no_version = ''sed -e "s/ + php_version//" -i plugins/php/uwsgiplugin.py''; + postPatch = '' for f in uwsgiconfig.py plugins/*/uwsgiplugin.py; do substituteInPlace "$f" \ --replace pkg-config "$PKG_CONFIG" done - ''; + '' + (lib.optionalString php8 php8_no_version); configurePhase = '' export pluginDir=$out/lib/uwsgi From 0ebda3cfb87d39fff56886bf26e4a8622e358dd5 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: Wed, 1 Dec 2021 15:43:38 +0100 Subject: [PATCH 3/4] uwsgi: fix "Missing arginfo for uwsgi_version()" errors at runtime https://github.com/unbit/uwsgi/issues/2356 Warning: Missing arginfo for uwsgi_version() in Unknown on line 0
--- pkgs/servers/uwsgi/default.nix | 1 + pkgs/servers/uwsgi/missing-arginfo-php8.patch | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 pkgs/servers/uwsgi/missing-arginfo-php8.patch diff --git a/pkgs/servers/uwsgi/default.nix b/pkgs/servers/uwsgi/default.nix index 03730adc4c59..86aff79f2486 100644 --- a/pkgs/servers/uwsgi/default.nix +++ b/pkgs/servers/uwsgi/default.nix @@ -69,6 +69,7 @@ stdenv.mkDerivation rec { 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 ]; diff --git a/pkgs/servers/uwsgi/missing-arginfo-php8.patch b/pkgs/servers/uwsgi/missing-arginfo-php8.patch new file mode 100644 index 000000000000..98a924e40279 --- /dev/null +++ b/pkgs/servers/uwsgi/missing-arginfo-php8.patch @@ -0,0 +1,49 @@ +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}, + }; + From fffd75e23c02e1571a78f58e8b7a377f0ee50944 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: Fri, 3 Dec 2021 01:46:40 +0100 Subject: [PATCH 4/4] uwsgi: non-weird postPatch :) --- pkgs/servers/uwsgi/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/uwsgi/default.nix b/pkgs/servers/uwsgi/default.nix index 86aff79f2486..e8bfed1ab89b 100644 --- a/pkgs/servers/uwsgi/default.nix +++ b/pkgs/servers/uwsgi/default.nix @@ -92,15 +92,15 @@ stdenv.mkDerivation rec { inherit python2 python3; }; - php8 = builtins.head (builtins.splitVersion php.version) == "8"; - php8_no_version = ''sed -e "s/ + php_version//" -i plugins/php/uwsgiplugin.py''; - postPatch = '' for f in uwsgiconfig.py plugins/*/uwsgiplugin.py; do substituteInPlace "$f" \ --replace pkg-config "$PKG_CONFIG" done - '' + (lib.optionalString php8 php8_no_version); + ${lib.optionalString (lib.versionAtLeast php.version "8") '' + sed -e "s/ + php_version//" -i plugins/php/uwsgiplugin.py + ''} + ''; configurePhase = '' export pluginDir=$out/lib/uwsgi