Skip to content

Commit 40f0988

Browse files
mcpplibs.mwrap zlib, zstd, xz, xxhash, libarchive and libc: the six wrappers of the headers mcpp and mcppls include
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
1 parent e28ff04 commit 40f0988

28 files changed

Lines changed: 727 additions & 0 deletions

File tree

‎.github/workflows/validate.yml‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,6 +1675,36 @@ jobs:
16751675
shell: bash
16761676
run: python3 tests/mwrap/check_installed_template.py --mcpp "$MCPP" --package mcpplibs.mwrap.mimalloc@3.6.1 --deploy
16771677

1678+
- name: Installed zlib wrapper archive, actual default compression template and its relocated notices
1679+
if: contains(format(' {0} ', env.MEMBERS), ' zlib-compress ') && matrix.toolchain == 'default'
1680+
shell: bash
1681+
run: python3 tests/mwrap/check_installed_template.py --mcpp "$MCPP" --package mcpplibs.mwrap.zlib@1.3.2 --deploy
1682+
1683+
- name: Installed zstd wrapper archive, actual default compression template and its relocated notices
1684+
if: contains(format(' {0} ', env.MEMBERS), ' zstd-squeeze ') && matrix.toolchain == 'default'
1685+
shell: bash
1686+
run: python3 tests/mwrap/check_installed_template.py --mcpp "$MCPP" --package mcpplibs.mwrap.zstd@1.5.7 --deploy
1687+
1688+
- name: Installed xz wrapper archive, actual default compression template and its relocated notices
1689+
if: contains(format(' {0} ', env.MEMBERS), ' xz-pack ') && matrix.toolchain == 'default'
1690+
shell: bash
1691+
run: python3 tests/mwrap/check_installed_template.py --mcpp "$MCPP" --package mcpplibs.mwrap.xz@5.8.3 --deploy
1692+
1693+
- name: Installed xxhash wrapper archive, actual default hashing template and its relocated notices
1694+
if: contains(format(' {0} ', env.MEMBERS), ' xxhash-digest ') && matrix.toolchain == 'default'
1695+
shell: bash
1696+
run: python3 tests/mwrap/check_installed_template.py --mcpp "$MCPP" --package mcpplibs.mwrap.xxhash@0.8.3 --deploy
1697+
1698+
- name: Installed libarchive wrapper archive, actual default archive template and its relocated notices
1699+
if: contains(format(' {0} ', env.MEMBERS), ' libarchive-bundle ') && matrix.toolchain == 'default'
1700+
shell: bash
1701+
run: python3 tests/mwrap/check_installed_template.py --mcpp "$MCPP" --package mcpplibs.mwrap.libarchive@3.8.7 --deploy
1702+
1703+
- name: Installed libc wrapper archive, actual default C stdio template and its relocated notices
1704+
if: contains(format(' {0} ', env.MEMBERS), ' libc-stdio ') && matrix.toolchain == 'default'
1705+
shell: bash
1706+
run: python3 tests/mwrap/check_installed_template.py --mcpp "$MCPP" --package mcpplibs.mwrap.libc@17.0.0 --deploy
1707+
16781708
- name: Installed libwebp wrapper archive, actual default image template and its relocated notices
16791709
if: contains(format(' {0} ', env.MEMBERS), ' libwebp-image ') && matrix.toolchain == 'default'
16801710
shell: bash

‎CHANGELOG.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515

1616
### Added
1717

18+
- **mcpplibs.mwrap.zlib 1.3.2、.zstd 1.5.7、.xz 5.8.3、.xxhash 0.8.3、.libarchive 3.8.7、.libc 17.0.0(新包)。** 六个 mwrap
19+
包装把头文件收敛到各自的包中(mcpp 设计记录 2026-11-07 D10)。前五个以 C++23 模块使用同版本的 compat 实现:函数、类型、
20+
枚举值以上游的全局名导出,常量宏与类型宏在 `.macros` 中为同名常量与别名,带参数的宏在 `<mwrap/<lib>/macros.hpp>`;
21+
导出清单由各仓库的 `tools/generate.py` 按 clang 读到的头文件生成并在 CI 中审计。`mcpplibs.mwrap.libc` 映射 ISO C17
22+
附录 B 的对象宏(`stdout()`、`errno()`、`EOF`、`INT_MAX` 等),实现为目标的 C 库。消费者测试 `tests/mwrap/zlib-compress`、
23+
`zstd-squeeze`、`xz-pack`、`xxhash-digest`、`libarchive-bundle`、`libc-stdio`,以及已安装模板与重定位许可检查(检查脚本以
24+
`STATIC_NOTICES` 表统一六个包的约定)。GLOBAL 为 GitHub 发布资产,CN 为 GitCode `mcpp-res/mwrap-<lib>` 镜像,sha256
25+
两处一致。`docs/mwrap.md` 补充 C 标准库这一实现来源。
26+
1827
- **openkal-macos 0.22.1.** The confinement rules are sized to the grants of each start; sixteen grants named near
1928
`MAXPATHLEN` no longer refuse a well-formed start with `kal_err_invalid`. OpenKal is the compatible range `^0.24.0`.
2029
First member of the openkal 0.24.1 correction group (mcpp design record 2026-11-07 §4.2.3).

