Skip to content

Package the desktop app for macOS (.app, DMG) and Windows (portable folder with its toolchain) - #33

Merged
MHunterG merged 3 commits into
mainfrom
desktop-app-packaging
Sep 26, 2026
Merged

MHunterG merged 3 commits into
mainfrom
desktop-app-packaging

Conversation

@MHunterG

Copy link
Copy Markdown
Contributor

Follows #32 (based on its branch; retarget to main once #32 is merged).

What

  • scripts/release_macos.sh takes, all optional: --packaging DIR (release description from another directory than <game>/packaging), --license NAME=FILE, --notices FILE, --extra PATH (repeatable), and in release.env RELEASE_EXTRA_EXECUTABLES, RELEASE_RESOURCES, RELEASE_PROFILE_DIR. A missing icon is a note, not an error. A game's release packs as before.
  • apps/portablekit/packaging/: the app's release.env, THIRD_PARTY_NOTICES.md (macOS and Windows), and a read-me for each.
  • macOS: scripts/release_macos.sh --game . --packaging apps/portablekit/packaging <build> makes PortableKit.app with psp_recomp in Contents/MacOS and the corpus headers in Contents/Resources/include, a DMG and a zip.
  • Windows: scripts/package_desktop_windows.ps1 -BuildDir <llvm-mingw build> -Toolchain <llvm-mingw> assembles the portable folder (program, recompiler, DLLs, headers, empty data\, trimmed llvm-mingw in toolchain\: x86_64 only), checks it for game data and machine paths, starts the packed program, links a probe library with the packed toolchain, and writes the zip, SHA256SUMS and BUILDINFO.txt. Same -License/-Notices/-Extra/-Packaging hooks.
  • docs/RELEASING.md: "The desktop app" and "A build with other components".

Verified

  • macOS arm64: app built with -DPORTABLEKIT_RELEASE=ON, the example HLE extension and a build label; packed with --license, --extra and --zip. All the script's checks pass (system imports against MacOSX13.1.sdk, no machine paths, no game data, codesign of the bundle, the DMG and the zip). The unpacked PortableKit.app reports its version, label and module; with a separate data dir it compiled LocoRoco 2 at -O0 using the bundled psp_recomp and Resources/include (315 s, 195 units) and ran the compiled code headless for 20 s.
  • Windows x64 (maintainer's PC, llvm-mingw 20260922, separate folders and data dir, PORTABLEKIT_NO_AUDIO=1): release build of the app with the example module; the script produced a 404 MB folder / 118 MB zip. Unpacked from the zip and run with PATH limited to System32: compile UCES00842 --opt 0 (God of War: Chains of Olympus) recompiled, compiled and linked with the packed toolchain, and run --no-compile --headless --seconds 20 loaded the compiled library.
  • A first version of the trim dropped clang's runtime folder and the link failed; the script now keeps it, fails if it goes missing, and links a probe library before packing.

Not verified

  • A game's own release (Purun, Yakumo) with the changed release_macos.sh; the defaults are meant to keep it identical, but it was not run.
  • The DMG opened on another Mac, or on macOS 13; the window of the packed app.
  • The Windows folder on a PC without the development tools installed (only PATH was restricted).
  • Linux packaging of the app (not part of this change).

🤖 Generated with Claude Code

MHunterG and others added 2 commits September 26, 2026 20:08
release_macos.sh packed exactly one executable and the files of the game's
repository. It now also takes, all optional and off by default:

- --packaging DIR: release.env, the notices and macos/ from another
  directory than <game>/packaging, such as the desktop app's or a
  downstream build's own;
- --license NAME=FILE, --notices FILE and --extra PATH (repeatable): a
  licence and a notices file for a component the build added, and files
  beside the app in the disk image and the zip;
- in release.env, RELEASE_EXTRA_EXECUTABLES (more programs beside the
  executable, signed with it), RELEASE_RESOURCES (folders of the build's
  bin/ for Contents/Resources) and RELEASE_PROFILE_DIR (where the profile
  whose game/ a developer build falls back to lives).

A missing icon is now a note instead of an error, and a checkout that is
PortableKit itself does not ship its licence twice. A game's release is
packed as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The desktop app needs more than one executable in its release: the
recompiler beside the program, the headers the generated code includes,
and on Windows the compiler it builds games with.

- apps/portablekit/packaging: the app's release.env, third-party notices
  for both systems and a read-me for each.
- macOS: scripts/release_macos.sh --game . --packaging
  apps/portablekit/packaging <build> makes PortableKit.app (psp_recomp in
  Contents/MacOS, the headers in Contents/Resources/include, where the
  program looks inside a bundle), a disk image and a zip.
- Windows: scripts/package_desktop_windows.ps1 assembles the portable
  folder from an llvm-mingw build: the program, the recompiler and their
  DLLs, the headers, an empty data folder and the part of llvm-mingw that
  compiling for x86_64 needs (clang's x86_64 runtime only). It checks for
  game data and paths of the build machine, starts the packed program,
  links a probe library with the packed toolchain, and writes the zip,
  SHA256SUMS and BUILDINFO.txt.
- Both take a downstream build's extra licences, notices and files
  (--license/-License, --notices/-Notices, --extra/-Extra) and another
  release description (--packaging/-Packaging), so such a build reuses the
  scripts instead of copying them.
- docs/RELEASING.md, "The desktop app".

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@MHunterG
MHunterG changed the base branch from hle-extensions to main September 26, 2026 17:37
@MHunterG
MHunterG marked this pull request as ready for review September 26, 2026 17:37
@MHunterG
MHunterG merged commit 16246a9 into main Sep 26, 2026
3 checks passed
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.

1 participant