Skip to content

Commit

Permalink
opendht: format
Browse files Browse the repository at this point in the history
  • Loading branch information
linsui committed Jan 17, 2025
1 parent c0d940b commit d41c444
Showing 1 changed file with 58 additions and 43 deletions.
101 changes: 58 additions & 43 deletions pkgs/development/libraries/opendht/default.nix
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
{ lib
, stdenv
, fetchFromGitHub
, Security
, cmake
, pkg-config
, asio
, nettle
, gnutls
, msgpack-cxx
, readline
, libargon2
, jsoncpp
, restinio
, llhttp
, openssl
, fmt
, enableProxyServerAndClient ? false
, enablePushNotifications ? false
{
lib,
stdenv,
fetchFromGitHub,
Security,
cmake,
pkg-config,
asio,
nettle,
gnutls,
msgpack-cxx,
readline,
libargon2,
jsoncpp,
restinio,
llhttp,
openssl,
fmt,
enableProxyServerAndClient ? false,
enablePushNotifications ? false,
}:

stdenv.mkDerivation {
Expand All @@ -35,29 +36,34 @@ stdenv.mkDerivation {
pkg-config
];

buildInputs = [
asio
fmt
nettle
gnutls
msgpack-cxx
readline
libargon2
] ++ lib.optionals enableProxyServerAndClient [
jsoncpp
restinio
llhttp
openssl
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
Security
];
buildInputs =
[
asio
fmt
nettle
gnutls
msgpack-cxx
readline
libargon2
]
++ lib.optionals enableProxyServerAndClient [
jsoncpp
restinio
llhttp
openssl
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
Security
];

cmakeFlags = lib.optionals enableProxyServerAndClient [
"-DOPENDHT_PROXY_SERVER=ON"
"-DOPENDHT_PROXY_CLIENT=ON"
] ++ lib.optionals enablePushNotifications [
"-DOPENDHT_PUSH_NOTIFICATIONS=ON"
];
cmakeFlags =
lib.optionals enableProxyServerAndClient [
"-DOPENDHT_PROXY_SERVER=ON"
"-DOPENDHT_PROXY_CLIENT=ON"
]
++ lib.optionals enablePushNotifications [
"-DOPENDHT_PUSH_NOTIFICATIONS=ON"
];

# https://github.com/savoirfairelinux/opendht/issues/612
postPatch = ''
Expand All @@ -66,13 +72,22 @@ stdenv.mkDerivation {
--replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR}
'';

outputs = [ "out" "lib" "dev" "man" ];
outputs = [
"out"
"lib"
"dev"
"man"
];

meta = with lib; {
description = "C++11 Kademlia distributed hash table implementation";
homepage = "https://github.com/savoirfairelinux/opendht";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ taeer olynch thoughtpolice ];
maintainers = with maintainers; [
taeer
olynch
thoughtpolice
];
platforms = platforms.unix;
};
}

0 comments on commit d41c444

Please sign in to comment.