nixpkgs-suyu/pkgs/servers/http/apache-httpd/2.2.nix

81 lines
2.3 KiB
Nix
Raw Normal View History

2014-08-30 23:30:31 +02:00
{ stdenv, fetchurl, pkgconfig, openssl, perl, zlib
, sslSupport, proxySupport ? true
, apr, aprutil, pcre
, ldapSupport ? true, openldap
, # Multi-processing module to use. This is built into the server and
# cannot be selected at runtime.
mpm ? "prefork"
}:
assert sslSupport -> openssl != null;
assert ldapSupport -> aprutil.ldapSupport && openldap != null;
assert mpm == "prefork" || mpm == "worker" || mpm == "event";
stdenv.mkDerivation rec {
version = "2.2.31";
name = "apache-httpd-${version}";
src = fetchurl {
url = "mirror://apache/httpd/httpd-${version}.tar.bz2";
sha256 = "1b165zi7jrrlz5wmyy3b34lcs3dl4g0dymfb0qxwdnimylcrsbzk";
};
# FIXME: -dev depends on -doc
outputs = [ "out" "dev" "doc" ];
setOutputFlags = false; # it would move $out/modules, etc.
2013-06-13 11:57:17 +02:00
propagatedBuildInputs = [ apr ]; # otherwise mod_* fail to find includes often
buildInputs = [ pkgconfig perl aprutil pcre zlib ] ++
stdenv.lib.optional sslSupport openssl;
# Required for pthread_cancel.
NIX_LDFLAGS = (if stdenv.isDarwin then "" else "-lgcc_s");
patchPhase = ''
sed -i config.layout -e "s|installbuilddir:.*|installbuilddir: $dev/share/build|"
'';
preConfigure = ''
configureFlags="$configureFlags --includedir=$dev/include"
'';
configureFlags = ''
--with-z=${zlib.dev}
--with-pcre=${pcre.dev}
--enable-mods-shared=all
--enable-authn-alias
${if proxySupport then "--enable-proxy" else ""}
${if sslSupport then "--enable-ssl --with-ssl=${openssl.dev}" else ""}
${if ldapSupport then "--enable-ldap --enable-authnz-ldap" else ""}
--with-mpm=${mpm}
--enable-cache
--enable-disk-cache
--enable-file-cache
--enable-mem-cache
--docdir=$(doc)/share/doc
'';
enableParallelBuilding = true;
2013-06-13 11:57:17 +02:00
stripDebugList = "lib modules bin";
postInstall = ''
2013-06-13 11:57:17 +02:00
mkdir -p $doc/share/doc/httpd
mv $out/manual $doc/share/doc/httpd
mkdir -p $dev/bin
mv $out/bin/apxs $dev/bin/apxs
'';
passthru = {
inherit apr aprutil sslSupport proxySupport;
};
meta = {
description = "Apache HTTPD, the world's most popular web server";
2014-02-18 03:13:45 +01:00
branch = "2.2";
homepage = http://httpd.apache.org/;
license = stdenv.lib.licenses.asl20;
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
maintainers = with stdenv.lib.maintainers; [ eelco lovek323 ];
};
}