From c9156695cc7b88df71567ee49e7604e02fc42a96 Mon Sep 17 00:00:00 2001 From: Izorkin Date: Wed, 22 May 2019 21:26:08 +0300 Subject: [PATCH] tengine: 2.2.3 -> 2.3.0 --- .../http/tengine/check-resolv-conf.patch | 14 ++++++ pkgs/servers/http/tengine/default.nix | 43 ++++++++++++++----- 2 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 pkgs/servers/http/tengine/check-resolv-conf.patch diff --git a/pkgs/servers/http/tengine/check-resolv-conf.patch b/pkgs/servers/http/tengine/check-resolv-conf.patch new file mode 100644 index 00000000000000..c46482b301490e --- /dev/null +++ b/pkgs/servers/http/tengine/check-resolv-conf.patch @@ -0,0 +1,14 @@ +diff --git a/auto/unix b/auto/unix +index a38c12dc..025a4899 100644 +--- a/auto/unix ++++ b/auto/unix +@@ -1072,9 +1072,7 @@ ngx_feature_test='int fd; + + + # Auto read nameserver from /etc/resolv.conf. +- if [ -f "/etc/resolv.conf" ]; then + have=NGX_RESOLVER_FILE + value=\"/etc/resolv.conf\" + . auto/define +-fi + diff --git a/pkgs/servers/http/tengine/default.nix b/pkgs/servers/http/tengine/default.nix index fb343d1a05c487..12dc207002df35 100644 --- a/pkgs/servers/http/tengine/default.nix +++ b/pkgs/servers/http/tengine/default.nix @@ -1,8 +1,8 @@ { stdenv, fetchurl, openssl, zlib, pcre, libxml2, libxslt -, gd, geoip +, gd, geoip, gperftools, jemalloc , withDebug ? false , withMail ? false -, withIPv6 ? true +, withStream ? false , modules ? [] , ... }: @@ -10,18 +10,22 @@ with stdenv.lib; stdenv.mkDerivation rec { - version = "2.2.3"; + version = "2.3.0"; name = "tengine-${version}"; src = fetchurl { url = "https://github.com/alibaba/tengine/archive/${version}.tar.gz"; - sha256 = "0x12mfs0q7lihpl335ad222a1a2sdkqzj5q8zbybzr20frixjs42"; + sha256 = "09165sdzad8bjxhnwphbags6yvxnz2rkf14p0w3vgvzssj017kqp"; }; buildInputs = - [ openssl zlib pcre libxml2 libxslt gd geoip ] + [ openssl zlib pcre libxml2 libxslt gd geoip gperftools jemalloc ] ++ concatMap (mod: mod.inputs or []) modules; + patches = [ + ./check-resolv-conf.patch + ]; + configureFlags = [ "--with-http_ssl_module" "--with-http_v2_module" @@ -36,33 +40,50 @@ stdenv.mkDerivation rec { "--with-http_gunzip_module" "--with-http_gzip_static_module" "--with-http_auth_request_module" - "--with-http_concat_module" "--with-http_random_index_module" "--with-http_secure_link_module" "--with-http_degradation_module" "--with-http_stub_status_module" - "--with-http_sysguard_module" "--with-threads" "--with-pcre-jit" "--with-http_slice_module" + "--with-select_module" + "--with-poll_module" + "--with-google_perftools_module" + "--with-jemalloc" ] ++ optional withDebug [ "--with-debug" ] ++ optional withMail [ "--with-mail" "--with-mail_ssl_module" - ] ++ optional (withMail != true) [ + ] ++ optional (!withMail) [ "--without-mail_pop3_module" "--without-mail_imap_module" "--without-mail_smtp_module" - ] ++ optional withIPv6 [ - "--with-ipv6" + ] ++ optional withStream [ + "--with-stream" + "--with-stream_ssl_module" + "--with-stream_realip_module" + "--with-stream_geoip_module" + "--with-stream_ssl_preread_module" + "--with-stream_sni" + ] ++ optional (!withStream) [ + "--without-stream_limit_conn_module" + "--without-stream_access_module" + "--without-stream_geo_module" + "--without-stream_map_module" + "--without-stream_split_clients_module" + "--without-stream_return_module" + "--without-stream_upstream_hash_module" + "--without-stream_upstream_least_conn_module" + "--without-stream_upstream_random_module" + "--without-stream_upstream_zone_module" ] ++ optional (gd != null) "--with-http_image_filter_module" ++ optional (with stdenv.hostPlatform; isLinux || isFreeBSD) "--with-file-aio" ++ map (mod: "--add-module=${mod.src}") modules; NIX_CFLAGS_COMPILE = [ "-I${libxml2.dev}/include/libxml2" - "-Wno-error=implicit-fallthrough" ] ++ optional stdenv.isDarwin "-Wno-error=deprecated-declarations"; preConfigure = (concatMapStringsSep "\n" (mod: mod.preConfigure or "") modules);