Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate finalised macOS bundles from Linux environment #9

Open
5 tasks
JanisErdmanis opened this issue Apr 30, 2024 · 0 comments
Open
5 tasks

Generate finalised macOS bundles from Linux environment #9

JanisErdmanis opened this issue Apr 30, 2024 · 0 comments
Labels
feature good first issue Good for newcomers

Comments

@JanisErdmanis
Copy link
Member

Currently, when one uses AppBundler on Linux and bundles applications for macOS, the bundling finishes by making a MyApp.app. This can be easily run on MacOS, but as it is a plain folder when distributed, it needs to be put into an archive. It is a standard practice to use dmg for that purpose.

On macOS, dmg is created with hdutils and is unavailable on Linux. This also depends on which dmg build relies upon; thus, I did not investigate a more cross-platform approach further. This was also complicated because app bundles need to be (self) signed before compressed into dmg to be able to be opened (with reasonable UX) on the host platform.

Recently, there was a posting on HackerNews about a cross-platform tool written in Rust that can sign applications for the Apple platform about rcodesign. This seems even to address entitlements, and there are some prospects that it will even contain dmg file creation.

Currently, the creation of the DMG file needs to be done with another tool. This issue suggests using libdmg-hfsplus, which Firefox uses to build its bundles on Linux. Therefore, it seems like a solved problem.

The only missing piece is the inability to precompile the project for macOS on Linux. A splash screen can be shown to alleviate user experience in such a situation, where I had already had some success and had resolved some limitations to make it work. However, users would likely want to see more than a triangle on a screen to make it pleasing.

So, to summarise, this project seems an interesting endeavour to explore. The hard part is to make a working recipe, which can be outlined in the following steps for MyApp.app bundle that AppBundler currently produces:

  • Create a .DS_Store file within AppBundler and try to add some sensible parametrisation for it;
  • Replace rcodesign to sign the application bundle on macros and see if it changes how a finalised DMG application bundle works;
  • Use libdmg-hfsplus to form DMG archive and compare it with one created with hdutil
  • Add the bundling to DMG in AppBundler and add API to specify a key file likely as a keyword argument;
  • Bundle libdmg-hfsplus and rcodesign with BinaryBuilder for macOS and Linux and make AppBundler depend on it;

This feature is also interesting on macOS as it would allow the creation of complete bundles within AppBundler without any finalisation step. Precompilation and potentially system image compilation could be provided as a keyword argument, and it could throw an error when the host platform does not support that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant