Use ExternalProject for NIH dependencies

Fixes: RIPD-1648

 - use ExternalProject for snappy, lz4, SOCI, and sqlite3
 - use FetchContent for NuDB
 - update SOCI from 79e222e3c2278e6108137a2d26d3689418b37544 to
   3a1f602b3021b925d38828e3ff95f9e7f8887ff7
 - update lz4 from c10863b98e1503af90616ae99725ecd120265dfb to v1.8.2
 - update sqlite3 from 3.21 to 3.24
 - update snappy from b02bfa754ebf27921d8da3bd2517eab445b84ff9 to 1.1.7
 - update NuDB from 00adc6a4f16679a376f40c967f77dfa544c179c1 to 1.0.0
This commit is contained in:
Mike Ellery
2018-08-24 08:09:53 -07:00
committed by Nik Bougalis
parent 8a4951947d
commit 83dac8b382
14 changed files with 652 additions and 278 deletions

View File

@@ -16,15 +16,23 @@ Source folders:
| Folder | Upstream Repo | Description |
|:----------------|:---------------------------------------------|:------------|
| `beast` | https://github.com/boostorg/beast | Cross-platform library for WebSocket and HTTP built on [Boost.Asio](https://think-async.com/Asio) |
| `beast` | N/A | legacy utility code that was formerly associated with boost::beast
| `ed25519-donna` | https://github.com/floodyberry/ed25519-donna | [Ed25519](http://ed25519.cr.yp.to/) digital signatures |
| `lz4` | https://github.com/lz4/lz4 | LZ4 lossless compression algorithm |
| `nudb` | https://github.com/vinniefalco/NuDB | Constant-time insert-only key/value database for SSD drives (Less memory usage than RocksDB.) |
| `protobuf` | https://github.com/google/protobuf | Protocol buffer data interchange format. Ripple has changed some names in order to support the unity-style of build (a single .cpp added to the project, instead of linking to a separately built static library). |
| `ripple` | N/A | **Core source code for `rippled`** |
| `rocksdb2` | https://github.com/facebook/rocksdb | Fast key/value database. (Supports rotational disks better than NuDB.) |
| `secp256k1` | https://github.com/bitcoin-core/secp256k1 | ECDSA digital signatures using the **secp256k1** curve |
| `snappy` | https://github.com/google/snappy | "Snappy" lossless compression algorithm. (Technically, the source is in `snappy/snappy`, while `snappy/` also has config options that aren't part of the upstream repository.) |
| `soci` | https://github.com/SOCI/soci | Abstraction layer for database access. |
| `sqlite` | https://www.sqlite.org/src | An embedded database engine that writes to simple files. (Technically not a subtree, just a direct copy of the [SQLite source distribution](http://sqlite.org/download.html).) |
| `test` | N/A | **Unit tests for `rippled`** |
The following dependencies are downloaded and built using ExternalProject
(or FetchContent, where possible). Refer to CMakeLists.txt file for
details about how these sources are built :
| Name | Upstream Repo | Description |
|:----------------|:---------------------------------------------|:------------|
| `lz4` | https://github.com/lz4/lz4 | LZ4 lossless compression algorithm |
| `nudb` | https://github.com/vinniefalco/NuDB | Constant-time insert-only key/value database for SSD drives (Less memory usage than RocksDB.) |
| `snappy` | https://github.com/google/snappy | "Snappy" lossless compression algorithm. |
| `soci` | https://github.com/SOCI/soci | Abstraction layer for database access. |
| `sqlite` | https://www.sqlite.org/src | An embedded database engine that writes to simple files. |

View File

@@ -1,66 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2012-2015 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
/* Stub functions for soci dynamic backends.
Ripple does not use dynamic backends, and inclduing soci's
dynamic backends compilcates the build (it requires a generated
header file and some macros to be defined.)
*/
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
#endif
#include <ripple/basics/contract.h>
#include <ripple/core/SociDB.h>
#include <soci/sqlite3/soci-sqlite3.h>
// dummy soci-backend
namespace soci {
namespace dynamic_backends {
// used internally by session
backend_factory const& get (std::string const& name)
{
ripple::Throw<std::runtime_error> ("Not Supported");
return std::ref(soci::sqlite3); // Silence compiler warning.
};
// provided for advanced user-level management
std::vector<std::string>& search_paths ()
{
static std::vector<std::string> empty;
return empty;
};
void register_backend (std::string const&, std::string const&){};
void register_backend (std::string const&, backend_factory const&){};
std::vector<std::string> list_all ()
{
return {};
};
void unload (std::string const&){};
void unload_all (){};
} // namespace dynamic_backends
} // namespace soci
#if defined(__clang__)
#pragma clang diagnostic pop
#endif

View File

@@ -28,7 +28,7 @@
#include <ripple/nodestore/impl/varint.h>
#include <ripple/nodestore/NodeObject.h>
#include <ripple/protocol/HashPrefix.h>
#include <lz4/lib/lz4.h>
#include <lz4.h>
#include <cstddef>
#include <cstring>
#include <string>

View File

@@ -18,5 +18,4 @@
//==============================================================================
#include <ripple/core/impl/DummySociDynamicBackend.cpp>
#include <ripple/core/impl/SociDB.cpp>