Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Extending Gosu / homebrew formula
- - By Jamer Date 2014-12-05 11:46
So I'm sure this is probably only useful to me, but I packaged C++ Gosu up in Homebrew.

https://github.com/jamer/homebrew/commit/73e5e2d76137eadc54d1c6cb2de7149078bf41c5

Since C++ Gosu isn't meant to be used by Mac package managers, I had to hack up a custom build and installation script.  ;)

Questions?  Comments?  Concerns?
Parent - - By jlnr (dev) Date 2014-12-05 13:05
Thanks! Nice hack :) If I can't find a way to get rid of the sdl2-from-homebrew dependency, maybe it would be better to move C++ Gosu (cleanly) into homebrew and provide a thin Ruby wrapper as a separate gem? I could probably clone my repository on github and call the C++ part libgosu. Hmm, I like that.

One alternative on OS X is to use CocoaPods (the podspec only lives in Gosu's repository for now). But there's no conflict here - brew installs Gosu on a Mac computer, pod includes it (statically) in a Mac app.
Parent - - By Jamer Date 2014-12-05 13:37 Edited 2014-12-05 13:54
The existing homebrew dependency was what inspired me to see if this was possible. :) Although it was pretty tricky and I think it was only with luck that it could be done at all. It would probably be cleanest to modify the build system so the hacks aren't needed.

I tried to submit the formula to homebrew (hope you don't mind-- I did it just before opening this thread-- although maybe I could have stopped by here first :) and they said they would prefer if the build were supported more natively. I guess I can see why, although that means more work.

https://github.com/Homebrew/homebrew/pull/34700

You have my complete permission to steal the formula and do as you like :). It works for both 0.8.5 and HEAD as is.

Right now it exploits the fact that ext/gosu/extconf.rb knows how to compile for Mac. Maybe using CocoaPods would have been better, but I wasn't able to figure out how to use that for a homebrew formula. In terms of getting a good build for homebrew, though, my first thoughts are to patch cmake to support Mac builds. What do you think?

Also, although I know literally nothing about gems, I wonder if it would be possible to move the extconf.rb's logic into cmake. Then there would be one less build system to worry about.
Parent - By jlnr (dev) Date 2014-12-06 01:34 Edited 2014-12-06 01:47
The CMake build files used to support the Mac, but I'm not sure how I would even verify that. I should probably take a day off with a good book and learn CMake; the only command-line build tool I know anything about is Rake. :)

The extconf.rb would definitely be a lot more "normal", if there was a C++ libgosu.dylib to link against.

And if I ever want to ship precompiled Mac gems again, with no dependencies on Homebrew - that is still technically possible. (Just painful.)

I'm pretty much sold on the idea of splitting up my repository and turning the C++ core into a proper library. I'll try to abuse the Ludum Dare weekend for that. :) Thanks again for the work & PR! It's also great to see that Homebrew's PR review system is thorough and helpful.
Parent - - By jlnr (dev) Date 2014-12-06 11:38
Okay, I think this has to be a long-term effort. Until C++ Gosu has been packaged for all common Linux distributions (which are more conservative than Homebrew), I should probably not mess with the self-contained Ruby gem. :/ Nobody wants to sudo make install a random C++ library on a clean install of Ubuntu.

So I shall focus on CMake for C++ for now...
Parent - By Jamer Date 2014-12-07 01:26
I'm kind of interested in maintaining a libgosu for Debian/Ubuntu, but I wouldn't know where to start.
Up Topic Gosu / Extending Gosu / homebrew formula

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill