Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add macOS release #17

Open
mateuszkrasucki opened this issue Jan 24, 2021 · 4 comments
Open

Add macOS release #17

mateuszkrasucki opened this issue Jan 24, 2021 · 4 comments
Labels
porting Generic porting related task

Comments

@mateuszkrasucki
Copy link

mateuszkrasucki commented Jan 24, 2021

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

Requirements:

  • homebrew

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
Copy link
Contributor

akx commented Jan 29, 2021

@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
Copy link
Author

@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
Copy link
Contributor

akx commented Feb 4, 2021

@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 veikkos added the porting Generic porting related task label May 28, 2021
@veikkos
Copy link
Member

veikkos commented Apr 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
porting Generic porting related task
Development

No branches or pull requests

3 participants