FreeBSD: apr-util, cyrus-sasl, berkeley db, glib, gnutls, kerberos, libelf-freebsd, openldap, serf, guile, tet, shishi, gawk, gnugrep

This commit is contained in:
janus 2015-11-28 00:46:00 +00:00
parent 9897b35661
commit a472d836f6
21 changed files with 141 additions and 33 deletions

View File

@ -34,7 +34,8 @@ stdenv.mkDerivation {
++ stdenv.lib.optionals guiSupport [tcl tk]; ++ stdenv.lib.optionals guiSupport [tcl tk];
# required to support pthread_cancel() # required to support pthread_cancel()
NIX_LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s"; NIX_LDFLAGS = stdenv.lib.optionalString (!stdenv.cc.isClang) "-lgcc_s"
+ stdenv.lib.optionalString (stdenv.isFreeBSD) "-lthr";
# without this, git fails when trying to check for /etc/gitconfig existence # without this, git fails when trying to check for /etc/gitconfig existence
propagatedSandboxProfile = stdenv.lib.sandbox.allowDirectoryList "/etc"; propagatedSandboxProfile = stdenv.lib.sandbox.allowDirectoryList "/etc";

View File

@ -3,6 +3,7 @@
, bdbSupport ? false, db , bdbSupport ? false, db
, ldapSupport ? !stdenv.isCygwin, openldap , ldapSupport ? !stdenv.isCygwin, openldap
, libiconv , libiconv
, cyrus_sasl, autoreconfHook
}: }:
assert sslSupport -> openssl != null; assert sslSupport -> openssl != null;
@ -19,19 +20,24 @@ stdenv.mkDerivation rec {
sha256 = "0bn81pfscy9yjvbmyx442svf43s6dhrdfcsnkpxz43fai5qk5kx6"; sha256 = "0bn81pfscy9yjvbmyx442svf43s6dhrdfcsnkpxz43fai5qk5kx6";
}; };
patches = stdenv.lib.optionals stdenv.isFreeBSD [ ./include-static-dependencies.patch ];
buildInputs = stdenv.lib.optionals stdenv.isFreeBSD [ autoreconfHook ];
configureFlags = '' configureFlags = ''
--with-apr=${apr} --with-expat=${expat} --with-apr=${apr} --with-expat=${expat}
${optionalString (!stdenv.isCygwin) "--with-crypto"} ${optionalString (!stdenv.isCygwin) "--with-crypto"}
${stdenv.lib.optionalString sslSupport "--with-openssl=${openssl}"} ${stdenv.lib.optionalString sslSupport "--with-openssl=${openssl}"}
${stdenv.lib.optionalString bdbSupport "--with-berkeley-db=${db}"} ${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"} optionalString stdenv.isCygwin "--without-pgsql --without-sqlite2 --without-sqlite3 --without-freetds --without-berkeley-db --without-crypto"}
''; '';
propagatedBuildInputs = [ makeWrapper apr expat libiconv ] propagatedBuildInputs = [ makeWrapper apr expat libiconv ]
++ optional sslSupport openssl ++ optional sslSupport openssl
++ optional bdbSupport db ++ optional bdbSupport db
++ optional ldapSupport openldap; ++ optional ldapSupport openldap
++ optional stdenv.isFreeBSD cyrus_sasl;
# Give apr1 access to sed for runtime invocations # Give apr1 access to sed for runtime invocations
postInstall = '' postInstall = ''

View File

@ -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")

View File

@ -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; with stdenv.lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -10,12 +10,19 @@ stdenv.mkDerivation rec {
}; };
buildInputs = buildInputs =
[ openssl db gettext kerberos ] [ openssl db gettext kerberos autoreconfHook ]
++ lib.optional stdenv.isLinux pam ++ lib.optional stdenv.isLinux pam
++ lib.optional stdenv.isDarwin fixDarwinDylibNames; ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
patches = [ ./missing-size_t.patch ]; # https://bugzilla.redhat.com/show_bug.cgi?id=906519 patches = [
patchFlags = "-p0"; ./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 = [ configureFlags = [
"--with-openssl=${openssl}" "--with-openssl=${openssl}"

View File

@ -1,6 +1,6 @@
Gentoo bug #458790 Gentoo bug #458790
--- include/sasl.h 2012-10-12 17:05:48.000000000 +0300 --- a/include/sasl.h 2012-10-12 17:05:48.000000000 +0300
+++ include/sasl.h 2013-02-23 16:56:44.648786268 +0200 +++ b/include/sasl.h 2013-02-23 16:56:44.648786268 +0200
@@ -121,6 +121,9 @@ @@ -121,6 +121,9 @@
#ifndef SASL_H #ifndef SASL_H
#define SASL_H 1 #define SASL_H 1

View File

@ -23,6 +23,7 @@ stdenv.mkDerivation rec {
(if cxxSupport then "--enable-cxx" else "--disable-cxx") (if cxxSupport then "--enable-cxx" else "--disable-cxx")
(if compat185 then "--enable-compat185" else "--disable-compat185") (if compat185 then "--enable-compat185" else "--disable-compat185")
"--enable-dbm" "--enable-dbm"
(stdenv.lib.optionalString stdenv.isFreeBSD "--with-pic")
]; ];
preConfigure = '' preConfigure = ''

View File

@ -63,8 +63,12 @@ stdenv.mkDerivation rec {
propagatedBuildInputs = [ pcre zlib libffi libiconv ] propagatedBuildInputs = [ pcre zlib libffi libiconv ]
++ libintlOrEmpty; ++ libintlOrEmpty;
LIBELF_CFLAGS = optional stdenv.isFreeBSD "-I${libelf}";
LIBELF_LIBS = optional stdenv.isFreeBSD "-L${libelf} -lelf";
configureFlags = configureFlags =
optional stdenv.isDarwin "--disable-compile-warnings" optional stdenv.isDarwin "--disable-compile-warnings"
++ optional stdenv.isFreeBSD "--with-libiconv=gnu"
++ optional stdenv.isSunOS ["--disable-modular-tests" "--with-libiconv"]; ++ optional stdenv.isSunOS ["--disable-modular-tests" "--with-libiconv"];
NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin " -lintl" NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin " -lintl"

View File

@ -30,7 +30,7 @@ stdenv.mkDerivation {
enableParallelBuilding = !guileBindings; enableParallelBuilding = !guileBindings;
buildInputs = [ lzo lzip nettle libtasn1 libidn p11_kit zlib gmp autogen ] 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 ++ lib.optional (tpmSupport && stdenv.isLinux) trousers
++ [ unbound ] ++ [ unbound ]
++ lib.optional guileBindings guile; ++ lib.optional guileBindings guile;

View File

@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ autoreconfHook pkgconfig python perl yacc flex ] nativeBuildInputs = [ autoreconfHook pkgconfig python perl yacc flex ]
++ (with perlPackages; [ JSON ]) ++ (with perlPackages; [ JSON ])
++ optional (!libOnly) texinfo; ++ 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 ]; ++ optionals (!libOnly) [ openldap pam ];
## ugly, X should be made an option ## ugly, X should be made an option
@ -31,14 +31,15 @@ stdenv.mkDerivation rec {
"--sysconfdir=/etc" "--sysconfdir=/etc"
"--localstatedir=/var" "--localstatedir=/var"
"--enable-hdb-openldap-module" "--enable-hdb-openldap-module"
"--with-capng"
"--with-sqlite3=${sqlite}" "--with-sqlite3=${sqlite}"
"--with-berkeley-db=${db}"
"--with-libedit=${libedit}" "--with-libedit=${libedit}"
"--with-openssl=${openssl}" "--with-openssl=${openssl}"
"--without-x" "--without-x"
] ++ optionals (!libOnly) [ ] ++ optionals (!libOnly) [
"--with-openldap=${openldap}" "--with-openldap=${openldap}"
] ++ optionals (!stdenv.isFreeBSD) [
"--with-berkeley-db=${db}"
"--with-capng"
]; ];
buildPhase = optionalString libOnly '' buildPhase = optionalString libOnly ''
@ -83,7 +84,7 @@ stdenv.mkDerivation rec {
meta = { meta = {
description = "An implementation of Kerberos 5 (and some more stuff)"; description = "An implementation of Kerberos 5 (and some more stuff)";
license = licenses.bsd3; license = licenses.bsd3;
platforms = platforms.linux; platforms = platforms.linux ++ platforms.freebsd;
maintainers = with maintainers; [ wkennington ]; maintainers = with maintainers; [ wkennington ];
}; };

View File

@ -1,20 +1,28 @@
{ fetchsvn, stdenv }: { fetchsvn, stdenv, gnum4, tet }:
stdenv.mkDerivation (rec { stdenv.mkDerivation (rec {
version = "3258"; version = "3258";
name = "libelf-freebsd-${version}"; 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 { src = fetchsvn {
url = svn://svn.code.sf.net/p/elftoolchain/code/trunk ; url = svn://svn.code.sf.net/p/elftoolchain/code/trunk;
rev = 3258; 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 = { meta = {
description = "Essential compilation tools and libraries for building and analyzing ELF based program images"; description = "Essential compilation tools and libraries for building and analyzing ELF based program images";

View File

@ -9,7 +9,16 @@ stdenv.mkDerivation rec {
}; };
# Should be removed with >=2.4.43 # 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" ]; outputs = [ "out" "man" ];
@ -19,7 +28,8 @@ stdenv.mkDerivation rec {
[ "--enable-overlays" [ "--enable-overlays"
"--disable-dependency-tracking" # speeds up one-time build "--disable-dependency-tracking" # speeds up one-time build
] ++ stdenv.lib.optional (openssl == null) "--without-tls" ] ++ 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; # !!! dontPatchELF = 1; # !!!

View File

@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
buildPhase = '' buildPhase = ''
scons PREFIX="$out" OPENSSL="${openssl}" ZLIB="${zlib}" APR="$(echo "${apr}"/bin/*-config)" \ scons PREFIX="$out" OPENSSL="${openssl}" ZLIB="${zlib}" APR="$(echo "${apr}"/bin/*-config)" \
APU="$(echo "${aprutil}"/bin/*-config)" CC="${ 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}\"" if (stdenv.isDarwin || stdenv.isCygwin) then "" else "GSSAPI=\"${kerberos}\""
} }

View File

@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
propagatedBuildInputs = [ libffi ]; propagatedBuildInputs = [ libffi ];
doCheck = true; doCheck = !stdenv.isFreeBSD; # XXX: 00-socket.test hangs
meta = { meta = {
description = "G-Wrap, a wrapper generator for Guile"; description = "G-Wrap, a wrapper generator for Guile";

View File

@ -0,0 +1,29 @@
{ fetchurl, stdenv }:
stdenv.mkDerivation (rec {
version = "3.8";
name = "tet-${version}";
src = fetchurl {
url = http://tetworks.opengroup.org/downloads/38/software/Sources/3.8/tet3.8-src.tar.gz ;
sha256 = "1j57hv56df38w249l595b8rsgmsyvjkbysai03a9724gax5jl9av" ;
};
buildInputs = [ ];
patchPhase = ''chmod +x configure'';
configurePhase = ''./configure -t lite'';
buildPhase = ''cd src; make; cd -'';
installPhase = ''cd src; make install; cd -; cp -vr $PWD $out'';
meta = {
description = "The Test Environment Toolkit is used in test applications like The Open Group's UNIX Certification program and the Free Standards Group's LSB Certification program";
homepage = http://tetworks.opengroup.org/Products/tet.htm ;
license = stdenv.lib.licenses.artistic1;
platforms = stdenv.lib.platforms.unix;
maintainers = [ ];
};
})

View File

@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
}; };
# Fixes support for gcrypt 1.6+ # Fixes support for gcrypt 1.6+
patches = [ ./gcrypt-fix.patch ]; patches = [ ./gcrypt-fix.patch ./freebsd-unistd.patch ];
buildInputs = [ libgcrypt libgpgerror libtasn1 optPam optLibidn optGnutls ]; buildInputs = [ libgcrypt libgpgerror libtasn1 optPam optLibidn optGnutls ];

View File

@ -0,0 +1,12 @@
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
index 2ea9af4..ed58960 100644
--- a/gl/unistd.in.h
+++ b/gl/unistd.in.h
@@ -116,6 +116,7 @@
# include <getopt.h>
#endif
+#include "config.h"
_GL_INLINE_HEADER_BEGIN
#ifndef _GL_UNISTD_INLINE
# define _GL_UNISTD_INLINE _GL_INLINE

View File

@ -3,7 +3,7 @@
echo Building the trivial bootstrap environment... echo Building the trivial bootstrap environment...
# needed FreeBSD packages: # needed FreeBSD packages:
# findutils gcpio gawk gnugrep coreutils bash gsed gtar gmake xar binutils gpatch lbzip2 # findutils gcpio gawk gnugrep coreutils bash gsed gtar gmake xar binutils gpatch lbzip2 diffutils
$mkdir -p $out/bin $mkdir -p $out/bin
@ -22,6 +22,12 @@ ln -s /usr/local/bin/gmake make
ln -s /usr/local/bin/lbzip2 ln -s /usr/local/bin/lbzip2
ln -s /usr/local/bin/gdiff diff
ln -s /usr/bin/locale
ln -s /usr/bin/more
ln -s /usr/bin/bzip2 ln -s /usr/bin/bzip2
ln -s /usr/bin/bunzip2 ln -s /usr/bin/bunzip2
ln -s /usr/bin/bzcat ln -s /usr/bin/bzcat

View File

@ -13,6 +13,7 @@ stdenv.mkDerivation rec {
stdenv.isCygwin # XXX: `test-dup2' segfaults on Cygwin 6.1 stdenv.isCygwin # XXX: `test-dup2' segfaults on Cygwin 6.1
|| stdenv.isDarwin # XXX: `locale' segfaults || stdenv.isDarwin # XXX: `locale' segfaults
|| stdenv.isSunOS # XXX: `_backsmalls1' fails, locale stuff? || stdenv.isSunOS # XXX: `_backsmalls1' fails, locale stuff?
|| stdenv.isFreeBSD
); );
buildInputs = stdenv.lib.optional (stdenv.system != "x86_64-cygwin") libsigsegv buildInputs = stdenv.lib.optional (stdenv.system != "x86_64-cygwin") libsigsegv

View File

@ -15,7 +15,8 @@ stdenv.mkDerivation {
buildInputs = [ pcre libiconv ]; buildInputs = [ pcre libiconv ];
# cygwin: FAIL: multibyte-white-space # cygwin: FAIL: multibyte-white-space
doCheck = !stdenv.isDarwin && !stdenv.isSunOS && !stdenv.isCygwin; # freebsd: FAIL mb-non-UTF8-performance
doCheck = !stdenv.isDarwin && !stdenv.isSunOS && !stdenv.isCygwin && !stdenv.isFreeBSD;
# On Mac OS X, force use of mkdir -p, since Grep's fallback # On Mac OS X, force use of mkdir -p, since Grep's fallback
# (./install-sh) is broken. # (./install-sh) is broken.

View File

@ -6099,6 +6099,9 @@ let
aprutil = callPackage ../development/libraries/apr-util { aprutil = callPackage ../development/libraries/apr-util {
bdbSupport = true; bdbSupport = true;
db = if stdenv.isFreeBSD then db44 else db;
# XXX: only the db_158 interface was available through
# apr with db58 on freebsd (nov 2015), for unknown reasons
}; };
assimp = callPackage ../development/libraries/assimp { }; assimp = callPackage ../development/libraries/assimp { };
@ -6277,7 +6280,9 @@ let
cwiid = callPackage ../development/libraries/cwiid { }; cwiid = callPackage ../development/libraries/cwiid { };
cyrus_sasl = callPackage ../development/libraries/cyrus-sasl { }; cyrus_sasl = callPackage ../development/libraries/cyrus-sasl {
kerberos = if stdenv.isFreeBSD then libheimdal else kerberos;
};
# Make bdb5 the default as it is the last release under the custom # Make bdb5 the default as it is the last release under the custom
# bsd-like license # bsd-like license
@ -8526,6 +8531,8 @@ let
python = python2; python = python2;
}; };
tet = callPackage ../development/tools/misc/tet { };
thrift = callPackage ../development/libraries/thrift { }; thrift = callPackage ../development/libraries/thrift { };
tidyp = callPackage ../development/libraries/tidyp { }; tidyp = callPackage ../development/libraries/tidyp { };
@ -9552,7 +9559,9 @@ let
ruby = ruby_2_1; ruby = ruby_2_1;
}; };
shishi = callPackage ../servers/shishi { }; shishi = if stdenv.isFreeBSD
then callPackage ../servers/shishi { pam = null; }
else callPackage ../servers/shishi { };
sipcmd = callPackage ../applications/networking/sipcmd { }; sipcmd = callPackage ../applications/networking/sipcmd { };

View File

@ -6555,7 +6555,7 @@ let self = _self // overrides; _self = with self; {
meta = { meta = {
description = "The World-Wide Web library for Perl"; description = "The World-Wide Web library for Perl";
license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ]; license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin ++ stdenv.lib.platforms.illumos; platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin ++ stdenv.lib.platforms.illumos ++ stdenv.lib.platforms.freebsd;
}; };
}; };