openresty: rebase on top of nginx package

The primary motivation of this change was to allow third-party modules
to be used with OpenResty, but it also results in a significant
reduction of code duplication.
This commit is contained in:
Emily
2020-02-04 19:30:40 -06:00
committed by Austin Seipp
parent db3182a65d
commit 6d046e1079
4 changed files with 70 additions and 69 deletions
+21 -38
View File
@@ -1,52 +1,35 @@
{ stdenv, fetchurl, openssl, zlib, pcre, postgresql, libxml2, libxslt,
gd, geoip, perl }:
{ callPackage
, runCommand
, lib
, fetchurl
, postgresql
, ...
}@args:
with stdenv.lib;
stdenv.mkDerivation rec {
callPackage ../nginx/generic.nix args rec {
pname = "openresty";
version = "1.15.8.2";
nginxVersion = "1.15.8";
version = "${nginxVersion}.2";
src = fetchurl {
url = "https://openresty.org/download/openresty-${version}.tar.gz";
sha256 = "05jxrb8hv758nm38jil8n63q1nhrz3d249bsrwc7maa7sn24wss3";
};
buildInputs = [ openssl zlib pcre libxml2 libxslt gd geoip postgresql ];
nativeBuildInputs = [ perl ];
fixPatch = patch:
runCommand "openresty-${patch.name}" { src = patch; } ''
substitute $src $out \
--replace "src/" "bundle/nginx-${nginxVersion}/src/"
'';
NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2";
buildInputs = [ postgresql ];
configureFlags = [ "--with-http_postgres_module" ];
preConfigure = ''
patchShebangs .
'';
configureFlags = [
"--with-pcre-jit"
"--with-http_ssl_module"
"--with-http_v2_module"
"--with-http_realip_module"
"--with-http_addition_module"
"--with-http_xslt_module"
"--with-http_image_filter_module"
"--with-http_geoip_module"
"--with-http_sub_module"
"--with-http_dav_module"
"--with-http_flv_module"
"--with-http_mp4_module"
"--with-http_gunzip_module"
"--with-http_gzip_static_module"
"--with-http_auth_request_module"
"--with-http_random_index_module"
"--with-http_secure_link_module"
"--with-http_degradation_module"
"--with-http_stub_status_module"
"--with-http_postgres_module"
"--with-ipv6"
];
enableParallelBuilding = true;
postInstall = ''
ln -s $out/luajit/bin/luajit-2.1.0-beta3 $out/bin/luajit-openresty
ln -s $out/nginx/sbin/nginx $out/bin/nginx
@@ -55,8 +38,8 @@ stdenv.mkDerivation rec {
meta = {
description = "A fast web application server built on Nginx";
homepage = http://openresty.org;
license = licenses.bsd2;
platforms = platforms.all;
maintainers = with maintainers; [ thoughtpolice lblasc ];
license = lib.licenses.bsd2;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ thoughtpolice lblasc emily ];
};
}