2018-11-18 11:52:06 +01:00
|
|
|
;; -*- mode: common-lisp; -*-
|
|
|
|
|
2019-02-14 16:25:03 +01:00
|
|
|
;; WARNING: Changing the *print-case* may break some packages, e.g. Mito.
|
|
|
|
;; Also see https://www.cliki.net/Case%20sensitivity.
|
|
|
|
;; (setf *print-case* :downcase)
|
2018-11-18 11:52:06 +01:00
|
|
|
|
|
|
|
;;; The following lines added by ql:add-to-init-file:
|
|
|
|
#-quicklisp
|
|
|
|
(let ((quicklisp-init (merge-pathnames ".quicklisp/setup.lisp"
|
|
|
|
(user-homedir-pathname))))
|
|
|
|
(when (probe-file quicklisp-init)
|
|
|
|
(load quicklisp-init)))
|
2018-11-22 14:55:59 +01:00
|
|
|
|
|
|
|
;; Some OSes package Lisp compilers in a way that ASDF is not automatically loaded.
|
|
|
|
(require "asdf")
|
|
|
|
|
2019-09-25 12:19:58 +02:00
|
|
|
(when (ignore-errors (asdf:load-system "cffi"))
|
|
|
|
;; Warning: Trailing "/" matters!
|
|
|
|
(dolist (guix-profile
|
|
|
|
`(,(when (uiop:directory-exists-p "~/.guix-profile")
|
|
|
|
(format nil "~a/.guix-profile/lib/" (uiop:getenv "HOME")))
|
|
|
|
,@(mapcar (lambda (d)
|
|
|
|
(format nil "~a~a/lib/"
|
|
|
|
(namestring d)
|
|
|
|
(first (last (pathname-directory d)))))
|
|
|
|
(uiop:subdirectories "~/.guix-extra-profiles/"))))
|
2018-11-22 14:55:59 +01:00
|
|
|
(push guix-profile
|
|
|
|
(symbol-value (find-symbol (string '*foreign-library-directories*)
|
|
|
|
(find-package 'cffi))))))
|
2019-06-24 10:11:01 +02:00
|
|
|
|
|
|
|
;; Uncomment the following to increase the debug details.
|
|
|
|
;; It's often better to do this from the REPL.
|
|
|
|
;; (declaim (optimize (speed 0) (space 0) (debug 3)))
|
2019-08-05 11:49:18 +02:00
|
|
|
|
|
|
|
;; Uncomment to enable full type checks (should be the default).
|
|
|
|
;; (declaim (optimize (or (>= safety 2) (>= safety speed 1))))
|
2019-08-24 16:07:40 +02:00
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
(defpackage ambrevar
|
|
|
|
(:use :cl))
|
|
|
|
(in-package :ambrevar)
|
|
|
|
|
|
|
|
(export 'exported-symbols)
|
|
|
|
(declaim (ftype (function ((or symbol package))) exported-symbols))
|
|
|
|
(defun exported-symbols (package)
|
|
|
|
"List exported symbols of PACKAGE."
|
|
|
|
(let ((package (if (packagep package)
|
|
|
|
package
|
|
|
|
(find-package package)))
|
|
|
|
(symbols))
|
|
|
|
(do-external-symbols (s package symbols)
|
|
|
|
(when (eq (symbol-package s) package)
|
|
|
|
(push s symbols)))
|
|
|
|
symbols))
|
|
|
|
|
2019-08-26 12:28:25 +02:00
|
|
|
(export 'system-depends-on)
|
|
|
|
(declaim (ftype (function (string)) system-depends-on))
|
|
|
|
(defun system-depends-on (system)
|
2019-08-24 16:07:40 +02:00
|
|
|
"List SYSTEM dependencies, even if SYSTEM is an inferred system.
|
|
|
|
From: https://gitlab.common-lisp.net/asdf/asdf/issues/10#note_5018."
|
|
|
|
(let (depends)
|
|
|
|
(labels ((iter (openlist)
|
|
|
|
(if (null openlist) depends
|
|
|
|
;; Is this a subsystem of SYSTEM?
|
|
|
|
(let ((find (search system (first openlist))))
|
|
|
|
(if (and find (zerop find))
|
|
|
|
(iter (append (asdf:system-depends-on (asdf:find-system (first openlist))) (rest openlist)))
|
|
|
|
;; If not, it's a direct dependency: collect it.
|
|
|
|
(progn
|
|
|
|
(pushnew (first openlist) depends :test 'equalp)
|
|
|
|
(iter (rest openlist))))))))
|
|
|
|
(iter (list system)))))
|
|
|
|
|
|
|
|
(in-package :cl-user)
|