‎docs/mwrap.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ A wrapper should depend on it when its configuration and ABI are sufficient.
2828
Complex implementations may instead vendor pinned sources under `upstream/`.
2929
Each implementation has one owner in a program: do not link both a vendored copy
3030
and a compat copy of the same library.
31+
The C standard library is the third source: its implementation is the target's
32+
C library, which mcpp selects with the target (glibc, musl, the Windows CRT,
33+
macOS libSystem, openkal-musl, mingw-w64). `mcpplibs.mwrap.libc` links nothing;
34+
its version names the standard (17.0.0 for ISO/IEC 9899:2018), recorded with
35+
`standard` in `[package.metadata.mwrap]`.
3136

3237
## Repository layout
3338

‎docs/zh/mwrap.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
包和模块名不带 -m,不创建另一套普通 API namespace。已发布旧身份、版本和内容保持不可变,
2121
通过新 mwrap 身份迁移。简单实现优先依赖 compat.xxx;复杂库可以 vendor 到 upstream/。
2222
同一程序的同一实现只能有一个所有者,不能把 compat 与 vendored 实现重复链接。
23+
C 标准库是第三种实现来源:实现由目标的 C 库提供,由 mcpp 随目标选定(glibc、musl、Windows CRT、macOS libSystem、
24+
openkal-musl、mingw-w64)。`mcpplibs.mwrap.libc` 不链接任何实现;版本号表示所依据的标准(ISO/IEC 9899:2018 为 17.0.0),
25+
记录在 `[package.metadata.mwrap]` 的 `standard` 中。
2326

2427
## 仓库分层
2528

