Attract-Mode Support Forum

Attract-Mode Support => General => Topic started by: estefan3112 on December 13, 2017, 01:42:42 PM

Title: Mac Users: Unofficial Mac Package 2.3.0-13
Post by: estefan3112 on December 13, 2017, 01:42:42 PM
To the extent that Mac users are not yet aware - there is an unofficial Mac Package of Attract Mode 2.3.0, in which Andrew ironed out the most critical compile errors. From my own testing, it seems to work quite well, and so far I have not received any negative feedback. Feel free to download!
https://mameonmacs.blogspot.co.at/2017/12/attract-mode-23013-for-mac-unofficial.html
Cheers!
Title: Re: Mac Users: Unofficial Mac Package 2.3.0-13
Post by: keilmillerjr on December 13, 2017, 06:51:01 PM
Woohoo!

Did you ever figure out why the bin is corrupted in the dmg?

Where I ended off:
Code: [Select]
# util/osx/create-pkg.sh

# added to line 105
cp -R "${SCRATCH}"/disk/Attract.app "${SCRIPT_PATH}“/../../

So Attract.app was copied from the scratch disk right before the dmg is created. Still had a corrupt bin. But the bin is make correctly.  Which leads me back to my original idea of it not being copied correctly. But I do not understand because line 73 looks correct to me.
Title: Re: Mac Users: Unofficial Mac Package 2.3.0-13
Post by: estefan3112 on December 13, 2017, 11:13:54 PM
No idea. But your posts were my inspiration to do it in the very bulky way: create the bin, create the dmg, set the dmg to edit mode, manually copy the working bin into the dmg, set the dmg back to read-only mode. Since this works, the question why the script does not work seems even more puzzling.

What I forgot to write: This binary has no SWF support, which I understand is rather new and alpha-esque. Just if some artwork does not function (in my case, Nevato, Robospin and other popular layouts just work).
Title: Re: Mac Users: Unofficial Mac Package 2.3.0-13
Post by: estefan3112 on December 15, 2017, 01:08:33 AM
A user reported back that there are problems with this build:
dyld: Library not loaded: /usr/local/opt/sfml/lib/libsfml-graphics.2.4.dylib
Referenced from: Attract.app/Contents/MacOS/./attract
Reason: image not found
This might mean that the application does not use the libraries in the package, but the ones under /usr/local/opt/, which I use for compiling.
So the package still is not ready for prime time.

In the create-pkg.sh, there is this section that shall link the libraries into the bundle - this and the bundlelibs.py script does not seem to work correctly:
# Copy extra libs to bundle and fix link path
pushd "${APPCONTENT}"/MacOS >/dev/null
${SCRIPT_PATH}/bundlelibs.py attract
popd >/dev/null
Title: Re: Mac Users: Unofficial Mac Package 2.3.0-13
Post by: raygun on December 18, 2017, 07:52:29 PM
I'm not too up on the mac development tools, but it sounds like you need to use the 'otool' command to edit the attract executable you have created so that it uses the dylibs from the Attract.app bundle instead of /usr/local/opt

That is what I think the bundlelibs.py script is doing.  Can you load python onto your system and try running the 'bundlelibs.py attract' command directly ?  It looks like it is being run from the MacOS subdirectory inside of the app bundle.

Title: Re: Mac Users: Unofficial Mac Package 2.3.0-13
Post by: estefan3112 on January 06, 2018, 02:32:00 AM
Many thanks Raygun, I will give it a try and report back further. Maybe Attract Mode brings me into coding a bit :-).
Sorry for the late reply and happy 2018!

UPDATE - I think that I could limit the error to exactly the the bundlelibs.py script - this is what I did:
- I installed Python via Homebrew and changed directory into the MacOS bundle with the unmodified working attract binary
- I applied bundlelibs.py to the unmodified attract binary and launched it via Terminal

Voila - attract ends up with the known segmentation fault. The long Crash Report is saved under Issue #397 on Github, it is too long for here.

Which means:
- If I run Attract Mode with an unmodified binary, it works (but only with the necessary libraries installed externally via Homebrew)
- If I run Attract Mode with the modified binary linking it into the bundled libraries, it crashes with the segfault documented in Issue #397
So the problem seems to lie in that modification as done by bundlelibs.py.


Thanks Raygun, this gives an idea.