On Tue, Apr 29, 2008 at 05:57:41PM +0200, Peter Hildebrandt wrote:
Hi Peter,
Sorry, I didn't have time to investigate this until now.
I just tried to pull in a current version of cl-cairo2 via asdf-install, and I ran into the following:
There is no class named CL-CAIRO2::MY-DOUBLE-TYPE.
(in cl-cairo2-swig)
For me, the failing define-foreign-type expands into:
(PROGN (CFFI::DEFINE-TYPE-SPEC-PARSER MY-DOUBLE-TYPE NIL (MAKE-INSTANCE 'CFFI::FOREIGN-TYPEDEF :NAME 'MY-DOUBLE-TYPE :ACTUAL-TYPE (CFFI::PARSE-TYPE (PROGN NIL (:ACTUAL-TYPE :DOUBLE) (:SIMPLE-PARSER MY-DOUBLE))))) 'MY-DOUBLE-TYPE)
Note that parse-type is a function, thus (:actual-type ...) will be interpreted as a function call.
This could be due a cffi mismatch: I have cffi 0.9.2 (the latest release). Do you use the one from darcs?
There has been a change in CFFI, AFAIK cl-cairo2 uses the new interface. My cffi version is 20080217-1, which does not appear to be in Ubuntu, so you should do a manual install from the repository. BTW, my version is from the latest (unstable) Debian package, so maybe it would help to nudge the Ubuntu maintainers to package the latest version.
Also, all three library names don't work in Ubuntu 8.04. I added the alternatives:
cairo.lisp: (load-foreign-library '(:or "libcairo" "libcairo.so.2"))
gtk-context.lisp: (define-foreign-library :gdk (cffi-features:unix (:or "libgdk-x11-2.0.so" "libgdk-x11-2.0.so.0")) (cffi-features:windows "libgdk-win32-2.0-0.dll") (cffi-features:darwin "libgdk-win32-2.0-0.dylib"))
xlib.lisp: (load-foreign-library '(:or "libX11.so" "libX11.so.6"))
Please try the new version of CFFI with the original code, and tell me if the error persists.
Tamas