Nuitka: Creating Mac ".app"?

Created on 28 Oct 2019  路  10Comments  路  Source: Nuitka/Nuitka

This is a question, not an issue... my first time trying this.

I'm on macOS (10.14) and I did python3 -m nuitka --standalone hello.py (also tried with --clang)

The result is a weird hello.dist folder 鈥撀爓hich doesn't even appear as a folder in Finder 鈥撀爓hich contains a bunch of .so files, Python and my executable hello.

I thought it would create an .app bundle? Is there another step?

I also tried https://sveinbjorn.org/platypus but that doesn't really compile the python.

Thanks for any help!

Most helpful comment

Sorry for the long delay, I'm still not finished my draft script due to some problems at work this month.
I plan to come back to develop in the next weeks!

All 10 comments

In fact, additional steps are needed, since Nuitka (by itself) does not create app bundle. It "just" compile you python script into executable. Once you had compiled it, you can create your own app bundle, for example following the commonly used bundle structures described in this (little outdated) description.
As an alternative you could also use Xcode I guess, to generate an app bundle starting from custom executables.

It would be great to develop a script (maybe to be included in the NUITKA-Utilities repo to automatically generate app bundles starting from executables compiled by Nuitka.
A good starting point could be the fman build system project, that in fact create app bundle for PyInstaller executable.

By the way, such a script should also resolve common "hide-console" issue on macOs (see for example #458).

I hope to have some time (early next year) to better investigate on that and maybe propose a draft utility script. If so, I'll use this issue to provide some updates.

@gioboske that would be fantastic indeed, the contribution would surely be valued. If it's good, I think Nuitka proper should carry it, unless we think it makes no sense. The description didn't look too involved, basically just need to make a difference for DLLs and data files, and main executable.

Also icons would be nice I guess.

But don't burden this with too much, just get started with being able to run via macOS folder UI would be enough for a start. The other things will have their own complexities.

But don't burden this with too much, just get started with being able to run via macOS folder UI would be enough for a start. The other things will have their own complexities.

Totally agree. I'll keep it minimal, at least for the first attempt.
I'll try to setup a proposal for a post-compilation script to pack a macOS app bundle. Thus applicable only to --standalone mode (for --module a macOS framework bundle should fit better).

@kayhayen, if you agree, I would fork NUITKA-Utilities repo and open a PR for it, so to keep the code separate from "pure" Nuitka code.

Yes, but don't be shy to propose Nuitka changes that will make it easier for you and long term, I think it belongs there. Windows icons and stuff are already in Nuitka, so I think it probably needs to be there for people to have out of the box experience. But moving code is easy, first lets see the algorithm. :)

Sorry for the long delay, I'm still not finished my draft script due to some problems at work this month.
I plan to come back to develop in the next weeks!

I would really love to see that happen.

I can't wait for this :-)

Hi,

Thank you for trying to make this happen.

I am very interested. Any update since January?

Was this page helpful?
0 / 5 - 0 ratings