Skip to content
Permalink
Browse files

Merge pull request #25 from inaimathi/qlot-for-local-quicklisp

Qlot for local quicklisp
  • Loading branch information...
inaimathi committed Mar 25, 2018
2 parents 8b123b0 + c62258e commit c133cbce2e5a6332d243d0d3fefd9436a3a050c5
Showing with 12 additions and 25 deletions.
  1. +1 −1 cl-notebook.asd
  2. +3 −1 src/model.lisp
  3. +1 −1 src/package.lisp
  4. +7 −22 src/start.lisp
@@ -5,7 +5,7 @@
:description "A notebook-style in-browser editor for Common Lisp"
:author "Inaimathi <leo.zovic@gmail.com>"
:license "AGPL3"
:depends-on (#+sbcl #:sb-introspect
:depends-on (#+sbcl #:sb-introspect #:qlot
#:alexandria #:anaphora #:cl-fad #:closer-mop
#:cl-who #:cl-css #:parenscript
#:house #:fact-base)
@@ -81,7 +81,9 @@
(publish-update! nil 'loading-package :package package)
(handler-bind ((error (lambda (e)
(publish-update! nil 'package-load-failed :package package :error (front-end-error nil e)))))
(funcall (intern "QUICKLOAD" :ql) package)
(qlot:with-local-quicklisp (*storage*)
(qlot/util:with-package-functions :ql (quickload)
(quickload package)))
(publish-update! nil 'finished-loading-package :package package))))

(defmethod load-dependencies! ((package-form list))
@@ -21,9 +21,9 @@
(defvar *storage* nil)
(defvar *books* nil)
(defvar *static* nil)
(defvar *ql* nil)

(defvar *static-files* nil)
(defvar *quicklisp-file* nil)

(defvar *default-indices* '(:a :b :ab :abc))

@@ -11,7 +11,6 @@ Only useful during the build process, where its called with an --eval flag."
(read-sequence data stream)
data))))
(let ((root (asdf:system-source-directory :cl-notebook)))
(setf *quicklisp-file* (read-file (merge-pathnames "quicklisp.lisp" root)))
(cl-fad:walk-directory
(sys-dir (merge-pathnames "static" root))
(lambda (filename)
@@ -39,7 +38,8 @@ Only useful during the build process, where its called with an --eval flag."
(host (if (or (get-param '(:o :open :public) params) public?) usocket:*wildcard-host* #(127 0 0 1))))
(format t "Initializing storage directories...~%")
(setf *storage* (sys-dir (merge-pathnames ".cl-notebook" (user-homedir-pathname)))
*books* (sys-dir (merge-pathnames "books" *storage*)))
*books* (sys-dir (merge-pathnames "books" *storage*))
*ql* (merge-pathnames "quicklisp" *storage*))
(unless *static*
(format t "Initializing static files...~%")
(setf *static* (merge-pathnames "static" *storage*))
@@ -51,27 +51,12 @@ Only useful during the build process, where its called with an --eval flag."
(write-statics :force? (get-param '(:f :force) params)))

(format t "Checking for quicklisp...~%")
(unless (dir-exists? *ql*) (qlot:install-quicklisp *ql*))
(if (find-package :quicklisp)
(format t " quicklisp already loaded...~%")
(let ((ql-dir
(or (dir-exists? "quicklisp")
(dir-exists? (merge-pathnames "quicklisp" (user-homedir-pathname)))
(dir-exists? (merge-pathnames "quicklisp" *storage*)))))
(cond (ql-dir
(format t " Loading quicklisp from ~s...~%" ql-dir)
(load (merge-pathnames "setup.lisp" ql-dir)))
(t
(format t " No quicklisp found...~%")
(let ((ql-setup-file (merge-pathnames "quicklisp.lisp" *storage*)))
(format t " TODO auto-install quicklisp to '~~/.cl-notebook/quicklisp/' at this point~%")
(format t " Writing quicklisp.lisp ...~%")
(with-open-file (stream ql-setup-file :direction :output :element-type '(unsigned-byte 8) :if-exists :supersede :if-does-not-exist :create)
(write-sequence *quicklisp-file* stream))
(load ql-setup-file)
(funcall
(intern "INSTALL" :quicklisp-quickstart)
:path (cl-fad:pathname-as-directory (merge-pathnames "quicklisp" *storage*))))))
(setf *quicklisp-file* nil)))
(format t " quicklisp already loaded...~%")
(progn
(format t " Loading quicklisp from ~s...~%" *ql*)
(load (merge-pathnames "setup.lisp" ql-dir))))

(in-package :cl-notebook)
(format t "Loading books...~%")

0 comments on commit c133cbc

Please sign in to comment.
You can’t perform that action at this time.