‎mcpp.toml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ members = [
3131
"tests/mwrap/libvpx-webm",
3232
"tests/mwrap/box2d-physics",
3333
"tests/mwrap/mimalloc-heap",
34+
"tests/mwrap/zlib-compress",
35+
"tests/mwrap/zstd-squeeze",
36+
"tests/mwrap/xz-pack",
37+
"tests/mwrap/xxhash-digest",
38+
"tests/mwrap/libarchive-bundle",
39+
"tests/mwrap/libc-stdio",
3440
"tests/mwrap/miniaudio-engine",
3541
"tests/mwrap/freetype-render",
3642
"tests/mwrap/harfbuzz-shape",

‎pkgs/mwrap/libarchive.lua‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
-- Immutable upstream-aligned mwrap source release (libarchive-m mwrap-3.8.7);
2+
-- GLOBAL and CN bytes are identical.
3+
--
4+
-- The wrapper is Apache-2.0; the library it links, compat.libarchive
5+
-- (libarchive 3.8.7), is BSD-2-Clause with the exceptions its COPYING lists,
6+
-- linked statically: the package deploys its README and COPYING beside
7+
-- programs (runtime.deploy).
8+
package = {
9+
spec = "1",
10+
namespace = "mcpplibs.mwrap",
11+
name = "libarchive",
12+
description = "libarchive-m: libarchive 3.8.7 (tar, cpio, zip, 7-Zip, ISO 9660 … with their compression filters, entries, disk access) as C++23 modules, with the constants of archive.h as C++ constants",
13+
licenses = { "Apache-2.0" },
14+
repo = "https://github.com/mcpplibs/libarchive-m",
15+
type = "package",
16+
extensions = {
17+
autoupdate = {
18+
tag = "mwrap-${version}",
19+
url = "https://github.com/mcpplibs/libarchive-m/releases/download/${tag}/libarchive-m-${version}.tar.gz",
20+
},
21+
},
22+
xpm = {
23+
linux = {
24+
["3.8.7"] = {
25+
url = {
26+
GLOBAL = "https://github.com/mcpplibs/libarchive-m/releases/download/mwrap-3.8.7/libarchive-m-3.8.7.tar.gz",
27+
CN = "https://gitcode.com/mcpp-res/mwrap-libarchive/releases/download/3.8.7/libarchive-m-3.8.7.tar.gz",
28+
},
29+
sha256 = "b55c102f8743112d94bd57ab8e79b31cdfe49935c1bebaed846b1a4508e9c8f8",
30+
},
31+
},
32+
macosx = {
33+
["3.8.7"] = {
34+
url = {
35+
GLOBAL = "https://github.com/mcpplibs/libarchive-m/releases/download/mwrap-3.8.7/libarchive-m-3.8.7.tar.gz",
36+
CN = "https://gitcode.com/mcpp-res/mwrap-libarchive/releases/download/3.8.7/libarchive-m-3.8.7.tar.gz",
37+
},
38+
sha256 = "b55c102f8743112d94bd57ab8e79b31cdfe49935c1bebaed846b1a4508e9c8f8",
39+
},
40+
},
41+
windows = {
42+
["3.8.7"] = {
43+
url = {
44+
GLOBAL = "https://github.com/mcpplibs/libarchive-m/releases/download/mwrap-3.8.7/libarchive-m-3.8.7.tar.gz",
45+
CN = "https://gitcode.com/mcpp-res/mwrap-libarchive/releases/download/3.8.7/libarchive-m-3.8.7.tar.gz",
46+
},
47+
sha256 = "b55c102f8743112d94bd57ab8e79b31cdfe49935c1bebaed846b1a4508e9c8f8",
48+
},
49+
},
50+
},
51+
}

‎pkgs/mwrap/libc.lua‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
-- Immutable upstream-aligned mwrap source release (libc-m mwrap-17.0.0);
2+
-- GLOBAL and CN bytes are identical.
3+
--
4+
-- The wrapper is Apache-2.0 and links nothing: the implementation is the
5+
-- target's C library. The version names the standard, ISO/IEC 9899:2018 (C17).
6+
package = {
7+
spec = "1",
8+
namespace = "mcpplibs.mwrap",
9+
name = "libc",
10+
description = "libc-m: the C standard library (ISO C17) for C++ modules: std.compat with the object-like macros of ISO C (stdout, errno, EOF, INT_MAX …) as C++ constants and functions",
11+
licenses = { "Apache-2.0" },
12+
repo = "https://github.com/mcpplibs/libc-m",
13+
type = "package",
14+
extensions = {
15+
autoupdate = {
16+
tag = "mwrap-${version}",
17+
url = "https://github.com/mcpplibs/libc-m/releases/download/${tag}/libc-m-${version}.tar.gz",
18+
},
19+
},
20+
xpm = {
21+
linux = {
22+
["17.0.0"] = {
23+
url = {
24+
GLOBAL = "https://github.com/mcpplibs/libc-m/releases/download/mwrap-17.0.0/libc-m-17.0.0.tar.gz",
25+
CN = "https://gitcode.com/mcpp-res/mwrap-libc/releases/download/17.0.0/libc-m-17.0.0.tar.gz",
26+
},
27+
sha256 = "e601179504f0fc94bb4d2f002982b2f5b9cc4b95a50a13822bd9b272519a3a9c",
28+
},
29+
},
30+
macosx = {
31+
["17.0.0"] = {
32+
url = {
33+
GLOBAL = "https://github.com/mcpplibs/libc-m/releases/download/mwrap-17.0.0/libc-m-17.0.0.tar.gz",
34+
CN = "https://gitcode.com/mcpp-res/mwrap-libc/releases/download/17.0.0/libc-m-17.0.0.tar.gz",
35+
},
36+
sha256 = "e601179504f0fc94bb4d2f002982b2f5b9cc4b95a50a13822bd9b272519a3a9c",
37+
},
38+
},
39+
windows = {
40+
["17.0.0"] = {
41+
url = {
42+
GLOBAL = "https://github.com/mcpplibs/libc-m/releases/download/mwrap-17.0.0/libc-m-17.0.0.tar.gz",
43+
CN = "https://gitcode.com/mcpp-res/mwrap-libc/releases/download/17.0.0/libc-m-17.0.0.tar.gz",
44+
},
45+
sha256 = "e601179504f0fc94bb4d2f002982b2f5b9cc4b95a50a13822bd9b272519a3a9c",
46+
},
47+
},
48+
},
49+
}

‎pkgs/mwrap/xxhash.lua‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
-- Immutable upstream-aligned mwrap source release (xxhash-m mwrap-0.8.3);
2+
-- GLOBAL and CN bytes are identical.
3+
--
4+
-- The wrapper is Apache-2.0; the library it links, compat.xxhash (xxHash
5+
-- 0.8.3), is BSD-2-Clause, linked statically: the package deploys its README
6+
-- and LICENSE beside programs (runtime.deploy).
7+
package = {
8+
spec = "1",
9+
namespace = "mcpplibs.mwrap",
10+
name = "xxhash",
11+
description = "xxhash-m: xxHash 0.8.3 (XXH32, XXH64, XXH3 64 and 128 bits, one-shot and streaming) as C++23 modules",
12+
licenses = { "Apache-2.0" },
13+
repo = "https://github.com/mcpplibs/xxhash-m",
14+
type = "package",
15+
extensions = {
16+
autoupdate = {
17+
tag = "mwrap-${version}",
18+
url = "https://github.com/mcpplibs/xxhash-m/releases/download/${tag}/xxhash-m-${version}.tar.gz",
19+
},
20+
},
21+
xpm = {
22+
linux = {
23+
["0.8.3"] = {
24+
url = {
25+
GLOBAL = "https://github.com/mcpplibs/xxhash-m/releases/download/mwrap-0.8.3/xxhash-m-0.8.3.tar.gz",
26+
CN = "https://gitcode.com/mcpp-res/mwrap-xxhash/releases/download/0.8.3/xxhash-m-0.8.3.tar.gz",
27+
},
28+
sha256 = "4e389afbece2290b44c24c12b4ad1086c28f146e78de8cebf5c701f676dc36cc",
29+
},
30+
},
31+
macosx = {
32+
["0.8.3"] = {
33+
url = {
34+
GLOBAL = "https://github.com/mcpplibs/xxhash-m/releases/download/mwrap-0.8.3/xxhash-m-0.8.3.tar.gz",
35+
CN = "https://gitcode.com/mcpp-res/mwrap-xxhash/releases/download/0.8.3/xxhash-m-0.8.3.tar.gz",
36+
},
37+
sha256 = "4e389afbece2290b44c24c12b4ad1086c28f146e78de8cebf5c701f676dc36cc",
38+
},
39+
},
40+
windows = {
41+
["0.8.3"] = {
42+
url = {
43+
GLOBAL = "https://github.com/mcpplibs/xxhash-m/releases/download/mwrap-0.8.3/xxhash-m-0.8.3.tar.gz",
44+
CN = "https://gitcode.com/mcpp-res/mwrap-xxhash/releases/download/0.8.3/xxhash-m-0.8.3.tar.gz",
45+
},
46+
sha256 = "4e389afbece2290b44c24c12b4ad1086c28f146e78de8cebf5c701f676dc36cc",
47+
},
48+
},
49+
},
50+
}

‎pkgs/mwrap/xz.lua‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
-- Immutable upstream-aligned mwrap source release (xz-m mwrap-5.8.3);
2+
-- GLOBAL and CN bytes are identical.
3+
--
4+
-- The wrapper is Apache-2.0; the library it links, compat.xz (liblzma of XZ
5+
-- Utils 5.8.3), is 0BSD, linked statically: the package deploys its README and
6+
-- licenses beside programs (runtime.deploy).
7+
package = {
8+
spec = "1",
9+
namespace = "mcpplibs.mwrap",
10+
name = "xz",
11+
description = "xz-m: liblzma of XZ Utils 5.8.3 (.xz and .lzma streams, filters, blocks, indexes, checks) as C++23 modules, with the constants of lzma.h as C++ constants",
12+
licenses = { "Apache-2.0" },
13+
repo = "https://github.com/mcpplibs/xz-m",
14+
type = "package",
15+
extensions = {
16+
autoupdate = {
17+
tag = "mwrap-${version}",
18+
url = "https://github.com/mcpplibs/xz-m/releases/download/${tag}/xz-m-${version}.tar.gz",
19+
},
20+
},
21+
xpm = {
22+
linux = {
23+
["5.8.3"] = {
24+
url = {
25+
GLOBAL = "https://github.com/mcpplibs/xz-m/releases/download/mwrap-5.8.3/xz-m-5.8.3.tar.gz",
26+
CN = "https://gitcode.com/mcpp-res/mwrap-xz/releases/download/5.8.3/xz-m-5.8.3.tar.gz",
27+
},
28+
sha256 = "6b3f720c05a66916ddb3e14ba98dfd65ace6018b66eda1400ce40adb05a3b957",
29+
},
30+
},
31+
macosx = {
32+
["5.8.3"] = {
33+
url = {
34+
GLOBAL = "https://github.com/mcpplibs/xz-m/releases/download/mwrap-5.8.3/xz-m-5.8.3.tar.gz",
35+
CN = "https://gitcode.com/mcpp-res/mwrap-xz/releases/download/5.8.3/xz-m-5.8.3.tar.gz",
36+
},
37+
sha256 = "6b3f720c05a66916ddb3e14ba98dfd65ace6018b66eda1400ce40adb05a3b957",
38+
},
39+
},
40+
windows = {
41+
["5.8.3"] = {
42+
url = {
43+
GLOBAL = "https://github.com/mcpplibs/xz-m/releases/download/mwrap-5.8.3/xz-m-5.8.3.tar.gz",
44+
CN = "https://gitcode.com/mcpp-res/mwrap-xz/releases/download/5.8.3/xz-m-5.8.3.tar.gz",
45+
},
46+
sha256 = "6b3f720c05a66916ddb3e14ba98dfd65ace6018b66eda1400ce40adb05a3b957",
47+
},
48+
},
49+
},
50+
}

‎pkgs/mwrap/zlib.lua‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
-- Immutable upstream-aligned mwrap source release (zlib-m mwrap-1.3.2);
2+
-- GLOBAL and CN bytes are identical.
3+
--
4+
-- The wrapper is Apache-2.0; the library it links, compat.zlib (zlib 1.3.2), is
5+
-- under the zlib license, linked statically: the package deploys zlib's README
6+
-- and LICENSE beside programs (runtime.deploy).
7+
package = {
8+
spec = "1",
9+
namespace = "mcpplibs.mwrap",
10+
name = "zlib",
11+
description = "zlib-m: zlib 1.3.2 (deflate, inflate, gzip files and checksums) as C++23 modules, with the constants of zlib.h as C++ constants",
12+
licenses = { "Apache-2.0" },
13+
repo = "https://github.com/mcpplibs/zlib-m",
14+
type = "package",
15+
extensions = {
16+
autoupdate = {
17+
tag = "mwrap-${version}",
18+
url = "https://github.com/mcpplibs/zlib-m/releases/download/${tag}/zlib-m-${version}.tar.gz",
19+
},
20+
},
21+
xpm = {
22+
linux = {
23+
["1.3.2"] = {
24+
url = {
25+
GLOBAL = "https://github.com/mcpplibs/zlib-m/releases/download/mwrap-1.3.2/zlib-m-1.3.2.tar.gz",
26+
CN = "https://gitcode.com/mcpp-res/mwrap-zlib/releases/download/1.3.2/zlib-m-1.3.2.tar.gz",
27+
},
28+
sha256 = "93a855abd3688dcba1526e6de1a61121e51eaeddef31da263342be30e2818b4b",
29+
},
30+
},
31+
macosx = {
32+
["1.3.2"] = {
33+
url = {
34+
GLOBAL = "https://github.com/mcpplibs/zlib-m/releases/download/mwrap-1.3.2/zlib-m-1.3.2.tar.gz",
35+
CN = "https://gitcode.com/mcpp-res/mwrap-zlib/releases/download/1.3.2/zlib-m-1.3.2.tar.gz",
36+
},
37+
sha256 = "93a855abd3688dcba1526e6de1a61121e51eaeddef31da263342be30e2818b4b",
38+
},
39+
},
40+
windows = {
41+
["1.3.2"] = {
42+
url = {
43+
GLOBAL = "https://github.com/mcpplibs/zlib-m/releases/download/mwrap-1.3.2/zlib-m-1.3.2.tar.gz",
44+
CN = "https://gitcode.com/mcpp-res/mwrap-zlib/releases/download/1.3.2/zlib-m-1.3.2.tar.gz",
45+
},
46+
sha256 = "93a855abd3688dcba1526e6de1a61121e51eaeddef31da263342be30e2818b4b",
47+
},
48+
},
49+
},
50+
}

0 commit comments

Comments
 (0)