Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion recipes/secp256k1/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from conan import ConanFile, tools
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import get
from conan.tools.files import get, copy
import os

required_conan_version = ">=2.0.0"

Expand Down Expand Up @@ -44,6 +45,17 @@ def package(self):
cmake = CMake(self)
cmake.install()

# These headers are used by XRPLF/mpt-crypto which is why we need to package them.
src_headers = ["util.h", "int128.h", "int128_impl.h", "scalar.h", "scalar_impl.h"]
src_headers_dependencies = ["checkmem.h", "int128_native.h", "int128_native_impl.h", "scalar_4x64.h", "scalar_4x64_impl.h", "modinv64.h", "modinv64_impl.h"]
for header in src_headers + src_headers_dependencies:
copy(
self,
header,
src=os.path.join(self.source_folder, "src"),
dst=os.path.join(self.package_folder, "include", "private")
Copy link

@bthomee bthomee Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these headers just be moved to another directory without breaking the compilation? I would've expected that the secp256k1 build would fail as #include "some_file.h" would now be in #include "private/some_file.h".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it, unfortunately, it doesn't compile.
And I like this way better, because we don't change in any way how the binary is built.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant to say: "does the way in which you do this, as presented in this PR, result in compilation failures?" but you now answered that question 🙂

)

def package_info(self):
self.cpp_info.libs = ["secp256k1"]
self.cpp_info.set_property("cmake_file_name", "secp256k1")
Expand Down