biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / servers / rippled / default.nix
blob83ceee00f45f7f58da68dce22ab12021e663c2d2
1 { lib, stdenv, fetchgit, fetchurl, fetchpatch, git, cmake, pkg-config
2 , openssl, boost, grpc, protobuf, libnsl, rocksdb_6_23, snappy }:
4 let
5   sqlite3 = fetchurl rec {
6     url = "https://www.sqlite.org/2018/sqlite-amalgamation-3260000.zip";
7     sha256 = "0vh9aa5dyvdwsyd8yp88ss300mv2c2m40z79z569lcxa6fqwlpfy";
8     passthru.url = url;
9   };
11   boostSharedStatic = boost.override {
12     enableShared = true;
13     enabledStatic = true;
14   };
16   docca = fetchgit {
17     url = "https://github.com/vinniefalco/docca.git";
18     rev = "335dbf9c3613e997ed56d540cc8c5ff2e28cab2d";
19     sha256 = "09cb90k0ygmnlpidybv6nzf6is51i80lnwlvad6ijc3gf1z6i1yh";
20     fetchSubmodules = false;
21     leaveDotGit = true;
22   };
24   nudb = fetchgit rec {
25     url = "https://github.com/CPPAlliance/NuDB.git";
26     rev = "2.0.5";
27     sha256 = "07dwvglhyzpqnhzd33a2vs80wrdxy55a3sirnd739xp1k5v8s2fx";
28     leaveDotGit = true;
29     fetchSubmodules = true;
30     postFetch = "cd $out && git tag ${rev}";
31   };
33   rocksdb = fetchgit {
34     url = "https://github.com/facebook/rocksdb.git";
35     rev = "v6.7.3";
36     sha256 = "0dzn5jg3i2mnnjj24dn9lzi3aajj5ga2akjf64lybyj481lq445k";
37     deepClone = true;
38     fetchSubmodules = false;
39     leaveDotGit = true;
40   };
42   lz4 = fetchgit rec {
43     url = "https://github.com/lz4/lz4.git";
44     rev = "v1.9.2";
45     sha256 = "0322xy2vfhxkb8akas7vwajjgcigq1q8l9f5fnfmavcsd6kmxmgg";
46     leaveDotGit = true;
47     fetchSubmodules = false;
48     postFetch = "cd $out && git tag ${rev}";
49   };
51   libarchive = fetchgit rec {
52     url = "https://github.com/libarchive/libarchive.git";
53     rev = "v3.4.3";
54     sha256 = "00yrzy2129vr4nfhigd91651984sl447dyfjfz26dmzvna5hwzp1";
55     leaveDotGit = true;
56     fetchSubmodules = false;
57     postFetch = "cd $out && git tag ${rev}";
58   };
60   soci = fetchgit {
61     url = "https://github.com/SOCI/soci.git";
62     rev = "04e1870294918d20761736743bb6136314c42dd5";
63     sha256 = "0w3b7qi3bwn8bxh4qbqy6c1fw2bbwh7pxvk8b3qb6h4qgsh6kx89";
64     leaveDotGit = true;
65     fetchSubmodules = false;
66   };
68   google-test = fetchgit {
69     url = "https://github.com/google/googletest.git";
70     rev = "5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081";
71     sha256 = "1ch7hq16z20ddhpc08slp9bny29j88x9vr6bi9r4yf5m77xbplja";
72     leaveDotGit = true;
73     fetchSubmodules = false;
74   };
76   google-benchmark = fetchgit {
77     url = "https://github.com/google/benchmark.git";
78     rev = "5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8";
79     sha256 = "0kcmb83framkncc50h0lyyz7v8nys6g19ja0h2p8x4sfafnnm6ig";
80     leaveDotGit = true;
81     fetchSubmodules = false;
82   };
84   date = fetchgit {
85     url = "https://github.com/HowardHinnant/date.git";
86     rev = "fc4cf092f9674f2670fb9177edcdee870399b829";
87     sha256 = "0w618p64mx2l074b6wd0xfc4h6312mabhvzabxxwsnzj4afpajcm";
88     leaveDotGit = true;
89     fetchSubmodules = false;
90   };
91 in stdenv.mkDerivation rec {
92   pname = "rippled";
93   version = "1.9.4";
95   src = fetchgit {
96     url = "https://github.com/ripple/rippled.git";
97     rev = version;
98     leaveDotGit = true;
99     fetchSubmodules = true;
100     hash = "sha256-VW/VmnhtF2xyHfEud3D6b3n8uTE0a/nDW1GISs5QfwM=";
101   };
103   patches = [
104     # Fix gcc-13 build due to missing <cstdint> includes:
105     #   https://github.com/XRPLF/rippled/pull/4555
106     (fetchpatch {
107       name = "gcc-13.patch";
108       url  = "https://github.com/XRPLF/rippled/commit/c9a586c2437bc8ffd22e946c82e1cbe906e1fc40.patch";
109       hash = "sha256-+4BDTMFoQWUHljgwGB1gtczVPQH/U5MA0ojbnBykceg=";
110       excludes = [ "src/ripple/basics/StringUtilities.h" ];
111     })
112   ];
114   hardeningDisable = ["format"];
115   cmakeFlags = ["-Dstatic=OFF" "-DBoost_NO_BOOST_CMAKE=ON" "-DSNAPPY_INCLUDE_DIR=${snappy}/include" ];
117   nativeBuildInputs = [ pkg-config cmake git ];
118   buildInputs = [ openssl openssl.dev boostSharedStatic grpc protobuf libnsl rocksdb_6_23 snappy ];
120   preConfigure = ''
121     export HOME=$PWD
123     git config --global protocol.file.allow always
124     git config --global url."file://${rocksdb}".insteadOf "${rocksdb.url}"
125     git config --global url."file://${docca}".insteadOf "${docca.url}"
126     git config --global url."file://${lz4}".insteadOf "${lz4.url}"
127     git config --global url."file://${libarchive}".insteadOf "${libarchive.url}"
128     git config --global url."file://${soci}".insteadOf "${soci.url}"
129     git config --global url."file://${nudb}".insteadOf "${nudb.url}"
130     git config --global url."file://${google-benchmark}".insteadOf "${google-benchmark.url}"
131     git config --global url."file://${google-test}".insteadOf "${google-test.url}"
132     git config --global url."file://${date}".insteadOf "${date.url}"
134     substituteInPlace Builds/CMake/deps/Sqlite.cmake --replace "http://www.sqlite.org/2018/sqlite-amalgamation-3260000.zip" ""
135     substituteInPlace Builds/CMake/deps/Sqlite.cmake --replace "https://www2.sqlite.org/2018/sqlite-amalgamation-3260000.zip" ""
136     substituteInPlace Builds/CMake/deps/Sqlite.cmake --replace "http://www2.sqlite.org/2018/sqlite-amalgamation-3260000.zip" ""
137     substituteInPlace Builds/CMake/deps/Sqlite.cmake --replace "URL ${sqlite3.url}" "URL ${sqlite3}"
139     substituteInPlace Builds/CMake/deps/Rocksdb.cmake --replace "RocksDB 6.27" "RocksDB"
140   '';
142   doCheck = true;
143   checkPhase = ''
144     ./rippled --unittest
145   '';
147   meta = with lib; {
148     description = "Ripple P2P payment network reference server";
149     homepage = "https://github.com/ripple/rippled";
150     maintainers = with maintainers; [ offline RaghavSood ];
151     license = licenses.isc;
152     platforms = platforms.linux;
153     mainProgram = "rippled";
154   };