diff --git a/README.md b/README.md index 0432463..0a65a90 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,10 @@ mcpp build # 自动拉取源码 + 构建 | 包名 | 版本 | 简介 | |------|------|------| | `ftxui` | 6.1.9 | C++ 函数式终端 UI 库(screen + dom + component) | +| `glfw` | 3.4 | GLFW 窗口与输入库(null platform 后端源码构建) | | `gtest` | 1.15.2 | Google Test 测试框架 | +| `imgui` | v1.92.8 | Dear ImGui immediate-mode GUI 核心源码 | +| `opengl` | 2026.05.31 | Khronos OpenGL API 头文件 | | `mbedtls` | 3.6.1 | TLS/加密库(纯 C) | | `lua` | 5.4.7 | Lua 脚本语言(纯 C 嵌入式库) | | `zlib` | v1.3.2 | DEFLATE 压缩库 | @@ -56,6 +59,9 @@ libarchive ├── lz4 ├── zstd └── xz ← 压缩后端自动传递 + +glfw + └── opengl ← GLFW/glfw3.h 所需 OpenGL 头文件 ``` mcpp 0.0.3+ 的 transitive walker 自动沿链路传播头文件和依赖,消费者只需声明直接依赖。 diff --git a/pkgs/c/compat.glfw.lua b/pkgs/c/compat.glfw.lua new file mode 100644 index 0000000..132fd63 --- /dev/null +++ b/pkgs/c/compat.glfw.lua @@ -0,0 +1,48 @@ +package = { + spec = "1", + namespace = "compat", + name = "compat.glfw", + description = "GLFW windowing and input library built from source with the null platform backend", + licenses = {"Zlib"}, + repo = "https://github.com/glfw/glfw", + type = "package", + + xpm = { + linux = { + ["3.4"] = { + url = "https://github.com/glfw/glfw/archive/refs/tags/3.4.tar.gz", + sha256 = "c038d34200234d071fae9345bc455e4a8f2f544ab60150765d7704e08f3dac01", + }, + }, + }, + + mcpp = { + language = "c++23", + import_std = false, + c_standard = "c11", + cflags = { "-D_DEFAULT_SOURCE" }, + include_dirs = {"*/include", "*/src"}, + sources = { + "*/src/context.c", + "*/src/init.c", + "*/src/input.c", + "*/src/monitor.c", + "*/src/platform.c", + "*/src/vulkan.c", + "*/src/window.c", + "*/src/egl_context.c", + "*/src/osmesa_context.c", + "*/src/null_init.c", + "*/src/null_monitor.c", + "*/src/null_window.c", + "*/src/null_joystick.c", + "*/src/posix_time.c", + "*/src/posix_thread.c", + "*/src/posix_module.c", + }, + targets = { ["glfw"] = { kind = "lib" } }, + deps = { + ["compat.opengl"] = "2026.05.31", + }, + }, +} diff --git a/pkgs/c/compat.imgui.lua b/pkgs/c/compat.imgui.lua new file mode 100644 index 0000000..b64ad81 --- /dev/null +++ b/pkgs/c/compat.imgui.lua @@ -0,0 +1,44 @@ +package = { + spec = "1", + namespace = "compat", + name = "compat.imgui", + description = "Dear ImGui immediate-mode GUI library core sources", + licenses = {"MIT"}, + repo = "https://github.com/ocornut/imgui", + type = "package", + + xpm = { + linux = { + ["v1.92.8"] = { + url = "https://github.com/ocornut/imgui/archive/refs/tags/v1.92.8.tar.gz", + sha256 = "fecb33d33930e12ff53a34064e9d3a06c8f7c3e04408f14cd36c80e3faac863b", + }, + }, + macosx = { + ["v1.92.8"] = { + url = "https://github.com/ocornut/imgui/archive/refs/tags/v1.92.8.tar.gz", + sha256 = "fecb33d33930e12ff53a34064e9d3a06c8f7c3e04408f14cd36c80e3faac863b", + }, + }, + windows = { + ["v1.92.8"] = { + url = "https://github.com/ocornut/imgui/archive/refs/tags/v1.92.8.tar.gz", + sha256 = "fecb33d33930e12ff53a34064e9d3a06c8f7c3e04408f14cd36c80e3faac863b", + }, + }, + }, + + mcpp = { + language = "c++23", + import_std = false, + include_dirs = {"*", "*/backends"}, + sources = { + "*/imgui.cpp", + "*/imgui_draw.cpp", + "*/imgui_tables.cpp", + "*/imgui_widgets.cpp", + }, + targets = { ["imgui"] = { kind = "lib" } }, + deps = {}, + }, +} diff --git a/pkgs/c/compat.opengl.lua b/pkgs/c/compat.opengl.lua new file mode 100644 index 0000000..bbfcadd --- /dev/null +++ b/pkgs/c/compat.opengl.lua @@ -0,0 +1,44 @@ +package = { + spec = "1", + namespace = "compat", + name = "compat.opengl", + description = "Khronos OpenGL API headers for mcpp packages", + licenses = {"MIT"}, + repo = "https://github.com/KhronosGroup/OpenGL-Registry", + type = "package", + + xpm = { + linux = { + ["2026.05.31"] = { + url = "https://github.com/KhronosGroup/OpenGL-Registry/archive/a30033d3e812c9bf10094f1010374a6b15e192eb.tar.gz", + sha256 = "3dadc4ccfe4b8d3a798fb405b7067304420ff997505b67041f3edfeecc3228ae", + }, + }, + macosx = { + ["2026.05.31"] = { + url = "https://github.com/KhronosGroup/OpenGL-Registry/archive/a30033d3e812c9bf10094f1010374a6b15e192eb.tar.gz", + sha256 = "3dadc4ccfe4b8d3a798fb405b7067304420ff997505b67041f3edfeecc3228ae", + }, + }, + windows = { + ["2026.05.31"] = { + url = "https://github.com/KhronosGroup/OpenGL-Registry/archive/a30033d3e812c9bf10094f1010374a6b15e192eb.tar.gz", + sha256 = "3dadc4ccfe4b8d3a798fb405b7067304420ff997505b67041f3edfeecc3228ae", + }, + }, + }, + + mcpp = { + language = "c++23", + import_std = false, + c_standard = "c11", + include_dirs = {"*/api", "mcpp_generated/include"}, + generated_files = { + ["mcpp_generated/include/GL/gl.h"] = "#pragma once\n#include \n", + ["mcpp_generated/opengl_empty.c"] = "int mcpp_compat_opengl_headers_anchor(void) { return 0; }\n", + }, + sources = {"mcpp_generated/opengl_empty.c"}, + targets = { ["opengl"] = { kind = "lib" } }, + deps = {}, + }, +}