deploying CLG
"Walter C. Pelissero" <[email protected]> Thu, 1 Nov 2007 17:07:37 +0100
| Newsgroups | gmane.lisp.clg.devel |
|---|---|
| Message-ID | <[email protected]> |
I wonder what is the intended way to deploy a CLG-based application.
Currently, with CMUCL, I'm creating a Lisp image. All seems to be
fine if not for a detail: all the shared objects pathnames are wired
in the image and even assuming the path to libgtk may not vary from
system to system I certainly don't want to reproduce my home directory
tree on every installation just for the CLG shared objects.
I'm currently using the following code short before dumping the
image. It works on CMUCL only and, admittedly, it's quite ugly:
(defun amend-libraries-table (table substitutions)
(loop
for lib in table
when (cdr lib)
collect (let ((path (cdr lib)))
(let ((substitution (assoc path substitutions :test #'pathname-match-p)))
(if substitution
(let ((new-path (make-pathname :host (pathname-host (cdr substitution))
:directory (pathname-directory (cdr substitution))
:defaults path)))
(cons (car lib) new-path))
lib)))))
(defun generalise-global-table ()
(setf system::*global-table*
(amend-libraries-table system::*global-table*
'((#P"/usr/local/lib/" . #P"")
(#P"/**/clg/gtk/" . #P"/usr/local/lib/clg/gtk/")
(#P"/**/clg/gdk/" . #P"/usr/local/lib/clg/gdk/")
(#P"/**/clg/glib/" . #P"/usr/local/lib/clg/glib/")
(#P"/**/clg/gffi/" . #P"/usr/local/lib/clg/gffi/")))))
(generalise-global-table)
This way, it's up to dlopen to figure out where to find most of the
libraries and I have just to copy a couple of CLG shared objects into
/usr/local/lib/clg.
Is there a better way to achieve the same result?
--
walter pelissero
http://www.pelissero.de
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/