at 17.09-beta 69 lines 2.1 kB view raw
1{ stdenv, fetchurl, makeWrapper, apr, expat, gnused 2, sslSupport ? true, openssl 3, bdbSupport ? false, db 4, ldapSupport ? !stdenv.isCygwin, openldap 5, libiconv 6, cyrus_sasl, autoreconfHook 7}: 8 9assert sslSupport -> openssl != null; 10assert bdbSupport -> db != null; 11assert ldapSupport -> openldap != null; 12 13with stdenv.lib; 14 15stdenv.mkDerivation rec { 16 name = "apr-util-1.6.0"; 17 18 src = fetchurl { 19 url = "mirror://apache/apr/${name}.tar.bz2"; 20 sha256 = "0k6a90d67xl36brz69s7adgkswjmw7isnjblm1naqmjblwzwjx44"; 21 }; 22 23 patches = optional stdenv.isFreeBSD ./include-static-dependencies.patch; 24 25 outputs = [ "out" "dev" ]; 26 outputBin = "dev"; 27 28 buildInputs = optional stdenv.isFreeBSD autoreconfHook; 29 30 configureFlags = [ "--with-apr=${apr.dev}" "--with-expat=${expat.dev}" ] 31 ++ optional (!stdenv.isCygwin) "--with-crypto" 32 ++ optional sslSupport "--with-openssl=${openssl.dev}" 33 ++ optional bdbSupport "--with-berkeley-db=${db}" 34 ++ optional ldapSupport "--with-ldap=ldap" 35 ++ optionals stdenv.isCygwin 36 [ "--without-pgsql" "--without-sqlite2" "--without-sqlite3" 37 "--without-freetds" "--without-berkeley-db" "--without-crypto" ] 38 ; 39 40 propagatedBuildInputs = [ makeWrapper apr expat libiconv ] 41 ++ optional sslSupport openssl 42 ++ optional bdbSupport db 43 ++ optional ldapSupport openldap 44 ++ optional stdenv.isFreeBSD cyrus_sasl; 45 46 postInstall = '' 47 for f in $out/lib/*.la $out/lib/apr-util-1/*.la; do 48 substituteInPlace $f \ 49 --replace "${expat.dev}/lib" "${expat.out}/lib" \ 50 --replace "${openssl.dev}/lib" "${openssl.out}/lib" 51 done 52 53 # Give apr1 access to sed for runtime invocations. 54 wrapProgram $dev/bin/apu-1-config --prefix PATH : "${gnused}/bin" 55 ''; 56 57 enableParallelBuilding = true; 58 59 passthru = { 60 inherit sslSupport bdbSupport ldapSupport; 61 }; 62 63 meta = { 64 homepage = http://apr.apache.org/; 65 description = "A companion library to APR, the Apache Portable Runtime"; 66 maintainers = [ stdenv.lib.maintainers.eelco ]; 67 platforms = stdenv.lib.platforms.unix; 68 }; 69}