about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2021-10-10 19:38:18 +0200
committerGitHub <noreply@github.com>2021-10-10 19:38:18 +0200
commit66bc8d9517db84739131818adf32fab9a4a0d148 (patch)
tree87de1e43f6ea6570e3f5c43b09e807229b32e4e6 /pkgs
parent43bbea938785d4228d87e4a443ea82f5ead9bcec (diff)
parent57a1b8476b0d9803e5066dfbb68d6b3cee28e8c2 (diff)
Merge pull request #140746 from linsui/opendht
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/libraries/opendht/default.nix69
-rw-r--r--pkgs/top-level/all-packages.nix4
2 files changed, 52 insertions, 21 deletions
diff --git a/pkgs/development/libraries/opendht/default.nix b/pkgs/development/libraries/opendht/default.nix
index 2de005d885a1d..d785146ecb070 100644
--- a/pkgs/development/libraries/opendht/default.nix
+++ b/pkgs/development/libraries/opendht/default.nix
@@ -1,6 +1,22 @@
-{ lib, stdenv, fetchFromGitHub, darwin
-, cmake, pkg-config
-, asio, nettle, gnutls, msgpack, readline, libargon2
+{ lib
+, stdenv
+, fetchFromGitHub
+, Security
+, cmake
+, pkg-config
+, asio
+, nettle
+, gnutls
+, msgpack
+, readline
+, libargon2
+, jsoncpp
+, restinio
+, http-parser
+, openssl
+, fmt
+, enableProxyServerAndClient ? false
+, enablePushNotifications ? false
 }:
 
 stdenv.mkDerivation rec {
@@ -14,29 +30,42 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-Os5PRYTZMVekQrbwNODWsHANTx6RSC5vzGJ5JoYtvtE=";
   };
 
-  nativeBuildInputs =
-    [ cmake
-      pkg-config
-    ];
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
 
-  buildInputs =
-    [ asio
-      nettle
-      gnutls
-      msgpack
-      readline
-      libargon2
-    ] ++ lib.optionals stdenv.isDarwin [
-      darwin.apple_sdk.frameworks.Security
-    ];
+  buildInputs = [
+    asio
+    nettle
+    gnutls
+    msgpack
+    readline
+    libargon2
+  ] ++ lib.optionals enableProxyServerAndClient [
+    jsoncpp
+    restinio
+    http-parser
+    openssl
+    fmt
+  ] ++ lib.optionals stdenv.isDarwin [
+    Security
+  ];
+
+  cmakeFlags = lib.optionals enableProxyServerAndClient [
+    "-DOPENDHT_PROXY_SERVER=ON"
+    "-DOPENDHT_PROXY_CLIENT=ON"
+  ] ++ lib.optionals enablePushNotifications [
+    "-DOPENDHT_PUSH_NOTIFICATIONS=ON"
+  ];
 
   outputs = [ "out" "lib" "dev" "man" ];
 
   meta = with lib; {
     description = "A C++11 Kademlia distributed hash table implementation";
-    homepage    = "https://github.com/savoirfairelinux/opendht";
-    license     = licenses.gpl3Plus;
+    homepage = "https://github.com/savoirfairelinux/opendht";
+    license = licenses.gpl3Plus;
     maintainers = with maintainers; [ taeer olynch thoughtpolice ];
-    platforms   = platforms.unix;
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index ed9abe8548071..8cca021c91413 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -7978,7 +7978,9 @@ with pkgs;
 
   opendbx = callPackage ../development/libraries/opendbx { };
 
-  opendht = callPackage ../development/libraries/opendht {};
+  opendht = callPackage ../development/libraries/opendht  {
+    inherit (darwin.apple_sdk.frameworks) Security;
+  };
 
   opendkim = callPackage ../development/libraries/opendkim { };