2020-04-16 20:08:00 +00:00
|
|
|
{ stdenv, fetchFromGitHub, nixosTests, which
|
2019-11-18 06:39:09 +00:00
|
|
|
, withPython2 ? false, python2
|
|
|
|
, withPython3 ? true, python3, ncurses
|
2020-04-29 10:46:26 +00:00
|
|
|
, withPHP72 ? false, php72
|
2020-04-16 19:54:57 +00:00
|
|
|
, withPHP73 ? false, php73
|
|
|
|
, withPHP74 ? true, php74
|
2019-11-18 06:39:09 +00:00
|
|
|
, withPerl528 ? false, perl528
|
|
|
|
, withPerl530 ? true, perl530
|
2018-12-14 18:34:43 +00:00
|
|
|
, withPerldevel ? false, perldevel
|
2019-11-18 06:39:09 +00:00
|
|
|
, withRuby_2_5 ? false, ruby_2_5
|
|
|
|
, withRuby_2_6 ? true, ruby_2_6
|
2020-01-01 00:24:48 +00:00
|
|
|
, withRuby_2_7 ? true, ruby_2_7
|
2018-12-06 10:08:40 +00:00
|
|
|
, withSSL ? true, openssl ? null
|
|
|
|
, withIPv6 ? true
|
|
|
|
, withDebug ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
2020-03-22 18:44:55 +00:00
|
|
|
let
|
|
|
|
phpConfig = {
|
2020-04-24 11:29:46 +00:00
|
|
|
embedSupport = true;
|
|
|
|
apxs2Support = false;
|
|
|
|
systemdSupport = false;
|
|
|
|
phpdbgSupport = false;
|
|
|
|
cgiSupport = false;
|
|
|
|
fpmSupport = false;
|
2020-03-22 18:44:55 +00:00
|
|
|
};
|
|
|
|
|
2020-04-29 10:46:26 +00:00
|
|
|
php72-unit = php72.override phpConfig;
|
|
|
|
php73-unit = php73.override phpConfig;
|
2020-04-16 19:54:57 +00:00
|
|
|
php74-unit = php74.override phpConfig;
|
|
|
|
|
2020-03-22 18:44:55 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
2020-05-30 16:28:25 +00:00
|
|
|
version = "1.18.0";
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "unit";
|
2018-12-06 10:08:40 +00:00
|
|
|
|
2018-12-14 18:34:43 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nginx";
|
|
|
|
repo = "unit";
|
2019-09-08 23:38:31 +00:00
|
|
|
rev = version;
|
2020-05-30 16:28:25 +00:00
|
|
|
sha256 = "0r2l3ra63qjjbpjzrmx75jp9fvz83yis4j3qxqdnmxm77psykwy8";
|
2018-12-06 10:08:40 +00:00
|
|
|
};
|
|
|
|
|
2018-12-14 18:34:43 +00:00
|
|
|
nativeBuildInputs = [ which ];
|
|
|
|
|
|
|
|
buildInputs = [ ]
|
2019-11-18 06:39:09 +00:00
|
|
|
++ optional withPython2 python2
|
|
|
|
++ optionals withPython3 [ python3 ncurses ]
|
2020-03-22 13:32:42 +00:00
|
|
|
++ optional withPHP72 php72-unit
|
|
|
|
++ optional withPHP73 php73-unit
|
2020-05-30 16:28:25 +00:00
|
|
|
++ optional withPHP74 php74-unit
|
2019-11-18 06:39:09 +00:00
|
|
|
++ optional withPerl528 perl528
|
|
|
|
++ optional withPerl530 perl530
|
2018-12-14 18:34:43 +00:00
|
|
|
++ optional withPerldevel perldevel
|
2019-11-18 06:39:09 +00:00
|
|
|
++ optional withRuby_2_5 ruby_2_5
|
|
|
|
++ optional withRuby_2_6 ruby_2_6
|
2020-01-01 00:24:48 +00:00
|
|
|
++ optional withRuby_2_7 ruby_2_7
|
2018-12-14 18:34:43 +00:00
|
|
|
++ optional withSSL openssl;
|
2018-12-06 10:08:40 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
2019-02-25 14:08:01 +00:00
|
|
|
"--control=unix:/run/unit/control.unit.sock"
|
|
|
|
"--pid=/run/unit/unit.pid"
|
|
|
|
"--user=unit"
|
|
|
|
"--group=unit"
|
2019-11-20 09:17:54 +00:00
|
|
|
] ++ optional withSSL "--openssl"
|
|
|
|
++ optional (!withIPv6) "--no-ipv6"
|
|
|
|
++ optional withDebug "--debug";
|
2018-12-06 10:08:40 +00:00
|
|
|
|
2020-05-30 16:52:41 +00:00
|
|
|
# Optionally add the PHP derivations used so they can be addressed in the configs
|
|
|
|
usedPhp72 = optionals withPHP72 php72-unit;
|
|
|
|
usedPhp73 = optionals withPHP73 php73-unit;
|
|
|
|
usedPhp74 = optionals withPHP74 php74-unit;
|
|
|
|
|
2018-12-06 10:08:40 +00:00
|
|
|
postConfigure = ''
|
2020-05-30 16:28:25 +00:00
|
|
|
${optionalString withPython2 "./configure python --module=python2 --config=python2-config --lib-path=${python2}/lib"}
|
|
|
|
${optionalString withPython3 "./configure python --module=python3 --config=python3-config --lib-path=${python3}/lib"}
|
2020-04-29 10:46:26 +00:00
|
|
|
${optionalString withPHP72 "./configure php --module=php72 --config=${php72-unit.unwrapped.dev}/bin/php-config --lib-path=${php72-unit}/lib"}
|
|
|
|
${optionalString withPHP73 "./configure php --module=php73 --config=${php73-unit.unwrapped.dev}/bin/php-config --lib-path=${php73-unit}/lib"}
|
2020-04-16 19:54:57 +00:00
|
|
|
${optionalString withPHP74 "./configure php --module=php74 --config=${php74-unit.unwrapped.dev}/bin/php-config --lib-path=${php74-unit}/lib"}
|
2019-11-18 06:39:09 +00:00
|
|
|
${optionalString withPerl528 "./configure perl --module=perl528 --perl=${perl528}/bin/perl"}
|
|
|
|
${optionalString withPerl530 "./configure perl --module=perl530 --perl=${perl530}/bin/perl"}
|
|
|
|
${optionalString withPerldevel "./configure perl --module=perldev --perl=${perldevel}/bin/perl"}
|
|
|
|
${optionalString withRuby_2_5 "./configure ruby --module=ruby25 --ruby=${ruby_2_5}/bin/ruby"}
|
|
|
|
${optionalString withRuby_2_6 "./configure ruby --module=ruby26 --ruby=${ruby_2_6}/bin/ruby"}
|
2020-01-01 00:24:48 +00:00
|
|
|
${optionalString withRuby_2_7 "./configure ruby --module=ruby27 --ruby=${ruby_2_7}/bin/ruby"}
|
2018-12-06 10:08:40 +00:00
|
|
|
'';
|
|
|
|
|
2020-04-16 20:08:00 +00:00
|
|
|
passthru.tests.unit-php = nixosTests.unit-php;
|
|
|
|
|
2018-12-06 10:08:40 +00:00
|
|
|
meta = {
|
|
|
|
description = "Dynamic web and application server, designed to run applications in multiple languages.";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://unit.nginx.org/";
|
2018-12-06 10:08:40 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ izorkin ];
|
|
|
|
};
|
|
|
|
}
|