.sbclrc 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. ;; -*- mode: common-lisp; -*-
  2. ;;; The following lines added by ql:add-to-init-file:
  3. ;; #-quicklisp
  4. ;; (let ((quicklisp-init (merge-pathnames ".quicklisp/setup.lisp"
  5. ;; (user-homedir-pathname))))
  6. ;; (when (probe-file quicklisp-init)
  7. ;; (load quicklisp-init)))
  8. ;; Some OSes package Lisp compilers in a way that ASDF is not automatically loaded.
  9. (require "asdf")
  10. (uiop:define-package #:guix
  11. (:use :common-lisp))
  12. (in-package #:guix)
  13. (export '*guix-profiles-dir*)
  14. (defvar *guix-profiles-dir* "~/.guix-extra-profiles/"
  15. "Directory in which Guix profiles are stored.
  16. The actual profiles are in the subsubdirectories.")
  17. (export '*cffi-dirs*)
  18. (defvar *cffi-dirs* '("~/.guix-profile/lib" "~/common-lisp/cl-webengine/source")
  19. "Shared library directories to be used for CFFI.")
  20. (defun find-guix-library-dirs (profiles-dir)
  21. (mapcar (lambda (d)
  22. (format nil "~a~a/lib/"
  23. (namestring d)
  24. (first (last (pathname-directory d)))))
  25. (uiop:subdirectories profiles-dir)))
  26. (export 'set-cffi-library-dirs)
  27. (defun set-cffi-library-dirs (&optional (dirs (append
  28. *cffi-dirs*
  29. (find-guix-library-dirs *guix-profiles-dir*))))
  30. "Call this to set `cffi:*foreign-library-directories*' to DIRS."
  31. (when (ignore-errors (asdf:load-system "cffi"))
  32. (setf (symbol-value (find-symbol (string '*foreign-library-directories*)
  33. (find-package 'cffi)))
  34. (union (symbol-value (find-symbol (string '*foreign-library-directories*)
  35. (find-package 'cffi)))
  36. ;; CFFI needs a trailing "/".
  37. (delete nil (mapcar #'uiop:ensure-directory-pathname dirs))
  38. :test #'uiop:pathname-equal))))
  39. ;; Set it by default.
  40. (set-cffi-library-dirs)
  41. (in-package :cl-user)
  42. ;; Uncomment the following to increase the debug details.
  43. ;; It's often better to do this from the REPL.
  44. ;; (declaim (optimize (speed 0) (space 0) (debug 3)))
  45. ;; Uncomment to enable full type checks (should be the default).
  46. ;; (declaim (optimize (or (>= safety 2) (>= safety speed 1))))