[cl-gd-devel] CLISP support for CL-GD through CFFI

Luis Oliveira luismbo at gmail.com
Sun Sep 25 23:37:04 UTC 2005


>From the mailing list archives I see that, earlier this year, Edi didn't
wan't to integrate the Carlos Ungil's port to CLISP's FFI:

Edi Weitz <edi at agharta.de> writes:
> Thanks.  I've made a new release which fixes the bugs you found and
> adds a link to your CLISP port.  I'm hesitant to add the port to the
> CL-GD distribution itself because it adds a large amount of code that
> I can't and won't maintain.  I'd rather wait until CLISP is supported
> by UFFI... :)

Today I saw the thread on comp.lang.lisp from someone trying to use
CLISP with CL-GD, looked at one of my todo items for CFFI ("test
uffi-compat more") and decided to try CLISP/CL-GD/uffi-compat. Here's a

diff -u cl-gd-0.4.8.orig/cl-gd-test.lisp cl-gd-0.4.8.new/cl-gd-test.lisp
--- cl-gd-0.4.8.orig/cl-gd-test.lisp	Sun Sep 25 23:42:54 2005
+++ cl-gd-0.4.8.new/cl-gd-test.lisp	Mon Sep 26 00:06:07 2005
@@ -39,8 +39,8 @@
 (defparameter *test-directory*
   (merge-pathnames (make-pathname :directory '(:relative "test"))
                    (make-pathname :name nil
-                                  :type :unspecific
-                                  :version :unspecific
+                                  :type nil
+                                  :version :newest
                                   :defaults cl-gd.system:*cl-gd-directory*))
   "Where test files are put.")
diff -u cl-gd-0.4.8.orig/cl-gd.asd cl-gd-0.4.8.new/cl-gd.asd
--- cl-gd-0.4.8.orig/cl-gd.asd	Sun Sep 25 23:42:54 2005
+++ cl-gd-0.4.8.new/cl-gd.asd	Mon Sep 26 00:06:52 2005
@@ -53,4 +53,4 @@
                  (:file "drawing" :depends-on ("transform" "colors-aux"))
                  (:file "strings" :depends-on ("transform" "colors-aux"))
                  (:file "misc" :depends-on ("transform")))
-    :depends-on (:uffi))
+    :depends-on (#-clisp :uffi #+clisp :cffi-uffi-compat))
Common subdirectories: cl-gd-0.4.8.orig/doc and cl-gd-0.4.8.new/doc
diff -u cl-gd-0.4.8.orig/specials.lisp cl-gd-0.4.8.new/specials.lisp
--- cl-gd-0.4.8.orig/specials.lisp	Sun Sep 25 23:42:54 2005
+++ cl-gd-0.4.8.new/specials.lisp	Mon Sep 26 00:15:59 2005
@@ -121,16 +121,16 @@
 (defconstant +gd-cmp-true-color+ 256
   "One image is a true-color image, the other one is palette-based.")
-(defvar *shared-library-directories* `(,(namestring (make-pathname :device :unspecific
-                                                                   :name nil
-                                                                   :type :unspecific
-                                                                   :version :unspecific
-                                                                   :defaults cl-gd.system:*cl-gd-directory*))
-                                       "/usr/local/lib/"
-                                       "/usr/lib/"
-                                       "/usr/lib/cl-gd/"
-                                       "/cygwin/usr/local/lib/"
-                                       "/cygwin/usr/lib/")
+(defvar *shared-library-directories*
+  `(,(namestring (make-pathname :name nil
+                                :type nil
+                                :version :newest
+                                :defaults cl-gd.system:*cl-gd-directory*))
+     "/usr/local/lib/"
+     "/usr/lib/"
+     "/usr/lib/cl-gd/"
+     "/cygwin/usr/local/lib/"
+     "/cygwin/usr/lib/")
   "A list of directories where UFFI tries to find cl-gd-glue.so")
 (defvar *shared-library-types* '("so" "dll")
   "The list of types a shared library can have. Used when looking for
Common subdirectories: cl-gd-0.4.8.orig/test and cl-gd-0.4.8.new/test

I tested with the latest CFFI, CLISP 2.35 and CL-GD 0.4.8 under Windows
2000 and it fails 3 or 4 tests. I see Carlos's CLISP port includes some
changes to some CL-GD functions other than the FFI part so I assume
those changes should be integrated too, but I guess he would know better
regarding what needs fixing for proper CLISP support.

The pathname changes might break other lisps, I haven't tested, sorry.

I hope this helps integrate CLISP support into CL-GD.

Luis Oliveira
luismbo (@) gmail (.) com
Equipa Portuguesa do Translation Project

More information about the Cl-gd-devel mailing list