2014-08-30 23:30:31 +02:00
|
|
|
|
{ stdenv, fetchurl, pkgconfig, openssl, perl, zlib
|
2008-10-06 15:38:45 +02:00
|
|
|
|
, sslSupport, proxySupport ? true
|
|
|
|
|
, apr, aprutil, pcre
|
2011-04-09 16:24:25 +02:00
|
|
|
|
, ldapSupport ? true, openldap
|
2012-07-06 20:23:07 +02:00
|
|
|
|
, # Multi-processing module to use. This is built into the server and
|
|
|
|
|
# cannot be selected at runtime.
|
|
|
|
|
mpm ? "prefork"
|
2003-11-05 13:17:48 +01:00
|
|
|
|
}:
|
2003-12-21 22:25:38 +01:00
|
|
|
|
|
2004-03-27 16:47:48 +01:00
|
|
|
|
assert sslSupport -> openssl != null;
|
2011-04-09 16:24:25 +02:00
|
|
|
|
assert ldapSupport -> aprutil.ldapSupport && openldap != null;
|
2012-07-06 20:23:07 +02:00
|
|
|
|
assert mpm == "prefork" || mpm == "worker" || mpm == "event";
|
2003-12-21 22:25:38 +01:00
|
|
|
|
|
2009-08-07 17:26:13 +02:00
|
|
|
|
stdenv.mkDerivation rec {
|
2014-09-24 21:04:24 +02:00
|
|
|
|
version = "2.2.29";
|
2009-08-07 17:26:13 +02:00
|
|
|
|
name = "apache-httpd-${version}";
|
2003-11-05 13:17:48 +01:00
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
2009-08-07 17:26:13 +02:00
|
|
|
|
url = "mirror://apache/httpd/httpd-${version}.tar.bz2";
|
2014-09-24 21:04:24 +02:00
|
|
|
|
sha1 = "1d6a8fbc1391d358cc6fe430edc16222b97258d5";
|
2003-11-05 17:28:26 +01:00
|
|
|
|
};
|
2003-11-05 13:17:48 +01:00
|
|
|
|
|
2013-06-13 11:57:17 +02:00
|
|
|
|
outputs = [ "dev" "out" "doc" ];
|
|
|
|
|
|
2014-08-30 23:30:31 +02:00
|
|
|
|
buildInputs = [ pkgconfig perl apr aprutil pcre zlib ] ++
|
2011-04-09 16:59:06 +02:00
|
|
|
|
stdenv.lib.optional sslSupport openssl;
|
2008-02-18 15:59:48 +01:00
|
|
|
|
|
2010-10-03 11:18:03 +02: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 20:23:07 +02:00
|
|
|
|
# Required for ‘pthread_cancel’.
|
2013-06-14 10:16:37 +02:00
|
|
|
|
NIX_LDFLAGS = (if stdenv.isDarwin then "" else "-lgcc_s");
|
2012-07-06 20:23:07 +02:00
|
|
|
|
|
2008-02-18 15:59:48 +01:00
|
|
|
|
configureFlags = ''
|
|
|
|
|
--with-z=${zlib}
|
2008-10-06 15:38:45 +02:00
|
|
|
|
--with-pcre=${pcre}
|
2008-02-18 15:59:48 +01: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 16:24:25 +02:00
|
|
|
|
${if ldapSupport then "--enable-ldap --enable-authnz-ldap" else ""}
|
2012-07-06 20:23:07 +02:00
|
|
|
|
--with-mpm=${mpm}
|
2014-11-11 10:30:58 +01:00
|
|
|
|
--enable-cache
|
|
|
|
|
--enable-disk-cache
|
|
|
|
|
--enable-file-cache
|
|
|
|
|
--enable-mem-cache
|
2008-02-18 15:59:48 +01:00
|
|
|
|
'';
|
|
|
|
|
|
2013-06-13 11:57:17 +02:00
|
|
|
|
preConfigure =
|
|
|
|
|
''
|
|
|
|
|
makeFlagsArray+=("installbuilddir=$dev/share/build")
|
|
|
|
|
'';
|
|
|
|
|
|
2012-07-06 20:23:07 +02:00
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
2013-06-13 11:57:17 +02:00
|
|
|
|
stripDebugList = "lib modules bin";
|
|
|
|
|
|
2008-02-18 15:59:48 +01:00
|
|
|
|
postInstall = ''
|
2013-06-13 11:57:17 +02:00
|
|
|
|
mkdir -p $doc/share/doc/httpd
|
|
|
|
|
mv $out/manual $doc/share/doc/httpd
|
|
|
|
|
mkdir -p $out/share # FIXME, hack
|
2008-02-18 15:59:48 +01:00
|
|
|
|
'';
|
2006-10-11 18:45:55 +02:00
|
|
|
|
|
2008-02-18 15:59:48 +01:00
|
|
|
|
passthru = {
|
2008-10-06 15:38:45 +02:00
|
|
|
|
inherit apr aprutil sslSupport proxySupport;
|
2008-02-18 15:59:48 +01:00
|
|
|
|
};
|
2010-10-21 17:39:53 +02:00
|
|
|
|
|
2006-10-11 18:45:55 +02:00
|
|
|
|
meta = {
|
|
|
|
|
description = "Apache HTTPD, the world's most popular web server";
|
2014-02-18 03:13:45 +01:00
|
|
|
|
branch = "2.2";
|
2013-06-15 14:02:58 +02:00
|
|
|
|
homepage = http://httpd.apache.org/;
|
|
|
|
|
license = stdenv.lib.licenses.asl20;
|
2013-11-04 20:25:20 +01:00
|
|
|
|
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
|
2014-05-01 11:48:56 +02:00
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ eelco simons lovek323 ];
|
2006-10-11 18:45:55 +02:00
|
|
|
|
};
|
2003-11-05 13:17:48 +01:00
|
|
|
|
}
|