nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 autoreconfHook,
6 pkg-config,
7 gnutls,
8 cunit,
9 ncurses,
10 knot-dns,
11 curlWithGnuTls,
12}:
13
14stdenv.mkDerivation rec {
15 pname = "ngtcp2";
16 version = "1.20.0";
17
18 src = fetchFromGitHub {
19 owner = "ngtcp2";
20 repo = "ngtcp2";
21 rev = "v${version}";
22 hash = "sha256-8enkRWmPLZXBtlD9v8N7zuZB+Fv+igl30W7q2UqI2ZE=";
23 };
24
25 outputs = [
26 "out"
27 "dev"
28 ];
29
30 nativeBuildInputs = [
31 autoreconfHook
32 pkg-config
33 ];
34 buildInputs = [ gnutls ];
35
36 configureFlags = [ "--with-gnutls=yes" ];
37 enableParallelBuilding = true;
38
39 doCheck = true;
40 nativeCheckInputs = [ cunit ] ++ lib.optional stdenv.hostPlatform.isDarwin ncurses;
41
42 passthru.tests = knot-dns.passthru.tests // {
43 inherit curlWithGnuTls;
44 };
45
46 meta = {
47 homepage = "https://github.com/ngtcp2/ngtcp2";
48 description = "Effort to implement RFC9000 QUIC protocol";
49 license = lib.licenses.mit;
50 platforms = lib.platforms.unix;
51 maintainers = with lib.maintainers; [
52 vcunat # for knot-dns
53 ];
54 };
55}
56
57/*
58 Why split from ./default.nix?
59
60 ngtcp2 libs contain helpers to plug into various crypto libs (gnutls, patched openssl, ...).
61 Building multiple of them while keeping closures separable would be relatively complicated.
62 Separating the builds is easier for now; the missed opportunity to share the 0.3--0.4 MB
63 library isn't such a big deal.
64
65 Moreover upstream still commonly does incompatible changes, so agreeing
66 on a single version might be hard sometimes. That's why it seemed simpler
67 to completely separate the nix expressions, too.
68*/