summary refs log tree commit diff
path: root/pkgs/development/libraries/apr-util/default.nix
blob: da03ab44ecdd520d272b968be89f46412ae589a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{ stdenv, fetchurl, makeWrapper, apr, expat, gnused
, sslSupport ? true, openssl
, bdbSupport ? false, db
, ldapSupport ? true, openldap
}:

assert sslSupport -> openssl != null;
assert bdbSupport -> db != 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"}
    ${stdenv.lib.optionalString bdbSupport "--with-berkeley-db=${db}"}
    ${stdenv.lib.optionalString ldapSupport "--with-ldap"}
  '';

  buildInputs = stdenv.lib.optional sslSupport openssl;

  propagatedBuildInputs = [ makeWrapper apr expat ]
    ++ optional sslSupport openssl
    ++ optional bdbSupport db
    ++ 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";
  };
}