diff --git a/README.md b/README.md index 4965084..5a4433b 100644 --- a/README.md +++ b/README.md @@ -32,19 +32,14 @@ now run the installer script: ## MANUAL INSTALLATION -1. `mkdir ~/quicklisp` and `cd ~/quicklisp` -2. Go to and lookup `:client-tar` URL, download it, verify - hash and untar. -3. Clone ql-https from to - to `~/common-lisp/ql-https` -4. Disconnect internet. (Prevent that anything leaks over HTTP during the installation) -5. Start a fresh REPL and (require 'asdf) -6. Load `~/common-lisp/ql-https/ql-setup.lisp` -7. Eval `(asdf:load-system "ql-https")` -8. Inspect `ql-http:*fetch-scheme-functions*` and verify everything was registered properly. Both `http` and - `https` have `ql-https:fetcher` registered. -9. Connect internet. -10. Eval `(quicklisp:setup)` - use the USE-HTTPS restart if you hit the network. +1. `mkdir ~/quicklisp` and `cd ~/quicklisp` +2. Go to and lookup `:client-tar` URL, download it, verify + hash and untar. +3. Clone ql-https from to + to `~/common-lisp/ql-https` +4. Start a fresh REPL and (require 'asdf) +5. Load `~/common-lisp/ql-https/ql-setup.lisp` +6. Eval `(uiop:symbol-call :ql-setup :setup)` Removing the *Missing client-info.sexp, using mock info* warning. @@ -62,8 +57,8 @@ Watch ASCIInema: (let ((quicklisp-init #p"~/common-lisp/ql-https/ql-setup.lisp")) (when (probe-file quicklisp-init) (load quicklisp-init) - (asdf:load-system "ql-https") - (uiop:symbol-call :quicklisp :setup))) + ;; Alternatively: (uiop:symbol-call :ql-setup :setup "/path/to/quicklisp/") + (uiop:symbol-call :ql-setup :setup))) ;; optional #+ql-https diff --git a/ql-setup.lisp b/ql-setup.lisp index 66d44de..80da194 100644 --- a/ql-setup.lisp +++ b/ql-setup.lisp @@ -36,14 +36,8 @@ (error "This file must be LOADed to set up quicklisp.")) (defvar *quicklisp-home* - (make-pathname :name nil :type nil - :defaults (let ((qlhome "~/quicklisp/")) - (if (probe-file qlhome) - qlhome - (error "Quicklisp not installed to - default location. Please set - *quicklisp-home* manually and - retry"))))) + (merge-pathnames "quicklisp/" + (user-homedir-pathname))) (defun qmerge (pathname) "Return PATHNAME merged with the base Quicklisp directory." @@ -141,8 +135,6 @@ compiling asdf.lisp to a FASL and then loading it." (try (load (compile-file source :verbose nil :output-file fasl)))) (error "Could not load ASDF ~S or newer" *required-asdf-version*)))))) -(ensure-asdf-loaded) - ;;; ;;; Quicklisp sometimes must upgrade ASDF. Ugrading ASDF will blow ;;; away existing ASDF methods, so e.g. FASL recompilation :around @@ -151,15 +143,29 @@ compiling asdf.lisp to a FASL and then loading it." ;;; ASDF. Thanks to Nikodemus Siivola for pointing out this issue. ;;; -(let ((asdf-init (probe-file (qmerge "asdf-config/init.lisp")))) - (when asdf-init - (with-simple-restart (skip "Skip loading ~S" asdf-init) - (load asdf-init :verbose nil :print nil)))) +(defun setup (&optional quicklisp-home) + "Perform necessary set-up for the Quicklisp installation. + +If QUICKLISP-HOME is given, binds `*quicklisp-home*' to it." + (declare (type (or Null Pathname) quicklisp-home)) + + (when quicklisp-home + (setf *quicklisp-home* quicklisp-home)) + + (ensure-asdf-loaded) + + (let ((asdf-init (probe-file (qmerge "asdf-config/init.lisp")))) + (when asdf-init + (with-simple-restart (skip "Skip loading ~S" asdf-init) + (load asdf-init :verbose nil :print nil)))) + + (push (qmerge "quicklisp/") asdf:*central-registry*) -(push (qmerge "quicklisp/") asdf:*central-registry*) + (let ((*compile-print* nil) + (*compile-verbose* nil) + (*load-verbose* nil) + (*load-print* nil)) + (asdf:oos 'asdf:load-op "quicklisp" :verbose nil)) -(let ((*compile-print* nil) - (*compile-verbose* nil) - (*load-verbose* nil) - (*load-print* nil)) - (asdf:oos 'asdf:load-op "quicklisp" :verbose nil)) + (asdf:load-system "ql-https") + (uiop:symbol-call :quicklisp :setup))