2008-10-06 17:38:45 +04:00
|
|
|
|
{ stdenv, fetchurl, openssl, perl, zlib
|
|
|
|
|
, sslSupport, proxySupport ? true
|
|
|
|
|
, apr, aprutil, pcre
|
2011-04-09 18:24:25 +04:00
|
|
|
|
, ldapSupport ? true, openldap
|
2012-07-06 22:23:07 +04:00
|
|
|
|
, # Multi-processing module to use. This is built into the server and
|
|
|
|
|
# cannot be selected at runtime.
|
|
|
|
|
mpm ? "prefork"
|
2003-11-05 15:17:48 +03:00
|
|
|
|
}:
|
2003-12-22 00:25:38 +03:00
|
|
|
|
|
2004-03-27 18:47:48 +03:00
|
|
|
|
assert sslSupport -> openssl != null;
|
2011-04-09 18:24:25 +04:00
|
|
|
|
assert ldapSupport -> aprutil.ldapSupport && openldap != null;
|
2012-07-06 22:23:07 +04:00
|
|
|
|
assert mpm == "prefork" || mpm == "worker" || mpm == "event";
|
2003-12-22 00:25:38 +03:00
|
|
|
|
|
2009-08-07 19:26:13 +04:00
|
|
|
|
stdenv.mkDerivation rec {
|
2012-10-02 19:45:54 +04:00
|
|
|
|
version = "2.2.23";
|
2009-08-07 19:26:13 +04:00
|
|
|
|
name = "apache-httpd-${version}";
|
2003-11-05 15:17:48 +03:00
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
2009-08-07 19:26:13 +04:00
|
|
|
|
url = "mirror://apache/httpd/httpd-${version}.tar.bz2";
|
2012-10-02 19:45:54 +04:00
|
|
|
|
sha1 = "2776145201068045d4ed83157a0e2e1c28c4c453";
|
2003-11-05 19:28:26 +03:00
|
|
|
|
};
|
2003-11-05 15:17:48 +03:00
|
|
|
|
|
2008-10-06 17:38:45 +04:00
|
|
|
|
buildInputs = [perl apr aprutil pcre] ++
|
2011-04-09 18:59:06 +04:00
|
|
|
|
stdenv.lib.optional sslSupport openssl;
|
2008-02-18 17:59:48 +03:00
|
|
|
|
|
2010-10-03 13:18:03 +04: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 22:23:07 +04:00
|
|
|
|
# Required for ‘pthread_cancel’.
|
|
|
|
|
NIX_LDFLAGS = "-lgcc_s";
|
|
|
|
|
|
2008-02-18 17:59:48 +03:00
|
|
|
|
configureFlags = ''
|
|
|
|
|
--with-z=${zlib}
|
2008-10-06 17:38:45 +04:00
|
|
|
|
--with-pcre=${pcre}
|
2008-02-18 17:59:48 +03: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 18:24:25 +04:00
|
|
|
|
${if ldapSupport then "--enable-ldap --enable-authnz-ldap" else ""}
|
2012-07-06 22:23:07 +04:00
|
|
|
|
--with-mpm=${mpm}
|
2008-02-18 17:59:48 +03:00
|
|
|
|
'';
|
|
|
|
|
|
2012-07-06 22:23:07 +04:00
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
2008-02-18 17:59:48 +03:00
|
|
|
|
postInstall = ''
|
|
|
|
|
echo "removing manual"
|
|
|
|
|
rm -rf $out/manual
|
|
|
|
|
'';
|
2006-10-11 20:45:55 +04:00
|
|
|
|
|
2008-02-18 17:59:48 +03:00
|
|
|
|
passthru = {
|
2008-10-06 17:38:45 +04:00
|
|
|
|
inherit apr aprutil sslSupport proxySupport;
|
2008-02-18 17:59:48 +03:00
|
|
|
|
};
|
2010-10-21 19:39:53 +04:00
|
|
|
|
|
2006-10-11 20:45:55 +04:00
|
|
|
|
meta = {
|
|
|
|
|
description = "Apache HTTPD, the world's most popular web server";
|
2008-02-18 17:59:48 +03:00
|
|
|
|
homepage = http://httpd.apache.org/;
|
2010-10-21 19:39:53 +04:00
|
|
|
|
license = "ASL2.0";
|
2010-10-25 17:12:57 +04:00
|
|
|
|
|
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
|
|
|
|
maintainers = [ stdenv.lib.maintainers.simons ];
|
2006-10-11 20:45:55 +04:00
|
|
|
|
};
|
2003-11-05 15:17:48 +03:00
|
|
|
|
}
|