2020-02-04 23:06:02 +01:00
|
|
|
{ callPackage
|
|
|
|
, runCommand
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, postgresql
|
|
|
|
, ...
|
|
|
|
}@args:
|
|
|
|
|
|
|
|
callPackage ../nginx/generic.nix args rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "openresty";
|
2020-02-04 23:06:02 +01:00
|
|
|
nginxVersion = "1.15.8";
|
2020-03-21 01:52:56 +01:00
|
|
|
version = "${nginxVersion}.3";
|
2014-08-20 07:34:29 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 20:43:35 +02:00
|
|
|
url = "https://openresty.org/download/openresty-${version}.tar.gz";
|
2020-03-21 01:52:56 +01:00
|
|
|
sha256 = "1a1la7vszv1parsnhphydblz64ffhycazncn3ividnvqg2mg735n";
|
2014-08-20 07:34:29 +02:00
|
|
|
};
|
|
|
|
|
2020-04-25 16:02:23 +02:00
|
|
|
fixPatch = patch: let name = patch.name or (builtins.baseNameOf patch); in
|
|
|
|
runCommand "openresty-${name}" { src = patch; } ''
|
2020-02-04 23:06:02 +01:00
|
|
|
substitute $src $out \
|
2020-04-25 16:02:23 +02:00
|
|
|
--replace "a/" "a/bundle/nginx-${nginxVersion}/" \
|
|
|
|
--replace "b/" "b/bundle/nginx-${nginxVersion}/"
|
2020-02-04 23:06:02 +01:00
|
|
|
'';
|
2018-03-04 20:52:32 +01:00
|
|
|
|
2020-02-04 23:06:02 +01:00
|
|
|
buildInputs = [ postgresql ];
|
|
|
|
|
|
|
|
configureFlags = [ "--with-http_postgres_module" ];
|
2018-03-04 20:52:32 +01:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
2014-08-20 07:34:29 +02:00
|
|
|
|
2018-03-04 20:52:32 +01:00
|
|
|
postInstall = ''
|
|
|
|
ln -s $out/luajit/bin/luajit-2.1.0-beta3 $out/bin/luajit-openresty
|
|
|
|
ln -s $out/nginx/sbin/nginx $out/bin/nginx
|
2020-06-02 07:00:09 +02:00
|
|
|
ln -s $out/nginx/conf $out/conf
|
|
|
|
ln -s $out/nginx/html $out/html
|
2014-08-20 07:34:29 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A fast web application server built on Nginx";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://openresty.org";
|
2020-02-04 23:06:02 +01:00
|
|
|
license = lib.licenses.bsd2;
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
maintainers = with lib.maintainers; [ thoughtpolice lblasc emily ];
|
2014-08-20 07:34:29 +02:00
|
|
|
};
|
|
|
|
}
|