nixpkgs/pkgs/development/libraries/apr-util/default.nix

72 lines
2.1 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, makeWrapper, apr, expat, gnused
, sslSupport ? true, openssl
2019-02-03 15:30:31 +00:00
, bdbSupport ? true, db
, ldapSupport ? !stdenv.isCygwin, openldap
, libiconv
, cyrus_sasl, autoreconfHook
}:
assert sslSupport -> openssl != null;
assert bdbSupport -> db != null;
assert ldapSupport -> openldap != null;
with stdenv.lib;
stdenv.mkDerivation rec {
2018-01-25 18:35:46 +00:00
name = "apr-util-1.6.1";
src = fetchurl {
url = "mirror://apache/apr/${name}.tar.bz2";
2018-01-25 18:35:46 +00:00
sha256 = "0nq3s1yn13vplgl6qfm09f7n0wm08malff9s59bqf9nid9xjzqfk";
};
2016-01-05 08:42:56 +00:00
patches = optional stdenv.isFreeBSD ./include-static-dependencies.patch;
outputs = [ "out" "dev" ];
outputBin = "dev";
2016-01-05 08:42:56 +00:00
buildInputs = optional stdenv.isFreeBSD autoreconfHook;
configureFlags = [ "--with-apr=${apr.dev}" "--with-expat=${expat.dev}" ]
2016-01-05 08:42:56 +00:00
++ optional (!stdenv.isCygwin) "--with-crypto"
++ optional sslSupport "--with-openssl=${openssl.dev}"
++ optional bdbSupport "--with-berkeley-db=${db.dev}"
2016-01-05 08:42:56 +00:00
++ 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"
'';
2013-01-14 13:38:00 +00:00
enableParallelBuilding = true;
passthru = {
inherit sslSupport bdbSupport ldapSupport;
};
2018-09-30 09:02:17 +00:00
meta = with stdenv.lib; {
homepage = http://apr.apache.org/;
description = "A companion library to APR, the Apache Portable Runtime";
2018-09-30 09:02:17 +00:00
maintainers = [ maintainers.eelco ];
platforms = platforms.unix;
license = licenses.asl20;
};
}