[macOS] Phase 3: .app bundle + ad-hoc signing (closes #10 #11)#20
Open
braggpd wants to merge 4 commits into
Open
[macOS] Phase 3: .app bundle + ad-hoc signing (closes #10 #11)#20braggpd wants to merge 4 commits into
braggpd wants to merge 4 commits into
Conversation
…11) - MACOSX_BUNDLE TRUE on pob-host; mac/Info.plist.in with bundle metadata - All dylibs install to Contents/Frameworks/ (SimpleGraphic, lcurl, socket, lzip, lua-utf8, vcpkg runtime deps) - RPATH: binary uses @executable_path/../Frameworks; dylibs use @loader_path - cmake/macos_bundle_runtime.cmake: copy vcpkg deps to Frameworks/ (was flat .) - Ad-hoc codesign --deep --force --sign - as final install step (#11) - mac/host.cpp: auto-discover Launch.lua by walking up from exe (handles both .app bundle layout and flat runtime-macos/ dev layout) Closes #10, #11 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
MACOS_BUNDLE_FRAMEWORKS_DEST baked in the configure-time CMAKE_INSTALL_PREFIX,
so cmake --install --prefix <path> would copy vcpkg deps to the wrong location.
Fix: pass @MACOS_FW_DEST@ (relative, configure-time) to the install script and
combine with ${CMAKE_INSTALL_PREFIX} at script run time. Same fix applied to
the codesign install(CODE) step (\${CMAKE_INSTALL_PREFIX} escaped).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CMake's install(TARGETS ... BUNDLE) names the .app after OUTPUT_NAME, not MACOSX_BUNDLE_BUNDLE_NAME. With MACOS_APP_NAME="Path of Building 2", the dylib install rules wrote to a different directory than the binary install, producing two incomplete .app bundles. Fix: set MACOS_APP_NAME="Path of Building-PoE2" to match OUTPUT_NAME. MACOSX_BUNDLE_BUNDLE_NAME still sets CFBundleName to "Path of Building 2" for the Info.plist display name. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
In dev layout basePath is runtime-macos/ so ../runtime/lua resolves correctly. In a .app bundle the executable lives in Contents/MacOS/, making ../runtime/lua point to Contents/runtime/lua which does not exist. Add an exists() fallback that goes 4 levels up to the directory containing the .app (runtime-macos/) and then finds runtime/lua/. Fixes package.path for xml/sha1/etc. modules when launched from the bundle. Also fixes the sha1.common preload path in ui_main.cpp. Co-Authored-By: Claude Sonnet 4.6 <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
MACOSX_BUNDLE TRUEonpob-host;mac/Info.plist.inbundle metadataContents/Frameworks/(SimpleGraphic, Lua modules, vcpkg runtime deps viamacos_bundle_runtime.cmake)@executable_path/../Frameworks; dylibs use@loader_pathcodesign --deep --force --sign -added as final install step (3.2: Code signing strategy (ad-hoc initial) #11)mac/host.cppauto-discoversLaunch.luaby walking up from the executable (handles.appbundle layout and flatruntime-macos/dev layout)Bundle layout after
cmake --installTest plan
ninja -C ~/PoB-SimpleGraphic-build/build— build passescmake --install ~/PoB-SimpleGraphic-build/build --prefix ~/PoB-PoE2-build/runtime-macos—.appbundle produced at correct pathcodesign -dv "Path of Building 2.app"— signature present.appfrom~/PoB-PoE2-build/runtime-macos/(withsrc/next to it) — UI renders./runtime-macos/"Path of Building 2.app/Contents/MacOS/Path of Building-PoE2" ./src/Launch.lua— explicit arg still works🤖 Generated with Claude Code