What is needed for a proper Mac support - Page 3

What is needed for a proper Mac support

Discuss everything related to compiling and running Spring on Mac OS X.

Moderator: Moderators

abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: What is needed for a proper Mac support

Post by abma »

very likely libary and header don't match / were compiled with different flags or different versions are installed on the system and one is used as header an one as lib.

look into CMakeCache.txt which header dir / lib dir is used for it.
lamer
Posts: 153
Joined: 08 Mar 2014, 23:13

Re: What is needed for a proper Mac support

Post by lamer »

In my case i had no glew frameworks at all before installing it through macports. And now GLEW_LIBRARIES is pointing to /opt/local/lib/libGLEW.dylib
Probably adding -DGLEW_LIBRARIES=/opt/local/lib/libGLEW.a to cmake args should fix an issue.

Or can also try without macport's glew and no glew cmake args (or only with proper -DGLEW_INCLUDE_DIR, because by default it was pointing to spring's glew and had undefined symbols).
darklord42
Posts: 96
Joined: 26 Jul 2014, 07:11

Re: What is needed for a proper Mac support

Post by darklord42 »

Halleluiah!
Thanks lamer!

adding -DGLEW_LIBRARIES=/opt/local/lib/libGLEW.a worked great.

Now I got to find a way to package all this. What a mess for mac people :) They aren't the most computer literate bunch.
darklord42
Posts: 96
Joined: 26 Jul 2014, 07:11

Re: What is needed for a proper Mac support

Post by darklord42 »

I'm still working my way through dependency h***, but it will work out..eventually. The other issue is getting spring to search for resources like the FreeSans font. Is there anyway I can set that at compile time in cmake to @executable_path/../Resources folder? Or unless it has to be an absolute path, which is doable. Just need to do a few tricks to maintain app portability.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: What is needed for a proper Mac support

Post by abma »

does this script still work for creating a bundle? https://github.com/spring/spring/blob/d ... _bundle.sh
darklord42
Posts: 96
Joined: 26 Jul 2014, 07:11

Re: What is needed for a proper Mac support

Post by darklord42 »

Awesome! Should have figured you guys had an old system in place.

I get

Code: Select all

Please run with /Users/herecomethej/spring/buildbot/slave/osx/create_Mac_bundle.sh <config> <branch>
I took a look inside but I have no idea what it means by config and branch. Do you remember how it is suppose to work?

Also dylibbundler had no issues packaging the libraries, (except for a small issue where spring was linked to the wrong x11 lib from another install). So my hopes are high that this should be able to find all the libraries off the macports install. :)
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: What is needed for a proper Mac support

Post by abma »

config is the buildbot config and branch is develop :-)
not sure what cwd has to be, i guess root of spring.

i.e.:
cd /Users/herecomethej/spring/
buildbot/slave/osx/create_Mac_bundle.sh default develop
darklord42
Posts: 96
Joined: 26 Jul 2014, 07:11

Re: What is needed for a proper Mac support

Post by darklord42 »

Code: Select all

buildbot/slave/osx/create_Mac_bundle.sh default develop
yeilds:

Code: Select all

MAKE isn't set, using 'make' as default
Installing into /tmp/spring/inst
buildbot/slave/osx/create_Mac_bundle.sh: line 12: cd: /Users/herecomethej/spring/build/default: No such file or directory
Just a quick look through the script. It wants to build a zip labeled for OSX 10.6. That isn't happening with SDL2. 10.7 at the earliest, and I don't have that setup.

Also at the end it wants to build a .zip file from the folder.
OSX distro are typically in compressed dmg disk images

A folder can be turned into one with the command:
hdiutil create -volname WhatYouWantTheDiskToBeNamed -srcfolder /whatever/path -ov -format UDZO name.dmg
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: What is needed for a proper Mac support

Post by abma »

this script was/is run on a buildslave and excepts a lot of stuff. either adjust the script or fix your build so it fits to the script. can't help that much with it, it shouldn't be hard to understand...
hokomoko
Spring Developer
Posts: 593
Joined: 02 Jun 2014, 00:46

Re: What is needed for a proper Mac support

Post by hokomoko »

Have you tried building SDL2? it's pretty straightforward on windows&linux, may work on your setup as well.
darklord42
Posts: 96
Joined: 26 Jul 2014, 07:11

Re: What is needed for a proper Mac support

Post by darklord42 »

[EDIT] Figured some stuff out
I guess I follow it. It's a bit of a rube goldberg machine, but I think we can get it to live again.

in prepare.sh

The <config> is actually a folder and subdirectory of the build folder from which you ran cmake. My guess it's a form of sorting between different builds.

