From b8942c074d3c237a4c6da5a487dd5e013a41a62b Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Sun, 1 Mar 2026 19:07:05 +0800 Subject: [PATCH 1/4] feat: add mcpplibs-xpkg package (libxpkg 0.0.1) Add the xpkg package specification C++23 reference implementation to the mcpplibs index with package definition, smoke test, and CI. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ci.yml | 24 +++++++++++++++++++++++- packages/m/mcpplibs-xpkg/xmake.lua | 19 +++++++++++++++++++ tests/m/mcpplibs-xpkg/main.cpp | 10 ++++++++++ tests/m/mcpplibs-xpkg/xmake.lua | 8 ++++++++ tests/xmake.lua | 1 + 5 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 packages/m/mcpplibs-xpkg/xmake.lua create mode 100644 tests/m/mcpplibs-xpkg/main.cpp create mode 100644 tests/m/mcpplibs-xpkg/xmake.lua diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d91f9e..b771e17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,7 @@ jobs: cmdline: ${{ steps.filter.outputs.cmdline }} llmapi: ${{ steps.filter.outputs.llmapi }} lua: ${{ steps.filter.outputs.lua }} + xpkg: ${{ steps.filter.outputs.xpkg }} steps: - uses: actions/checkout@v4 - uses: dorny/paths-filter@v3 @@ -47,6 +48,10 @@ jobs: - 'packages/m/mcpplibs-capi-lua/**' - 'tests/l/lua/**' - '.github/workflows/ci.yml' + xpkg: + - 'packages/m/mcpplibs-xpkg/**' + - 'tests/m/mcpplibs-xpkg/**' + - '.github/workflows/ci.yml' build: needs: detect-changes @@ -54,7 +59,8 @@ jobs: needs.detect-changes.outputs.templates == 'true' || needs.detect-changes.outputs.cmdline == 'true' || needs.detect-changes.outputs.llmapi == 'true' || - needs.detect-changes.outputs.lua == 'true' + needs.detect-changes.outputs.lua == 'true' || + needs.detect-changes.outputs.xpkg == 'true' strategy: fail-fast: false matrix: @@ -150,3 +156,19 @@ jobs: $env:PATH = "$env:USERPROFILE\.xlings\subos\current\bin;$env:PATH" xmake build -P . -y lua_test xmake run -P . lua_test + + # mcpplibs-xpkg + - name: mcpplibs-xpkg (unix) + if: runner.os != 'Windows' && needs.detect-changes.outputs.xpkg == 'true' + working-directory: tests + run: | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" + xmake build -P . -y mcpplibs-xpkg_test + xmake run -P . mcpplibs-xpkg_test + - name: mcpplibs-xpkg (windows) + if: runner.os == 'Windows' && needs.detect-changes.outputs.xpkg == 'true' + working-directory: tests + run: | + $env:PATH = "$env:USERPROFILE\.xlings\subos\current\bin;$env:PATH" + xmake build -P . -y mcpplibs-xpkg_test + xmake run -P . mcpplibs-xpkg_test diff --git a/packages/m/mcpplibs-xpkg/xmake.lua b/packages/m/mcpplibs-xpkg/xmake.lua new file mode 100644 index 0000000..d6c3950 --- /dev/null +++ b/packages/m/mcpplibs-xpkg/xmake.lua @@ -0,0 +1,19 @@ +package("mcpplibs-xpkg") + + set_homepage("https://github.com/Sunrisepeak/libxpkg") + set_description("C++23 reference implementation of the xpkg package specification") + set_license("MIT") + + add_urls( + "https://github.com/Sunrisepeak/libxpkg/archive/refs/tags/$(version).tar.gz", + "https://github.com/Sunrisepeak/libxpkg.git" + ) + + add_versions("0.0.1", "4bbf178c9225e6be09302408ebe70edfdae237adbf142ddf10d1535aec2ae0cd") + + add_deps("mcpplibs-capi-lua") + + on_install(function (package) + local configs = {} + import("package.tools.xmake").install(package, configs, {target = "xpkg"}) + end) diff --git a/tests/m/mcpplibs-xpkg/main.cpp b/tests/m/mcpplibs-xpkg/main.cpp new file mode 100644 index 0000000..a5e9004 --- /dev/null +++ b/tests/m/mcpplibs-xpkg/main.cpp @@ -0,0 +1,10 @@ +import std; +import mcpplibs.xpkg; + +int main() { + mcpplibs::xpkg::Package pkg; + pkg.name = "test"; + pkg.description = "mcpplibs-xpkg smoke test"; + std::println("package: {} - {}", pkg.name, pkg.description); + return 0; +} diff --git a/tests/m/mcpplibs-xpkg/xmake.lua b/tests/m/mcpplibs-xpkg/xmake.lua new file mode 100644 index 0000000..00c6174 --- /dev/null +++ b/tests/m/mcpplibs-xpkg/xmake.lua @@ -0,0 +1,8 @@ +add_requires("mcpplibs-xpkg 0.0.1") + +target("mcpplibs-xpkg_test") + set_kind("binary") + set_languages("c++23") + add_files("main.cpp") + add_packages("mcpplibs-xpkg") + set_policy("build.c++.modules", true) diff --git a/tests/xmake.lua b/tests/xmake.lua index f20ce2d..3074df0 100644 --- a/tests/xmake.lua +++ b/tests/xmake.lua @@ -4,3 +4,4 @@ includes("l/llmapi") includes("l/lua") includes("c/cmdline") includes("t/templates") +includes("m/mcpplibs-xpkg") From cdb29aff60da55b2dfad0ae591627dbb7ae97aac Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Sun, 1 Mar 2026 19:10:33 +0800 Subject: [PATCH 2/4] fix: add v prefix to libxpkg version tag in URLs The libxpkg repo uses v-prefixed tags (v0.0.1), so the URL template needs v$(version) instead of $(version). Co-Authored-By: Claude Opus 4.6 --- packages/m/mcpplibs-xpkg/xmake.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/m/mcpplibs-xpkg/xmake.lua b/packages/m/mcpplibs-xpkg/xmake.lua index d6c3950..29150ce 100644 --- a/packages/m/mcpplibs-xpkg/xmake.lua +++ b/packages/m/mcpplibs-xpkg/xmake.lua @@ -5,8 +5,8 @@ package("mcpplibs-xpkg") set_license("MIT") add_urls( - "https://github.com/Sunrisepeak/libxpkg/archive/refs/tags/$(version).tar.gz", - "https://github.com/Sunrisepeak/libxpkg.git" + "https://github.com/Sunrisepeak/libxpkg/archive/refs/tags/v$(version).tar.gz", + "https://github.com/Sunrisepeak/libxpkg.git v$(version)" ) add_versions("0.0.1", "4bbf178c9225e6be09302408ebe70edfdae237adbf142ddf10d1535aec2ae0cd") From 4d692cd6a64aa3d470a8af2c8e0a460e9fadd2da Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Sun, 1 Mar 2026 19:17:05 +0800 Subject: [PATCH 3/4] fix: install each library target individually instead of phony target The phony `xpkg` target produces no installable artifacts. Install each of the 5 real library targets individually to properly export module files and static libraries while avoiding examples/tests. Co-Authored-By: Claude Opus 4.6 --- packages/m/mcpplibs-xpkg/xmake.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/m/mcpplibs-xpkg/xmake.lua b/packages/m/mcpplibs-xpkg/xmake.lua index 29150ce..4367f24 100644 --- a/packages/m/mcpplibs-xpkg/xmake.lua +++ b/packages/m/mcpplibs-xpkg/xmake.lua @@ -15,5 +15,11 @@ package("mcpplibs-xpkg") on_install(function (package) local configs = {} - import("package.tools.xmake").install(package, configs, {target = "xpkg"}) + local install = import("package.tools.xmake").install + -- Install each library target individually to avoid building examples/tests + install(package, configs, {target = "mcpplibs-xpkg"}) + install(package, configs, {target = "mcpplibs-xpkg-loader"}) + install(package, configs, {target = "mcpplibs-xpkg-index"}) + install(package, configs, {target = "mcpplibs-xpkg-lua-stdlib"}) + install(package, configs, {target = "mcpplibs-xpkg-executor"}) end) From 76ab670469db78c7fc001f47f70c2296a866864a Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Sun, 1 Mar 2026 19:28:32 +0800 Subject: [PATCH 4/4] fix: add mcpplibs-capi-lua to test for module resolution The installed loader/executor cppm files import mcpplibs.capi.lua, so the test target needs explicit access to that module for scanning. Co-Authored-By: Claude Opus 4.6 --- tests/m/mcpplibs-xpkg/xmake.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/m/mcpplibs-xpkg/xmake.lua b/tests/m/mcpplibs-xpkg/xmake.lua index 00c6174..fa797cb 100644 --- a/tests/m/mcpplibs-xpkg/xmake.lua +++ b/tests/m/mcpplibs-xpkg/xmake.lua @@ -1,8 +1,9 @@ add_requires("mcpplibs-xpkg 0.0.1") +add_requires("mcpplibs-capi-lua 0.0.1") target("mcpplibs-xpkg_test") set_kind("binary") set_languages("c++23") add_files("main.cpp") - add_packages("mcpplibs-xpkg") + add_packages("mcpplibs-xpkg", "mcpplibs-capi-lua") set_policy("build.c++.modules", true)