about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/apr-util
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/libraries/apr-util
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/apr-util')
-rw-r--r--nixpkgs/pkgs/development/libraries/apr-util/default.nix71
-rw-r--r--nixpkgs/pkgs/development/libraries/apr-util/include-static-dependencies.patch12
2 files changed, 83 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/apr-util/default.nix b/nixpkgs/pkgs/development/libraries/apr-util/default.nix
new file mode 100644
index 000000000000..fe159afe6854
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/apr-util/default.nix
@@ -0,0 +1,71 @@
+{ stdenv, fetchurl, makeWrapper, apr, expat, gnused
+, sslSupport ? true, openssl
+, bdbSupport ? false, 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 {
+  name = "apr-util-1.6.1";
+
+  src = fetchurl {
+    url = "mirror://apache/apr/${name}.tar.bz2";
+    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;
+  };
+
+  meta = with stdenv.lib; {
+    homepage = http://apr.apache.org/;
+    description = "A companion library to APR, the Apache Portable Runtime";
+    maintainers = [ maintainers.eelco ];
+    platforms = platforms.unix;
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/apr-util/include-static-dependencies.patch b/nixpkgs/pkgs/development/libraries/apr-util/include-static-dependencies.patch
new file mode 100644
index 000000000000..1813c7217810
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/apr-util/include-static-dependencies.patch
@@ -0,0 +1,12 @@
+diff --git a/build/apu-conf.m4 b/build/apu-conf.m4
+index 8943f10..aa44305 100644
+--- a/build/apu-conf.m4
++++ b/build/apu-conf.m4
+@@ -279,6 +279,7 @@ AC_ARG_WITH(ldap,[  --with-ldap=library     ldap library to use],
+         APU_FIND_LDAPLIB("ldap", "-llber -lresolv -lsocket -lnsl")
+         APU_FIND_LDAPLIB("ldap", "-ldl -lpthread")
+       else
++        APU_FIND_LDAPLIB($LIBLDAP, "-llber -lcrypto -lssl -lsasl2")
+         APU_FIND_LDAPLIB($LIBLDAP)
+         APU_FIND_LDAPLIB($LIBLDAP, "-lresolv")
+         APU_FIND_LDAPLIB($LIBLDAP, "-lresolv -lsocket -lnsl")