[cello-cvs] CVS cello/cl-magick

fgoenninger fgoenninger at common-lisp.net
Sat Aug 26 21:46:21 UTC 2006


Update of /project/cello/cvsroot/cello/cl-magick
In directory clnet:/tmp/cvs-serv28823

Modified Files:
	cl-magick.lisp 
Log Message:
Changed: Loading of dynamic libs now safe also on OS X.

--- /project/cello/cvsroot/cello/cl-magick/cl-magick.lisp	2006/08/23 21:10:31	1.8
+++ /project/cello/cvsroot/cello/cl-magick/cl-magick.lisp	2006/08/26 21:46:21	1.9
@@ -20,12 +20,7 @@
 ;;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 
 ;;; IN THE SOFTWARE.
 
-#+asdf
-(eval-when (:load-toplevel :compile-toplevel)
-  (asdf:operate 'asdf:load-op 'cffi)
-  (asdf:operate 'asdf:load-op 'cffi-extender)
-  (asdf:operate 'asdf:load-op 'kt-opengl)
-  (asdf:operate 'asdf:load-op 'gui-geometry))
+;;; $Id: cl-magick.lisp,v 1.9 2006/08/26 21:46:21 fgoenninger Exp $
 
 (defpackage :cl-magick
     (:nicknames :mgk)
@@ -64,9 +59,9 @@
   (path-to-wand
    (or *wand-template*
        (make-pathname
-         :directory '(:absolute "0dev" "user"
-                      "graphics" "templates")
-         :name "metal" :type "gif"))))
+#-macosx :directory '(:absolute "0dev" "user" "graphics" "templates")
+#+macosx :directory '(:absolute "Users" "frgo" "Pictures")
+         :name "metal003" :type "gif"))))
 
 (defparameter *imagick-dll-loaded* nil)
 (defparameter *wands-loaded* nil)
@@ -81,15 +76,6 @@
 (cffi:define-foreign-library Wand
   (:darwin (:or "/usr/local/lib/libWand.dylib")))
 
-;; Order matters! First, load Wand then Magick on Darwin
-#+macosx
-(eval-when (:load-toplevel :execute)
-  (cffi:use-foreign-library Wand))
-
-(eval-when (:load-toplevel :execute)
-  (cffi:use-foreign-library Magick))
-
-
 ;-------------------------------------------------------------------
 
 (defun cl-magick-init ()
@@ -97,9 +83,13 @@
     (progn
       ;(print "clearing magick wands")
       ;(wands-clear)
+
+      ;; Order matters! First, load Wand then Magick on Darwin
+      #+macosx
+      (cffi:use-foreign-library Wand)
       
-      (assert (setq *imagick-dll-loaded* t
-                  #+not (cffi:use-foreign-library magick))
+      (assert (setq *imagick-dll-loaded*
+		    (cffi:use-foreign-library Magick))
         () "Unable to load imagick" )
       (print `(magick-copyright ,(magick-get-copyright)))
       (print `(magick-version ,(magick-get-version *mgk-version*)))
@@ -142,4 +132,3 @@
       (print `(unloading foreign library ,dll))
       (setf *imagick-dll-loaded* nil)
       (ff:unload-foreign-library dll))))
-




More information about the Cello-cvs mailing list