Dosbox-staging: Publish snapshot builds for macOS

Created on 27 Jan 2020  路  5Comments  路  Source: dosbox-staging/dosbox-staging

Continuation of #31

We already have snapshots builds for Linux and Windows, macOS is the last remaining mainstream OS we want to add right now.

We need some macOS dev, who could implement packaging job in our CI and test if generated packages work correctly.

help wanted macOS

Most helpful comment

Initial support for macOS snapshot builds just landed in master with #200, so I am closing this issue.

All the problems I mentioned in my earlier comments are still there and we'll be addressing them one-by-one via new issues/bug reports.

All 5 comments

OK, so I was working on this issue lately, and (as suspected), packaging for macOS is "a bit" more complicated than simply "Create and App directory, threw files in and done", as multiple Apple "expert users" told me when I looked for help on various fora. There are multiple serious issues, that are making packaging for Apple really bad experience...

Anyways, here are some initial test app bundles:

Caveats:

  • App bundles are unsigned; we have similar issue on Windows 10, but Microsoft at least provides semi-sensible UI to selectively disable check for an exe. Tu run dosbox-staging bundle on macOS click on app with right mouse button, select "Open" and the dialog will show a button to accept unsigned app. It is unclear if I can sign our snapshots, but if it really costs 99$ per year for the privilege, then count me out.
  • Handling of external libs is much more problematic than on Linux or Windows - we can't rely on SDL being available in repos and sane loader (as in Linux), and simply dropping dylibs in specific directory inside bundle does not make it visible to the app (as in Windows), because dynamic linking hardcodes paths inside binary; Apple provides a tool to overwrite paths inside binaries, but it's not a good solution, as I would need to overwrite paths inside all our dependencies. For this reason, SDL2 is linked statically. ALL optional dependencies were disabled for now, we'll re-enable it one by one in future iterations.
  • App bundles created on macOS are not backwards compatible. At all. There's no way to install old SDKs without opening a browser and downloading Xcode manually. This is simply ridiculous.
  • GitHub CI removed macOS 10.14 and older Xcode versions, so the best we can do without hacking some questionable solutions is to wait for GitHub to bring back old SDKs to new macOS VMs (they have this item in backlog); there's no guarantee it will solve the issue.
  • Official Apple versioning scheme is incompatible with semver and rather inadequate (only 255 test builds per version?! really?!). For this reason I decided to ignore it completely, as for now there seems it's not a problem in practice (I wonder when it'll turn out to be a problem).
  • GitHub CI LFS does not seem to work on macOS hosts :/
  • SDL2 sdl2-config program returns broken flags, incompatible with statically linking package provided via brew
  • Python 3 is not available; Apple is dropping all scripting languages in future versions of macOS. This creates an issue, as Python 3 installed via brew uses /usr/local paths, so proper hash bangs do not work. I will probably go through scripts we use for development and replace (correct) hash bangs with (incorrect) hash bangs working with brew on macOS. Our python scripts are not part of dosbox itself (only used for development), but it's annoying nonetheless.
  • I have no idea ATM how to reliably configure folder inside DMG to show desired background, reorder icons, resize them, etc. We can't "simply open Finder and click around" on CI.

Work on these app bundles continues, but help with solving the issues I mentioned above would be appreciated.

@dreamer: First of all I wanted to mention, that I really appreciate your efforts to make DOSBOX development more transparent and for making sure, that your GIT version is so close to the original. Great job! Highly appreciated. And thank you for working so hard to make a macOS build doable.

Now, about your issue:

"SDL2 sdl2-config program returns broken flags, incompatible with statically linking package provided via brew"

I ran into the exactly same problem in one of my projects. Here is a code snippet of my shell build script, how I solved this issue - maybe it helps:

if [ $OSTP = "OSX" ]; then
    #On OSX sdl2-config is not returning the right string to build statically, so we
    #need to create it manually by finding out the path to the SDL2 library and then
    #by replacing the lSDL2 part in the output of sdl2-config
    PATH_TO_SDL2LIB=$(sdl2-config --static-libs | perl -pe 's|(-L/.+?\s).*|\1|' | cut -c 3- | rev | cut -c 2- | rev)"/libSDL2.a"
    SDL2_LIBS=$(sdl2-config --static-libs | sed 's|-lSDL2|'$PATH_TO_SDL2LIB'|')
else
    SDL2_LIBS=`sdl2-config --static-libs`

I cleaned up and updated macOS snapshot work done so far, it's now on branch po/macos-snapshot-3.

The latest test build can be downloaded from here: https://github.com/dreamer/dosbox-staging/actions/runs/40168027

Previous build had a linking problem preventing it from starting if SDL2_net was missing, new updated test branch for snapshots is now po/macos-snapshot-4 (hopefully it's the last one before merging-in release build to master branch).

The latest build can be downloaded from here: https://github.com/dreamer/dosbox-staging/actions/runs/46491796

Initial support for macOS snapshot builds just landed in master with #200, so I am closing this issue.

All the problems I mentioned in my earlier comments are still there and we'll be addressing them one-by-one via new issues/bug reports.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dreamer picture dreamer  路  5Comments

dreamer picture dreamer  路  4Comments

okias picture okias  路  4Comments

datapackrat picture datapackrat  路  4Comments

LowLevelMahn picture LowLevelMahn  路  6Comments