diff --git a/packaging/flatpak/net.catcrafts.CrafterBuild.yaml b/packaging/flatpak/net.catcrafts.CrafterBuild.yaml index e95288d..7eb8644 100644 --- a/packaging/flatpak/net.catcrafts.CrafterBuild.yaml +++ b/packaging/flatpak/net.catcrafts.CrafterBuild.yaml @@ -183,6 +183,33 @@ modules: url: https://github.com/bytecodealliance/wasmtime/releases/download/v49.0.2/wasmtime-v49.0.2-x86_64-linux.tar.xz sha256: a4d6e9e3a5a60f527cf7793d674c48930c80c2e8977995b8a275cad3254b9322 + - name: libcxx-22-modules + # The std module source of the libc++ release before the bundled one, for + # cross sysroots that carry that libc++ without it: Alpine packages the + # headers and the library but not share/libc++/v1, and a module source + # only compiles against the headers of its own release. crafter-build + # picks /std.cppm here by the sysroot's _LIBCPP_VERSION + # (SysrootStdModule in Crafter.Build:Toolchain). Add a module like this + # one per release worth supporting; the bundled clang has to be able to + # compile that release's headers. + buildsystem: simple + build-commands: + # Configure only. The cxx-modules component is std.cppm as configure + # generates it plus the .inc files straight from the source tree, so + # nothing is compiled, and libc++'s own install rule stays the one + # place that knows what a module source install consists of. + - cmake -S runtimes -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/app/bin/clang -DCMAKE_CXX_COMPILER=/app/bin/clang++ "-DLLVM_ENABLE_RUNTIMES=libcxx;libcxxabi" -DLIBCXXABI_USE_LLVM_UNWINDER=OFF -DLIBCXX_INSTALL_MODULES=ON + # Staged, not installed to /app: the component also writes + # lib/libc++.modules.json, which would replace the bundled libc++'s. + - cmake --install build --component cxx-modules --prefix "$PWD/stage" + - grep -q "_LIBCPP_VERSION 22" libcxx/include/__config + - mkdir -p /app/share/crafter-build/libc++-modules + - cp -r stage/share/libc++/v1 /app/share/crafter-build/libc++-modules/22 + sources: + - type: archive + url: https://github.com/llvm/llvm-project/releases/download/llvmorg-22.1.8/llvm-project-22.1.8.src.tar.xz + sha256: 922f1817a0df7b1489272d18134ee0087a8b068828f87ac63b9861b1a9965888 + - name: crafter-build buildsystem: simple build-options: