From c1764020edf1ddca6e75e35dc362a37bc585d812 Mon Sep 17 00:00:00 2001 From: John Freeman Date: Tue, 27 Jun 2023 03:23:52 -0500 Subject: [PATCH] Fix package definition for Conan (#4485) Fix the libxrpl library target for consumers using Conan. * Fix installation issues and update includes. * Update requirements in the Conan package info. * libxrpl requires openssl::crypto. (Conan is a software package manager for C++.) --- Builds/CMake/RippledCore.cmake | 57 ++++++++++++++++--- conanfile.py | 6 +- src/ripple/protocol/impl/secp256k1.h | 2 +- src/secp256k1/CMakeLists.txt | 2 +- src/secp256k1/src/bench_ecdh.c | 4 +- src/secp256k1/src/bench_internal.c | 2 +- src/secp256k1/src/bench_recover.c | 4 +- src/secp256k1/src/bench_schnorr_verify.c | 4 +- src/secp256k1/src/bench_sign.c | 2 +- src/secp256k1/src/bench_verify.c | 2 +- src/secp256k1/src/gen_context.c | 2 +- .../src/java/org_bitcoin_NativeSecp256k1.c | 6 +- .../src/java/org_bitcoin_NativeSecp256k1.h | 2 +- .../src/java/org_bitcoin_Secp256k1Context.c | 2 +- .../src/java/org_bitcoin_Secp256k1Context.h | 2 +- src/secp256k1/src/modules/ecdh/main_impl.h | 2 +- .../src/modules/recovery/main_impl.h | 2 +- src/secp256k1/src/secp256k1.c | 2 +- src/secp256k1/src/tests.c | 2 +- src/secp256k1/src/tests_exhaustive.c | 4 +- 20 files changed, 79 insertions(+), 32 deletions(-) diff --git a/Builds/CMake/RippledCore.cmake b/Builds/CMake/RippledCore.cmake index 3b77e35c8c0..9f5813297b2 100644 --- a/Builds/CMake/RippledCore.cmake +++ b/Builds/CMake/RippledCore.cmake @@ -149,31 +149,54 @@ target_link_libraries (xrpl_core #]=================================] install ( FILES + src/ripple/basics/algorithm.h + src/ripple/basics/Archive.h src/ripple/basics/base64.h + src/ripple/basics/base_uint.h + src/ripple/basics/BasicConfig.h src/ripple/basics/Blob.h src/ripple/basics/Buffer.h + src/ripple/basics/ByteUtilities.h + src/ripple/basics/chrono.h + src/ripple/basics/comparators.h + src/ripple/basics/CompressionAlgorithms.h + src/ripple/basics/contract.h src/ripple/basics/CountedObject.h + src/ripple/basics/DecayingSample.h + src/ripple/basics/Expected.h + src/ripple/basics/FeeUnits.h src/ripple/basics/FileUtilities.h + src/ripple/basics/hardened_hash.h src/ripple/basics/IOUAmount.h + src/ripple/basics/join.h + src/ripple/basics/KeyCache.h src/ripple/basics/LocalValue.h src/ripple/basics/Log.h + src/ripple/basics/make_SSLContext.h src/ripple/basics/MathUtilities.h + src/ripple/basics/mulDiv.h src/ripple/basics/Number.h + src/ripple/basics/partitioned_unordered_map.h + src/ripple/basics/PerfLog.h + src/ripple/basics/random.h + src/ripple/basics/RangeSet.h + src/ripple/basics/README.md + src/ripple/basics/ResolverAsio.h + src/ripple/basics/Resolver.h src/ripple/basics/safe_cast.h + src/ripple/basics/scope.h + src/ripple/basics/SHAMapHash.h src/ripple/basics/Slice.h src/ripple/basics/spinlock.h + src/ripple/basics/strHex.h src/ripple/basics/StringUtilities.h + src/ripple/basics/TaggedCache.h + src/ripple/basics/tagged_integer.h src/ripple/basics/ThreadSafetyAnalysis.h src/ripple/basics/ToString.h src/ripple/basics/UnorderedContainers.h + src/ripple/basics/UptimeClock.h src/ripple/basics/XRPAmount.h - src/ripple/basics/algorithm.h - src/ripple/basics/base_uint.h - src/ripple/basics/chrono.h - src/ripple/basics/contract.h - src/ripple/basics/FeeUnits.h - src/ripple/basics/hardened_hash.h - src/ripple/basics/strHex.h DESTINATION include/ripple/basics) install ( FILES @@ -287,6 +310,26 @@ install ( src/ripple/beast/unit_test.h src/ripple/beast/xor_shift_engine.h DESTINATION include/ripple/beast) +install ( + FILES + src/ripple/beast/unit_test/amount.hpp + src/ripple/beast/unit_test/dstream.hpp + src/ripple/beast/unit_test/global_suites.hpp + src/ripple/beast/unit_test/main.cpp + src/ripple/beast/unit_test/match.hpp + src/ripple/beast/unit_test/recorder.hpp + src/ripple/beast/unit_test/reporter.hpp + src/ripple/beast/unit_test/results.hpp + src/ripple/beast/unit_test/runner.hpp + src/ripple/beast/unit_test/suite.hpp + src/ripple/beast/unit_test/suite_info.hpp + src/ripple/beast/unit_test/suite_list.hpp + src/ripple/beast/unit_test/thread.hpp + DESTINATION include/ripple/beast/unit_test) +install ( + FILES + src/ripple/beast/unit_test/detail/const_container.hpp + DESTINATION include/ripple/beast/unit_test/detail) install ( FILES src/ripple/beast/utility/Journal.h diff --git a/conanfile.py b/conanfile.py index 6e616b3c9f4..9c135d9e445 100644 --- a/conanfile.py +++ b/conanfile.py @@ -151,4 +151,8 @@ def package_info(self): 'libsecp256k1.a', ] libxrpl.includedirs = ['include'] - libxrpl.requires = ['boost::boost'] + libxrpl.requires = [ + 'boost::boost', + 'openssl::crypto', + 'date::date', + ] diff --git a/src/ripple/protocol/impl/secp256k1.h b/src/ripple/protocol/impl/secp256k1.h index 8877fff28cf..36f4d39a133 100644 --- a/src/ripple/protocol/impl/secp256k1.h +++ b/src/ripple/protocol/impl/secp256k1.h @@ -20,7 +20,7 @@ #ifndef RIPPLE_PROTOCOL_SECP256K1_H_INCLUDED #define RIPPLE_PROTOCOL_SECP256K1_H_INCLUDED -#include +#include namespace ripple { diff --git a/src/secp256k1/CMakeLists.txt b/src/secp256k1/CMakeLists.txt index 6b41b66c8ab..304ae00cb5f 100644 --- a/src/secp256k1/CMakeLists.txt +++ b/src/secp256k1/CMakeLists.txt @@ -24,7 +24,7 @@ target_compile_definitions(secp256k1 PRIVATE ) target_include_directories(secp256k1 PUBLIC $ - PRIVATE $ + PUBLIC $ ) target_compile_options(secp256k1 PRIVATE $<$:-wd4319> diff --git a/src/secp256k1/src/bench_ecdh.c b/src/secp256k1/src/bench_ecdh.c index cde5e2dbb4e..0cf47f7f652 100644 --- a/src/secp256k1/src/bench_ecdh.c +++ b/src/secp256k1/src/bench_ecdh.c @@ -6,8 +6,8 @@ #include -#include "include/secp256k1.h" -#include "include/secp256k1_ecdh.h" +#include "secp256k1.h" +#include "secp256k1_ecdh.h" #include "util.h" #include "bench.h" diff --git a/src/secp256k1/src/bench_internal.c b/src/secp256k1/src/bench_internal.c index 0809f77bda1..66b690109b7 100644 --- a/src/secp256k1/src/bench_internal.c +++ b/src/secp256k1/src/bench_internal.c @@ -5,7 +5,7 @@ **********************************************************************/ #include -#include "include/secp256k1.h" +#include "secp256k1.h" #include "util.h" #include "hash_impl.h" diff --git a/src/secp256k1/src/bench_recover.c b/src/secp256k1/src/bench_recover.c index 6489378cc64..e59120333ae 100644 --- a/src/secp256k1/src/bench_recover.c +++ b/src/secp256k1/src/bench_recover.c @@ -4,8 +4,8 @@ * file COPYING or http://www.opensource.org/licenses/mit-license.php.* **********************************************************************/ -#include "include/secp256k1.h" -#include "include/secp256k1_recovery.h" +#include "secp256k1.h" +#include "secp256k1_recovery.h" #include "util.h" #include "bench.h" diff --git a/src/secp256k1/src/bench_schnorr_verify.c b/src/secp256k1/src/bench_schnorr_verify.c index 5f137dda23e..f5c3312d8a5 100644 --- a/src/secp256k1/src/bench_schnorr_verify.c +++ b/src/secp256k1/src/bench_schnorr_verify.c @@ -7,8 +7,8 @@ #include #include -#include "include/secp256k1.h" -#include "include/secp256k1_schnorr.h" +#include "secp256k1.h" +#include "secp256k1_schnorr.h" #include "util.h" #include "bench.h" diff --git a/src/secp256k1/src/bench_sign.c b/src/secp256k1/src/bench_sign.c index ed7224d757e..2ff60e2a14b 100644 --- a/src/secp256k1/src/bench_sign.c +++ b/src/secp256k1/src/bench_sign.c @@ -4,7 +4,7 @@ * file COPYING or http://www.opensource.org/licenses/mit-license.php.* **********************************************************************/ -#include "include/secp256k1.h" +#include "secp256k1.h" #include "util.h" #include "bench.h" diff --git a/src/secp256k1/src/bench_verify.c b/src/secp256k1/src/bench_verify.c index 418defa0aa2..ed454e90baf 100644 --- a/src/secp256k1/src/bench_verify.c +++ b/src/secp256k1/src/bench_verify.c @@ -7,7 +7,7 @@ #include #include -#include "include/secp256k1.h" +#include "secp256k1.h" #include "util.h" #include "bench.h" diff --git a/src/secp256k1/src/gen_context.c b/src/secp256k1/src/gen_context.c index 1835fd491d1..7247fbee0ef 100644 --- a/src/secp256k1/src/gen_context.c +++ b/src/secp256k1/src/gen_context.c @@ -7,7 +7,7 @@ #define USE_BASIC_CONFIG 1 #include "basic-config.h" -#include "include/secp256k1.h" +#include "secp256k1.h" #include "field_impl.h" #include "scalar_impl.h" #include "group_impl.h" diff --git a/src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.c b/src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.c index bcef7b32ce3..3970b655a49 100644 --- a/src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.c +++ b/src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.c @@ -2,9 +2,9 @@ #include #include #include "org_bitcoin_NativeSecp256k1.h" -#include "include/secp256k1.h" -#include "include/secp256k1_ecdh.h" -#include "include/secp256k1_recovery.h" +#include "secp256k1.h" +#include "secp256k1_ecdh.h" +#include "secp256k1_recovery.h" SECP256K1_API jlong JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ctx_1clone diff --git a/src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.h b/src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.h index fe613c9e9e7..665cf4dd5c7 100644 --- a/src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.h +++ b/src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.h @@ -1,6 +1,6 @@ /* DO NOT EDIT THIS FILE - it is machine generated */ #include -#include "include/secp256k1.h" +#include "secp256k1.h" /* Header for class org_bitcoin_NativeSecp256k1 */ #ifndef _Included_org_bitcoin_NativeSecp256k1 diff --git a/src/secp256k1/src/java/org_bitcoin_Secp256k1Context.c b/src/secp256k1/src/java/org_bitcoin_Secp256k1Context.c index a52939e7e7d..81a87a10e93 100644 --- a/src/secp256k1/src/java/org_bitcoin_Secp256k1Context.c +++ b/src/secp256k1/src/java/org_bitcoin_Secp256k1Context.c @@ -1,7 +1,7 @@ #include #include #include "org_bitcoin_Secp256k1Context.h" -#include "include/secp256k1.h" +#include "secp256k1.h" SECP256K1_API jlong JNICALL Java_org_bitcoin_Secp256k1Context_secp256k1_1init_1context (JNIEnv* env, jclass classObject) diff --git a/src/secp256k1/src/java/org_bitcoin_Secp256k1Context.h b/src/secp256k1/src/java/org_bitcoin_Secp256k1Context.h index 0d2bc84b7f3..f1ed91ad87d 100644 --- a/src/secp256k1/src/java/org_bitcoin_Secp256k1Context.h +++ b/src/secp256k1/src/java/org_bitcoin_Secp256k1Context.h @@ -1,6 +1,6 @@ /* DO NOT EDIT THIS FILE - it is machine generated */ #include -#include "include/secp256k1.h" +#include "secp256k1.h" /* Header for class org_bitcoin_Secp256k1Context */ #ifndef _Included_org_bitcoin_Secp256k1Context diff --git a/src/secp256k1/src/modules/ecdh/main_impl.h b/src/secp256k1/src/modules/ecdh/main_impl.h index 9e30fb73dd7..bd22b2fd1ca 100644 --- a/src/secp256k1/src/modules/ecdh/main_impl.h +++ b/src/secp256k1/src/modules/ecdh/main_impl.h @@ -7,7 +7,7 @@ #ifndef _SECP256K1_MODULE_ECDH_MAIN_ #define _SECP256K1_MODULE_ECDH_MAIN_ -#include "include/secp256k1_ecdh.h" +#include "secp256k1_ecdh.h" #include "ecmult_const_impl.h" int secp256k1_ecdh(const secp256k1_context* ctx, unsigned char *result, const secp256k1_pubkey *point, const unsigned char *scalar) { diff --git a/src/secp256k1/src/modules/recovery/main_impl.h b/src/secp256k1/src/modules/recovery/main_impl.h index c6fbe239813..c2c66e3990d 100755 --- a/src/secp256k1/src/modules/recovery/main_impl.h +++ b/src/secp256k1/src/modules/recovery/main_impl.h @@ -7,7 +7,7 @@ #ifndef _SECP256K1_MODULE_RECOVERY_MAIN_ #define _SECP256K1_MODULE_RECOVERY_MAIN_ -#include "include/secp256k1_recovery.h" +#include "secp256k1_recovery.h" static void secp256k1_ecdsa_recoverable_signature_load(const secp256k1_context* ctx, secp256k1_scalar* r, secp256k1_scalar* s, int* recid, const secp256k1_ecdsa_recoverable_signature* sig) { (void)ctx; diff --git a/src/secp256k1/src/secp256k1.c b/src/secp256k1/src/secp256k1.c index fb8b882faaf..1db0b6b6a0a 100644 --- a/src/secp256k1/src/secp256k1.c +++ b/src/secp256k1/src/secp256k1.c @@ -4,7 +4,7 @@ * file COPYING or http://www.opensource.org/licenses/mit-license.php.* **********************************************************************/ -#include "include/secp256k1.h" +#include "secp256k1.h" #include "util.h" #include "num_impl.h" diff --git a/src/secp256k1/src/tests.c b/src/secp256k1/src/tests.c index 9ae7d302813..1ca75297b54 100644 --- a/src/secp256k1/src/tests.c +++ b/src/secp256k1/src/tests.c @@ -14,7 +14,7 @@ #include #include "secp256k1.c" -#include "include/secp256k1.h" +#include "secp256k1.h" #include "testrand_impl.h" #ifdef ENABLE_OPENSSL_TESTS diff --git a/src/secp256k1/src/tests_exhaustive.c b/src/secp256k1/src/tests_exhaustive.c index b040bb0733d..645fb9b3022 100644 --- a/src/secp256k1/src/tests_exhaustive.c +++ b/src/secp256k1/src/tests_exhaustive.c @@ -21,14 +21,14 @@ #define EXHAUSTIVE_TEST_LAMBDA 9 /* cube root of 1 mod 13 */ #endif -#include "include/secp256k1.h" +#include "secp256k1.h" #include "group.h" #include "secp256k1.c" #include "testrand_impl.h" #ifdef ENABLE_MODULE_RECOVERY #include "src/modules/recovery/main_impl.h" -#include "include/secp256k1_recovery.h" +#include "secp256k1_recovery.h" #endif /** stolen from tests.c */