Skip to content

Instantly share code, notes, and snippets.

Created December 13, 2012 19:28
Show Gist options
  • Save anonymous/4279042 to your computer and use it in GitHub Desktop.
Save anonymous/4279042 to your computer and use it in GitHub Desktop.
A simple workaround for sbcl clsql-based cores deployment. Solving libraries paths problem by unloading/loading libraries.
(let ((library-list (cffi:list-foreign-libraries)))
(setf cffi:*foreign-library-directories* (list #p"lib/"))
(setf clsql-sys:*foreign-library-search-paths* (list #p"lib/"))
#+sbcl
(progn
(pushnew (alexandria:named-lambda load-libraries ()
(mapcar #'(lambda (x)
(cffi:load-foreign-library x))
(mapcar #'(lambda (x)
(pathname (file-namestring (slot-value x 'pathname))))
library-list)))
sb-ext:*init-hooks*)
(mapcar #'cffi:close-foreign-library library-list))
(save-lisp-and-die "image.core" :purify t :executable t))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment