Recently Written · git

cores

Save your custom core file after re-installing SBCL. Load libraries compiled into the core. Works but very rough around the edges.

git clone https://github.com/equwal/cores

Log | Files | Refs


commit c51addd3d8cc28b0ad27be8b7256462dfa61c7f7
Spenser Truex <truex@equwal.com>
2021-01-03 19:59:14 -0800

Initial commit.

Does generate the packages successfully, but really should be able to
choose where the core goes. It is a bit of work to be able to do that
without infecting the namespace, since it has to be called in the
`save-lisp-and-die` call.

 README.md   | 38 ++++++++++++++++++++++++++++++++++++++
 config.lisp | 23 +++++++++++++++++++++++
 make.lisp   | 15 +++++++++++++++
 3 files changed, 76 insertions(+)
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..3cf838f
--- /dev/null
+++ b/README.md
@@ -0,0 +1,38 @@
+# REQUIREMENTS
+
+SBCL
+QUICKLISP
+
+# INSTALLATION
+
+1) Add local packages to ASDF if needed in the `~/.sbclrc`.
+```cl
+(pushnew  (merge-pathnames #p"common-lisp/" (user-homedir-pathname))
+            asdf:*central-registry*)
+```
+2) Modify packages to load into the core in `config.lisp`. There are some examples.
+```cl
+(defvar *quicklisp-packages*
+  '("BORDEAUX-THREADS")
+  "Load into core from quicklisp.")
+```
+3) Generate the core. It goes to `.sbcl-core-libs`.
+```sh
+sbcl --load "make.lisp"
+```
+4) Add the core to your SBCL startup process. There multiple ways to do that.
+
+Modifying the environment variable.
+```sh
+SBCL_HOME="$HOME/.sbcl-core-libs"
+```
+The --core option in the IDE call to SBCL.
+```sh
+sbcl --core "$HOME/.sbcl-core/libs"
+```
+
+# AFTER UPDATING SBCL
+Just regenerate the core.
+```sh
+sbcl --load core-generation.lisp
+```
diff --git a/config.lisp b/config.lisp
new file mode 100644
index 0000000..e7cccb1
--- /dev/null
+++ b/config.lisp
@@ -0,0 +1,23 @@
+(in-package :cl-user)
+
+(defvar *local-packages* nil
+  ;; Use lowercase strings in the packages here! For example:
+  ;; '("utils")
+  "Load into the core from local ASDF directories.")
+
+;;; USE UPPERCASE STRINGS TO KEEP NAMESPACE CLEAN.
+(defvar *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.
+    "QUICKPROJECT"  ;Generate new projects
+    ;; Testing
+    "FIVEAM"        ;A great way to do testing with reader macros.
+    ;; Threading
+    "BORDEAUX-THREADS"    ;Portable threading.
+    )
+  "Load into core from quicklisp.")
diff --git a/make.lisp b/make.lisp
new file mode 100644
index 0000000..2466dcf
--- /dev/null
+++ b/make.lisp
@@ -0,0 +1,15 @@
+(in-package :cl-user)
+;; This code is intended to be used to generate an SBCL core on update
+
+(load "config.lisp")
+(when *local-packages* (mapc #'asdf:load-system *local-packages*))
+
+(when *quicklisp-packages*
+  (mapc #'ql:quickload *quicklisp-packages*))
+
+(fmakunbound '*local-packages*)
+(fmakunbound '*quicklisp-packages*)
+
+(save-lisp-and-die (merge-pathnames #p".sbcl-core-libs" (user-homedir-pathname)))
+
+