Skip to content

Instantly share code, notes, and snippets.

@equwal
Last active March 7, 2020 16:52
Show Gist options
  • Save equwal/607c89b26e13bf92879e1cfc3b8f7a7c to your computer and use it in GitHub Desktop.
Save equwal/607c89b26e13bf92879e1cfc3b8f7a7c to your computer and use it in GitHub Desktop.
Generate SBCL core image with libraries inside
;;;; Recommended command to install SBCL:
;;;; sbcl --load "/home/jose/common-lisp/sbcl-core-generation.lisp" --script '(save-lisp-and-die "sbcl-core-libs")'
(in-package :cl-user)
;;;; The gentoo package for SBCL typically fails to create a core sanely.
;;; This code is intended to be used to generate an SBCL core on update.
(pushnew (merge-pathnames #p"common-lisp/"
(user-homedir-pathname))
asdf:*central-registry*)
#-quicklisp
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
(user-homedir-pathname))))
(when (probe-file quicklisp-init)
(load quicklisp-init)))
;;; I chose to use lexical names and strings as much as possible in order to
;;; avoid fowling the cl-user namespace. The downside is that they are
;;; accessible anymore, and the uppercase strings are not strictly portable in
;;; the rare implementation that allows for case sensitivity.
(let ((quicklisp-packages
'(;;; For sly
"SB-BSD-SOCKETS" "SB-POSIX" "SB-INTROSPECT" "SB-CLTL2" "ASDF"
;;; Personal choices
;; Utilities
"ALEXANDRIA" ;For lots of great utilities, very stable.
"UIOP" ;Required by almost everyone.
"CL-PPCRE" ;Regular expressions.
"SERIES" ;Another way to do looping. Unpopular.
"QUICKPROJECT" ;Generate new projects
;; APL interpreter written in CL, easily embedded as a DSL.
"APRIL"
;; Testing
"FIVEAM" ;A great way to do testing with reader macros.
;; Threading
"BORDEAUX-THREADS" ;Portable threading.
"LPARALLEL" ;More portable threading
"CL-ASYNC" ;And more
"SIMPLE-FLOW-DISPATCHER" ;For cl-flow.
"SCREAMER" ;Pattern matching.
;; Books, talks, etc.
"AFP-UTILS" ;From the Atlanta Functional Programming group.
;; Doug Hoyte's book/utils. Autogensymming does not work
"LET-OVER-LAMBDA"
))
(local-packages
;; need to be lowercase for asdf!
'("utils" ;My utilities I've learned to use or made myself.
"cl-flow";Multithreading, quicklisp does not act right equwal 2019-11-02
)))
(mapc #'ql:quickload quicklisp-packages)
(mapc #'asdf:load-system local-packages)
(mapc #'require (append quicklisp-packages local-packages)))
(load #p"~/common-lisp/qpconf.lisp")
(sb-ext:set-sbcl-source-location "/bleeding/sbcl/")
(save-lisp-and-die "/home/jose/common-lisp/sbcl-core-libs")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment