summary refs log tree commit diff
path: root/pkgs/servers/nfd/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/servers/nfd/default.nix')
-rw-r--r--pkgs/servers/nfd/default.nix55
1 files changed, 55 insertions, 0 deletions
diff --git a/pkgs/servers/nfd/default.nix b/pkgs/servers/nfd/default.nix
new file mode 100644
index 00000000000..5be17fc7b49
--- /dev/null
+++ b/pkgs/servers/nfd/default.nix
@@ -0,0 +1,55 @@
+{ lib
+, stdenv
+, boost
+, fetchFromGitHub
+, libpcap
+, ndn-cxx
+, openssl
+, pkg-config
+, sphinx
+, systemd
+, wafHook
+, websocketpp
+, withSystemd ? stdenv.isLinux
+, withWebSocket ? true
+}:
+
+stdenv.mkDerivation rec {
+  pname = "nfd";
+  version = "0.7.1";
+
+  src = fetchFromGitHub {
+    owner = "named-data";
+    repo = lib.toUpper pname;
+    rev = "NFD-${version}";
+    sha256 = "1l9bchj8c68r6qw4vr1kc96jgxl0vpqa2vjkvy1xmhz92sivr6gi";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ pkg-config sphinx wafHook ];
+  buildInputs = [ libpcap ndn-cxx openssl websocketpp ] ++ lib.optional withSystemd systemd;
+
+  wafConfigureFlags = [
+    "--boost-includes=${boost.dev}/include"
+    "--boost-libs=${boost.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 Neworking (NDN) Forwarding Daemon";
+    license = licenses.gpl3Plus;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.bertof ];
+  };
+}