2013-11-18 16:02:33 +01:00
|
|
|
{ stdenv, fetchurl, fetchgit, openssl, zlib, pcre, libxml2, libxslt, expat
|
|
|
|
, rtmp ? false
|
|
|
|
, fullWebDAV ? false
|
|
|
|
, syslog ? false}:
|
2012-10-09 20:20:44 +02:00
|
|
|
|
2013-05-05 21:48:07 +02:00
|
|
|
let
|
2013-11-25 07:58:34 +01:00
|
|
|
version = "1.4.4";
|
|
|
|
mainSrc = fetchurl {
|
|
|
|
url = "http://nginx.org/download/nginx-${version}.tar.gz";
|
|
|
|
sha256 = "1f82845mpgmhvm151fhn2cnqjggw9w7cvsqbva9rb320wmc9m63w";
|
|
|
|
};
|
|
|
|
|
2013-11-18 16:02:33 +01:00
|
|
|
rtmp-ext = fetchgit {
|
2013-11-18 17:04:30 +01:00
|
|
|
url = git://github.com/arut/nginx-rtmp-module.git;
|
2013-11-18 16:02:33 +01:00
|
|
|
rev = "1cfb7aeb582789f3b15a03da5b662d1811e2a3f1";
|
2013-11-18 17:04:30 +01:00
|
|
|
sha256 = "03ikfd2l8mzsjwx896l07rdrw5jn7jjfdiyl572yb9jfrnk48fwi";
|
2013-11-18 16:02:33 +01:00
|
|
|
};
|
|
|
|
|
2013-05-05 21:48:07 +02:00
|
|
|
dav-ext = fetchgit {
|
|
|
|
url = git://github.com/arut/nginx-dav-ext-module.git;
|
|
|
|
rev = "54cebc1f21fc13391aae692c6cce672fa7986f9d";
|
2013-11-25 07:58:34 +01:00
|
|
|
sha256 = "1dvpq1fg5rslnl05z8jc39sgnvh3akam9qxfl033akpczq1bh8nq";
|
2013-05-05 21:48:07 +02:00
|
|
|
};
|
2013-10-10 02:38:47 +02:00
|
|
|
|
|
|
|
syslog-ext = fetchgit {
|
|
|
|
url = https://github.com/yaoweibin/nginx_syslog_patch.git;
|
|
|
|
rev = "165affd9741f0e30c4c8225da5e487d33832aca3";
|
|
|
|
sha256 = "14dkkafjnbapp6jnvrjg9ip46j00cr8pqc2g7374z9aj7hrvdvhs";
|
|
|
|
};
|
2013-05-05 21:48:07 +02:00
|
|
|
in
|
|
|
|
|
2011-10-31 19:26:20 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2013-11-25 07:58:34 +01:00
|
|
|
name = "nginx-${version}";
|
|
|
|
src = mainSrc;
|
2012-10-09 20:20:44 +02:00
|
|
|
|
2013-11-18 17:04:30 +01:00
|
|
|
buildInputs = [ openssl zlib pcre libxml2 libxslt
|
|
|
|
] ++ stdenv.lib.optional fullWebDAV expat;
|
2008-11-30 10:06:53 +01:00
|
|
|
|
2013-10-10 02:38:47 +02:00
|
|
|
patches = if syslog then [ "${syslog-ext}/syslog_1.4.0.patch" ] else [];
|
|
|
|
|
2008-11-30 10:06:53 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--with-http_ssl_module"
|
|
|
|
"--with-http_xslt_module"
|
|
|
|
"--with-http_sub_module"
|
|
|
|
"--with-http_dav_module"
|
|
|
|
"--with-http_gzip_static_module"
|
|
|
|
"--with-http_secure_link_module"
|
2010-04-09 13:26:54 +02:00
|
|
|
# Install destination problems
|
2012-10-09 20:20:44 +02:00
|
|
|
# "--with-http_perl_module"
|
2013-11-18 17:04:30 +01:00
|
|
|
] ++ stdenv.lib.optional rtmp "--add-module=${rtmp-ext}"
|
2013-11-18 16:02:33 +01:00
|
|
|
++ stdenv.lib.optional fullWebDAV "--add-module=${dav-ext}"
|
2013-10-10 02:38:47 +02:00
|
|
|
++ stdenv.lib.optional syslog "--add-module=${syslog-ext}";
|
2008-11-30 10:06:53 +01:00
|
|
|
|
2011-10-31 19:26:20 +01:00
|
|
|
preConfigure = ''
|
|
|
|
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libxml2}/include/libxml2"
|
|
|
|
'';
|
2008-11-30 10:06:53 +01:00
|
|
|
|
2012-02-19 22:36:34 +01:00
|
|
|
postInstall = ''
|
|
|
|
mv $out/sbin $out/bin
|
|
|
|
'';
|
|
|
|
|
2008-11-30 10:06:53 +01:00
|
|
|
meta = {
|
2012-10-09 20:20:44 +02:00
|
|
|
description = "A reverse proxy and lightweight webserver";
|
|
|
|
maintainers = [ stdenv.lib.maintainers.raskin];
|
|
|
|
platforms = stdenv.lib.platforms.all;
|
2013-11-25 07:58:34 +01:00
|
|
|
inherit version;
|
2008-11-30 10:06:53 +01:00
|
|
|
};
|
|
|
|
}
|