Skip to content

Commit f2a4734

Browse files
authored
Add mpt-crypto recipe (#37)
1 parent 4c90bff commit f2a4734

File tree

4 files changed

+74
-5
lines changed

4 files changed

+74
-5
lines changed

.github/workflows/export.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ name: Export
33
on:
44
pull_request:
55
paths:
6-
- '.github/workflows/export.yml'
7-
- 'recipes/**'
6+
- ".github/workflows/export.yml"
7+
- "recipes/**"
88
push:
99
branches:
1010
- master
1111
paths:
12-
- '.github/workflows/export.yml'
13-
- 'recipes/**'
12+
- ".github/workflows/export.yml"
13+
- "recipes/**"
1414

1515
concurrency:
1616
group: ${{ github.workflow }}-${{ github.ref }}
@@ -39,13 +39,14 @@ jobs:
3939
conan export ed25519/all --version=2015.03
4040
conan export grpc/all --version=1.72.0
4141
conan export m4/all --version=1.4.19
42+
conan export mpt-crypto/all --version=0.1.0-rc1
4243
conan export nudb/all --version=2.0.9
4344
conan export openssl/3.x.x --version=3.5.4
4445
conan export secp256k1/all --version=0.7.1
4546
conan export snappy/all --version=1.1.10
4647
conan export soci/all --version=4.0.3
47-
conan export wasmi/all --version=1.0.6
4848
conan export wasm-xrplf/all --version=2.4.1-xrplf
49+
conan export wasmi/all --version=1.0.6
4950
- name: Add Conan remote
5051
run: |
5152
conan remote add --index 0 ${{ env.CONAN_REMOTE_NAME }} ${{ env.CONAN_REMOTE_URL }}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
sources:
2+
"0.1.0-rc1":
3+
url: https://github.com/XRPLF/mpt-crypto/archive/refs/tags/0.1.0-rc1.zip
4+
sha256: bbcd1b2ac7b31854a85ee8f28b409f0d4b558597ae7ff86e0778f0c5d90ea132
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
from conan import ConanFile, tools
2+
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
3+
from conan.tools.files import get
4+
5+
required_conan_version = ">=2.0.0"
6+
7+
8+
class MptCryptoConan(ConanFile):
9+
name = "mpt-crypto"
10+
description = "MPT-Crypto: Cryptographic Primitives for Confidential Assets"
11+
url = "https://github.com/XRPLF/mpt-crypto"
12+
package_type = "library"
13+
settings = "os", "arch", "compiler", "build_type"
14+
options = {
15+
"shared": [True, False],
16+
"fPIC": [True, False],
17+
"tests": [True, False],
18+
}
19+
default_options = {
20+
"shared": False,
21+
"fPIC": True,
22+
"tests": False,
23+
}
24+
25+
requires = [
26+
"openssl/3.5.5",
27+
"secp256k1/0.7.1",
28+
]
29+
30+
def source(self):
31+
get(self, **self.conan_data["sources"][self.version], strip_root=True)
32+
33+
def config_options(self):
34+
if self.settings.os == "Windows":
35+
del self.options.fPIC
36+
37+
def layout(self):
38+
cmake_layout(self, src_folder="src")
39+
self.folders.generators = "build/generators"
40+
41+
def generate(self):
42+
tc = CMakeToolchain(self)
43+
tc.variables["ENABLE_TESTS"] = self.options.tests
44+
tc.generate()
45+
46+
deps = CMakeDeps(self)
47+
deps.generate()
48+
49+
def build(self):
50+
cmake = CMake(self)
51+
cmake.configure()
52+
cmake.build()
53+
54+
def package(self):
55+
cmake = CMake(self)
56+
cmake.install()
57+
58+
def package_info(self):
59+
self.cpp_info.libs = ["mpt-crypto"]
60+
self.cpp_info.set_property("cmake_file_name", "mpt-crypto")
61+
self.cpp_info.set_property("cmake_target_name", "mpt-crypto::mpt-crypto")

recipes/mpt-crypto/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
versions:
2+
"0.1.0-rc1":
3+
folder: all

0 commit comments

Comments
 (0)