nixpkgs/pkgs/development/libraries/apr-util/default.nix
William A. Kennington III 844ab16b90 apr-util: Cleanup
Add the required packages to buildInputs. Create a wrapper around
apr-1-config so that internal sed commands succeed.
2013-12-31 08:00:21 -06:00

52 lines
1.3 KiB
Nix

{ stdenv, fetchurl, makeWrapper, apr, expat, gnused
, sslSupport ? true, openssl
, bdbSupport ? false, db4
, ldapSupport ? true, openldap
}:
assert sslSupport -> openssl != null;
assert bdbSupport -> db4 != null;
assert ldapSupport -> openldap != null;
let
optional = stdenv.lib.optional;
in
stdenv.mkDerivation rec {
name = "apr-util-1.5.3";
src = fetchurl {
url = "mirror://apache/apr/${name}.tar.bz2";
sha256 = "0s1rpqjy5xr03k9s4xrsm5wvhj5286vlkf6jvqayw99yy5sb3vbq";
};
configureFlags = ''
--with-apr=${apr} --with-expat=${expat}
--with-crypto
${stdenv.lib.optionalString sslSupport "--with-openssl=${openssl}"}
${stdenv.lib.optionalString bdbSupport "--with-berkeley-db=${db4}"}
${stdenv.lib.optionalString ldapSupport "--with-ldap"}
'';
propagatedBuildInputs = [ makeWrapper apr expat ]
++ optional sslSupport openssl
++ optional bdbSupport db4
++ optional ldapSupport openldap;
# Give apr1 access to sed for runtime invocations
postInstall = ''
wrapProgram $out/bin/apu-1-config --prefix PATH : "${gnused}/bin"
'';
enableParallelBuilding = true;
passthru = {
inherit sslSupport bdbSupport ldapSupport;
};
meta = {
homepage = http://apr.apache.org/;
description = "A companion library to APR, the Apache Portable Runtime";
};
}