Skip to content

Commit 47f63d0

Browse files
authored
Add a selection of private headers to the secp256k1 package (#35)
https://github.com/XRPLF/mpt-crypto library uses some private headers of secp256k1. So, I copy them (and their dependencies) to `include/private`. This allows conan to be used for secp256k1 library
1 parent 612fb15 commit 47f63d0

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

recipes/secp256k1/all/conanfile.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from conan import ConanFile, tools
22
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
3-
from conan.tools.files import get
3+
from conan.tools.files import get, copy
4+
import os
45

56
required_conan_version = ">=2.0.0"
67

@@ -44,6 +45,17 @@ def package(self):
4445
cmake = CMake(self)
4546
cmake.install()
4647

48+
# These headers are used by XRPLF/mpt-crypto which is why we need to package them.
49+
src_headers = ["util.h", "int128.h", "int128_impl.h", "scalar.h", "scalar_impl.h"]
50+
src_headers_dependencies = ["checkmem.h", "int128_native.h", "int128_native_impl.h", "scalar_4x64.h", "scalar_4x64_impl.h", "modinv64.h", "modinv64_impl.h"]
51+
for header in src_headers + src_headers_dependencies:
52+
copy(
53+
self,
54+
header,
55+
src=os.path.join(self.source_folder, "src"),
56+
dst=os.path.join(self.package_folder, "include", "private")
57+
)
58+
4759
def package_info(self):
4860
self.cpp_info.libs = ["secp256k1"]
4961
self.cpp_info.set_property("cmake_file_name", "secp256k1")

0 commit comments

Comments
 (0)