nixpkgs/pkgs/servers/rippled/default.nix

165 lines
5.3 KiB
Nix
Raw Normal View History

2019-10-03 12:29:58 +01:00
{ stdenv, fetchFromGitHub, fetchgit, fetchurl, runCommand, git, cmake, pkgconfig
2020-07-05 04:00:10 +01:00
, openssl, zlib, boost, grpc, c-ares, abseil-cpp, protobuf3_8 }:
2019-02-13 16:52:06 +00:00
let
2019-10-03 12:29:58 +01: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 12:29:58 +01:00
passthru.url = url;
2019-02-13 16:52:06 +00:00
};
2020-07-05 04:00:10 +01:00
boostSharedStatic = boost.override {
enableShared = true;
enabledStatic = true;
};
beast = fetchgit {
url = "https://github.com/boostorg/beast.git";
rev = "2f9a8440c2432d8a196571d6300404cb76314125";
sha256 = "1n9ms5cn67b0p0mhldz5psgylds22sm5x22q7knrsf20856vlk5a";
fetchSubmodules = false;
leaveDotGit = true;
};
2019-02-13 16:52:06 +00:00
docca = fetchgit {
url = "https://github.com/vinniefalco/docca.git";
rev = "335dbf9c3613e997ed56d540cc8c5ff2e28cab2d";
2020-07-05 04:00:10 +01:00
sha256 = "09cb90k0ygmnlpidybv6nzf6is51i80lnwlvad6ijc3gf1z6i1yh";
2019-10-03 12:29:58 +01:00
fetchSubmodules = false;
2020-07-05 04:00:10 +01:00
leaveDotGit = true;
};
nudb = fetchgit rec {
url = "https://github.com/CPPAlliance/NuDB.git";
rev = "2.0.1";
sha256 = "10hlp2k7pc0c705f8sk0qw6mjfky0k08cjhh262bbjvp9fbdc7r4";
leaveDotGit = true;
fetchSubmodules = true;
postFetch = "cd $out && git tag ${rev}";
2019-02-13 16:52:06 +00:00
};
2019-10-03 12:29:58 +01:00
rocksdb = fetchgit rec {
2019-02-13 16:52:06 +00:00
url = "https://github.com/facebook/rocksdb.git";
2020-07-05 04:00:10 +01:00
rev = "v6.5.3";
sha256 = "11kbwqph1i3w6rbhr0kl2aq4jidhai24gw420y9qi9ab7zl0zcqg";
deepClone = true;
2019-10-03 12:29:58 +01:00
fetchSubmodules = false;
2020-07-05 04:00:10 +01:00
leaveDotGit = true;
2019-02-13 16:52:06 +00:00
};
lz4 = fetchgit rec {
url = "https://github.com/lz4/lz4.git";
rev = "v1.8.2";
sha256 = "1niv553q60hwn95yflzmrqkp1046hrid13h0yr36lm4fjza21h9w";
leaveDotGit = true;
fetchSubmodules = false;
postFetch = "cd $out && git tag ${rev}";
};
libarchive = fetchgit rec {
url = "https://github.com/libarchive/libarchive.git";
rev = "v3.3.3";
sha256 = "165imgfmizpi4ffpiwfs8gxysn6lw3y1fxj5rga98filkl7hxs31";
leaveDotGit = true;
fetchSubmodules = false;
postFetch = "cd $out && git tag ${rev}";
};
2019-08-13 22:52:01 +01:00
soci = fetchgit {
2019-02-13 16:52:06 +00:00
url = "https://github.com/SOCI/soci.git";
2019-10-03 12:29:58 +01:00
rev = "04e1870294918d20761736743bb6136314c42dd5";
sha256 = "0w3b7qi3bwn8bxh4qbqy6c1fw2bbwh7pxvk8b3qb6h4qgsh6kx89";
2019-02-13 16:52:06 +00:00
leaveDotGit = true;
fetchSubmodules = false;
};
snappy = fetchgit rec {
url = "https://github.com/google/snappy.git";
rev = "1.1.7";
sha256 = "1f0i0sz5gc8aqd594zn3py6j4w86gi1xry6qaz2vzyl4w7cb4v35";
leaveDotGit = true;
fetchSubmodules = false;
postFetch = "cd $out && git tag ${rev}";
};
2020-07-05 04:00:10 +01:00
cares = fetchgit rec {
url = "https://github.com/c-ares/c-ares.git";
rev = "cares-1_15_0";
sha256 = "1fkzsyhfk5p5hr4dx4r36pg9xzs0md6cyj1q2dni3cjgqj3s518v";
2019-02-13 16:52:06 +00:00
leaveDotGit = true;
fetchSubmodules = false;
postFetch = "cd $out && git tag ${rev}";
};
2019-08-13 22:52:01 +01:00
google-test = fetchgit {
2019-02-13 16:52:06 +00:00
url = "https://github.com/google/googletest.git";
2020-07-05 04:00:10 +01:00
rev = "5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081";
sha256 = "1ch7hq16z20ddhpc08slp9bny29j88x9vr6bi9r4yf5m77xbplja";
2019-10-03 12:29:58 +01:00
leaveDotGit = true;
2020-07-05 04:00:10 +01:00
fetchSubmodules = false;
2019-02-13 16:52:06 +00:00
};
2019-08-13 22:52:01 +01:00
google-benchmark = fetchgit {
2019-02-13 16:52:06 +00:00
url = "https://github.com/google/benchmark.git";
rev = "5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8";
2020-07-05 04:00:10 +01:00
sha256 = "0kcmb83framkncc50h0lyyz7v8nys6g19ja0h2p8x4sfafnnm6ig";
2019-10-03 12:29:58 +01:00
leaveDotGit = true;
2020-07-05 04:00:10 +01:00
fetchSubmodules = false;
2019-02-13 16:52:06 +00:00
};
2019-10-03 12:29:58 +01:00
2020-07-05 04:00:10 +01: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 {
pname = "rippled";
2020-07-05 04:00:10 +01:00
version = "1.5.0";
2020-07-05 04:00:10 +01:00
src = fetchgit {
url = "https://github.com/ripple/rippled.git";
2015-03-18 19:30:49 +00:00
rev = version;
2020-07-05 04:00:10 +01:00
sha256 = "0nh0x1ygrj3fw558vxbcp0md80qh27yrp3xhdlasrir7h1l2nplv";
leaveDotGit = true;
fetchSubmodules = true;
};
2019-02-13 16:52:06 +00:00
hardeningDisable = ["format"];
2020-07-05 04:00:10 +01:00
cmakeFlags = ["-Dstatic=OFF" "-DBoost_NO_BOOST_CMAKE=ON"];
2019-02-13 16:52:06 +00:00
nativeBuildInputs = [ pkgconfig cmake git ];
2020-07-05 04:00:10 +01:00
buildInputs = [ openssl openssl.dev boostSharedStatic zlib grpc c-ares c-ares.cmake-config abseil-cpp protobuf3_8 ];
2019-02-13 16:52:06 +00:00
preConfigure = ''
export HOME=$PWD
2020-07-05 04:00:10 +01:00
git config --global url."file://${rocksdb}".insteadOf "${rocksdb.url}"
2019-10-03 12:29:58 +01: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://${snappy}".insteadOf "${snappy.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 04:00:10 +01:00
git config --global url."file://${date}".insteadOf "${date.url}"
2019-02-13 16:52:06 +00:00
2019-10-03 12:29:58 +01:00
substituteInPlace Builds/CMake/deps/Sqlite.cmake --replace "URL ${sqlite3.url}" "URL ${sqlite3}"
2019-02-13 16:52:06 +00:00
'';
2019-02-13 16:52:06 +00:00
doCheck = true;
checkPhase = ''
./rippled --unittest
'';
2015-03-18 19:30:49 +00:00
meta = with stdenv.lib; {
description = "Ripple P2P payment network reference server";
homepage = "https://github.com/ripple/rippled";
2020-07-06 03:00:09 +01:00
maintainers = with maintainers; [ ehmry offline RaghavSood ];
2015-03-18 19:30:49 +00:00
license = licenses.isc;
2015-04-16 17:16:14 +01:00
platforms = [ "x86_64-linux" ];
};
2014-09-19 18:56:08 +01:00
}