So I am coming to the realization that packaging C extensions is quite annoying stuff.
How can I package the opengl2 gem into a .app with Gosu?
1. Install it on Ruby 1.9.2 on every OS that you want to support. (64bit/32bit/PowerPC… - generally if you build on an older OS X, it will work on a newer OS X too, but not vice versa.) I use rvm for this.
2. Change the install name of the
libruby.1.9.1 reference in each architecture:
install_name_tool -change full_path_of_ruby191_dylib @executable_path/../Frameworks/libruby.1.9.1.dylib path_of_opengl2_bundle
3. Grab the .bundle files thate are built and merge them with
lipo -create … to create a universal binary core.
4. Throw them in
lib in the .app wrapper.
I couldn't manage to compile the old
ruby-opengl on either platform last time I built the .app. I'll try to include `ruby-opengl next time, but don't hold your breath since the .app build process is crazy complicated. I actually want to factor it out of the main repository too, so that might take a while.
Thanks. So I assume the @executable_path part is actually supposed to be like that?
Yeah, apparently the old ruby-opengl gem is depreciated (or at least it's not being worked on). I assume that it's been that way for a while, which is why Debian (and by extension Ubuntu) switched to vendoring their own version through their repositories.
Yep, there are several @special_paths that can be used in dylib identifiers. And of course, Console.app is your friend while figuring out why the .app does not start.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill