mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
Merge pull request #176063 from Izorkin/update-unit
unit: 1.26.1 -> 1.27.0
This commit is contained in:
commit
df9f6848ac
2 changed files with 30 additions and 10 deletions
|
@ -10,15 +10,15 @@ in {
|
||||||
services.unit = {
|
services.unit = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = pkgs.lib.strings.toJSON {
|
config = pkgs.lib.strings.toJSON {
|
||||||
listeners."*:9080".application = "php_80";
|
listeners."*:9081".application = "php_81";
|
||||||
applications.php_80 = {
|
applications.php_81 = {
|
||||||
type = "php 8.0";
|
type = "php 8.1";
|
||||||
processes = 1;
|
processes = 1;
|
||||||
user = "testuser";
|
user = "testuser";
|
||||||
group = "testgroup";
|
group = "testgroup";
|
||||||
root = "${testdir}/www";
|
root = "${testdir}/www";
|
||||||
index = "info.php";
|
index = "info.php";
|
||||||
options.file = "${pkgs.unit.usedPhp80}/lib/php.ini";
|
options.file = "${pkgs.unit.usedPhp81}/lib/php.ini";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -34,14 +34,19 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
testScript = ''
|
testScript = ''
|
||||||
|
machine.start()
|
||||||
|
|
||||||
machine.wait_for_unit("unit.service")
|
machine.wait_for_unit("unit.service")
|
||||||
|
machine.wait_for_open_port(9081)
|
||||||
|
|
||||||
# Check so we get an evaluated PHP back
|
# Check so we get an evaluated PHP back
|
||||||
response = machine.succeed("curl -f -vvv -s http://127.0.0.1:9080/")
|
response = machine.succeed("curl -f -vvv -s http://127.0.0.1:9081/")
|
||||||
assert "PHP Version ${pkgs.unit.usedPhp80.version}" in response, "PHP version not detected"
|
assert "PHP Version ${pkgs.unit.usedPhp81.version}" in response, "PHP version not detected"
|
||||||
|
|
||||||
# Check so we have database and some other extensions loaded
|
# Check so we have database and some other extensions loaded
|
||||||
for ext in ["json", "opcache", "pdo_mysql", "pdo_pgsql", "pdo_sqlite"]:
|
for ext in ["json", "opcache", "pdo_mysql", "pdo_pgsql", "pdo_sqlite"]:
|
||||||
assert ext in response, f"Missing {ext} extension"
|
assert ext in response, f"Missing {ext} extension"
|
||||||
|
|
||||||
|
machine.shutdown()
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
{ lib, stdenv, fetchFromGitHub, nixosTests, which
|
{ lib, stdenv, fetchFromGitHub, nixosTests, which
|
||||||
, pcre2
|
, pcre2
|
||||||
, withPython3 ? true, python3, ncurses
|
, withPython3 ? true, python3, ncurses
|
||||||
, withPHP80 ? true, php80
|
, withPHP80 ? false, php80
|
||||||
|
, withPHP81 ? true, php81
|
||||||
, withPerl532 ? false, perl532
|
, withPerl532 ? false, perl532
|
||||||
, withPerl534 ? true, perl534
|
, withPerl534 ? true, perl534
|
||||||
, withPerldevel ? false, perldevel
|
, withPerldevel ? false, perldevel
|
||||||
, withRuby_2_7 ? false, ruby_2_7
|
, withRuby_2_7 ? true, ruby_2_7
|
||||||
|
, withRuby_3_0 ? false, ruby_3_0
|
||||||
|
, withRuby_3_1 ? false, ruby_3_1
|
||||||
, withSSL ? true, openssl ? null
|
, withSSL ? true, openssl ? null
|
||||||
, withIPv6 ? true
|
, withIPv6 ? true
|
||||||
, withDebug ? false
|
, withDebug ? false
|
||||||
|
@ -24,16 +27,17 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
php80-unit = php80.override phpConfig;
|
php80-unit = php80.override phpConfig;
|
||||||
|
php81-unit = php81.override phpConfig;
|
||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
in stdenv.mkDerivation rec {
|
||||||
version = "1.26.1";
|
version = "1.27.0";
|
||||||
pname = "unit";
|
pname = "unit";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "nginx";
|
owner = "nginx";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = version;
|
rev = version;
|
||||||
sha256 = "sha256-rTT7EJSHepGOwNXVqlOBOhZayZQXyNo3B2Oa1oLf2FI=";
|
sha256 = "sha256-H/WIrCyocEO/HZfVMyI9IwD565JsUIzC8n1qUYmCvWc=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ which ];
|
nativeBuildInputs = [ which ];
|
||||||
|
@ -41,10 +45,13 @@ in stdenv.mkDerivation rec {
|
||||||
buildInputs = [ pcre2.dev ]
|
buildInputs = [ pcre2.dev ]
|
||||||
++ optionals withPython3 [ python3 ncurses ]
|
++ optionals withPython3 [ python3 ncurses ]
|
||||||
++ optional withPHP80 php80-unit
|
++ optional withPHP80 php80-unit
|
||||||
|
++ optional withPHP81 php81-unit
|
||||||
++ optional withPerl532 perl532
|
++ optional withPerl532 perl532
|
||||||
++ optional withPerl534 perl534
|
++ optional withPerl534 perl534
|
||||||
++ optional withPerldevel perldevel
|
++ optional withPerldevel perldevel
|
||||||
++ optional withRuby_2_7 ruby_2_7
|
++ optional withRuby_2_7 ruby_2_7
|
||||||
|
++ optional withRuby_3_0 ruby_3_0
|
||||||
|
++ optional withRuby_3_1 ruby_3_1
|
||||||
++ optional withSSL openssl;
|
++ optional withSSL openssl;
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
|
@ -58,14 +65,22 @@ in stdenv.mkDerivation rec {
|
||||||
|
|
||||||
# Optionally add the PHP derivations used so they can be addressed in the configs
|
# Optionally add the PHP derivations used so they can be addressed in the configs
|
||||||
usedPhp80 = optionals withPHP80 php80-unit;
|
usedPhp80 = optionals withPHP80 php80-unit;
|
||||||
|
usedPhp81 = optionals withPHP81 php81-unit;
|
||||||
|
|
||||||
postConfigure = ''
|
postConfigure = ''
|
||||||
${optionalString withPython3 "./configure python --module=python3 --config=python3-config --lib-path=${python3}/lib"}
|
${optionalString withPython3 "./configure python --module=python3 --config=python3-config --lib-path=${python3}/lib"}
|
||||||
${optionalString withPHP80 "./configure php --module=php80 --config=${php80-unit.unwrapped.dev}/bin/php-config --lib-path=${php80-unit}/lib"}
|
${optionalString withPHP80 "./configure php --module=php80 --config=${php80-unit.unwrapped.dev}/bin/php-config --lib-path=${php80-unit}/lib"}
|
||||||
|
${optionalString withPHP81 "./configure php --module=php81 --config=${php81-unit.unwrapped.dev}/bin/php-config --lib-path=${php81-unit}/lib"}
|
||||||
${optionalString withPerl532 "./configure perl --module=perl532 --perl=${perl532}/bin/perl"}
|
${optionalString withPerl532 "./configure perl --module=perl532 --perl=${perl532}/bin/perl"}
|
||||||
${optionalString withPerl534 "./configure perl --module=perl534 --perl=${perl534}/bin/perl"}
|
${optionalString withPerl534 "./configure perl --module=perl534 --perl=${perl534}/bin/perl"}
|
||||||
${optionalString withPerldevel "./configure perl --module=perldev --perl=${perldevel}/bin/perl"}
|
${optionalString withPerldevel "./configure perl --module=perldev --perl=${perldevel}/bin/perl"}
|
||||||
${optionalString withRuby_2_7 "./configure ruby --module=ruby27 --ruby=${ruby_2_7}/bin/ruby"}
|
${optionalString withRuby_2_7 "./configure ruby --module=ruby27 --ruby=${ruby_2_7}/bin/ruby"}
|
||||||
|
${optionalString withRuby_3_0 "./configure ruby --module=ruby30 --ruby=${ruby_3_0}/bin/ruby"}
|
||||||
|
${optionalString withRuby_3_1 "./configure ruby --module=ruby31 --ruby=${ruby_3_1}/bin/ruby"}
|
||||||
|
'';
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
rmdir $out/state
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.tests.unit-php = nixosTests.unit-php;
|
passthru.tests.unit-php = nixosTests.unit-php;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue