nixos-config/dotfiles/dot_sbclrc

34 lines
1.4 KiB
Text
Raw Normal View History

2024-10-16 14:22:52 -04:00
;; The following lines added by ql:add-to-init-file:
2024-09-27 15:57:30 -04:00
#-quicklisp
2024-10-16 14:22:52 -04:00
#+asdf (require :asdf)
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
2024-09-27 15:57:30 -04:00
(user-homedir-pathname))))
(when (probe-file quicklisp-init)
(load quicklisp-init)))
2024-12-01 15:31:55 -05:00
(push (pathname "~/source/_cl") ql:*local-project-directories*)
2024-10-16 14:22:52 -04:00
(ql:quickload :cffi :silent t)
(pushnew (merge-pathnames ".nix-profile/lib/" (user-homedir-pathname))
cffi:*foreign-library-directories*)
(pushnew (merge-pathnames ".nix-profile/lib64/" (user-homedir-pathname))
cffi:*foreign-library-directories*)
2024-11-22 16:26:46 -05:00
(pushnew (merge-pathnames "/run/current-system/sw/share/nix-ld/lib/" (user-homedir-pathname))
cffi:*foreign-library-directories*)
2024-10-16 14:22:52 -04:00
(defun pkg-config-add-lib (libname)
(let ((process (sb-ext:run-program "/usr/bin/env"
(list "pkg-config" libname "--libs-only-L")
:input t :output :stream :wait t)))
(let ((stream (sb-ext:process-output process)))
(loop for line = (read-line stream nil nil)
while line do
;; Drop "-L" part, and add '/' to the end. '/' IS necessary!
(pushnew (pathname (concatenate 'string (subseq line 2) "/"))
cffi:*foreign-library-directories*))
(sb-ext:process-close process))))
;; load specific libs
(pkg-config-add-lib "libffi")