the make line should be
make spring (or we try to build parts of the project that don't play nicely with OSX yet)

in the main script needs a little updating as well

the make install should be
make install-spring (same issue as above)

The rest should be ok, from what I can follow. It might not install libgcc but I'll have to try it out.
Again not a fan of zip distros of apps for OSX :)

@ hokomoko

Sure, but macports doesn't allow it. Parts of the system are just too old.
Last edited by darklord42 on 18 Jan 2015, 06:14, edited 1 time in total.
darklord42
Posts: 96
Joined: 26 Jul 2014, 07:11

Re: What is needed for a proper Mac support

Post by darklord42 »

EDIT

Now that I figured out the script, It's actually quite simple to copy what it does. So now I have a working spring.app. Time to move on to springlobby :)
darklord42
Posts: 96
Joined: 26 Jul 2014, 07:11

Re: What is needed for a proper Mac support

Post by darklord42 »

Well I have a working Springlobby and Spring.apps. Unfortionatly they don't work together. I don't think Springlobby can select the app package and work, and using a soft link to the macos folder to select the libunitsync.dylib doesn't work either cause it cant obtain the version string? I guess it's for official releases only?

But anyway. People are free to play with it.
http://www.mediafire.com/download/n31j8 ... esting.dmg
For OSX 10.10 only
Last edited by darklord42 on 18 Jan 2015, 17:20, edited 1 time in total.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: What is needed for a proper Mac support

Post by abma »

link is 404.
. I don't think Springlobby can select the app package and work, and using a soft link to the macos folder to select the libunitsync.dylib doesn't work either cause it cant obtain the version string? I guess it's for official releases only?
no clue how it worked, i didn't write the code nor do i have osx. but afaik it worked somehow :-)

maybe the code got broken which allowed to select the .app package? idk, sorry.
darklord42
Posts: 96
Joined: 26 Jul 2014, 07:11

Re: What is needed for a proper Mac support

Post by darklord42 »

Oops somehow copied the wrong link...

Anyway, perhaps with a test bundle we can get some answers :)
lamer
Posts: 153
Joined: 08 Mar 2014, 23:13

Re: What is needed for a proper Mac support

Post by lamer »

Works a bit. But tests were not clean (e.g. i have installed all development libraries earlier).
Can't select Spring.app package in springlobby, it only allows to select libunitsync.dylib and file browser doesn't open Spring.app as directory.
Had to manually edit

Code: Select all

/Users/bob/Library/Preferences/.springlobby/springlobby.conf
and add there

Code: Select all

[Spring/Paths]
[Spring/Paths/98.0.1-284-gae0a419\ develop]
SpringBinPath=/Applications/Spring.app/Contents/MacOS/spring
UnitSyncPath=/Applications/Spring.app/Contents/MacOS/libunitsync.dylib
SpringBundlePath=/Applications/Spring.app
darklord42
Posts: 96
Joined: 26 Jul 2014, 07:11

Re: What is needed for a proper Mac support

Post by darklord42 »

I understand putting resources in hidden folders in the home folder. That's a unix convention. (although a hoop to jump through in OSX requiring a command to the finder and reset the finder) But why put resources in a hidden folder under ~/Library/Preferences? Seems a tad silly.
lamer
Posts: 153
Joined: 08 Mar 2014, 23:13

Re: What is needed for a proper Mac support

Post by lamer »

But why put resources in a hidden folder under ~/Library/Preferences? Seems a tad silly.
Yep, don't know why its that way (i guess because there is no OS X devs). I just typed "find / -name *springlobby*" and found it there. Also spring settings are in "~/.config/spring/springsettings.cfg" :)
darklord42
Posts: 96
Joined: 26 Jul 2014, 07:11

Re: What is needed for a proper Mac support

Post by darklord42 »

I'll have to remember that. Spotlight ignores hidden folders. unless you start the search from within one. Thanks!

I just added the values manually, but it just complains about libunitsync.dylib not loading. Did the same happen for you?
darklord42
Posts: 96
Joined: 26 Jul 2014, 07:11

Re: What is needed for a proper Mac support

Post by darklord42 »

Gah, I forgot to "bundle" unitsync. and points to the macports /opt/local libraries.

Odd thing is I'm having a heck of a time bundling it. It seems no matter what I do, using dylibbundler to relink libraries to the lib folder, or same folder with @lib_path/../MacOS. Springlobby tells me it can't load. (unless I use pointing to macports) this really has me scratching my head. otool -L tells me all the decencies to libunitsync.dylib are in the right places in the bundle. But no luck..

I even tried to use the bundle builder script, using the fixes I mentioned above. (it fails when it tries to strip the libraries) and doesn't get far. But even the partial success tells me that the script had the same idea with putting depend ices of libunitsync.dylib in the same folder as itself. But still no luck. I'm going to leave this for the day, and come back to it later.
Post Reply

Return to “Mac OS X”