Closed kirbysayshi closed 9 years ago
From what I see it looks like it is supposed to be doing so in the cmake for rdsp. I'm not on mac so I don't know the full logistics of how the app bundles work.
I compiled it succefully on Mac, do you put vanilla library in the compiled binary folder? them you must put the sp game library in the base folder. Im playing JA without problems in OSX 10.9.
It indeed does not copy the .dylibs into their right place, you have to put them manually. Not sure if it's how it's intended to be, or it's a bug in cmake rules.
Ok, I guess I'll take a look at the cmake rules to see if that's suppose to be happening or not? Not too familiar with cmake itself.
I'm writing up some build instructions for mac... aside from needing to manually copy over .dylibs, what other custom things need to happen? Right now I've run the following:
$ mkdir -p ~/Library/Application\ Support/OpenJK
$ cp -r ~/Library/Application\ Support/Steam/SteamApps/common/Jedi\ Academy/SWJKJA.app/Contents/base/ ~/Library/Application\ Support/OpenJK/base/
But my build crashes once I try to start actually playing.
Is there any other documentation on building/running on a mac?
...And I just found https://github.com/JACoders/OpenJK/wiki/Compilation-guide. Sorry for not looking at the wiki earlier.
Are there any objections to a compilation guide existing within the source, like a COMPILING.md
?
what OSX version are you using?
OSX 10.9
Homebrew installed:
2.0.1 is newest actual stable SDL2, whether its available for you on 10.9 is another story.
We will not be adding any sort of extra compilation guide that describes how to add things to the .app. This should be solved so that its done automatically by CMake.
I'll look for 2.0.1.
By add a guide, I meant would you be open to me making a COMPILING.md file in a PR, just showing how to get things setup on a mac (and other platforms eventually) quickly. Again, I just found the wiki but I think it's really useful for new people if there is basic documentation close to the source code... I suppose I could just add it to the wiki, but I'd like some peer review first since I wouldn't want to give bad information.
I support moving the current compilation guide to COMPILING.md, and adding any missing Mac steps. Sounds like this issue in particular should be solved too.
Cool! I'll work on porting the info over and adding my mac stuff, if that's ok.
@kirbysayshi It might crash because you might have not copied libjagame which is a must. Try running OpenJK from Terminal and see what it outputs.
libjagame? I don't see that file anywhere in my file hierarchy. Do you mean jagamex86.dylib
? From the run log, it appears I need to at least copy jagamex86.dylib
to a base folder within the build
folder.
Ok, looks like if I manually run:
$ find . -name 'rd*.dylib' | xargs -I{} cp -f {} .
$ mkdir -p base && find code codemp -name '*.dylib' | xargs -I{} cp -f {} ./base/
Then single player loads up! Ideally the make file would copy non rd*.dylib
s to openjk{_sp,}.x86.app/Contents/MacOS/base/
, and the rd*.dylib
s to openjk{_sp,}.x86.app/Contents/MacOS/
Seems like that needs to happen anyway if .app files will ever be available for release as well.
Its supposed to be happening however the rules in our cmake were never fully finished.
Renderer dylibs should not be in the base or mod folders. Should be at the equivalent of the root directory (which would be where the executable would be under other OS')
I looked into this in a bit more detail - the renderer dylibs are only copied into the .app bundle when you do make install
. This should be fixed at some point.
@ensiform That makes sense. In this case I copied them there because I noticed it was looking for it, and that was easier than specifying the proper dylib names and app bundle paths.
@xycaleth make install
does indeed copy them into the app bundles, but it also copied all of that (including other build targets) into /usr/local
, e.g. my homebrew directory:
$ make install
[ 11%] Built target openjk_sp.x86
[ 30%] Built target jagamex86
[ 42%] Built target rdsp-vanilla_x86
[ 45%] Built target botlib
[ 58%] Built target openjk.x86
[ 70%] Built target openjkded.x86
[ 80%] Built target jampgamex86
[ 86%] Built target cgamex86
[ 88%] Built target uix86
[100%] Built target rd-vanilla_x86
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/./openjk_sp.x86.app
-- Installing: /usr/local/./openjk_sp.x86.app/Contents
-- Installing: /usr/local/./openjk_sp.x86.app/Contents/Info.plist
-- Installing: /usr/local/./openjk_sp.x86.app/Contents/MacOS
-- Installing: /usr/local/./openjk_sp.x86.app/Contents/MacOS/openjk_sp.x86
-- Installing: /usr/local/./openjk_sp.x86.app/Contents/Resources
-- Installing: /usr/local/./openjk_sp.x86.app/Contents/Resources/OpenJK.icns
-- Installing: /usr/local/OpenJK/jagamex86.dylib
-- Installing: /usr/local/openjk_sp.x86.app/Contents/MacOS/rdsp-vanilla_x86.dylib
-- Installing: /usr/local/./openjk.x86.app
-- Installing: /usr/local/./openjk.x86.app/Contents
-- Installing: /usr/local/./openjk.x86.app/Contents/Info.plist
-- Installing: /usr/local/./openjk.x86.app/Contents/MacOS
-- Installing: /usr/local/./openjk.x86.app/Contents/MacOS/openjk.x86
-- Installing: /usr/local/./openjk.x86.app/Contents/Resources
-- Installing: /usr/local/./openjk.x86.app/Contents/Resources/OpenJK.icns
-- Installing: /usr/local/./openjkded.x86
-- Installing: /usr/local/OpenJK/jampgamex86.dylib
-- Installing: /usr/local/OpenJK/cgamex86.dylib
-- Installing: /usr/local/OpenJK/uix86.dylib
-- Installing: /usr/local/openjk.x86.app/Contents/MacOS/rd-vanilla_x86.dylib
Once I configured the install prefix, I was able to force it to install locally.
But even then, jagamex86.dylib
was not copied to a ./base
folder.
@redsaurus kinda just hacked up the support for app bundles, so don't expect it to even remotely be 100% working or perfect ;)
No idea if the game can/will even load it from there anyway.
Ideally this is the expected how it should be in the end whenever this is all sorted:
We haven't finalized if it will copy to base or the OpenJK folder yet. There is some potential issues with mixing and changing the default game folder etc.
openjk_sp.x86.app
openjk_sp.x86.app\Contents
openjk_sp.x86.app\Contents\Info.plist
openjk_sp.x86.app\Contents\MacOS
openjk_sp.x86.app\Contents\PkgInfo
openjk_sp.x86.app\Contents\Resources
openjk_sp.x86.app\Contents\MacOS\base
openjk_sp.x86.app\Contents\MacOS\openjk_sp.x86
openjk_sp.x86.app\Contents\MacOS\rdsp-vanilla_x86.dylib
openjk_sp.x86.app\Contents\MacOS\OpenJK\jagamex86.dylib
openjk_sp.x86.app\Contents\MacOS\base\jagamex86.dylib
openjk_sp.x86.app\Contents\Resources\OpenJK.icns
openjk.x86.app
openjk.x86.app\Contents
openjk.x86.app\Contents\Info.plist
openjk.x86.app\Contents\MacOS
openjk.x86.app\Contents\PkgInfo
openjk.x86.app\Contents\Resources
openjk.x86.app\Contents\MacOS\base
openjk.x86.app\Contents\MacOS\openjk.x86
openjk.x86.app\Contents\MacOS\openjkded.x86
openjk.x86.app\Contents\MacOS\rd-vanilla_x86.dylib
openjk.x86.app\Contents\MacOS\OpenJK\jampgamex86.dylib
openjk.x86.app\Contents\MacOS\OpenJK\cgamex86.dylib
openjk.x86.app\Contents\MacOS\OpenJK\uix86.dylib
openjk.x86.app\Contents\MacOS\base\jampgamex86.dylib
openjk.x86.app\Contents\MacOS\base\cgamex86.dylib
openjk.x86.app\Contents\MacOS\base\uix86.dylib
openjk.x86.app\Contents\Resources\OpenJK.icns
When using make install all the correct dylibs are copied into the application bundle now (and have been for a while).
Using CPack will also package the renderer dylib in the correct place (in the same way that make install
does) so I'm closing this issue.
Basically when I try to compile and run a build, the executable can't find
rdsp-vanilla_x86.dylib
. If I copy the dylib intoopenjk_sp.x86.app/Contents/MacOS/
, then it works. Am I doing something wrong?Build steps below:
The build appears to succeed (log is here).
I wind up with a few
.app
files. If I try to run any of them (after copying assets to~/Library/Application\ Support/JKOpen/base
), I get the following output:The files exist:
And if I copy fdsp-vanilla: