Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / cross-platform chipmunk gem released
- By banister Date 2009-09-30 13:19 Edited 2009-10-07 08:00
hey,

I just finished building & uploading a cross-platform chipmunk gem.

To try it out just type: gem install chipmunk

jlnr says that the macosx gem should be precompiled (as not everyone has devtools installed... the macosx gem is currently compiled from source on install, which should be fine for 99% of you guys)

So..if anyone here who's running macosx and wants to help build the macosx binaries, just reply to this thread and we'll try to work something out.

EDIT: here's the github project for ppl that are interested: http://github.com/banister/chipmunk

thanks

banister
- By banister Date 2009-10-04 18:19
ok,

ive been strugging for a few days now to get a macosx universal 'fat gem'  out there. but i've given up because:
(1) i dont have macosx
(2) i am not sure what i even need to do to generate a fat binaries, i've been informed by some people running macosx but im not 100% sure this is correct
(3) code can only develop through a code/test cycle, given that i do not run macosx the 'testing' side is incredibly time-consuming and laborious as i must enlist the help of other ppl
(4) extreme frustration

anyway, someone else needs to take this over from me, preferably someone running macosx with ruby versions (both 1.8 and 1.9) compiled as universal binaries

here is the current state of the project: http://github.com/banister/chipmunk/

some things to note:
* the extconf.rb i *think* is more or less complete, i *think* it'll generate universal binaries, but im not 100% sure
* the compilation process uses rvm (ruby version manager) to generate each of the 1.8 and 1.9 binaries, but it just occurred to me that these are probably not universal binaries and so this method is probably not going to work
* typing 'rake gem' will generate the macosx gem (containing the precompiled fat binaries)

to the person who takes this over, feel free to ask me any questions, i want to get this chipmunk thing over and done with.

thanks,

banister
- By ippa Date 2009-10-04 20:36
Great work so far Banister. I hope someone with osx can step up to get that last piece in place (though I myself mostly care about the windows version).

Chipmunk is a great lib and your (and others) efforts on this universal gem are higly appreciated.
- By disciplex Date 2009-10-05 10:55
I run MacOSX and also have a use for Chipmunk, so will have a go at this today.
- By disciplex Date 2009-10-05 11:02
Just cloned the project from Github and ran 'rake gem', which created a chipmunk.bundle for Ruby 1.8 (I'll do the 1.9 version next). Grabbed a copy of the Gosu examples and tested the ChipmunkIntegration, which works great.
- By banister Date 2009-10-06 09:17
nice work.

But im a bit confused, as (assuming you installed the rvm gem) 'rake gem' should actually build both the 1.8 and 1.9 binaries and stick them in the gem ready to go. :/

sorry i should have made it clear that you had to 'rake install rvm' and then also build the 1.8.6 and 1.9.1 versions of ruby

you also need the rake-compiler gem for each of the rvm ruby versions, however the Rakefile should take care of installing those gems for you :)

banister
- By disciplex Date 2009-10-06 10:36
I hadn't installed 1.9.1-p243, I was using 1.9.1-rc2

Got this sorted now. Just ran 'rvm rake gem' and everything has built successfully. Do you want me to send it all over to you?
- By banister Date 2009-10-06 15:26
cool, thanks a lot for your work :)))

just one thing though, did it stick both 1.8 and 1.9 binaries into that gem ? you should be able to test by installing the gem on both your 1.8 and 1.9 ruby installations and ensuring they both can run the Chipmunk examples

if it passes this test, sure send it over :))

thanks
- By disciplex Date 2009-10-06 15:57
Works great at my end on both 1.8.6 and 1.9.1-p243. Sent you an email.
- By banister Date 2009-10-07 07:52
heya,

i haven't had a chance to test it yet but one thing that comes to mind is the gem is called "chipmunk-4.1.0-x86-darwin-9.gem"
(a 'universal' chipmunk gem would be called "chipmunk-4.1.0-universal-darwin-9.gem" OR "chipmunk-4.1.0-universal-darwin-10.gem", btw i am still mighty confused on the darwin-9 versus darwin-10 issue...do we need to build two universal gems?)

the 'x86' in the name implies the gem is not universal but is instead restricted to the x86 platform. I think the situation is as follows:
The binaries themselves ARE universal but since you built the gem on a non-universal ruby version the gem platform is set to x86.

THere are two ways to go from here, i think. One is to try to understand where/how the gem's platform is defined (aside from in the filename) and then 'hack' the gem so it says it's universal.

Another way, and easier way, is for someone out there (or you :D) with a universal ruby version to build the gem. Note that your binaries should be fine, we can use them again, it's just a matter of sticking them in the lib/ directory when building
the gem on a universal ruby version.

banister
- By disciplex Date 2009-10-07 11:05
Gem environment for my native ruby is universal, however 'rvm gem environment' shows that rvm actually compiles ruby for your architecture, which isn't much of a surprise, but that explains why its coming out as x86. I'll have a look at this later.
- By banister Date 2009-10-07 13:03
ah ok...

so ensure you're using your system ruby (rvm system) and then typing 'rake gem' should probably do it? If not, then just ensure that the universal binary for 1.9 is in lib/1.9/ and the universal binary for 1.8 is in lib/1.8/   and i can write you a Rakefile to gem it with your universal ruby
Up Topic Gosu / Gosu Exchange / cross-platform chipmunk gem released

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill