2024-02-25 12:43:42 +00:00
|
|
|
{ lib, stdenv, fetchgit, fetchurl, fetchpatch, git, cmake, pkg-config
|
2023-06-06 21:14:13 +00:00
|
|
|
, openssl, boost, grpc, protobuf, libnsl, rocksdb_6_23, snappy }:
|
2014-03-26 22:12:00 +00:00
|
|
|
|
2019-02-13 16:52:06 +00:00
|
|
|
let
|
2019-10-03 11:29:58 +00:00
|
|
|
sqlite3 = fetchurl rec {
|
2019-02-13 16:52:06 +00:00
|
|
|
url = "https://www.sqlite.org/2018/sqlite-amalgamation-3260000.zip";
|
|
|
|
sha256 = "0vh9aa5dyvdwsyd8yp88ss300mv2c2m40z79z569lcxa6fqwlpfy";
|
2019-10-03 11:29:58 +00:00
|
|
|
passthru.url = url;
|
2019-02-13 16:52:06 +00:00
|
|
|
};
|
|
|
|
|
2020-07-05 03:00:10 +00:00
|
|
|
boostSharedStatic = boost.override {
|
2020-11-18 22:54:29 +00:00
|
|
|
enableShared = true;
|
2020-07-05 03:00:10 +00:00
|
|
|
enabledStatic = true;
|
|
|
|
};
|
|
|
|
|
2019-02-13 16:52:06 +00:00
|
|
|
docca = fetchgit {
|
|
|
|
url = "https://github.com/vinniefalco/docca.git";
|
|
|
|
rev = "335dbf9c3613e997ed56d540cc8c5ff2e28cab2d";
|
2020-07-05 03:00:10 +00:00
|
|
|
sha256 = "09cb90k0ygmnlpidybv6nzf6is51i80lnwlvad6ijc3gf1z6i1yh";
|
2019-10-03 11:29:58 +00:00
|
|
|
fetchSubmodules = false;
|
2020-07-05 03:00:10 +00:00
|
|
|
leaveDotGit = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
nudb = fetchgit rec {
|
|
|
|
url = "https://github.com/CPPAlliance/NuDB.git";
|
2021-04-08 16:48:37 +00:00
|
|
|
rev = "2.0.5";
|
2021-05-22 14:08:15 +00:00
|
|
|
sha256 = "07dwvglhyzpqnhzd33a2vs80wrdxy55a3sirnd739xp1k5v8s2fx";
|
2020-07-05 03:00:10 +00:00
|
|
|
leaveDotGit = true;
|
|
|
|
fetchSubmodules = true;
|
|
|
|
postFetch = "cd $out && git tag ${rev}";
|
2019-02-13 16:52:06 +00:00
|
|
|
};
|
|
|
|
|
2023-06-06 21:14:13 +00:00
|
|
|
rocksdb = fetchgit {
|
2019-02-13 16:52:06 +00:00
|
|
|
url = "https://github.com/facebook/rocksdb.git";
|
2021-04-08 16:48:37 +00:00
|
|
|
rev = "v6.7.3";
|
2021-05-22 14:08:15 +00:00
|
|
|
sha256 = "0dzn5jg3i2mnnjj24dn9lzi3aajj5ga2akjf64lybyj481lq445k";
|
2020-07-05 03:00:10 +00:00
|
|
|
deepClone = true;
|
2019-10-03 11:29:58 +00:00
|
|
|
fetchSubmodules = false;
|
2020-07-05 03:00:10 +00:00
|
|
|
leaveDotGit = true;
|
2019-02-13 16:52:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
lz4 = fetchgit rec {
|
|
|
|
url = "https://github.com/lz4/lz4.git";
|
2020-08-20 14:02:57 +00:00
|
|
|
rev = "v1.9.2";
|
|
|
|
sha256 = "0322xy2vfhxkb8akas7vwajjgcigq1q8l9f5fnfmavcsd6kmxmgg";
|
2019-02-13 16:52:06 +00:00
|
|
|
leaveDotGit = true;
|
|
|
|
fetchSubmodules = false;
|
|
|
|
postFetch = "cd $out && git tag ${rev}";
|
|
|
|
};
|
|
|
|
|
|
|
|
libarchive = fetchgit rec {
|
|
|
|
url = "https://github.com/libarchive/libarchive.git";
|
2020-08-20 14:02:57 +00:00
|
|
|
rev = "v3.4.3";
|
|
|
|
sha256 = "00yrzy2129vr4nfhigd91651984sl447dyfjfz26dmzvna5hwzp1";
|
2019-02-13 16:52:06 +00:00
|
|
|
leaveDotGit = true;
|
|
|
|
fetchSubmodules = false;
|
|
|
|
postFetch = "cd $out && git tag ${rev}";
|
|
|
|
};
|
|
|
|
|
2019-08-13 21:52:01 +00:00
|
|
|
soci = fetchgit {
|
2019-02-13 16:52:06 +00:00
|
|
|
url = "https://github.com/SOCI/soci.git";
|
2019-10-03 11:29:58 +00:00
|
|
|
rev = "04e1870294918d20761736743bb6136314c42dd5";
|
|
|
|
sha256 = "0w3b7qi3bwn8bxh4qbqy6c1fw2bbwh7pxvk8b3qb6h4qgsh6kx89";
|
2019-02-13 16:52:06 +00:00
|
|
|
leaveDotGit = true;
|
|
|
|
fetchSubmodules = false;
|
|
|
|
};
|
|
|
|
|
2019-08-13 21:52:01 +00:00
|
|
|
google-test = fetchgit {
|
2019-02-13 16:52:06 +00:00
|
|
|
url = "https://github.com/google/googletest.git";
|
2020-07-05 03:00:10 +00:00
|
|
|
rev = "5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081";
|
|
|
|
sha256 = "1ch7hq16z20ddhpc08slp9bny29j88x9vr6bi9r4yf5m77xbplja";
|
2019-10-03 11:29:58 +00:00
|
|
|
leaveDotGit = true;
|
2020-07-05 03:00:10 +00:00
|
|
|
fetchSubmodules = false;
|
2019-02-13 16:52:06 +00:00
|
|
|
};
|
|
|
|
|
2019-08-13 21:52:01 +00:00
|
|
|
google-benchmark = fetchgit {
|
2019-02-13 16:52:06 +00:00
|
|
|
url = "https://github.com/google/benchmark.git";
|
|
|
|
rev = "5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8";
|
2020-07-05 03:00:10 +00:00
|
|
|
sha256 = "0kcmb83framkncc50h0lyyz7v8nys6g19ja0h2p8x4sfafnnm6ig";
|
2019-10-03 11:29:58 +00:00
|
|
|
leaveDotGit = true;
|
2020-07-05 03:00:10 +00:00
|
|
|
fetchSubmodules = false;
|
2019-02-13 16:52:06 +00:00
|
|
|
};
|
2019-10-03 11:29:58 +00:00
|
|
|
|
2020-07-05 03:00:10 +00:00
|
|
|
date = fetchgit {
|
|
|
|
url = "https://github.com/HowardHinnant/date.git";
|
|
|
|
rev = "fc4cf092f9674f2670fb9177edcdee870399b829";
|
|
|
|
sha256 = "0w618p64mx2l074b6wd0xfc4h6312mabhvzabxxwsnzj4afpajcm";
|
|
|
|
leaveDotGit = true;
|
|
|
|
fetchSubmodules = false;
|
|
|
|
};
|
2019-02-13 16:52:06 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "rippled";
|
2023-06-06 21:14:13 +00:00
|
|
|
version = "1.9.4";
|
2014-03-26 22:12:00 +00:00
|
|
|
|
2020-07-05 03:00:10 +00:00
|
|
|
src = fetchgit {
|
|
|
|
url = "https://github.com/ripple/rippled.git";
|
2015-03-18 19:30:49 +00:00
|
|
|
rev = version;
|
2020-07-05 03:00:10 +00:00
|
|
|
leaveDotGit = true;
|
|
|
|
fetchSubmodules = true;
|
2023-06-06 21:14:13 +00:00
|
|
|
hash = "sha256-VW/VmnhtF2xyHfEud3D6b3n8uTE0a/nDW1GISs5QfwM=";
|
2014-03-26 22:12:00 +00:00
|
|
|
};
|
|
|
|
|
2024-02-25 12:43:42 +00:00
|
|
|
patches = [
|
|
|
|
# Fix gcc-13 build due to missing <cstdint> includes:
|
|
|
|
# https://github.com/XRPLF/rippled/pull/4555
|
|
|
|
(fetchpatch {
|
|
|
|
name = "gcc-13.patch";
|
|
|
|
url = "https://github.com/XRPLF/rippled/commit/c9a586c2437bc8ffd22e946c82e1cbe906e1fc40.patch";
|
|
|
|
hash = "sha256-+4BDTMFoQWUHljgwGB1gtczVPQH/U5MA0ojbnBykceg=";
|
|
|
|
excludes = [ "src/ripple/basics/StringUtilities.h" ];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2019-02-13 16:52:06 +00:00
|
|
|
hardeningDisable = ["format"];
|
2023-06-06 21:14:13 +00:00
|
|
|
cmakeFlags = ["-Dstatic=OFF" "-DBoost_NO_BOOST_CMAKE=ON" "-DSNAPPY_INCLUDE_DIR=${snappy}/include" ];
|
2019-02-13 16:52:06 +00:00
|
|
|
|
2020-12-31 07:48:55 +00:00
|
|
|
nativeBuildInputs = [ pkg-config cmake git ];
|
2023-06-06 21:14:13 +00:00
|
|
|
buildInputs = [ openssl openssl.dev boostSharedStatic grpc protobuf libnsl rocksdb_6_23 snappy ];
|
2014-03-26 22:12:00 +00:00
|
|
|
|
2019-02-13 16:52:06 +00:00
|
|
|
preConfigure = ''
|
|
|
|
export HOME=$PWD
|
|
|
|
|
2023-06-06 21:14:13 +00:00
|
|
|
git config --global protocol.file.allow always
|
2020-07-05 03:00:10 +00:00
|
|
|
git config --global url."file://${rocksdb}".insteadOf "${rocksdb.url}"
|
2019-10-03 11:29:58 +00:00
|
|
|
git config --global url."file://${docca}".insteadOf "${docca.url}"
|
2019-02-13 16:52:06 +00:00
|
|
|
git config --global url."file://${lz4}".insteadOf "${lz4.url}"
|
|
|
|
git config --global url."file://${libarchive}".insteadOf "${libarchive.url}"
|
|
|
|
git config --global url."file://${soci}".insteadOf "${soci.url}"
|
|
|
|
git config --global url."file://${nudb}".insteadOf "${nudb.url}"
|
|
|
|
git config --global url."file://${google-benchmark}".insteadOf "${google-benchmark.url}"
|
|
|
|
git config --global url."file://${google-test}".insteadOf "${google-test.url}"
|
2020-07-05 03:00:10 +00:00
|
|
|
git config --global url."file://${date}".insteadOf "${date.url}"
|
2019-02-13 16:52:06 +00:00
|
|
|
|
2020-11-18 22:54:29 +00:00
|
|
|
substituteInPlace Builds/CMake/deps/Sqlite.cmake --replace "http://www.sqlite.org/2018/sqlite-amalgamation-3260000.zip" ""
|
|
|
|
substituteInPlace Builds/CMake/deps/Sqlite.cmake --replace "https://www2.sqlite.org/2018/sqlite-amalgamation-3260000.zip" ""
|
|
|
|
substituteInPlace Builds/CMake/deps/Sqlite.cmake --replace "http://www2.sqlite.org/2018/sqlite-amalgamation-3260000.zip" ""
|
2019-10-03 11:29:58 +00:00
|
|
|
substituteInPlace Builds/CMake/deps/Sqlite.cmake --replace "URL ${sqlite3.url}" "URL ${sqlite3}"
|
2023-06-06 21:14:13 +00:00
|
|
|
|
|
|
|
substituteInPlace Builds/CMake/deps/Rocksdb.cmake --replace "RocksDB 6.27" "RocksDB"
|
2019-02-13 16:52:06 +00:00
|
|
|
'';
|
2014-03-26 22:12:00 +00:00
|
|
|
|
2019-02-13 16:52:06 +00:00
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
|
|
|
./rippled --unittest
|
2014-03-26 22:12:00 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2014-03-26 22:12:00 +00:00
|
|
|
description = "Ripple P2P payment network reference server";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/ripple/rippled";
|
2021-03-23 09:20:20 +00:00
|
|
|
maintainers = with maintainers; [ offline RaghavSood ];
|
2015-03-18 19:30:49 +00:00
|
|
|
license = licenses.isc;
|
2023-06-06 21:14:13 +00:00
|
|
|
platforms = platforms.linux;
|
2023-11-23 21:09:35 +00:00
|
|
|
mainProgram = "rippled";
|
2014-03-26 22:12:00 +00:00
|
|
|
};
|
2014-09-19 17:56:08 +00:00
|
|
|
}
|