Skip to content

[macOS] Phase 3: .app bundle + ad-hoc signing (closes #10 #11)#20

Open
braggpd wants to merge 4 commits into
macos-portfrom
macos/issue-10-app-bundle
Open

[macOS] Phase 3: .app bundle + ad-hoc signing (closes #10 #11)#20
braggpd wants to merge 4 commits into
macos-portfrom
macos/issue-10-app-bundle

Conversation

@braggpd

@braggpd braggpd commented May 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • MACOSX_BUNDLE TRUE on pob-host; mac/Info.plist.in bundle metadata
  • All dylibs install to Contents/Frameworks/ (SimpleGraphic, Lua modules, vcpkg runtime deps via macos_bundle_runtime.cmake)
  • RPATHs updated: binary uses @executable_path/../Frameworks; dylibs use @loader_path
  • codesign --deep --force --sign - added as final install step (3.2: Code signing strategy (ad-hoc initial) #11)
  • mac/host.cpp auto-discovers Launch.lua by walking up from the executable (handles .app bundle layout and flat runtime-macos/ dev layout)

Bundle layout after cmake --install

Path of Building 2.app/
  Contents/
    Info.plist
    MacOS/
      Path of Building-PoE2
    Frameworks/
      libSimpleGraphic.dylib
      lcurl.so / socket.so / lzip.so / lua-utf8.so
      liblua51.dylib / libzstd.dylib / ...  (vcpkg runtime deps)
      libEGL.dylib → liblibEGL_angle.dylib  (symlinks)

Test plan

  • ninja -C ~/PoB-SimpleGraphic-build/build — build passes
  • cmake --install ~/PoB-SimpleGraphic-build/build --prefix ~/PoB-PoE2-build/runtime-macos.app bundle produced at correct path
  • codesign -dv "Path of Building 2.app" — signature present
  • Double-click .app from ~/PoB-PoE2-build/runtime-macos/ (with src/ 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

patrickdbragg and others added 4 commits May 25, 2026 18:28
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants