Skip to content
Merged
Show file tree
Hide file tree
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
39 changes: 39 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,49 @@ jobs:
echo "::error file=$f::version identifiers must not use a leading v"
fail=1
fi
# 4. Mirror table sanity: when a download `url` is written as a
# { GLOBAL=..., CN=... } table, both regions must be present and
# the CN entry must point at the gitcode mcpp-res mirror.
if ! lua5.4 tests/check_mirror_urls.lua "$f"; then
fail=1
fi
done
[ $fail -eq 0 ] && echo "All package files valid."
exit $fail

mirror-cn-reachable:
# Closed-loop guard for the CN mirror: every CN url referenced by a
# descriptor must be a live, downloadable gitcode release asset.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install lua
run: sudo apt-get install -y --no-install-recommends lua5.4
- name: Check CN mirror assets are reachable
run: |
fail=0
# collect unique CN urls across all descriptors
: > /tmp/cn.tsv
for f in pkgs/*/*.lua; do
lua5.4 tests/list_cn_urls.lua "$f" >> /tmp/cn.tsv || true
done
sort -u /tmp/cn.tsv -o /tmp/cn.tsv
total=$(grep -c . /tmp/cn.tsv || true)
echo "checking $total CN mirror url(s)"
while IFS=$'\t' read -r url sha; do
[ -z "$url" ] && continue
# follow redirects; gitcode release assets resolve to object storage
code=$(curl -fsSL -o /dev/null -w '%{http_code}' --retry 2 --max-time 60 "$url" || echo "000")
if [ "$code" != "200" ]; then
echo "::error::CN mirror unreachable ($code): $url"
fail=1
else
echo "ok: $url"
fi
done < /tmp/cn.tsv
[ $fail -eq 0 ] && echo "All CN mirror urls reachable."
exit $fail

smoke-linux:
runs-on: ubuntu-latest
steps:
Expand Down
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,38 @@ package = {
}
```

### 镜像源(GLOBAL / CN)

`xpm.<平台>.<版本>.url` 除了普通字符串,还支持镜像表,为不同地区提供下载源:

```lua
["3.6.1"] = {
url = {
GLOBAL = "https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/mbedtls-3.6.1.tar.gz",
CN = "https://gitcode.com/mcpp-res/mbedtls/releases/download/3.6.1/mbedtls-3.6.1.tar.gz",
},
sha256 = "db75d2f7f35e29cf09f7bd6734d8ee3325f29c298ef071350c5e70a40dd4f0f9",
},
```

- **GLOBAL**(默认):上游原始地址(GitHub / 官方站点),行为与之前完全一致。
- **CN**:[`mcpp-res`](https://gitcode.com/mcpp-res) 组织在 gitcode 上的镜像 —
每个库一个仓库,资源以 release 资产形式按版本 tag 发布,URL 形如
`https://gitcode.com/mcpp-res/<库>/releases/download/<版本>/<库>-<版本>.<ext>`。
CN 镜像内容与 GLOBAL 源 **逐字节一致**(同一 `sha256`),只是托管在国内可
快速访问的 gitcode 上。

切换镜像(底层透传给 xlings 安装引擎):

```bash
mcpp self config --mirror CN # 使用国内镜像
mcpp self config --mirror GLOBAL # 使用上游源(默认)
```

> 镜像表遵循 [xpkg V1 规范](https://github.com/d2learn/xim-pkgindex/blob/main/docs/V1/xpackage-spec.md)
> 的 `url = { GLOBAL=..., CN=... }` 约定,解析优先级 `GLOBAL > CN`。`validate`
> workflow 会校验镜像表完整性并探测每个 CN 资源可达。

### 获取方式

mcpp 初次运行时自动 clone 本仓库到 `~/.mcpp/registry/data/mcpp-index/`。后续更新:
Expand Down Expand Up @@ -231,6 +263,7 @@ cd ~/.mcpp/registry/data/mcpp-index && git pull
| [xlings](https://github.com/d2learn/xlings) | mcpp 底层的包安装引擎 + 沙箱环境 |
| [xpkg V1 spec](https://github.com/d2learn/xim-pkgindex/blob/main/docs/V1/xpackage-spec.md) | 包描述文件规范 |
| [mcpplibs](https://github.com/mcpplibs) | mcpp 生态的模块化 C++23 库集合 |
| [mcpp-res](https://gitcode.com/mcpp-res) | 包资源的 CN 镜像组织(gitcode release 资产) |
| [xim-pkgindex](https://github.com/d2learn/xim-pkgindex) | xlings 的通用包索引仓库 |

## 社区
Expand Down
15 changes: 12 additions & 3 deletions pkgs/c/capi.lua.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,28 @@ package = {
xpm = {
linux = {
["0.0.3"] = {
url = "https://github.com/mcpplibs/lua/archive/refs/tags/0.0.3.tar.gz",
url = {
GLOBAL = "https://github.com/mcpplibs/lua/archive/refs/tags/0.0.3.tar.gz",
CN = "https://gitcode.com/mcpp-res/capi.lua/releases/download/0.0.3/capi.lua-0.0.3.tar.gz",
},
sha256 = "f7f46c3cd193dc4527be5f3e5cfc29d7e322d5d3db56b9bdb060f289090088d6",
},
},
macosx = {
["0.0.3"] = {
url = "https://github.com/mcpplibs/lua/archive/refs/tags/0.0.3.tar.gz",
url = {
GLOBAL = "https://github.com/mcpplibs/lua/archive/refs/tags/0.0.3.tar.gz",
CN = "https://gitcode.com/mcpp-res/capi.lua/releases/download/0.0.3/capi.lua-0.0.3.tar.gz",
},
sha256 = "f7f46c3cd193dc4527be5f3e5cfc29d7e322d5d3db56b9bdb060f289090088d6",
},
},
windows = {
["0.0.3"] = {
url = "https://github.com/mcpplibs/lua/archive/refs/tags/0.0.3.tar.gz",
url = {
GLOBAL = "https://github.com/mcpplibs/lua/archive/refs/tags/0.0.3.tar.gz",
CN = "https://gitcode.com/mcpp-res/capi.lua/releases/download/0.0.3/capi.lua-0.0.3.tar.gz",
},
sha256 = "f7f46c3cd193dc4527be5f3e5cfc29d7e322d5d3db56b9bdb060f289090088d6",
},
},
Expand Down
30 changes: 24 additions & 6 deletions pkgs/c/cmdline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,49 @@ package = {
xpm = {
linux = {
["0.0.1"] = {
url = "https://github.com/mcpplibs/cmdline/archive/refs/tags/0.0.1.tar.gz",
url = {
GLOBAL = "https://github.com/mcpplibs/cmdline/archive/refs/tags/0.0.1.tar.gz",
CN = "https://gitcode.com/mcpp-res/cmdline/releases/download/0.0.1/cmdline-0.0.1.tar.gz",
},
sha256 = "3fb2f5495c1a144485b3cbb2e43e27059151633460f702af0f3851cbff387ef0",
},
["0.0.2"] = {
url = "https://github.com/mcpplibs/cmdline/archive/refs/tags/v0.0.2.tar.gz",
url = {
GLOBAL = "https://github.com/mcpplibs/cmdline/archive/refs/tags/v0.0.2.tar.gz",
CN = "https://gitcode.com/mcpp-res/cmdline/releases/download/0.0.2/cmdline-0.0.2.tar.gz",
},
sha256 = "4f3e2b8dc4d9f11bdd9a784a9914e889234ac305e1020282ffa03f506b75d52a",
},
},
macosx = {
["0.0.1"] = {
url = "https://github.com/mcpplibs/cmdline/archive/refs/tags/0.0.1.tar.gz",
url = {
GLOBAL = "https://github.com/mcpplibs/cmdline/archive/refs/tags/0.0.1.tar.gz",
CN = "https://gitcode.com/mcpp-res/cmdline/releases/download/0.0.1/cmdline-0.0.1.tar.gz",
},
sha256 = "3fb2f5495c1a144485b3cbb2e43e27059151633460f702af0f3851cbff387ef0",
},
["0.0.2"] = {
url = "https://github.com/mcpplibs/cmdline/archive/refs/tags/v0.0.2.tar.gz",
url = {
GLOBAL = "https://github.com/mcpplibs/cmdline/archive/refs/tags/v0.0.2.tar.gz",
CN = "https://gitcode.com/mcpp-res/cmdline/releases/download/0.0.2/cmdline-0.0.2.tar.gz",
},
sha256 = "4f3e2b8dc4d9f11bdd9a784a9914e889234ac305e1020282ffa03f506b75d52a",
},
},
windows = {
["0.0.1"] = {
url = "https://github.com/mcpplibs/cmdline/archive/refs/tags/0.0.1.tar.gz",
url = {
GLOBAL = "https://github.com/mcpplibs/cmdline/archive/refs/tags/0.0.1.tar.gz",
CN = "https://gitcode.com/mcpp-res/cmdline/releases/download/0.0.1/cmdline-0.0.1.tar.gz",
},
sha256 = "3fb2f5495c1a144485b3cbb2e43e27059151633460f702af0f3851cbff387ef0",
},
["0.0.2"] = {
url = "https://github.com/mcpplibs/cmdline/archive/refs/tags/v0.0.2.tar.gz",
url = {
GLOBAL = "https://github.com/mcpplibs/cmdline/archive/refs/tags/v0.0.2.tar.gz",
CN = "https://gitcode.com/mcpp-res/cmdline/releases/download/0.0.2/cmdline-0.0.2.tar.gz",
},
sha256 = "4f3e2b8dc4d9f11bdd9a784a9914e889234ac305e1020282ffa03f506b75d52a",
},
},
Expand Down
15 changes: 12 additions & 3 deletions pkgs/c/compat.bzip2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,28 @@ package = {
xpm = {
linux = {
["1.0.8"] = {
url = "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz",
url = {
GLOBAL = "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz",
CN = "https://gitcode.com/mcpp-res/bzip2/releases/download/1.0.8/bzip2-1.0.8.tar.gz",
},
sha256 = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269",
},
},
macosx = {
["1.0.8"] = {
url = "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz",
url = {
GLOBAL = "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz",
CN = "https://gitcode.com/mcpp-res/bzip2/releases/download/1.0.8/bzip2-1.0.8.tar.gz",
},
sha256 = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269",
},
},
windows = {
["1.0.8"] = {
url = "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz",
url = {
GLOBAL = "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz",
CN = "https://gitcode.com/mcpp-res/bzip2/releases/download/1.0.8/bzip2-1.0.8.tar.gz",
},
sha256 = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269",
},
},
Expand Down
15 changes: 12 additions & 3 deletions pkgs/c/compat.ftxui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,28 @@ package = {
xpm = {
linux = {
["6.1.9"] = {
url = "https://github.com/ArthurSonzogni/FTXUI/archive/refs/tags/v6.1.9.tar.gz",
url = {
GLOBAL = "https://github.com/ArthurSonzogni/FTXUI/archive/refs/tags/v6.1.9.tar.gz",
CN = "https://gitcode.com/mcpp-res/ftxui/releases/download/6.1.9/ftxui-6.1.9.tar.gz",
},
sha256 = "45819c1e54914783d4a1ca5633885035d74146778a1f74e1213cdb7b76340e71",
},
},
macosx = {
["6.1.9"] = {
url = "https://github.com/ArthurSonzogni/FTXUI/archive/refs/tags/v6.1.9.tar.gz",
url = {
GLOBAL = "https://github.com/ArthurSonzogni/FTXUI/archive/refs/tags/v6.1.9.tar.gz",
CN = "https://gitcode.com/mcpp-res/ftxui/releases/download/6.1.9/ftxui-6.1.9.tar.gz",
},
sha256 = "45819c1e54914783d4a1ca5633885035d74146778a1f74e1213cdb7b76340e71",
},
},
windows = {
["6.1.9"] = {
url = "https://github.com/ArthurSonzogni/FTXUI/archive/refs/tags/v6.1.9.tar.gz",
url = {
GLOBAL = "https://github.com/ArthurSonzogni/FTXUI/archive/refs/tags/v6.1.9.tar.gz",
CN = "https://gitcode.com/mcpp-res/ftxui/releases/download/6.1.9/ftxui-6.1.9.tar.gz",
},
sha256 = "45819c1e54914783d4a1ca5633885035d74146778a1f74e1213cdb7b76340e71",
},
},
Expand Down
15 changes: 12 additions & 3 deletions pkgs/c/compat.glfw.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,28 @@ package = {
xpm = {
linux = {
["3.4"] = {
url = "https://github.com/glfw/glfw/archive/refs/tags/3.4.tar.gz",
url = {
GLOBAL = "https://github.com/glfw/glfw/archive/refs/tags/3.4.tar.gz",
CN = "https://gitcode.com/mcpp-res/glfw/releases/download/3.4/glfw-3.4.tar.gz",
},
sha256 = "c038d34200234d071fae9345bc455e4a8f2f544ab60150765d7704e08f3dac01",
},
},
macosx = {
["3.4"] = {
url = "https://github.com/glfw/glfw/archive/refs/tags/3.4.tar.gz",
url = {
GLOBAL = "https://github.com/glfw/glfw/archive/refs/tags/3.4.tar.gz",
CN = "https://gitcode.com/mcpp-res/glfw/releases/download/3.4/glfw-3.4.tar.gz",
},
sha256 = "c038d34200234d071fae9345bc455e4a8f2f544ab60150765d7704e08f3dac01",
},
},
windows = {
["3.4"] = {
url = "https://github.com/glfw/glfw/archive/refs/tags/3.4.tar.gz",
url = {
GLOBAL = "https://github.com/glfw/glfw/archive/refs/tags/3.4.tar.gz",
CN = "https://gitcode.com/mcpp-res/glfw/releases/download/3.4/glfw-3.4.tar.gz",
},
sha256 = "c038d34200234d071fae9345bc455e4a8f2f544ab60150765d7704e08f3dac01",
},
},
Expand Down
5 changes: 4 additions & 1 deletion pkgs/c/compat.glx-runtime.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ package = {
xpm = {
linux = {
["2026.06.03"] = {
url = "https://raw.githubusercontent.com/KhronosGroup/OpenGL-Registry/a30033d3e812c9bf10094f1010374a6b15e192eb/README.adoc",
url = {
GLOBAL = "https://raw.githubusercontent.com/KhronosGroup/OpenGL-Registry/a30033d3e812c9bf10094f1010374a6b15e192eb/README.adoc",
CN = "https://gitcode.com/mcpp-res/glx-runtime/releases/download/2026.06.03/glx-runtime-2026.06.03.adoc",
},
sha256 = "ea68efce197e68413ebb62c51ab4bccfb2309a2fca776d31b49d972f59f3640e",
},
},
Expand Down
15 changes: 12 additions & 3 deletions pkgs/c/compat.gtest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,28 @@ package = {
xpm = {
linux = {
["1.15.2"] = {
url = "https://github.com/google/googletest/archive/refs/tags/v1.15.2.tar.gz",
url = {
GLOBAL = "https://github.com/google/googletest/archive/refs/tags/v1.15.2.tar.gz",
CN = "https://gitcode.com/mcpp-res/gtest/releases/download/1.15.2/gtest-1.15.2.tar.gz",
},
sha256 = "7b42b4d6ed48810c5362c265a17faebe90dc2373c885e5216439d37927f02926",
},
},
macosx = {
["1.15.2"] = {
url = "https://github.com/google/googletest/archive/refs/tags/v1.15.2.tar.gz",
url = {
GLOBAL = "https://github.com/google/googletest/archive/refs/tags/v1.15.2.tar.gz",
CN = "https://gitcode.com/mcpp-res/gtest/releases/download/1.15.2/gtest-1.15.2.tar.gz",
},
sha256 = "7b42b4d6ed48810c5362c265a17faebe90dc2373c885e5216439d37927f02926",
},
},
windows = {
["1.15.2"] = {
url = "https://github.com/google/googletest/archive/refs/tags/v1.15.2.tar.gz",
url = {
GLOBAL = "https://github.com/google/googletest/archive/refs/tags/v1.15.2.tar.gz",
CN = "https://gitcode.com/mcpp-res/gtest/releases/download/1.15.2/gtest-1.15.2.tar.gz",
},
sha256 = "7b42b4d6ed48810c5362c265a17faebe90dc2373c885e5216439d37927f02926",
},
},
Expand Down
30 changes: 24 additions & 6 deletions pkgs/c/compat.imgui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,49 @@ package = {
xpm = {
linux = {
["1.92.8"] = {
url = "https://github.com/ocornut/imgui/archive/refs/tags/v1.92.8.tar.gz",
url = {
GLOBAL = "https://github.com/ocornut/imgui/archive/refs/tags/v1.92.8.tar.gz",
CN = "https://gitcode.com/mcpp-res/imgui/releases/download/1.92.8/imgui-1.92.8.tar.gz",
},
sha256 = "fecb33d33930e12ff53a34064e9d3a06c8f7c3e04408f14cd36c80e3faac863b",
},
["1.92.8-docking"] = {
url = "https://github.com/ocornut/imgui/archive/refs/tags/v1.92.8-docking.tar.gz",
url = {
GLOBAL = "https://github.com/ocornut/imgui/archive/refs/tags/v1.92.8-docking.tar.gz",
CN = "https://gitcode.com/mcpp-res/imgui/releases/download/1.92.8-docking/imgui-1.92.8-docking.tar.gz",
},
sha256 = "ca0653454ed371b7a87e9b0bc29a5d15c9be7f7c0fbe778042fc48c71df1d3d8",
},
},
macosx = {
["1.92.8"] = {
url = "https://github.com/ocornut/imgui/archive/refs/tags/v1.92.8.tar.gz",
url = {
GLOBAL = "https://github.com/ocornut/imgui/archive/refs/tags/v1.92.8.tar.gz",
CN = "https://gitcode.com/mcpp-res/imgui/releases/download/1.92.8/imgui-1.92.8.tar.gz",
},
sha256 = "fecb33d33930e12ff53a34064e9d3a06c8f7c3e04408f14cd36c80e3faac863b",
},
["1.92.8-docking"] = {
url = "https://github.com/ocornut/imgui/archive/refs/tags/v1.92.8-docking.tar.gz",
url = {
GLOBAL = "https://github.com/ocornut/imgui/archive/refs/tags/v1.92.8-docking.tar.gz",
CN = "https://gitcode.com/mcpp-res/imgui/releases/download/1.92.8-docking/imgui-1.92.8-docking.tar.gz",
},
sha256 = "ca0653454ed371b7a87e9b0bc29a5d15c9be7f7c0fbe778042fc48c71df1d3d8",
},
},
windows = {
["1.92.8"] = {
url = "https://github.com/ocornut/imgui/archive/refs/tags/v1.92.8.tar.gz",
url = {
GLOBAL = "https://github.com/ocornut/imgui/archive/refs/tags/v1.92.8.tar.gz",
CN = "https://gitcode.com/mcpp-res/imgui/releases/download/1.92.8/imgui-1.92.8.tar.gz",
},
sha256 = "fecb33d33930e12ff53a34064e9d3a06c8f7c3e04408f14cd36c80e3faac863b",
},
["1.92.8-docking"] = {
url = "https://github.com/ocornut/imgui/archive/refs/tags/v1.92.8-docking.tar.gz",
url = {
GLOBAL = "https://github.com/ocornut/imgui/archive/refs/tags/v1.92.8-docking.tar.gz",
CN = "https://gitcode.com/mcpp-res/imgui/releases/download/1.92.8-docking/imgui-1.92.8-docking.tar.gz",
},
sha256 = "ca0653454ed371b7a87e9b0bc29a5d15c9be7f7c0fbe778042fc48c71df1d3d8",
},
},
Expand Down
Loading
Loading