Skip to content

Commit

Permalink
Fix package definition for Conan (#4485)
Browse files Browse the repository at this point in the history
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++.)
  • Loading branch information
thejohnfreeman authored Jun 27, 2023
1 parent 534a365 commit 6b4437d
Show file tree
Hide file tree
Showing 20 changed files with 79 additions and 32 deletions.
57 changes: 50 additions & 7 deletions Builds/CMake/RippledCore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]
2 changes: 1 addition & 1 deletion src/ripple/protocol/impl/secp256k1.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#ifndef RIPPLE_PROTOCOL_SECP256K1_H_INCLUDED
#define RIPPLE_PROTOCOL_SECP256K1_H_INCLUDED

#include <secp256k1/include/secp256k1.h>
#include <secp256k1.h>

namespace ripple {

Expand Down
2 changes: 1 addition & 1 deletion src/secp256k1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ target_compile_definitions(secp256k1 PRIVATE
)
target_include_directories(secp256k1
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
target_compile_options(secp256k1 PRIVATE
$<$<C_COMPILER_ID:MSVC>:-wd4319>
Expand Down
4 changes: 2 additions & 2 deletions src/secp256k1/src/bench_ecdh.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include <string.h>

#include "include/secp256k1.h"
#include "include/secp256k1_ecdh.h"
#include "secp256k1.h"
#include "secp256k1_ecdh.h"
#include "util.h"
#include "bench.h"

Expand Down
2 changes: 1 addition & 1 deletion src/secp256k1/src/bench_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
**********************************************************************/
#include <stdio.h>

#include "include/secp256k1.h"
#include "secp256k1.h"

#include "util.h"
#include "hash_impl.h"
Expand Down
4 changes: 2 additions & 2 deletions src/secp256k1/src/bench_recover.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions src/secp256k1/src/bench_schnorr_verify.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#include <stdio.h>
#include <string.h>

#include "include/secp256k1.h"
#include "include/secp256k1_schnorr.h"
#include "secp256k1.h"
#include "secp256k1_schnorr.h"
#include "util.h"
#include "bench.h"

Expand Down
2 changes: 1 addition & 1 deletion src/secp256k1/src/bench_sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion src/secp256k1/src/bench_verify.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <stdio.h>
#include <string.h>

#include "include/secp256k1.h"
#include "secp256k1.h"
#include "util.h"
#include "bench.h"

Expand Down
2 changes: 1 addition & 1 deletion src/secp256k1/src/gen_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#include <stdint.h>
#include <string.h>
#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
Expand Down
2 changes: 1 addition & 1 deletion src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/secp256k1/src/java/org_bitcoin_Secp256k1Context.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <stdlib.h>
#include <stdint.h>
#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)
Expand Down
2 changes: 1 addition & 1 deletion src/secp256k1/src/java/org_bitcoin_Secp256k1Context.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/secp256k1/src/modules/ecdh/main_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/secp256k1/src/modules/recovery/main_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/secp256k1/src/secp256k1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/secp256k1/src/tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <time.h>

#include "secp256k1.c"
#include "include/secp256k1.h"
#include "secp256k1.h"
#include "testrand_impl.h"

#ifdef ENABLE_OPENSSL_TESTS
Expand Down
4 changes: 2 additions & 2 deletions src/secp256k1/src/tests_exhaustive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 6b4437d

Please sign in to comment.