PeaceFounder / AppBundler.jl

Bundle your Julia application
MIT License
53 stars 3 forks source link

Generate finalised macOS bundles from Linux environment #9

Open JanisErdmanis opened 4 months ago

JanisErdmanis commented 4 months ago

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:

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.