Not STK but if anyone knows, how to create OS X app bundles

Not STK but if anyone knows, how to create OS X app bundles

Postby Knitter » 15 Feb 2012, 00:57

Sorry for asking here but I have tried to get some info on this and have failed miserably and since it was STK's wiki that offered the info to move a step forward I'm hopping someone has some insight.

I'm trying to package Me&My Shadow and Supertux so that I can create an application bundle for OS X, I had several problems with the dependent libraries that I managed to overcome due to finding about dylibbundler ( I was using otool manually and always failed). After running the tool and copying the libraries to the proper destination, the application crashes without errors or warnings.

I think it's related to the data folder, that is not in the same directory as the executable and in nowhere did I configure the folders path but I'm not sure.

So, anyone has some steps on how to create an application bundle with proper settings? Or some documentation that I can follow since I can't find anything to use. I've looked at Apple's documentation but I can't seem to get things to work.

Also is there any way to see why a bundle fails to start? I've tried opening the bundle in the Terminal but no message is shown and I have no crash report.

One final issue I'm having, the Info.plist and PkgInfo files are supposed to be placed inside the "Contents" folder of the bundle but if I do that my bundle is reported as broken and doesn't start, if I move those files to the bundle's root the application starts but crashes before I see any screen or anything else.

And should I mention that I'm doing this bundle by hand since I couldn't find any instruction on how to do that with XCode, almost all I find are for older versions and the ones I saw for version 4 don't work or make no sense with the XCode project I have for Me & My Shadow. And I can't seem to understand how XCode works :(

So, help! :D
Knitter
 
Posts: 237
Joined: 03 Jul 2011, 22:52
Location: Portugal

Re: Not STK but if anyone knows, how to create OS X app bun

Postby Auria » 15 Feb 2012, 01:16

Hi,

first of all, by some weird chance, it happens that I'm the author of dylibbundler ;)

Now you need to figure why it crashes. I suggest running the application from terminal in gdb
{l Code}: {l Select All Code}
gdb /path/to/foo.app/Contents/MacOS/foo
run
... wait until it crashes ...
bt


this should tell you more on what is wrong
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Re: Not STK but if anyone knows, how to create OS X app bun

Postby Knitter » 15 Feb 2012, 12:03

Hi,

I must say that dylibbundler is a very nice piece of software, thank you! :D (I had given up on this bundle thing since every time I used otool there was no error but also no change to the binary :( )

It looks like the binary is exiting with an error an not crashing. Running gdb showed that meandmyshadow exits with code 01, "FATAL ERROR: Failed to configure paths". This messsage is shown when the executable is unable to find the data files (music, sound, images, etc), so I think my first assumption may be correct and I need a way to tell the executable file inside the bundle where the "data" folder is located.

I also have a lot of these a when running the terminal:
{l Code}: {l Select All Code}
warning: Could not find object file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/crctable.o" - no debug information available for "crctable.c".
warning: Could not find object file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/randtable.o" - no debug information available for "randtable.c".
warning: Could not find object file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/compress.o" - no debug information available for "compress.c".
warning: Could not find object file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/decompress.o" - no debug information available for "decompress.c".
warning: Could not find object file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/bzlib.o" - no debug information available for "bzlib.c".
.....warning: Could not find object file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_audio_libvorbis/libvorbis/work/libvorbis-1.3.2/lib/.libs/vorbisfile.o" - no debug information available for "vorbisfile.c".
.warning: Could not find object file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_audio_libvorbis/libvorbis/work/libvorbis-1.3.2/lib/.libs/mdct.o" - no debug information available for "mdct.c".
warning: Could not find object file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_audio_libvorbis/libvorbis/work/libvorbis-1.3.2/lib/.libs/smallft.o" - no debug information available for "smallft.c".
warning: Could not find object file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_audio_libvorbis/libvorbis/work/libvorbis-1.3.2/lib/.libs/block.o" - no debug information available for "block.c".
warning: Could not find object file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_audio_libvorbis/libvorbis/work/libvorbis-1.3.2/lib/.libs/envelope.o" - no debug information available for "envelope.c".
warning: Could not find object file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_audio_libvorbis/libvorbis/work/libvorbis-1.3.2/lib/.libs/window.o" - no debug information available for "window.c".
Knitter
 
Posts: 237
Joined: 03 Jul 2011, 22:52
Location: Portugal

Re: Not STK but if anyone knows, how to create OS X app bun

Postby Knitter » 15 Feb 2012, 12:49

I've been reviewing the documentation on bundle structure and corrected a few mistakes, can't get the damn icon to be used but double clicking the bundle launches the application. Now I can't find a way to tell the executable where the resources are.

I've moved the resources from "MeAndMyShadow.app/Contents/Resources/data/" to "MeAndMyShadow.app/Contents/Resources/" in the hopes that Finder made that folder relative to the executable but it's not working. I can't pass arguments to a bundle so I can't use the option to specify a different data folder. I'm stuck in this error.

Regards,

Knitter
Knitter
 
Posts: 237
Joined: 03 Jul 2011, 22:52
Location: Portugal

Re: Not STK but if anyone knows, how to create OS X app bun

Postby Auria » 16 Feb 2012, 00:48

At this point, you will need to dig into the code of the application to help it locate its files on OSX. From here I'm afraid I don't have the time to personally help with the process, and each game is different in this regard. If you dig into the code and the code is well-done usually it's not very hard to make it find its paths
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Re: Not STK but if anyone knows, how to create OS X app bun

Postby Knitter » 16 Feb 2012, 22:35

Thanks, I'm already on to it, or at least trying to test some solutions. Though reading C++ code when one knows too little about the language is not easy :)
Knitter
 
Posts: 237
Joined: 03 Jul 2011, 22:52
Location: Portugal

Who is online

Users browsing this forum: No registered users and 1 guest