summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/apr-util/default.nix10
-rw-r--r--pkgs/development/libraries/apr-util/include-static-dependencies.patch12
-rw-r--r--pkgs/development/libraries/cyrus-sasl/default.nix15
-rw-r--r--pkgs/development/libraries/cyrus-sasl/missing-size_t.patch4
-rw-r--r--pkgs/development/libraries/db/generic.nix1
-rw-r--r--pkgs/development/libraries/glib/default.nix4
-rw-r--r--pkgs/development/libraries/gnutls/generic.nix2
-rw-r--r--pkgs/development/libraries/kerberos/heimdal.nix9
-rw-r--r--pkgs/development/libraries/libelf-freebsd/default.nix26
-rw-r--r--pkgs/development/libraries/openldap/default.nix14
-rw-r--r--pkgs/development/libraries/serf/default.nix2
11 files changed, 74 insertions, 25 deletions
diff --git a/pkgs/development/libraries/apr-util/default.nix b/pkgs/development/libraries/apr-util/default.nix
index c35520f22fd..e0b2832f6e4 100644
--- a/pkgs/development/libraries/apr-util/default.nix
+++ b/pkgs/development/libraries/apr-util/default.nix
@@ -3,6 +3,7 @@
 , bdbSupport ? false, db
 , ldapSupport ? !stdenv.isCygwin, openldap
 , libiconv
+, cyrus_sasl, autoreconfHook
 }:
 
 assert sslSupport -> openssl != null;
@@ -19,19 +20,24 @@ stdenv.mkDerivation rec {
     sha256 = "0bn81pfscy9yjvbmyx442svf43s6dhrdfcsnkpxz43fai5qk5kx6";
   };
 
+  patches = stdenv.lib.optionals stdenv.isFreeBSD [ ./include-static-dependencies.patch ];
+
+  buildInputs = stdenv.lib.optionals stdenv.isFreeBSD [ autoreconfHook ];
+
   configureFlags = ''
     --with-apr=${apr} --with-expat=${expat}
     ${optionalString (!stdenv.isCygwin) "--with-crypto"}
     ${stdenv.lib.optionalString sslSupport "--with-openssl=${openssl}"}
     ${stdenv.lib.optionalString bdbSupport "--with-berkeley-db=${db}"}
