nixpkgs/pkgs/servers/http/openresty/default.nix
Emily 4b1d39d935 treewide: remove myself from packages I don’t use
I’ve had an extended absence from Nix work and no longer actively
use a bunch of packages I used to maintain, so remove myself as a
maintainer from things I can’t usefully review/test changes for
as I ease back into things. This does unfortunately leave a few
packages orphaned (`stm32loader`, `tinyprog`, `python3Packages.fx2`,
and `python3Packages.jsonmerge`).
2024-06-15 16:53:23 +01:00

61 lines
1.5 KiB
Nix

{ callPackage
, runCommand
, lib
, fetchurl
, perl
, postgresql
, nixosTests
, ...
}@args:
callPackage ../nginx/generic.nix args rec {
pname = "openresty";
nginxVersion = "1.21.4";
version = "${nginxVersion}.3";
src = fetchurl {
url = "https://openresty.org/download/openresty-${version}.tar.gz";
sha256 = "sha256-M6hMY8/Z5GsOXGLrLdx7gGi9ouFoYxQ0O4n8P/0kzdM=";
};
# generic.nix applies fixPatch on top of every patch defined there.
# This allows updating the patch destination, as openresty has
# nginx source code in a different folder.
fixPatch = patch:
let name = patch.name or (builtins.baseNameOf patch); in
runCommand "openresty-${name}" { src = patch; } ''
substitute $src $out \
--replace "a/" "a/bundle/nginx-${nginxVersion}/" \
--replace "b/" "b/bundle/nginx-${nginxVersion}/"
'';
nativeBuildInputs = [ perl ];
buildInputs = [ postgresql ];
postPatch = ''
patchShebangs configure bundle/
'';
configureFlags = [ "--with-http_postgres_module" ];
postInstall = ''
ln -s $out/luajit/bin/luajit-2.1.0-beta3 $out/bin/luajit-openresty
ln -s $out/nginx/bin/nginx $out/bin/nginx
ln -s $out/nginx/conf $out/conf
ln -s $out/nginx/html $out/html
'';
passthru.tests = {
inherit (nixosTests) openresty-lua;
};
meta = {
description = "Fast web application server built on Nginx";
homepage = "https://openresty.org";
license = lib.licenses.bsd2;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ thoughtpolice lblasc ];
};
}