From ef5161984c7b9c2f4a0bb8a9cd4e83149fa80561 Mon Sep 17 00:00:00 2001 From: Izorkin Date: Thu, 6 Dec 2018 13:08:40 +0300 Subject: [PATCH 1/3] unit: init at v1.6 --- pkgs/servers/http/unit/default.nix | 67 ++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 20 ++++++++- 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 pkgs/servers/http/unit/default.nix diff --git a/pkgs/servers/http/unit/default.nix b/pkgs/servers/http/unit/default.nix new file mode 100644 index 00000000000..68676a07bf0 --- /dev/null +++ b/pkgs/servers/http/unit/default.nix @@ -0,0 +1,67 @@ +{ stdenv, fetchurl +, which +, python +, php71 +, php72 +, perl526 +, perl +, perldevel +, ruby_2_3 +, ruby_2_4 +, ruby +, withSSL ? true, openssl ? null +, withIPv6 ? true +, withDebug ? false +}: + +with stdenv.lib; + +stdenv.mkDerivation rec { + version = "1.6"; + name = "unit-${version}"; + + src = fetchurl { + url = "https://unit.nginx.org/download/${name}.tar.gz"; + sha256 = "0lws5xpzkcmv0gc7vi8pgnymin02dq4gw0zb41jfzq0vbljxxl14"; + }; + + buildInputs = [ + which + python + php71 + php72 + perl526 + perl + perldevel + ruby_2_3 + ruby_2_4 + ruby + ] ++ optional withSSL openssl; + + configureFlags = [ + "--control=unix:/run/control.unit.sock" + "--pid=/run/unit.pid" + ] ++ optional withSSL [ "--openssl" ] + ++ optional (!withIPv6) [ "--no-ipv6" ] + ++ optional withDebug [ "--debug" ]; + + postConfigure = '' + ./configure python --module=python --config=${python}/bin/python-config --lib-path=${python}/lib + ./configure php --module=php71 --config=${php71.dev}/bin/php-config --lib-path=${php71}/lib + ./configure php --module=php72 --config=${php72.dev}/bin/php-config --lib-path=${php72}/lib + ./configure perl --module=perl526 --perl=${perl526}/bin/perl + ./configure perl --module=perl --perl=${perl}/bin/perl + ./configure perl --module=perl529 --perl=${perldevel}/bin/perl + ./configure ruby --module=ruby23 --ruby=${ruby_2_3}/bin/ruby + ./configure ruby --module=ruby24 --ruby=${ruby_2_4}/bin/ruby + ./configure ruby --module=ruby --ruby=${ruby}/bin/ruby + ''; + + 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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e939afa1808..a273d116293 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7829,7 +7829,6 @@ in php = php72; }); - inherit (callPackages ../development/interpreters/php { }) php71 php72; @@ -7846,6 +7845,20 @@ in config.php.apxs2 = false; }; + php-unit = php72-unit; + + php71-unit = php71.override { + config.php.embed = true; + config.php.apxs2 = false; + config.php.fpm = false; + }; + + php72-unit = php72.override { + config.php.embed = true; + config.php.apxs2 = false; + config.php.fpm = false; + }; + picoc = callPackage ../development/interpreters/picoc {}; picolisp = callPackage ../development/interpreters/picolisp {}; @@ -13514,6 +13527,11 @@ in neard = callPackage ../servers/neard { }; + unit = callPackage ../servers/http/unit { + php71 = php71-unit; + php72 = php72-unit; + }; + nginx = nginxStable; nginxStable = callPackage ../servers/http/nginx/stable.nix { From 35eb1c21dce382fd73309afb3327da145915d1fc Mon Sep 17 00:00:00 2001 From: Izorkin Date: Sat, 8 Dec 2018 11:07:45 +0300 Subject: [PATCH 2/3] phpPackages: add build phpPackages with php-unit --- pkgs/top-level/all-packages.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a273d116293..78aa59d48f2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7829,6 +7829,15 @@ in php = php72; }); + phpPackages-unit = php72Packages-unit; + + php71Packages-unit = recurseIntoAttrs (callPackage ./php-packages.nix { + php = php71-unit; + }); + php72Packages-unit = recurseIntoAttrs (callPackage ./php-packages.nix { + php = php72-unit; + }); + inherit (callPackages ../development/interpreters/php { }) php71 php72; From 9c5311251aa6ca9388cef07999ec604aae401812 Mon Sep 17 00:00:00 2001 From: Izorkin Date: Sat, 8 Dec 2018 19:18:14 +0300 Subject: [PATCH 3/3] php: add option config.php.systemd --- pkgs/development/interpreters/php/default.nix | 5 +++-- pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix index 03a235ae384..67ba470ac01 100644 --- a/pkgs/development/interpreters/php/default.nix +++ b/pkgs/development/interpreters/php/default.nix @@ -13,6 +13,7 @@ let { version , sha256 , extraPatches ? [] + , withSystemd ? config.php.systemd or stdenv.isLinux , imapSupport ? config.php.imap or (!stdenv.isDarwin) , ldapSupport ? config.php.ldap or true , mhashSupport ? config.php.mhash or true @@ -68,7 +69,7 @@ let nativeBuildInputs = [ pkgconfig autoconf ]; buildInputs = [ flex bison pcre ] - ++ optional stdenv.isLinux systemd + ++ optional withSystemd systemd ++ optionals imapSupport [ uwimap openssl pam ] ++ optionals curlSupport [ curl openssl ] ++ optionals ldapSupport [ openldap openssl ] @@ -105,7 +106,7 @@ let "--with-pcre-regex=${pcre.dev} PCRE_LIBDIR=${pcre}" ] ++ optional stdenv.isDarwin "--with-iconv=${libiconv}" - ++ optional stdenv.isLinux "--with-fpm-systemd" + ++ optional withSystemd "--with-fpm-systemd" ++ optionals imapSupport [ "--with-imap=${uwimap}" "--with-imap-ssl" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 78aa59d48f2..daa1d12ffe6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7859,12 +7859,14 @@ in php71-unit = php71.override { config.php.embed = true; config.php.apxs2 = false; + config.php.systemd = false; config.php.fpm = false; }; php72-unit = php72.override { config.php.embed = true; config.php.apxs2 = false; + config.php.systemd = false; config.php.fpm = false; };