这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@orazioedoardo
Copy link
Contributor

@orazioedoardo orazioedoardo commented Jul 26, 2023

This pull request adds CMake settings and metadata to build a Mac app with frameworks included so that it can be distributed without installing Homebrew, SDL, and Xcode tools on the target Mac. I'm not really familiar with CMake but those setting that I looked up in the documentation worked for me.

The build script generates a .app and packages it in a DMG file as it is usually done on Mac. It uses special build of SDL Mixer with MIDI support sourced here libsdl-org/SDL_mixer#419 (comment) otherwise music won't work. A sample GitHub workflow is included too.

Users need to provide assets and copy them in the SpaceCadetPinball.app/Contents/Resources/ folder.

I created an icon using AI upscaler similarly to what has been done on #180, fixed artifacts, and adapted to a Big Sur template. Here's what a smaller version of it looks like by the way:
SpaceCadetPinball

@orazioedoardo orazioedoardo marked this pull request as draft July 26, 2023 11:09
@orazioedoardo orazioedoardo marked this pull request as ready for review July 26, 2023 12:01
@k4zmu2a
Copy link
Owner

k4zmu2a commented Jul 31, 2023

This build setup seems reasonable enough, although I cannot personally verify it.
Some finer points:

For finding SDL in /extern, try setting search paths from CMakeLists.txt, instead of adding it in find files.
Example: I do the same thing for Windows, searching for SDL DLLs in /Libs folder.
In CMakeLists.txt, see under this comment “On Windows, set paths to SDL-devel packages here”.

I suggest unification with Windows - use /Libs instead of /extern.
/extern needs to be in the .gitignore, if you stick with it.

About SDL mixer on macOS.
I was not aware that it ships with stripped native MIDI support, how bizarre.
I wonder how this impacts users who compile the game as described in the readme.
Does the official release at least support external synths, like Fluidsynth?

@orazioedoardo
Copy link
Contributor Author

orazioedoardo commented Jul 31, 2023

For finding SDL in /extern, try setting search paths from CMakeLists.txt, instead of adding it in find files.

Done.

I suggest unification with Windows - use /Libs instead of /extern.

Done.

I wonder how this impacts users who compile the game as described in the readme.

They need to provide a Sound Font 2 file like this and set the SDL_SOUNDFONTS environment variable to get music working.

Does the official release at least support external synths, like Fluidsynth?

Yes, and homebrew installs fluid-synth as a dependency of SDL2_mixer.

@k4zmu2a k4zmu2a merged commit 6ab7b3e into k4zmu2a:master Aug 1, 2023
@k4zmu2a
Copy link
Owner

k4zmu2a commented Aug 1, 2023

Thank you, it looks much better now. Merged.
I will include the universal .dmg made by this new workflow in the future releases.

It is good to hear that the official mixer release is functional MIDI-wise.
Even if it is only at feature/ease of use parity with Linux.

@orazioedoardo orazioedoardo deleted the mac-build branch August 1, 2023 06:19
@k4zmu2a k4zmu2a mentioned this pull request Aug 2, 2023
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.

2 participants