python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / development / libraries / opendht / default.nix
blob26a7676dd61559622e8ba10821db967b015ed807
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , Security
5 , cmake
6 , pkg-config
7 , asio
8 , nettle
9 , gnutls
10 , msgpack
11 , readline
12 , libargon2
13 , jsoncpp
14 , restinio
15 , http-parser
16 , openssl
17 , fmt
18 , enableProxyServerAndClient ? false
19 , enablePushNotifications ? false
22 stdenv.mkDerivation rec {
23   pname = "opendht";
24   version = "2.4.10";
26   src = fetchFromGitHub {
27     owner = "savoirfairelinux";
28     repo = "opendht";
29     rev = "v${version}";
30     sha256 = "sha256-2jTphFpBsm72UDzlBlCP1fWk1qNuxicwVJtrEutOjM0=";
31   };
33   nativeBuildInputs = [
34     cmake
35     pkg-config
36   ];
38   buildInputs = [
39     asio
40     nettle
41     gnutls
42     msgpack
43     readline
44     libargon2
45   ] ++ lib.optionals enableProxyServerAndClient [
46     jsoncpp
47     restinio
48     http-parser
49     openssl
50     fmt
51   ] ++ lib.optionals stdenv.isDarwin [
52     Security
53   ];
55   cmakeFlags = lib.optionals enableProxyServerAndClient [
56     "-DOPENDHT_PROXY_SERVER=ON"
57     "-DOPENDHT_PROXY_CLIENT=ON"
58   ] ++ lib.optionals enablePushNotifications [
59     "-DOPENDHT_PUSH_NOTIFICATIONS=ON"
60   ];
62   # https://github.com/savoirfairelinux/opendht/issues/612
63   postPatch = ''
64     substituteInPlace CMakeLists.txt \
65       --replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \
66       --replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR}
67   '';
69   outputs = [ "out" "lib" "dev" "man" ];
71   meta = with lib; {
72     description = "A C++11 Kademlia distributed hash table implementation";
73     homepage = "https://github.com/savoirfairelinux/opendht";
74     license = licenses.gpl3Plus;
75     maintainers = with maintainers; [ taeer olynch thoughtpolice ];
76     platforms = platforms.unix;
77   };