-    ${stdenv.lib.optionalString ldapSupport "--with-ldap"}${
+    ${stdenv.lib.optionalString ldapSupport "--with-ldap=ldap"}${
       optionalString 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 ldapSupport openldap
+    ++ optional stdenv.isFreeBSD cyrus_sasl;
 
   # Give apr1 access to sed for runtime invocations
   postInstall = ''
diff --git a/pkgs/development/libraries/apr-util/include-static-dependencies.patch b/pkgs/development/libraries/apr-util/include-static-dependencies.patch
new file mode 100644
index 00000000000..1813c721781
--- /dev/null
+++ b/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")
diff --git a/pkgs/development/libraries/cyrus-sasl/default.nix b/pkgs/development/libraries/cyrus-sasl/default.nix
index 2be98f3d5e8..71cfc626bac 100644
--- a/pkgs/development/libraries/cyrus-sasl/default.nix
+++ b/pkgs/development/libraries/cyrus-sasl/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, openssl, kerberos, db, gettext, pam, fixDarwinDylibNames }:
+{ lib, stdenv, fetchurl, openssl, kerberos, db, gettext, pam, fixDarwinDylibNames, autoreconfHook }:
 
 with stdenv.lib;
 stdenv.mkDerivation rec {
@@ -10,12 +10,19 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs =
-    [ openssl db gettext kerberos ]
+    [ openssl db gettext kerberos autoreconfHook ]
     ++ lib.optional stdenv.isLinux pam
     ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
 
-  patches = [ ./missing-size_t.patch ]; # https://bugzilla.redhat.com/show_bug.cgi?id=906519
-  patchFlags = "-p0";
+  patches = [
+    ./missing-size_t.patch # https://bugzilla.redhat.com/show_bug.cgi?id=906519
+    (
+      fetchurl {
+        url = "http://www.linuxfromscratch.org/patches/blfs/svn/cyrus-sasl-2.1.26-fixes-3.patch";
+        sha256 = "1vh4pc2rxxm6yvykx0b7kg09jbcwcxwv5rs6yq2ag3y8p6a9x86w";
+      }
+    )
+  ];
 
   configureFlags = [
     "--with-openssl=${openssl}"
diff --git a/pkgs/development/libraries/cyrus-sasl/missing-size_t.patch b/pkgs/development/libraries/cyrus-sasl/missing-size_t.patch
index 42f20fb8096..da96818ca26 100644
--- a/pkgs/development/libraries/cyrus-sasl/missing-size_t.patch
+++ b/pkgs/development/libraries/cyrus-sasl/missing-size_t.patch
@@ -1,6 +1,6 @@
 Gentoo bug #458790
---- include/sasl.h	2012-10-12 17:05:48.000000000 +0300
-+++ include/sasl.h	2013-02-23 16:56:44.648786268 +0200
+--- a/include/sasl.h	2012-10-12 17:05:48.000000000 +0300
++++ b/include/sasl.h	2013-02-23 16:56:44.648786268 +0200
 @@ -121,6 +121,9 @@
  #ifndef SASL_H
  #define SASL_H 1
diff --git a/pkgs/development/libraries/db/generic.nix b/pkgs/development/libraries/db/generic.nix
index 077bd4e03a3..f5ee4e440ff 100644
--- a/pkgs/development/libraries/db/generic.nix
+++ b/pkgs/development/libraries/db/generic.nix
@@ -23,6 +23,7 @@ stdenv.mkDerivation rec {
     (if cxxSupport then "--enable-cxx" else "--disable-cxx")
     (if compat185 then "--enable-compat185" else "--disable-compat185")
     "--enable-dbm"
+    (stdenv.lib.optionalString stdenv.isFreeBSD "--with-pic")
   ];
 
   preConfigure = ''
diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix
index 07e1f1243ec..538a40615f1 100644
--- a/pkgs/development/libraries/glib/default.nix
+++ b/pkgs/development/libraries/glib/default.nix
@@ -63,8 +63,12 @@ stdenv.mkDerivation rec {
   propagatedBuildInputs = [ pcre zlib libffi libiconv ]
     ++ libintlOrEmpty;
 
+  LIBELF_CFLAGS = optional stdenv.isFreeBSD "-I${libelf}";
+  LIBELF_LIBS = optional stdenv.isFreeBSD "-L${libelf} -lelf";
+
   configureFlags =
     optional stdenv.isDarwin "--disable-compile-warnings"
+    ++ optional stdenv.isFreeBSD "--with-libiconv=gnu"
     ++ optional stdenv.isSunOS ["--disable-modular-tests" "--with-libiconv"];
 
   NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin " -lintl"
diff --git a/pkgs/development/libraries/gnutls/generic.nix b/pkgs/development/libraries/gnutls/generic.nix
index f1eb62e0083..ebaef47ca14 100644
--- a/pkgs/development/libraries/gnutls/generic.nix
+++ b/pkgs/development/libraries/gnutls/generic.nix
@@ -30,7 +30,7 @@ stdenv.mkDerivation {
   enableParallelBuilding = !guileBindings;
 
   buildInputs = [ lzo lzip nettle libtasn1 libidn p11_kit zlib gmp autogen ]
-    ++ lib.optional (stdenv.isDarwin) libiconv
+    ++ lib.optional (stdenv.isFreeBSD || stdenv.isDarwin) libiconv
     ++ lib.optional (tpmSupport && stdenv.isLinux) trousers
     ++ [ unbound ]
     ++ lib.optional guileBindings guile;
diff --git a/pkgs/development/libraries/kerberos/heimdal.nix b/pkgs/development/libraries/kerberos/heimdal.nix
index 0569c0bf5b3..3f8ed7c9de4 100644
--- a/pkgs/development/libraries/kerberos/heimdal.nix
+++ b/pkgs/development/libraries/kerberos/heimdal.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ autoreconfHook pkgconfig python perl yacc flex ]
     ++ (with perlPackages; [ JSON ])
     ++ optional (!libOnly) texinfo;
-  buildInputs = [ libcap_ng sqlite openssl db libedit ]
+  buildInputs = (if (!stdenv.isFreeBSD) then [ libcap_ng db ] else []) ++ [ sqlite openssl libedit ]
     ++ optionals (!libOnly) [ openldap pam ];
 
   ## ugly, X should be made an option
@@ -31,14 +31,15 @@ stdenv.mkDerivation rec {
     "--sysconfdir=/etc"
     "--localstatedir=/var"
     "--enable-hdb-openldap-module"
-    "--with-capng"
     "--with-sqlite3=${sqlite}"
-    "--with-berkeley-db=${db}"
     "--with-libedit=${libedit}"
     "--with-openssl=${openssl}"
     "--without-x"
   ] ++ optionals (!libOnly) [
     "--with-openldap=${openldap}"
+  ] ++ optionals (!stdenv.isFreeBSD) [
+    "--with-berkeley-db=${db}"
+    "--with-capng"
   ];
 
   buildPhase = optionalString libOnly ''
@@ -83,7 +84,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "An implementation of Kerberos 5 (and some more stuff)";
     license = licenses.bsd3;
-    platforms = platforms.linux;
+    platforms = platforms.linux ++ platforms.freebsd;
     maintainers = with maintainers; [ wkennington ];
   };
 
diff --git a/pkgs/development/libraries/libelf-freebsd/default.nix b/pkgs/development/libraries/libelf-freebsd/default.nix
index ee0b6d50408..3e09d4c6cd4 100644
--- a/pkgs/development/libraries/libelf-freebsd/default.nix
+++ b/pkgs/development/libraries/libelf-freebsd/default.nix
@@ -1,20 +1,28 @@
-{ fetchsvn, stdenv }:
+{ fetchsvn, stdenv, gnum4, tet }:
 
 stdenv.mkDerivation (rec {
   version = "3258";
   name = "libelf-freebsd-${version}";
 
-  #src = fetchurl {
-  #  url = "http://sourceforge.net/code-snapshots/svn/e/el/elftoolchain/code/elftoolchain-code-${version}-trunk.zip";
-  #  sha256 = "0vf7s9dwk2xkmhb79aigqm0x0yfbw1j0b9ksm51207qwr179n6jr";
-  #};
   src = fetchsvn {
-    url = svn://svn.code.sf.net/p/elftoolchain/code/trunk ;
-    rev = 3258;
+    url = svn://svn.code.sf.net/p/elftoolchain/code/trunk;
+    rev = (stdenv.lib.strings.toInt version);
   };
 
-  doCheck = true;
-  
+  buildInputs = [ gnum4 tet ];
+
+  buildPhase = ''
+    PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:$PATH # use BSD install(1) instead of coreutils and make(1) instead of GNU Make
+    cp -vr ${tet} test/tet/tet3.8
+    chmod -R a+w test/tet/tet3.8
+    make libelf
+  '';
+
+  installPhase = ''
+    cp -vr libelf $out
+    cp -vr common/. $out/
+  '';
+
   meta = {
     description = "Essential compilation tools and libraries for building and analyzing ELF based program images";
 
diff --git a/pkgs/development/libraries/openldap/default.nix b/pkgs/development/libraries/openldap/default.nix
index 253f74ecc6a..7d836cd5a0d 100644
--- a/pkgs/development/libraries/openldap/default.nix
+++ b/pkgs/development/libraries/openldap/default.nix
@@ -9,7 +9,16 @@ stdenv.mkDerivation rec {
   };
 
   # Should be removed with >=2.4.43
-  patches = [ ./CVE-2015-6908.patch ];
+  patches = [
+    ./CVE-2015-6908.patch
+    (
+      fetchurl {
+        sha256 = "5bcb3f9fb7186b380efa0a1c2d31ad755e190134b5c4dac07c65bbf7c0b6b3b3";
+        url = "https://github.com/LMDB/lmdb/commit/3360cbad668f678fb23c064ca4efcc5c9ae95d10.patch";
+        name = "openldap-clang-compilation.patch";
+      }
+    )
+  ];
 
   outputs = [ "out" "man" ];
 
@@ -19,7 +28,8 @@ stdenv.mkDerivation rec {
     [ "--enable-overlays"
       "--disable-dependency-tracking"   # speeds up one-time build
     ] ++ stdenv.lib.optional (openssl == null) "--without-tls"
-      ++ stdenv.lib.optional (cyrus_sasl == null) "--without-cyrus-sasl";
+      ++ stdenv.lib.optional (cyrus_sasl == null) "--without-cyrus-sasl"
+      ++ stdenv.lib.optional stdenv.isFreeBSD "--with-pic";
 
   dontPatchELF = 1; # !!!
 
diff --git a/pkgs/development/libraries/serf/default.nix b/pkgs/development/libraries/serf/default.nix
index 580460d5fc0..20ce1dabf9a 100644
--- a/pkgs/development/libraries/serf/default.nix
+++ b/pkgs/development/libraries/serf/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   buildPhase = ''
     scons PREFIX="$out" OPENSSL="${openssl}" ZLIB="${zlib}" APR="$(echo "${apr}"/bin/*-config)" \
         APU="$(echo "${aprutil}"/bin/*-config)" CC="${
-          if stdenv.isDarwin then "clang" else "${stdenv.cc}/bin/gcc"
+          if stdenv.cc.isClang then "clang" else "${stdenv.cc}/bin/gcc"
         }" ${
           if (stdenv.isDarwin || stdenv.isCygwin) then "" else "GSSAPI=\"${kerberos}\""
         }