about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVladimír Čunát <vladimir.cunat@nic.cz>2022-09-01 10:06:28 +0200
committerVladimír Čunát <vladimir.cunat@nic.cz>2022-09-01 10:06:28 +0200
commit2da64a81275b68fdad38af669afeda43d401e94b (patch)
tree91ff2732d540ab1d5f8d1b1dee15dd571fd8c864
parentef1cc4c4f5c9be6254bb0eed65a0439995e4d99b (diff)
parentb17757e458b878b987d9aaddf8a48b0595e01d90 (diff)
downloadnixlib-2da64a81275b68fdad38af669afeda43d401e94b.tar
nixlib-2da64a81275b68fdad38af669afeda43d401e94b.tar.gz
nixlib-2da64a81275b68fdad38af669afeda43d401e94b.tar.bz2
nixlib-2da64a81275b68fdad38af669afeda43d401e94b.tar.lz
nixlib-2da64a81275b68fdad38af669afeda43d401e94b.tar.xz
nixlib-2da64a81275b68fdad38af669afeda43d401e94b.tar.zst
nixlib-2da64a81275b68fdad38af669afeda43d401e94b.zip
Merge #188383: ngtcp2-gnutls: init at 0.7.0 and use in knot-dns
-rw-r--r--pkgs/development/libraries/ngtcp2/gnutls.nix51
-rw-r--r--pkgs/servers/dns/knot-dns/default.nix2
-rw-r--r--pkgs/top-level/all-packages.nix1
3 files changed, 54 insertions, 0 deletions
diff --git a/pkgs/development/libraries/ngtcp2/gnutls.nix b/pkgs/development/libraries/ngtcp2/gnutls.nix
new file mode 100644
index 000000000000..c2b928e851c8
--- /dev/null
+++ b/pkgs/development/libraries/ngtcp2/gnutls.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv, fetchFromGitHub
+, autoreconfHook, pkg-config
+, gnutls
+, cunit, ncurses
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ngtcp2";
+  version = "0.7.0";
+
+  src = fetchFromGitHub {
+    owner = "ngtcp2";
+    repo = "ngtcp2";
+    rev = "v${version}";
+    sha256 = "sha256-REAN5TW0miWXI3HFxtW3znTKTrhsBbNqu1VfjC2w0no=";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ gnutls ];
+
+  configureFlags = [ "--with-gnutls=yes" ];
+  enableParallelBuilding = true;
+
+  doCheck = true;
+  checkInputs = [ cunit ]
+    ++ lib.optional stdenv.isDarwin ncurses;
+
+  meta = with lib; {
+    homepage = "https://github.com/ngtcp2/ngtcp2";
+    description = "an effort to implement RFC9000 QUIC protocol.";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ vcunat/* for knot-dns */ ];
+  };
+}
+
+/*
+  Why split from ./default.nix?
+
+  ngtcp2 libs contain helpers to plug into various crypto libs (gnutls, patched openssl, ...).
+  Building multiple of them while keeping closures separable would be relatively complicated.
+  Separating the builds is easier for now; the missed opportunity to share the 0.3--0.4 MB
+  library isn't such a big deal.
+
+  Moreover upstream still commonly does incompatible changes, so agreeing
+  on a single version might be hard sometimes.  That's why it seemed simpler
+  to completely separate the nix expressions, too.
+*/
+
diff --git a/pkgs/servers/dns/knot-dns/default.nix b/pkgs/servers/dns/knot-dns/default.nix
index 427bdb597aa9..fc4efcfe56a1 100644
--- a/pkgs/servers/dns/knot-dns/default.nix
+++ b/pkgs/servers/dns/knot-dns/default.nix
@@ -1,5 +1,6 @@
 { lib, stdenv, fetchurl, pkg-config, gnutls, liburcu, lmdb, libcap_ng, libidn2, libunistring
 , systemd, nettle, libedit, zlib, libiconv, libintl, libmaxminddb, libbpf, nghttp2, libmnl
+, ngtcp2-gnutls
 , autoreconfHook, nixosTests, knot-resolver
 , fetchpatch
 }:
@@ -39,6 +40,7 @@ stdenv.mkDerivation rec {
     nettle libedit
     libiconv lmdb libintl
     nghttp2 # DoH support in kdig
+    ngtcp2-gnutls  # DoQ support in kdig (and elsewhere but not much use there yet)
     libmaxminddb # optional for geoip module (it's tiny)
     # without sphinx &al. for developer documentation
     # TODO: add dnstap support?
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 6e67d7bf67b7..0106424aa8eb 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -20570,6 +20570,7 @@ with pkgs;
   nghttp3 = callPackage ../development/libraries/nghttp3 { };
 
   ngtcp2 = callPackage ../development/libraries/ngtcp2 { };
+  ngtcp2-gnutls = callPackage ../development/libraries/ngtcp2/gnutls.nix { };
 
   nix-plugins = callPackage ../development/libraries/nix-plugins { };