nixpkgs/pkgs/development/libraries/opendht/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

79 lines
1.6 KiB
Nix
Raw Normal View History

2021-10-08 14:18:30 +00:00
{ lib
, stdenv
, fetchFromGitHub
, Security
, cmake
, pkg-config
, asio
, nettle
, gnutls
, msgpack
, readline
, libargon2
, jsoncpp
, restinio
, http-parser
, openssl
, fmt
, enableProxyServerAndClient ? false
, enablePushNotifications ? false
2017-07-11 17:00:07 +00:00
}:
stdenv.mkDerivation rec {
pname = "opendht";
2023-05-14 04:25:03 +00:00
version = "2.5.5";
2017-07-11 17:00:07 +00:00
src = fetchFromGitHub {
owner = "savoirfairelinux";
repo = "opendht";
2022-07-28 12:21:41 +00:00
rev = "v${version}";
2023-05-14 04:25:03 +00:00
sha256 = "sha256-OXLVuyPFlo7VD8f9wAN71p4PZpfM2ISq9UoUiAYEXUQ=";
2017-07-11 17:00:07 +00:00
};
2021-10-08 14:18:30 +00:00
nativeBuildInputs = [
cmake
pkg-config
];
2017-07-11 17:00:07 +00:00
2021-10-08 14:18:30 +00:00
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"
];
2022-05-18 14:30:27 +00:00
# https://github.com/savoirfairelinux/opendht/issues/612
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \
--replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR}
'';
outputs = [ "out" "lib" "dev" "man" ];
2017-07-11 17:00:07 +00:00
meta = with lib; {
2017-07-11 17:00:07 +00:00
description = "A C++11 Kademlia distributed hash table implementation";
2021-10-08 14:18:30 +00:00
homepage = "https://github.com/savoirfairelinux/opendht";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ taeer olynch thoughtpolice ];
2021-10-08 14:18:30 +00:00
platforms = platforms.unix;
2017-07-11 17:00:07 +00:00
};
}