Files

29 lines
1.0 KiB
Common Lisp

;;;; Helper loader for building and testing nextcloud-niri on Guix/Ubuntu/Linux
;;;; Ensures CFFI can locate OpenSSL 3 libraries before cl+ssl / dexador loads.
(ql:quickload :cffi :silent t)
(defun %find-openssl3-dir ()
(let ((candidates
(append
(list (merge-pathnames ".guix-home/profile/lib/" (user-homedir-pathname))
#P"/run/current-system/profile/lib/"
#P"/usr/lib/x86_64-linux-gnu/"
#P"/usr/lib64/"
#P"/usr/lib/")
(sort (directory #P"/gnu/store/*-openssl-3.*/lib/")
#'string> :key #'namestring))))
(dolist (dir candidates)
(when (and dir
(probe-file (merge-pathnames "libcrypto.so.3" dir))
(probe-file (merge-pathnames "libssl.so.3" dir)))
(return dir)))))
(let ((ssl-dir (%find-openssl3-dir)))
(when ssl-dir
(pushnew ssl-dir cffi:*foreign-library-directories* :test #'equal)))
(pushnew (truename *default-pathname-defaults*)
asdf:*central-registry*
:test #'equal)