;; dirty hack for "forgerie"
(ql:quickload :cffi)
;; FIXME: Find a way to make libmysqlclient, libcrypto found by nixified quicklisp...
;; so browsing files can happen seemlessly
(setq cffi:*foreign-library-directories* nil)
(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)
(ql:quickload :uiop)
;; Make sure we can provide path to forgerie code...
(let ((forgerie-path (truename (format nil "~A/~A" (uiop:getenv "SWH_ENVIRONMENT_HOME") "../forgerie"))))
(when (and forgerie-path (probe-file forgerie-path))
(pushnew (pathname forgerie-path) asdf:*central-registry*
:test #'equal)))
;; (let ((mysql-lib-path (merge-pathnames ".nix-profile/lib/mysql" (user-homedir-pathname))))
;; (cffi:load-foreign-library :mysql :search-path mysql-lib-path))
;; (let ((path (merge-pathnames ".nix-profile/lib/mysql" (user-homedir-pathname))))
;; (cffi:load-foreign-library "mysql" :search-path path))
(ql:quickload :forgerie)