96cec2a7bd
Conflicts: pkgs/applications/audio/flac/default.nix pkgs/build-support/gcc-wrapper/builder.sh pkgs/development/libraries/apr-util/default.nix pkgs/development/libraries/apr/default.nix pkgs/development/libraries/atk/default.nix pkgs/development/libraries/freetype/default.nix pkgs/development/libraries/gdk-pixbuf/default.nix pkgs/development/libraries/glib/default.nix pkgs/development/libraries/glibc/2.17/builder.sh pkgs/development/libraries/glibc/2.17/locales.nix pkgs/development/libraries/libjpeg/default.nix pkgs/development/libraries/libogg/default.nix pkgs/development/libraries/libsamplerate/default.nix pkgs/development/libraries/libtiff/default.nix pkgs/development/libraries/libvorbis/default.nix pkgs/development/libraries/mesa/default.nix pkgs/development/libraries/pango/default.nix pkgs/development/web/nodejs/default.nix pkgs/os-specific/linux/pam/default.nix pkgs/os-specific/linux/systemd/default.nix pkgs/stdenv/generic/setup.sh pkgs/stdenv/linux/default.nix pkgs/top-level/all-packages.nix pkgs/top-level/release-small.nix
74 lines
2.1 KiB
Nix
74 lines
2.1 KiB
Nix
{ stdenv, fetchurl, 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.27";
|
||
name = "apache-httpd-${version}";
|
||
|
||
src = fetchurl {
|
||
url = "mirror://apache/httpd/httpd-${version}.tar.bz2";
|
||
sha256 = "0iw19y6knijinqwvv4q16fgq5xq8nwxdg14wrrbc0mfasvg76n90";
|
||
};
|
||
|
||
outputs = [ "dev" "out" "doc" ];
|
||
|
||
buildInputs = [perl apr aprutil pcre] ++
|
||
stdenv.lib.optional sslSupport openssl;
|
||
|
||
# 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";
|
||
|
||
# Required for ‘pthread_cancel’.
|
||
NIX_LDFLAGS = (if stdenv.isDarwin then "" else "-lgcc_s");
|
||
|
||
configureFlags = ''
|
||
--with-z=${zlib}
|
||
--with-pcre=${pcre}
|
||
--enable-mods-shared=all
|
||
--enable-authn-alias
|
||
${if proxySupport then "--enable-proxy" else ""}
|
||
${if sslSupport then "--enable-ssl --with-ssl=${openssl}" else ""}
|
||
${if ldapSupport then "--enable-ldap --enable-authnz-ldap" else ""}
|
||
--with-mpm=${mpm}
|
||
'';
|
||
|
||
preConfigure =
|
||
''
|
||
makeFlagsArray+=("installbuilddir=$dev/share/build")
|
||
'';
|
||
|
||
enableParallelBuilding = true;
|
||
|
||
stripDebugList = "lib modules bin";
|
||
|
||
postInstall = ''
|
||
mkdir -p $doc/share/doc/httpd
|
||
mv $out/manual $doc/share/doc/httpd
|
||
mkdir -p $out/share # FIXME, hack
|
||
'';
|
||
|
||
passthru = {
|
||
inherit apr aprutil sslSupport proxySupport;
|
||
};
|
||
|
||
meta = {
|
||
description = "Apache HTTPD, the world's most popular web server";
|
||
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 simons lovek323 ];
|
||
};
|
||
}
|