2022-09-09 14:08:57 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
|
|
|
, autoreconfHook, pkg-config
|
|
|
|
, gnutls
|
2022-09-30 11:47:45 +00:00
|
|
|
, cunit, ncurses, knot-dns
|
2022-09-09 14:08:57 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ngtcp2";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.19.1";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ngtcp2";
|
|
|
|
repo = "ngtcp2";
|
|
|
|
rev = "v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-agiQRy/e5VS+ANxajXYi5huRjQQ2M8eddH/AzmwnHdQ=";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config ];
|
|
|
|
buildInputs = [ gnutls ];
|
|
|
|
|
|
|
|
configureFlags = [ "--with-gnutls=yes" ];
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
doCheck = true;
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ cunit ]
|
2022-09-09 14:08:57 +00:00
|
|
|
++ lib.optional stdenv.isDarwin ncurses;
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
passthru.tests = knot-dns.passthru.tests; # the only consumer so far
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
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.
|
|
|
|
*/
|
|
|
|
|