Andreas Lochmann wrote on 24/08/21 10:30 am:
This would make things faster for the users. But --makepreviews
unfortunately doesn't place the generated .pngs in the correct folders;
you would have to move them by hand.
I think I have that covered already. Because any formula submitted to
Homebrew project for inclusion in homebrew-core cannot build an app
bundle, only command line executables, I removed the macapp target from
Makefile and made the homebrew formula use make install to put files in
/usr/local/bin and /usr/local/share/enigma just like on Linux. I
modified the macOS path setting in main.cc to be the same as Linux when
it detects it is not running from an app bundle.
Running enigma --makepreview will put the .pngs into the correct level
folders for whichever is being run, /usr/local/bin or
Enigma.app/Contents/MacOS.
To create the app bundle, I wrote a script enigmabuilddmg which is
installed using the Homebrew formula enigma-dev-tools. It copies the
files installed in /usr/local/bin/enigma and /usr/local/share/enigma
into the correct locations to create the Enigma.app bundle (along with
required shared libraries) and then packages it into an Enigma.dmg. If
you run enigma --makepreview before running enigmabuilddmg, the .png
files will end up properly copied from the /usr/local/share/enigma levels.
So, the current steps to build enigma and the dmg would be (using
formula from our github account Enigma-Game because it is not yet
accepted into homebrew-core):
brew install enigma-game/enigma/enigma
brew install enigma-game/enigma/enigma-dev-tools
enigma --makepreview
enigmabuilddmg
That creates a file Enigma.dmg in the current directory, with a
self-contained Enigma.app bundle that does not require Homebrew.
The Enigma-1.30-beta.dmg I uploaded to Github has the previews done that
way.
-- sidney