at 18.09-beta 70 lines 2.2 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.1"; 17 18 src = fetchurl { 19 url = "mirror://apache/apr/${name}.tar.bz2"; 20 sha256 = "0nq3s1yn13vplgl6qfm09f7n0wm08malff9s59bqf9nid9xjzqfk"; 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.dev}" 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 $dev/bin/apu-1-config; do 48 substituteInPlace $f \ 49 --replace "${expat.dev}/lib" "${expat.out}/lib" \ 50 --replace "${db.dev}/lib" "${db.out}/lib" \ 51 --replace "${openssl.dev}/lib" "${openssl.out}/lib" 52 done 53 54 # Give apr1 access to sed for runtime invocations. 55 wrapProgram $dev/bin/apu-1-config --prefix PATH : "${gnused}/bin" 56 ''; 57 58 enableParallelBuilding = true; 59 60 passthru = { 61 inherit sslSupport bdbSupport ldapSupport; 62 }; 63 64 meta = { 65 homepage = http://apr.apache.org/; 66 description = "A companion library to APR, the Apache Portable Runtime"; 67 maintainers = [ stdenv.lib.maintainers.eelco ]; 68 platforms = stdenv.lib.platforms.unix; 69 }; 70}