suomipelit / skijump3-sdl

Ski Jump International v3 (SDL2 port)
https://www.nomasi.com/sj3/
GNU General Public License v3.0
12 stars 3 forks source link

Add macOS release #17

Open mateuszkrasucki opened 3 years ago

mateuszkrasucki commented 3 years ago

I've managed to successfully build SJ3 for Mac, for both x8664 and arm64.

Requirements:

Steps

# Install compiler and SDL2
$ brew install fpc sdl2

# Clone Pascal SDL2 headers
$ git clone https://github.com/ev1313/Pascal-SDL-2-Headers

# Compile
$ fpc -Mtp -k-L{path homebrew installed library to, depends on your setup} -k-lSDL2 -k-framework -kOpenGL -k-framework -kCocoa  -Fu./Pascal-SDL-2-Headers/ SJ3.PAS

Since all the tooling works already with Apple Sillicon (sdl2 for arm64 is already available in homebrew and fpc can be easily built) it's also quite straightforward to build Apple Sillicon version.

I've bundled an universal app with SDL dylib included and here's the DMG available for download: https://www.dropbox.com/s/vfpdeu2m8a7tg8e/SJ3.dmg?dl=0. You can add it as a Release if interested.

I don't have have an Apple Developer account so it's unsigned and not notarised so one have to go Settings -> Security&Privacy to accept Gatekeeper exception upon first launch. Except that, it just works :)

In case somebody would like to add hills or modify names files etc. you have to open an app bundle by clicking Show Package Contents in context menu (option-click on the app) and going into Contents/Resources.

akx commented 3 years ago

@mateuszkrasucki Do you have command line steps for building the .app bundle, or did you build it by hand somehow? We could make this a GitHub Actions build :)

mateuszkrasucki commented 3 years ago

@akx I did use a script and also did some slightly ugly huck with zsh script to make it actually start from a .app bundle. Still, it's been reported to me that it didn't work for anybody with version lower than BigSur. I didn't know that GitHub actions have maxOS runners. I'll try to contribute to make it work whenever I have a bit more free time :)

akx commented 3 years ago

@mateuszkrasucki Well, you can take a look at my draft PR #18 :)

I think there's something wrong with how I'm packaging the assets into the .app – if you can share your zsh script, I could adapt from there :)

veikkos commented 5 months ago

I tried the generated DMG which can be found from the builds. It's ok initial package but would need some additional work!

SJ3 contains default settings, hills, "records" and many things under "Resources" dir. The binary does not work unless its working dir contains all resources files and the binary is also modifying those files.

Likely those files should be copied to ~/Library/Application Support or ~/Documents (thanks for the consultation @akx) which should be then used as the working dir.