summary refs log tree commit diff
path: root/pkgs/servers/nfd/default.nix
blob: 2b6655106de70d66803ced239c567a4ed979b3db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ lib
, stdenv
, boost179 # probably needs to match the one from ndn-cxx
, fetchFromGitHub
, libpcap
, ndn-cxx
, openssl
, pkg-config
, sphinx
, systemd
, waf
, websocketpp
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
, withWebSocket ? true
}:

stdenv.mkDerivation rec {
  pname = "nfd";
  version = "22.12";

  src = fetchFromGitHub {
    owner = "named-data";
    repo = lib.toUpper pname;
    rev = "NFD-${version}";
    sha256 = "sha256-epY5qtET7rsKL3KIKvxfa+wF+AGZbYs+zRhy8SnIffk=";
    fetchSubmodules = true;
  };

  nativeBuildInputs = [ pkg-config sphinx waf.hook ];
  buildInputs = [ libpcap ndn-cxx openssl websocketpp ] ++ lib.optional withSystemd systemd;

  configureFlags = [
    "--boost-includes=${boost179.dev}/include"
    "--boost-libs=${boost179.out}/lib"
    "--with-tests"
  ] ++ lib.optional (!withWebSocket) "--without-websocket";

  doCheck = true;
  checkPhase = ''
    runHook preCheck
    build/unit-tests-core
    # build/unit-tests-daemon # 3 tests fail
    build/unit-tests-rib
    build/unit-tests-tools
    runHook postCheck
  '';

  meta = with lib; {
    homepage = "https://named-data.net/";
    description = "Named Data Networking (NDN) Forwarding Daemon";
    license = licenses.gpl3Plus;
    platforms = platforms.unix;
    maintainers = with maintainers; [ bertof ];
  };
}