2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper, apr, expat, gnused
|
2020-04-24 23:36:52 +00:00
|
|
|
, sslSupport ? true, openssl
|
|
|
|
, bdbSupport ? true, db
|
|
|
|
, ldapSupport ? !stdenv.isCygwin, openldap
|
|
|
|
, libiconv
|
|
|
|
, cyrus_sasl, autoreconfHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert sslSupport -> openssl != null;
|
|
|
|
assert bdbSupport -> db != null;
|
|
|
|
assert ldapSupport -> openldap != null;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
with lib;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-07-21 07:28:18 +00:00
|
|
|
pname = "apr-util";
|
|
|
|
version = "1.6.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-07-21 07:28:18 +00:00
|
|
|
url = "mirror://apache/apr/${pname}-${version}.tar.bz2";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "0nq3s1yn13vplgl6qfm09f7n0wm08malff9s59bqf9nid9xjzqfk";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = optional stdenv.isFreeBSD ./include-static-dependencies.patch;
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
outputBin = "dev";
|
|
|
|
|
|
|
|
buildInputs = optional stdenv.isFreeBSD autoreconfHook;
|
|
|
|
|
|
|
|
configureFlags = [ "--with-apr=${apr.dev}" "--with-expat=${expat.dev}" ]
|
|
|
|
++ optional (!stdenv.isCygwin) "--with-crypto"
|
|
|
|
++ optional sslSupport "--with-openssl=${openssl.dev}"
|
|
|
|
++ optional bdbSupport "--with-berkeley-db=${db.dev}"
|
|
|
|
++ optional ldapSupport "--with-ldap=ldap"
|
|
|
|
++ optionals stdenv.isCygwin
|
|
|
|
[ "--without-pgsql" "--without-sqlite2" "--without-sqlite3"
|
|
|
|
"--without-freetds" "--without-berkeley-db" "--without-crypto" ]
|
|
|
|
;
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ makeWrapper apr expat libiconv ]
|
|
|
|
++ optional sslSupport openssl
|
|
|
|
++ optional bdbSupport db
|
|
|
|
++ optional ldapSupport openldap
|
|
|
|
++ optional stdenv.isFreeBSD cyrus_sasl;
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
for f in $out/lib/*.la $out/lib/apr-util-1/*.la $dev/bin/apu-1-config; do
|
|
|
|
substituteInPlace $f \
|
|
|
|
--replace "${expat.dev}/lib" "${expat.out}/lib" \
|
|
|
|
--replace "${db.dev}/lib" "${db.out}/lib" \
|
|
|
|
--replace "${openssl.dev}/lib" "${openssl.out}/lib"
|
|
|
|
done
|
|
|
|
|
|
|
|
# Give apr1 access to sed for runtime invocations.
|
|
|
|
wrapProgram $dev/bin/apu-1-config --prefix PATH : "${gnused}/bin"
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
inherit sslSupport bdbSupport ldapSupport;
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://apr.apache.org/";
|
|
|
|
description = "A companion library to APR, the Apache Portable Runtime";
|
|
|
|
maintainers = [ maintainers.eelco ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|