Merge pull request #176063 from Izorkin/update-unit

unit: 1.26.1 -> 1.27.0

authored by Guillaume Girol and committed by GitHub df9f6848 5e78a8ac

+30 -10
+11 -6
nixos/tests/web-servers/unit-php.nix
··· 10 services.unit = { 11 enable = true; 12 config = pkgs.lib.strings.toJSON { 13 - listeners."*:9080".application = "php_80"; 14 - applications.php_80 = { 15 - type = "php 8.0"; 16 processes = 1; 17 user = "testuser"; 18 group = "testgroup"; 19 root = "${testdir}/www"; 20 index = "info.php"; 21 - options.file = "${pkgs.unit.usedPhp80}/lib/php.ini"; 22 }; 23 }; 24 }; ··· 34 }; 35 }; 36 testScript = '' 37 machine.wait_for_unit("unit.service") 38 39 # Check so we get an evaluated PHP back 40 - response = machine.succeed("curl -f -vvv -s http://127.0.0.1:9080/") 41 - assert "PHP Version ${pkgs.unit.usedPhp80.version}" in response, "PHP version not detected" 42 43 # Check so we have database and some other extensions loaded 44 for ext in ["json", "opcache", "pdo_mysql", "pdo_pgsql", "pdo_sqlite"]: 45 assert ext in response, f"Missing {ext} extension" 46 ''; 47 })
··· 10 services.unit = { 11 enable = true; 12 config = pkgs.lib.strings.toJSON { 13 + listeners."*:9081".application = "php_81"; 14 + applications.php_81 = { 15 + type = "php 8.1"; 16 processes = 1; 17 user = "testuser"; 18 group = "testgroup"; 19 root = "${testdir}/www"; 20 index = "info.php"; 21 + options.file = "${pkgs.unit.usedPhp81}/lib/php.ini"; 22 }; 23 }; 24 }; ··· 34 }; 35 }; 36 testScript = '' 37 + machine.start() 38 + 39 machine.wait_for_unit("unit.service") 40 + machine.wait_for_open_port(9081) 41 42 # Check so we get an evaluated PHP back 43 + response = machine.succeed("curl -f -vvv -s http://127.0.0.1:9081/") 44 + assert "PHP Version ${pkgs.unit.usedPhp81.version}" in response, "PHP version not detected" 45 46 # Check so we have database and some other extensions loaded 47 for ext in ["json", "opcache", "pdo_mysql", "pdo_pgsql", "pdo_sqlite"]: 48 assert ext in response, f"Missing {ext} extension" 49 + 50 + machine.shutdown() 51 ''; 52 })
+19 -4
pkgs/servers/http/unit/default.nix
··· 1 { lib, stdenv, fetchFromGitHub, nixosTests, which 2 , pcre2 3 , withPython3 ? true, python3, ncurses 4 - , withPHP80 ? true, php80 5 , withPerl532 ? false, perl532 6 , withPerl534 ? true, perl534 7 , withPerldevel ? false, perldevel 8 - , withRuby_2_7 ? false, ruby_2_7 9 , withSSL ? true, openssl ? null 10 , withIPv6 ? true 11 , withDebug ? false ··· 24 }; 25 26 php80-unit = php80.override phpConfig; 27 28 in stdenv.mkDerivation rec { 29 - version = "1.26.1"; 30 pname = "unit"; 31 32 src = fetchFromGitHub { 33 owner = "nginx"; 34 repo = pname; 35 rev = version; 36 - sha256 = "sha256-rTT7EJSHepGOwNXVqlOBOhZayZQXyNo3B2Oa1oLf2FI="; 37 }; 38 39 nativeBuildInputs = [ which ]; ··· 41 buildInputs = [ pcre2.dev ] 42 ++ optionals withPython3 [ python3 ncurses ] 43 ++ optional withPHP80 php80-unit 44 ++ optional withPerl532 perl532 45 ++ optional withPerl534 perl534 46 ++ optional withPerldevel perldevel 47 ++ optional withRuby_2_7 ruby_2_7 48 ++ optional withSSL openssl; 49 50 configureFlags = [ ··· 58 59 # Optionally add the PHP derivations used so they can be addressed in the configs 60 usedPhp80 = optionals withPHP80 php80-unit; 61 62 postConfigure = '' 63 ${optionalString withPython3 "./configure python --module=python3 --config=python3-config --lib-path=${python3}/lib"} 64 ${optionalString withPHP80 "./configure php --module=php80 --config=${php80-unit.unwrapped.dev}/bin/php-config --lib-path=${php80-unit}/lib"} 65 ${optionalString withPerl532 "./configure perl --module=perl532 --perl=${perl532}/bin/perl"} 66 ${optionalString withPerl534 "./configure perl --module=perl534 --perl=${perl534}/bin/perl"} 67 ${optionalString withPerldevel "./configure perl --module=perldev --perl=${perldevel}/bin/perl"} 68 ${optionalString withRuby_2_7 "./configure ruby --module=ruby27 --ruby=${ruby_2_7}/bin/ruby"} 69 ''; 70 71 passthru.tests.unit-php = nixosTests.unit-php;
··· 1 { lib, stdenv, fetchFromGitHub, nixosTests, which 2 , pcre2 3 , withPython3 ? true, python3, ncurses 4 + , withPHP80 ? false, php80 5 + , withPHP81 ? true, php81 6 , withPerl532 ? false, perl532 7 , withPerl534 ? true, perl534 8 , withPerldevel ? false, perldevel 9 + , withRuby_2_7 ? true, ruby_2_7 10 + , withRuby_3_0 ? false, ruby_3_0 11 + , withRuby_3_1 ? false, ruby_3_1 12 , withSSL ? true, openssl ? null 13 , withIPv6 ? true 14 , withDebug ? false ··· 27 }; 28 29 php80-unit = php80.override phpConfig; 30 + php81-unit = php81.override phpConfig; 31 32 in stdenv.mkDerivation rec { 33 + version = "1.27.0"; 34 pname = "unit"; 35 36 src = fetchFromGitHub { 37 owner = "nginx"; 38 repo = pname; 39 rev = version; 40 + sha256 = "sha256-H/WIrCyocEO/HZfVMyI9IwD565JsUIzC8n1qUYmCvWc="; 41 }; 42 43 nativeBuildInputs = [ which ]; ··· 45 buildInputs = [ pcre2.dev ] 46 ++ optionals withPython3 [ python3 ncurses ] 47 ++ optional withPHP80 php80-unit 48 + ++ optional withPHP81 php81-unit 49 ++ optional withPerl532 perl532 50 ++ optional withPerl534 perl534 51 ++ optional withPerldevel perldevel 52 ++ optional withRuby_2_7 ruby_2_7 53 + ++ optional withRuby_3_0 ruby_3_0 54 + ++ optional withRuby_3_1 ruby_3_1 55 ++ optional withSSL openssl; 56 57 configureFlags = [ ··· 65 66 # Optionally add the PHP derivations used so they can be addressed in the configs 67 usedPhp80 = optionals withPHP80 php80-unit; 68 + usedPhp81 = optionals withPHP81 php81-unit; 69 70 postConfigure = '' 71 ${optionalString withPython3 "./configure python --module=python3 --config=python3-config --lib-path=${python3}/lib"} 72 ${optionalString withPHP80 "./configure php --module=php80 --config=${php80-unit.unwrapped.dev}/bin/php-config --lib-path=${php80-unit}/lib"} 73 + ${optionalString withPHP81 "./configure php --module=php81 --config=${php81-unit.unwrapped.dev}/bin/php-config --lib-path=${php81-unit}/lib"} 74 ${optionalString withPerl532 "./configure perl --module=perl532 --perl=${perl532}/bin/perl"} 75 ${optionalString withPerl534 "./configure perl --module=perl534 --perl=${perl534}/bin/perl"} 76 ${optionalString withPerldevel "./configure perl --module=perldev --perl=${perldevel}/bin/perl"} 77 ${optionalString withRuby_2_7 "./configure ruby --module=ruby27 --ruby=${ruby_2_7}/bin/ruby"} 78 + ${optionalString withRuby_3_0 "./configure ruby --module=ruby30 --ruby=${ruby_3_0}/bin/ruby"} 79 + ${optionalString withRuby_3_1 "./configure ruby --module=ruby31 --ruby=${ruby_3_1}/bin/ruby"} 80 + ''; 81 + 82 + postInstall = '' 83 + rmdir $out/state 84 ''; 85 86 passthru.tests.unit-php = nixosTests.unit-php;