Closed utgarda closed 12 years ago
I have not updated chipmunk-ffi to work with chipmunk 6.0.1. I have to check with the author of chipmunk to see if he has removed those symbols, or moved them. I'll look into this, thanks for the report.
They are still there, though named without _. Tried to make them visible in .so , did not succeed though. Hope that is solvable.
"static inline" is how you prevent methods from being publicly exposed in a C library. Seems chipmunk was updated to be more strict about some of the public APIs.
james, that's why the chipmunk guy created chipmunk_ffi; to appease me. :D He compiles them into data so FFI can get them and use them as function pointers.
Looks like they should still be there in the latest chipmunk source. How did you build chipmunk? (they are all defined in chipmunk_ffi.h)
How i built it: cloned Chipmunk-Physics from here, got all prerequisites, then
cmake .
./configure
make
Then checked the demo app, then tried to build chipmunk-ffi. Found nothing about ffi in readme, now I think of it, should have read the 'configure' itself, maybe there's a key to include this particular header file.
Chipmunk 6.x isn't really compatible with 5.x There are numerous API changes that will need to be addressed by the gem before you can use them together.
Ok, so here goes: First, you must add -DCHIPMUNK_FFI to your CFLAGS when building chipmunk to add the needed fields (export CFLAGS="-DCHIPMUNK_FFI" before running cmake/make) Second, chipmunk_ffi.h seems to be broken for the moment https://gist.github.com/da077d834798d849452d (slembcke is working on a fix for this.) Third, erisdiscord is correct there are backward compatibility issues that have not been addressed yet (not sure how severe though)
Fixed in chipmunk source, chipmunk-ffi cannot work until the 6.0.2 release (unless you build from source). I'll leave this open until part 3 gets resolved.
Thanks, building with CFLAGS mentioned works for me, chipmunk_ffi.h is not broken anymore with this fix, though may be incomplete, I'm not sure. Trying to get it working : 708c078423f611c5b22b , partially fixing character cases in names, mostly commenting out with #TODO for now. I'll let you know if I get somewhere decent.
So you are working off of chipmunk's source? Sounds good, thanks.
Works up to core_spec.rb: f67b54b9da8db6016226 Changes applied only where specs failed or segfaults happened. Specs mostly check only that values can be got and set, without checking their real meanings ( not sure it's possible, definitely not easy) So every struct should be rechecked, cause somewhere in Chipmunk code values of the same type swap positions. Thus, the new binding passes specs but may prove erroneous in real usage.
Can't send pull request - didn't work on backward compatibility, so for <6.x it's broken. Would you create a branch "for 6.x' or something?
Tried to fix shape.rb, failed. Too much o' yer black magic for me, others are pretty straightforward. Though, looking at cpShape.c, maybe Shape.cache_bb should look like this now:
def cache_bb
CP.cpShapeCacheBB(@struct)
end
I've created a base branch off of the current code for chipmunk-6. Did you want to keep working on this or hand me what you've done so far? (yay open source)
The first struct I checked: Arbiter struct is way off now. Looks like they will all need to be reworked.
Thanks, I guess I'd like to spend some more time on this, maybeeven read FFI manuals. But, anyways, most likely my skill is not enough to finish it, so you'll have to. And maybe I won't have a chance to continue till Monday, so please go on, if you feel like it. I'll catch up.
Maybe I build chipmunk the wrong way? Trying it with 6.0.1. Seems like everything 'static inline' doesn't get to the resulting .so file. It's a shame I forgot C development so much, maybe I never really knew it.
rake /usr/lib64/ruby/gems/1.8/gems/ffi-1.0.9/lib/ffi/library.rb:165:in
attach_variable': Function '_cpv' not found in [#<FFI::DynamicLibrary:0x7fe99e7ecea0>] (FFI::NotFoundError) from ~/chipmunk-ffi/lib/chipmunk-ffi.rb:29:in
cp_static_inline' from ~/chipmunk-ffi/lib/chipmunk-ffi/vec2.rb:24