2008-10-06 14:38:45 +01:00
|
|
|
|
{ stdenv, fetchurl, openssl, perl, zlib
|
|
|
|
|
, sslSupport, proxySupport ? true
|
|
|
|
|
, apr, aprutil, pcre
|
2011-04-09 15:24:25 +01:00
|
|
|
|
, ldapSupport ? true, openldap
|
2012-07-06 19:23:07 +01:00
|
|
|
|
, # Multi-processing module to use. This is built into the server and
|
|
|
|
|
# cannot be selected at runtime.
|
|
|
|
|
mpm ? "prefork"
|
2003-11-05 12:17:48 +00:00
|
|
|
|
}:
|
2003-12-21 21:25:38 +00:00
|
|
|
|
|
2004-03-27 15:47:48 +00:00
|
|
|
|
assert sslSupport -> openssl != null;
|
2011-04-09 15:24:25 +01:00
|
|
|
|
assert ldapSupport -> aprutil.ldapSupport && openldap != null;
|
2012-07-06 19:23:07 +01:00
|
|
|
|
assert mpm == "prefork" || mpm == "worker" || mpm == "event";
|
2003-12-21 21:25:38 +00:00
|
|
|
|
|
2009-08-07 16:26:13 +01:00
|
|
|
|
stdenv.mkDerivation rec {
|
2013-12-09 08:47:10 +00:00
|
|
|
|
version = "2.2.26";
|
2009-08-07 16:26:13 +01:00
|
|
|
|
name = "apache-httpd-${version}";
|
2003-11-05 12:17:48 +00:00
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
2009-08-07 16:26:13 +01:00
|
|
|
|
url = "mirror://apache/httpd/httpd-${version}.tar.bz2";
|
2013-12-09 08:47:10 +00:00
|
|
|
|
sha256 = "1dj29cl2bsk8ir8hxw0ajhbpbrrmsh8mwqfc1ipiqgv7slyqx45g";
|
2003-11-05 16:28:26 +00:00
|
|
|
|
};
|
2003-11-05 12:17:48 +00:00
|
|
|
|
|
2008-10-06 14:38:45 +01:00
|
|
|
|
buildInputs = [perl apr aprutil pcre] ++
|
2011-04-09 15:59:06 +01:00
|
|
|
|
stdenv.lib.optional sslSupport openssl;
|
2008-02-18 14:59:48 +00:00
|
|
|
|
|
2010-10-03 10:18:03 +01:00
|
|
|
|
# An apr-util header file includes an apr header file
|
|
|
|
|
# through #include "" (quotes)
|
|
|
|
|
# passing simply CFLAGS did not help, then I go by NIX_CFLAGS_COMPILE
|
|
|
|
|
NIX_CFLAGS_COMPILE = "-iquote ${apr}/include/apr-1";
|
|
|
|
|
|
2012-07-06 19:23:07 +01:00
|
|
|
|
# Required for ‘pthread_cancel’.
|
2013-06-14 09:16:37 +01:00
|
|
|
|
NIX_LDFLAGS = (if stdenv.isDarwin then "" else "-lgcc_s");
|
2012-07-06 19:23:07 +01:00
|
|
|
|
|
2008-02-18 14:59:48 +00:00
|
|
|
|
configureFlags = ''
|
|
|
|
|
--with-z=${zlib}
|
2008-10-06 14:38:45 +01:00
|
|
|
|
--with-pcre=${pcre}
|
2008-02-18 14:59:48 +00:00
|
|
|
|
--enable-mods-shared=all
|
|
|
|
|
--enable-authn-alias
|
|
|
|
|
${if proxySupport then "--enable-proxy" else ""}
|
|
|
|
|
${if sslSupport then "--enable-ssl --with-ssl=${openssl}" else ""}
|
2011-04-09 15:24:25 +01:00
|
|
|
|
${if ldapSupport then "--enable-ldap --enable-authnz-ldap" else ""}
|
2012-07-06 19:23:07 +01:00
|
|
|
|
--with-mpm=${mpm}
|
2008-02-18 14:59:48 +00:00
|
|
|
|
'';
|
|
|
|
|
|
2012-07-06 19:23:07 +01:00
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
2008-02-18 14:59:48 +00:00
|
|
|
|
postInstall = ''
|
|
|
|
|
echo "removing manual"
|
|
|
|
|
rm -rf $out/manual
|
|
|
|
|
'';
|
2006-10-11 17:45:55 +01:00
|
|
|
|
|
2008-02-18 14:59:48 +00:00
|
|
|
|
passthru = {
|
2008-10-06 14:38:45 +01:00
|
|
|
|
inherit apr aprutil sslSupport proxySupport;
|
2008-02-18 14:59:48 +00:00
|
|
|
|
};
|
2010-10-21 16:39:53 +01:00
|
|
|
|
|
2006-10-11 17:45:55 +01:00
|
|
|
|
meta = {
|
|
|
|
|
description = "Apache HTTPD, the world's most popular web server";
|
2013-06-15 13:02:58 +01:00
|
|
|
|
homepage = http://httpd.apache.org/;
|
|
|
|
|
license = stdenv.lib.licenses.asl20;
|
2013-11-04 19:25:20 +00:00
|
|
|
|
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
|
2013-06-15 13:02:58 +01:00
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ simons lovek323 ];
|
2006-10-11 17:45:55 +01:00
|
|
|
|
};
|
2003-11-05 12:17:48 +00:00
|
|
|
|
}
|