Skip to content

Commit d2df006

Browse files
committed
feat: add mbedtls 3.6.1 descriptor
xpkg V1 + mcpp Form B descriptor for `mbedtls 3.6.1`. Targets the C language compile rule introduced in mcpp 0.0.2: `library/*.c` (108 sources) compile via `c_object` (gcc/clang sibling driver, c11) and archive into a single `libmbedtls.a` covering crypto + x509 + ssl — matching what xmake's `add_packages("mbedtls")` produces. Glob-aware paths (`*/library/*.c`, `*/include`, `*/library`) absorb the GitHub tarball's `mbedtls-mbedtls-3.6.1/` wrap layer. Verified locally: a smoke project depending on `mbedtls = "3.6.1"` builds, links statically (musl), runs, and produces the FIPS 180-4 SHA-256 vector for "abc" correctly. First downstream consumer is mcpplibs/tinyhttps (parallel PR adds an `mcpp.toml` that depends on this descriptor).
1 parent 5af9906 commit d2df006

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

pkgs/m/mbedtls.lua

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
-- M6.x glob-aware Form B descriptor for mbedtls.
2+
--
3+
-- Pure-C library; relies on mcpp 0.0.2's C-language compile rule (`.c`
4+
-- routed to `c_object` via the gcc/clang sibling driver). Produces a
5+
-- single static archive `libmbedtls.a` that bundles all of mbedtls's
6+
-- crypto + x509 + ssl translation units — the same arrangement xmake's
7+
-- mbedtls package emits when used by `add_packages("mbedtls")`.
8+
9+
package = {
10+
spec = "1",
11+
name = "mbedtls",
12+
description = "An open source, portable, easy to use, readable and flexible TLS library, and reference implementation of the PSA Cryptography API",
13+
licenses = {"Apache-2.0"},
14+
repo = "https://github.com/Mbed-TLS/mbedtls",
15+
type = "package",
16+
17+
xpm = {
18+
linux = {
19+
["3.6.1"] = {
20+
url = "https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/mbedtls-3.6.1.tar.gz",
21+
sha256 = "db75d2f7f35e29cf09f7bd6734d8ee3325f29c298ef071350c5e70a40dd4f0f9",
22+
},
23+
},
24+
macosx = {
25+
["3.6.1"] = {
26+
url = "https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/mbedtls-3.6.1.tar.gz",
27+
sha256 = "db75d2f7f35e29cf09f7bd6734d8ee3325f29c298ef071350c5e70a40dd4f0f9",
28+
},
29+
},
30+
windows = {
31+
["3.6.1"] = {
32+
url = "https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/mbedtls-3.6.1.tar.gz",
33+
sha256 = "db75d2f7f35e29cf09f7bd6734d8ee3325f29c298ef071350c5e70a40dd4f0f9",
34+
},
35+
},
36+
},
37+
38+
-- Form B `mcpp` segment: paths are globs relative to the verdir
39+
-- (~/.mcpp/registry/data/xpkgs/<idx>-x-mbedtls/<ver>/). The leading
40+
-- `*/` absorbs the GitHub tarball's `mbedtls-mbedtls-3.6.1/` wrap.
41+
mcpp = {
42+
language = "c++23", -- the [package].standard knob; mcpp uses it for the C++23 toolchain.
43+
import_std = false, -- pure C lib — no std module.
44+
sources = { "*/library/*.c" }, -- 108 sources, all of crypto + x509 + ssl.
45+
include_dirs = { "*/include", "*/library" },
46+
c_standard = "c11",
47+
targets = { ["mbedtls"] = { kind = "lib" } },
48+
deps = { },
49+
},
50+
}

0 commit comments

Comments
 (0)