2015-08-13 01:01:53 +01:00
|
|
|
{ lib, fetchurl, stdenv, zlib, lzo, libtasn1, nettle, pkgconfig, lzip
|
|
|
|
, guileBindings, guile, perl, gmp, autogen, libidn, p11_kit, unbound
|
2015-07-26 11:37:57 +01:00
|
|
|
, tpmSupport ? false, trousers
|
2015-04-04 03:16:33 +01:00
|
|
|
|
|
|
|
# Version dependent args
|
2015-09-09 21:05:00 +01:00
|
|
|
, version, src, patches ? [], postPatch ? "", nativeBuildInputs ? []
|
2015-04-04 03:16:33 +01:00
|
|
|
, ...}:
|
|
|
|
|
|
|
|
assert guileBindings -> guile != null;
|
|
|
|
|
2015-09-09 21:05:00 +01:00
|
|
|
stdenv.mkDerivation {
|
2015-04-04 03:16:33 +01:00
|
|
|
name = "gnutls-${version}";
|
|
|
|
|
2015-09-09 21:05:00 +01:00
|
|
|
inherit src patches postPatch;
|
2015-04-04 03:16:33 +01:00
|
|
|
|
2015-10-15 16:43:23 +01:00
|
|
|
outputs = [ "dev" "out" "bin" "man" "docdev" ];
|
|
|
|
outputInfo = "docdev";
|
2015-07-26 23:25:53 +01:00
|
|
|
|
2015-06-11 08:02:56 +01:00
|
|
|
configureFlags =
|
2015-06-01 20:33:47 +01:00
|
|
|
# FIXME: perhaps use $SSL_CERT_FILE instead
|
2015-07-26 11:37:57 +01:00
|
|
|
lib.optional stdenv.isLinux "--with-default-trust-store-file=/etc/ssl/certs/ca-certificates.crt"
|
2015-06-11 08:02:56 +01:00
|
|
|
++ [
|
2015-04-19 08:49:15 +01:00
|
|
|
"--disable-dependency-tracking"
|
|
|
|
"--enable-fast-install"
|
2015-07-26 11:37:57 +01:00
|
|
|
] ++ lib.optional guileBindings
|
2015-04-19 08:49:15 +01:00
|
|
|
[ "--enable-guile" "--with-guile-site-dir=\${out}/share/guile/site" ];
|
2015-04-04 03:16:33 +01:00
|
|
|
|
|
|
|
# Build of the Guile bindings is not parallel-safe. See
|
|
|
|
# <http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=330995a920037b6030ec0282b51dde3f8b493cad>
|
|
|
|
# for the actual fix.
|
|
|
|
enableParallelBuilding = !guileBindings;
|
|
|
|
|
2015-08-13 01:01:53 +01:00
|
|
|
buildInputs = [ lzo lzip nettle libtasn1 libidn p11_kit zlib gmp autogen ]
|
2015-07-26 11:37:57 +01:00
|
|
|
++ lib.optional (tpmSupport && stdenv.isLinux) trousers
|
2015-05-15 05:51:07 +01:00
|
|
|
++ [ unbound ]
|
2015-07-26 11:37:57 +01:00
|
|
|
++ lib.optional guileBindings guile;
|
2015-04-04 03:16:33 +01:00
|
|
|
|
2015-09-09 21:05:00 +01:00
|
|
|
nativeBuildInputs = [ perl pkgconfig ] ++ nativeBuildInputs;
|
2015-04-04 03:16:33 +01:00
|
|
|
|
|
|
|
# XXX: Gnulib's `test-select' fails on FreeBSD:
|
|
|
|
# http://hydra.nixos.org/build/2962084/nixlog/1/raw .
|
|
|
|
doCheck = (!stdenv.isFreeBSD && !stdenv.isDarwin);
|
|
|
|
|
2015-04-25 10:36:38 +01:00
|
|
|
# Fixup broken libtool and pkgconfig files
|
2015-07-26 11:37:57 +01:00
|
|
|
preFixup = lib.optionalString (!stdenv.isDarwin) ''
|
|
|
|
sed ${lib.optionalString tpmSupport "-e 's,-ltspi,-L${trousers}/lib -ltspi,'"} \
|
2015-04-27 12:18:16 +01:00
|
|
|
-e 's,-lz,-L${zlib.out}/lib -lz,' \
|
2015-10-15 16:43:23 +01:00
|
|
|
-e 's,-L${gmp.dev}/lib,-L${gmp.out}/lib,' \
|
2015-10-17 21:53:54 +01:00
|
|
|
-e 's,-lgmp,-L${gmp.out}/lib -lgmp,' \
|
|
|
|
-i $out/lib/*.la "$dev/lib/pkgconfig/gnutls.pc"
|
2015-04-25 10:36:38 +01:00
|
|
|
'';
|
|
|
|
|
2015-07-26 11:37:57 +01:00
|
|
|
meta = with lib; {
|
2015-04-04 03:16:33 +01:00
|
|
|
description = "The GNU Transport Layer Security Library";
|
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
GnuTLS is a project that aims to develop a library which
|
|
|
|
provides a secure layer, over a reliable transport
|
|
|
|
layer. Currently the GnuTLS library implements the proposed standards by
|
|
|
|
the IETF's TLS working group.
|
|
|
|
|
|
|
|
Quoting from the TLS protocol specification:
|
|
|
|
|
|
|
|
"The TLS protocol provides communications privacy over the
|
|
|
|
Internet. The protocol allows client/server applications to
|
|
|
|
communicate in a way that is designed to prevent eavesdropping,
|
|
|
|
tampering, or message forgery."
|
|
|
|
'';
|
|
|
|
|
|
|
|
homepage = http://www.gnu.org/software/gnutls/;
|
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = with maintainers; [ eelco wkennington ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|