about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/gnutls
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/gnutls
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/gnutls')
-rw-r--r--nixpkgs/pkgs/development/libraries/gnutls/3.5.10.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gnutls/3.6.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/gnutls/generic.nix90
3 files changed, 120 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/gnutls/3.5.10.nix b/nixpkgs/pkgs/development/libraries/gnutls/3.5.10.nix
new file mode 100644
index 000000000000..a44e2b04ed71
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gnutls/3.5.10.nix
@@ -0,0 +1,10 @@
+{ callPackage, fetchurl, libunistring, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "3.5.10";
+
+  src = fetchurl {
+    url = "mirror://gnupg/gnutls/v3.5/gnutls-${version}.tar.xz";
+    sha256 = "17apwvdkkazh5w8z8mbanpj2yj8s2002qwy46wz4v3akpa33wi5g";
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/gnutls/3.6.nix b/nixpkgs/pkgs/development/libraries/gnutls/3.6.nix
new file mode 100644
index 000000000000..7fb1af70a289
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gnutls/3.6.nix
@@ -0,0 +1,20 @@
+{ callPackage, fetchurl, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "3.6.2";
+
+  src = fetchurl {
+    url = "mirror://gnupg/gnutls/v3.6/gnutls-${version}.tar.xz";
+    sha256 = "07wdffklwmxpa9i50sh5nwrc5ajb47skrldm6rzjc0jf4dxxpmdw";
+  };
+
+  # Skip two tests introduced in 3.5.11.  Probable reasons of failure:
+  #  - pkgconfig: building against the result won't work before installing
+  #  - trust-store: default trust store path (/etc/ssl/...) is missing in sandbox
+  # Change p11-kit test to use pkg-config to find p11-kit
+  postPatch = ''
+    sed '2iexit 77' -i tests/pkgconfig.sh
+    sed '/^void doit(void)/,$s/{/{ exit(77);/; t' -i tests/trust-store.c
+    sed 's:/usr/lib64/pkcs11/ /usr/lib/pkcs11/ /usr/lib/x86_64-linux-gnu/pkcs11/:`pkg-config --variable=p11_module_path p11-kit-1`:' -i tests/p11-kit-trust.sh
+  '';
+})
diff --git a/nixpkgs/pkgs/development/libraries/gnutls/generic.nix b/nixpkgs/pkgs/development/libraries/gnutls/generic.nix
new file mode 100644
index 000000000000..052438241426
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gnutls/generic.nix
@@ -0,0 +1,90 @@
+{ lib, stdenv, zlib, lzo, libtasn1, nettle, pkgconfig, lzip
+, guileBindings, guile, perl, gmp, autogen, libidn, p11-kit, libiconv
+, tpmSupport ? false, trousers, which, nettools, libunistring
+, unbound, dns-root-data, gettext
+
+# Version dependent args
+, version, src, patches ? [], postPatch ? "", nativeBuildInputs ? []
+, buildInputs ? []
+, ...}:
+
+assert guileBindings -> guile != null;
+let
+  # XXX: Gnulib's `test-select' fails on FreeBSD:
+  # http://hydra.nixos.org/build/2962084/nixlog/1/raw .
+  doCheck = !stdenv.isFreeBSD && !stdenv.isDarwin && lib.versionAtLeast version "3.4"
+      && stdenv.buildPlatform == stdenv.hostPlatform;
+in
+stdenv.mkDerivation {
+  name = "gnutls-${version}";
+
+  inherit src patches;
+
+  outputs = [ "bin" "dev" "out" "man" "devdoc" ];
+  outputInfo = "devdoc";
+
+  postPatch = lib.optionalString (lib.versionAtLeast version "3.4") ''
+    sed '2iecho "name constraints tests skipped due to datefudge problems"\nexit 0' \
+      -i tests/cert-tests/name-constraints
+  '' + postPatch;
+
+  preConfigure = "patchShebangs .";
+  configureFlags =
+    lib.optional stdenv.isLinux "--with-default-trust-store-file=/etc/ssl/certs/ca-certificates.crt"
+  ++ [
+    "--disable-dependency-tracking"
+    "--enable-fast-install"
+    "--with-unbound-root-key-file=${dns-root-data}/root.key"
+  ] ++ lib.optional guileBindings
+    [ "--enable-guile" "--with-guile-site-dir=\${out}/share/guile/site" ];
+
+  enableParallelBuilding = true;
+
+  buildInputs = [ lzo lzip libtasn1 libidn p11-kit zlib gmp autogen libunistring unbound gettext libiconv ]
+    ++ lib.optional (tpmSupport && stdenv.isLinux) trousers
+    ++ lib.optional guileBindings guile
+    ++ buildInputs;
+
+  nativeBuildInputs = [ perl pkgconfig ] ++ nativeBuildInputs
+    ++ lib.optionals doCheck [ which nettools ];
+
+  propagatedBuildInputs = [ nettle ];
+
+  inherit doCheck;
+
+  # Fixup broken libtool and pkgconfig files
+  preFixup = lib.optionalString (!stdenv.isDarwin) ''
+    sed ${lib.optionalString tpmSupport "-e 's,-ltspi,-L${trousers}/lib -ltspi,'"} \
+        -e 's,-lz,-L${zlib.out}/lib -lz,' \
+        -e 's,-L${gmp.dev}/lib,-L${gmp.out}/lib,' \
+        -e 's,-lgmp,-L${gmp.out}/lib -lgmp,' \
+        -i $out/lib/*.la "$dev/lib/pkgconfig/gnutls.pc"
+  '' + ''
+    # It seems only useful for static linking but basically noone does that.
+    substituteInPlace "$out/lib/libgnutls.la" \
+      --replace "-lunistring" ""
+  '';
+
+  meta = with lib; {
+    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 = https://www.gnu.org/software/gnutls/;
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ eelco wkennington fpletz ];
+    platforms = platforms.all;
+  };
+}