diff options
-rw-r--r-- | meta-oe/recipes-support/libspdm/libspdm_3.6.0.bb | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/libspdm/libspdm_3.6.0.bb b/meta-oe/recipes-support/libspdm/libspdm_3.6.0.bb new file mode 100644 index 0000000000..fa04ce6c59 --- /dev/null +++ b/meta-oe/recipes-support/libspdm/libspdm_3.6.0.bb | |||
@@ -0,0 +1,76 @@ | |||
1 | SUMMARY = "DMTF's Reference Implementation of SPDM" | ||
2 | DESCRIPTION = "libspdm is a reference implementation of the DMTF’s Security Protocols and \ | ||
3 | Data Models (SPDM). This is used to enable authentication, attestation and key exchange to \ | ||
4 | assist in providing infrastructure security enablement" | ||
5 | HOMEPAGE = "https://github.com/DMTF/libspdm" | ||
6 | BUGTRACKER = "https://github.com/DMTF/libspdm/issues" | ||
7 | LICENSE = "BSD-3-Clause" | ||
8 | LIC_FILES_CHKSUM = "file://LICENSE.md;md5=8f9b59a81a88da8e812af43728b72dd7" | ||
9 | |||
10 | DEPENDS = "openssl" | ||
11 | |||
12 | SRC_URI = "git://github.com/DMTF/libspdm.git;branch=main;protocol=https" | ||
13 | SRCREV = "5ebe5e3946b9439928fa3a7548268c29cccc1b16" | ||
14 | |||
15 | S = "${WORKDIR}/git" | ||
16 | |||
17 | inherit cmake | ||
18 | |||
19 | LIBSPDM_CFLAGS = "\ | ||
20 | ${TARGET_CFLAGS} \ | ||
21 | -DLIBSPDM_ENABLE_CAPABILITY_EVENT_CAP=0 \ | ||
22 | -DLIBSPDM_ENABLE_CAPABILITY_MEL_CAP=0 \ | ||
23 | -DLIBSPDM_ENABLE_CAPABILITY_GET_KEY_PAIR_INFO_CAP=0 \ | ||
24 | -DLIBSPDM_ENABLE_CAPABILITY_SET_KEY_PAIR_INFO_CAP=0 \ | ||
25 | -DLIBSPDM_HAL_PASS_SPDM_CONTEXT=1 \ | ||
26 | " | ||
27 | |||
28 | def get_spdm_multiarch(bb, d): | ||
29 | target_arch = d.getVar('TARGET_ARCH') | ||
30 | multiarch_options = { | ||
31 | "x86_64": "x64", | ||
32 | "i586": "ia32", | ||
33 | "i686": "ia32", | ||
34 | "arm": "arm", | ||
35 | "aarch64": "aarch64", | ||
36 | "riscv32": "riscv32", | ||
37 | "riscv64": "riscv64", | ||
38 | } | ||
39 | |||
40 | if target_arch in multiarch_options : | ||
41 | return multiarch_options[target_arch] | ||
42 | |||
43 | bb.error("unsupported architecture '%s'" % target_arch) | ||
44 | |||
45 | EXTRA_OECMAKE += "\ | ||
46 | -DARCH=${@get_spdm_multiarch(bb, d)} \ | ||
47 | -DTOOLCHAIN=NONE \ | ||
48 | -DTARGET=Release \ | ||
49 | -DCRYPTO=openssl \ | ||
50 | -DENABLE_BINARY_BUILD=1 \ | ||
51 | -DCOMPILED_LIBCRYPTO_PATH=${libdir} \ | ||
52 | -DCOMPILED_LIBSSL_PATH=${libdir} \ | ||
53 | -DDISABLE_TESTS=1 \ | ||
54 | -DDISABLE_EDDSA=1 \ | ||
55 | " | ||
56 | |||
57 | do_install () { | ||
58 | install -d ${D}/${libdir} | ||
59 | install -m 0644 lib/* ${D}/${libdir}/ | ||
60 | |||
61 | install -d ${D}/${includedir}/${BPN}/ | ||
62 | cp -rf ${S}/include/* ${D}/${includedir}/${BPN}/ | ||
63 | |||
64 | install -d ${D}/${includedir}/${BPN}/os_stub/spdm_crypt_ext_lib | ||
65 | cp -rf ${S}/os_stub/spdm_crypt_ext_lib/*.h ${D}/${includedir}/${BPN}/os_stub/spdm_crypt_ext_lib/ | ||
66 | } | ||
67 | |||
68 | FILES:${PN} += "${libdir}/*.a" | ||
69 | FILES:${PN} += "${includedir}/${BPN}/*.h" | ||
70 | FILES:${PN} += "${includedir}/${BPN}/os_stub/spdm_crypt_ext_lib/*.h" | ||
71 | |||
72 | COMPATIBLE_HOST:powerpc = "null" | ||
73 | COMPATIBLE_HOST:powerpc64 = "null" | ||
74 | COMPATIBLE_HOST:mipsarchn32 = "null" | ||
75 | |||
76 | BBCLASSEXTEND = "native nativesdk" | ||