feat: 支持 macOS 构建与自动化打包#9
Merged
qingchenyouforcc merged 2 commits intoqingchenyouforcc:mainfrom May 3, 2026
Merged
Conversation
让仓库可以在 Homebrew 安装的 Qt6 / libarchive 下直接构建,并修掉若干 跨平台构建配置的细节问题,README 同步更新 macOS 的构建说明。 - common.mk:在 macOS 上自动探测 Homebrew 的 qtbase / qtmultimedia / qttools / libarchive,找不到时回退到 MacPorts;通过 `pkg-config --with-path` 让 make 自身的 $(shell pkg-config) 也能命中 keg-only 路径。 - Makefile:链接时显式带上 libpugixml.a,并把 metainfo.xml / resources.rc / metadata.json 这类生成文件依赖通过 `$(filter ...)` 从链接命令中过滤掉,避免被当作输入扔给 ld。 - CMakeLists.txt:链接 Qt6::WidgetsPrivate 之前先 find_package OPTIONAL_COMPONENTS WidgetsPrivate,避免 Homebrew 多 framework 布局 下回退路径选错 include 目录。 - cmake/libshimejifinder:default_actions.cc / default_behaviors.cc 设为 HEADER_FILE_ONLY,仍参与生成依赖但不再独立编译,避免触发 -Werror=unused-const-variable。 - 给 libshimejifinder/bin2cpp.sh 与 src/tools/generate-metainfo.sh 添加可执行权限。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
把原先 `if: false` 的 macOS 占位 job 替换成参与同一 matrix 的 CMake + install-qt-action 流程,并补齐 .app 打包链路。 主要改动: - `.github/workflows/build-release.yaml`:在 matrix 里加入 macos-14 (arm64) 和 macos-13 (x86_64),使用 `install-qt-action` 拉取 Qt 6.8.3 (含 qtmultimedia/qtimageformats),跑 `cmake --build --target macapp` 打 .app,再用 `ditto` 压成可正确恢复 bundle 的 zip 上传为 `release-macos-arm64` / `release-macos-x86_64`。删掉旧的 MacPorts/Make based `build-macos` job。 - `.github/workflows/build-debug.yaml`:在 matrix 里追加 macos-14 入口, 执行 Debug 构建并上传 `debug-mac-arm64` 用于 PR 验证。 - `cmake/MacApp.cmake`(新增):定义 `macapp` 自定义目标,复制 `src/packaging/NeurolingsCE.app` 骨架、灌入构建产物(含 CLI)、 调 `macdeployqt`,最后用 `codesign --force --deep --sign -` 重签整个 bundle,规避 macdeployqt 偶发的子组件签名失效。Homebrew 多 keg 布局下额外补 `-libpath` 指向 qtsvg/qtimageformats/qtmultimedia/ qttools/qtbase 等 keg 目录。 - `CMakeLists.txt`:APPLE 分支引入 MacApp.cmake,并把 NeurolingsCECli 也带入 .app 的 Contents/MacOS。 - `cmake/Version.cmake`:扩展 `load_version` 把 APP_NAME / APP_BUNDLE_* / APP_COMPANY 等键都从 VERSION.txt 解析出来,否则 Info.plist / resources.rc / GNOME metadata.json 里的 @APP_BUNDLE_NAME@ 等占位 会展开成空串,导致 .app 无法启动、Windows 资源元数据为空、GNOME 扩展加载失败。 - 同步重新生成上述三个生成文件,让仓库里的版本与模板对齐。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cmake/MacApp.cmake用于打包.app,并修复 Homebrew 环境下的构建问题build-release/build-debugGitHub Actions 工作流中加入 macOS 自动构建任务Makefile/common.mk/CMakeLists.txt与 README,补充 macOS 相关说明Commits
Test plan
make构建通过