;; dirty hack for "forgerie"
(ql:quickload :cffi)

;; FIXME: Find a way to make libmysqlclient, libcrypto found by nixified quicklisp...
(defun prepare-ldpath ()
 (let ((nix-profile-lib-path (merge-pathnames ".nix-profile/lib" (user-homedir-pathname)))
       ;; libmysqlclient.so
       (mysql-lib-path (merge-pathnames ".nix-profile/lib/mysql" (user-homedir-pathname)))
         ;; libcrypto.so
       (system-lib-path (truename "/usr/lib/x86_64-linux-gnu")))
  (loop
   for libpath in `(,system-lib-path ,nix-profile-lib-path ,mysql-lib-path)
   do (pushnew (truename libpath) cffi:*foreign-library-directories* :test #'equal)))
 cffi:*foreign-library-directories*)

;; (setf cffi:*foreign-library-directories* nil)
(prepare-ldpath)

;; Make sure we can provide path to forgerie code...
(let ((forgerie-path (truename "../../forgerie")))
  (when (and forgerie-path (probe-file forgerie-path))
   (pushnew (pathname forgerie-path) asdf:*central-registry*
    :test #'equal)))

(ql:quickload :forgerie)