2018-12-14 19:34:43 +01:00
|
|
|
{ stdenv, fetchFromGitHub, which
|
2019-11-18 07:39:09 +01:00
|
|
|
, withPython2 ? false, python2
|
|
|
|
, withPython3 ? true, python3, ncurses
|
|
|
|
, withPHP72 ? false, php72
|
|
|
|
, withPHP73 ? true, php73
|
|
|
|
, withPerl528 ? false, perl528
|
|
|
|
, withPerl530 ? true, perl530
|
2018-12-14 19:34:43 +01:00
|
|
|
, withPerldevel ? false, perldevel
|
|
|
|
, withRuby_2_4 ? false, ruby_2_4
|
2019-11-18 07:39:09 +01:00
|
|
|
, withRuby_2_5 ? false, ruby_2_5
|
|
|
|
, withRuby_2_6 ? true, ruby_2_6
|
2020-01-01 01:24:48 +01:00
|
|
|
, withRuby_2_7 ? true, ruby_2_7
|
2018-12-06 11:08:40 +01:00
|
|
|
, withSSL ? true, openssl ? null
|
|
|
|
, withIPv6 ? true
|
|
|
|
, withDebug ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-12-26 15:39:14 +01:00
|
|
|
version = "1.14.0";
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "unit";
|
2018-12-06 11:08:40 +01:00
|
|
|
|
2018-12-14 19:34:43 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nginx";
|
|
|
|
repo = "unit";
|
2019-09-09 01:38:31 +02:00
|
|
|
rev = version;
|
2019-12-26 15:39:14 +01:00
|
|
|
sha256 = "01anczfcdwd22hb0y4zw647f86ivk5zq8lcd13xfxjvkmnsnbj9w";
|
2018-12-06 11:08:40 +01:00
|
|
|
};
|
|
|
|
|
2019-12-26 15:51:53 +01:00
|
|
|
patches = [
|
|
|
|
# https://github.com/nginx/unit/issues/357
|
|
|
|
./drop_cap.patch
|
|
|
|
];
|
|
|
|
|
2018-12-14 19:34:43 +01:00
|
|
|
nativeBuildInputs = [ which ];
|
|
|
|
|
|
|
|
buildInputs = [ ]
|
2019-11-18 07:39:09 +01:00
|
|
|
++ optional withPython2 python2
|
|
|
|
++ optionals withPython3 [ python3 ncurses ]
|
2018-12-14 19:34:43 +01:00
|
|
|
++ optional withPHP72 php72
|
|
|
|
++ optional withPHP73 php73
|
2019-11-18 07:39:09 +01:00
|
|
|
++ optional withPerl528 perl528
|
|
|
|
++ optional withPerl530 perl530
|
2018-12-14 19:34:43 +01:00
|
|
|
++ optional withPerldevel perldevel
|
|
|
|
++ optional withRuby_2_4 ruby_2_4
|
2019-11-18 07:39:09 +01:00
|
|
|
++ optional withRuby_2_5 ruby_2_5
|
|
|
|
++ optional withRuby_2_6 ruby_2_6
|
2020-01-01 01:24:48 +01:00
|
|
|
++ optional withRuby_2_7 ruby_2_7
|
2018-12-14 19:34:43 +01:00
|
|
|
++ optional withSSL openssl;
|
2018-12-06 11:08:40 +01:00
|
|
|
|
|
|
|
configureFlags = [
|
2019-02-25 15:08:01 +01:00
|
|
|
"--control=unix:/run/unit/control.unit.sock"
|
|
|
|
"--pid=/run/unit/unit.pid"
|
|
|
|
"--user=unit"
|
|
|
|
"--group=unit"
|
2019-11-20 10:17:54 +01:00
|
|
|
] ++ optional withSSL "--openssl"
|
|
|
|
++ optional (!withIPv6) "--no-ipv6"
|
|
|
|
++ optional withDebug "--debug";
|
2018-12-06 11:08:40 +01:00
|
|
|
|
|
|
|
postConfigure = ''
|
2019-11-18 07:39:09 +01:00
|
|
|
${optionalString withPython2 "./configure python --module=python2 --config=${python2}/bin/python2-config --lib-path=${python2}/lib"}
|
|
|
|
${optionalString withPython3 "./configure python --module=python3 --config=${python3}/bin/python3-config --lib-path=${python3}/lib"}
|
|
|
|
${optionalString withPHP72 "./configure php --module=php72 --config=${php72.dev}/bin/php-config --lib-path=${php72}/lib"}
|
|
|
|
${optionalString withPHP73 "./configure php --module=php73 --config=${php73.dev}/bin/php-config --lib-path=${php73}/lib"}
|
|
|
|
${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_4 "./configure ruby --module=ruby24 --ruby=${ruby_2_4}/bin/ruby"}
|
|
|
|
${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 01:24:48 +01:00
|
|
|
${optionalString withRuby_2_7 "./configure ruby --module=ruby27 --ruby=${ruby_2_7}/bin/ruby"}
|
2018-12-06 11:08:40 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Dynamic web and application server, designed to run applications in multiple languages.";
|
|
|
|
homepage = https://unit.nginx.org/;
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ izorkin ];
|
|
|
|
};
|
|
|
|
}
|