mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2025-12-06 02:40:26 -08:00
Added a quick path to install quicklisp on any ECL system
This commit is contained in:
parent
146b06794c
commit
c27d4c34b7
2 changed files with 49 additions and 0 deletions
42
contrib/quicklisp/ecl-quicklisp.lisp
Normal file
42
contrib/quicklisp/ecl-quicklisp.lisp
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
(defpackage :ecl-quicklisp
|
||||
(:use :cl))
|
||||
|
||||
(in-package :ecl-quicklisp)
|
||||
|
||||
(require :ecl-curl)
|
||||
|
||||
(defparameter *quicklisp-url* "http://beta.quicklisp.org/quicklisp.lisp")
|
||||
|
||||
(defparameter *quicklisp-directory* (translate-logical-pathname "SYS:QUICKLISP;"))
|
||||
|
||||
(defparameter *quicklisp-setup* "SYS:QUICKLISP;SETUP.LISP")
|
||||
|
||||
(defun safe-download (url filename)
|
||||
(ensure-directories-exist filename)
|
||||
(handler-case
|
||||
(ecl-curl:download-url-to-file url filename)
|
||||
(ecl-curl:download-error (c)
|
||||
(format t "~&;;;~%;;; Unable to download quicklisp. Aborting. ~%;;;")
|
||||
(ext:quit 1)))
|
||||
filename)
|
||||
|
||||
(defun install-quicklisp (target-directory)
|
||||
(let ((file (merge-pathnames "_installer.lisp" target-directory)))
|
||||
(ensure-directories-exist file)
|
||||
(ecl-curl:download-url-to-file *quicklisp-url* file)
|
||||
(load file)
|
||||
(eval (read-from-string
|
||||
(format nil "(quicklisp-quickstart:install :path ~S)"
|
||||
(namestring (truename target-directory))))
|
||||
)))
|
||||
|
||||
(handler-case
|
||||
(progn
|
||||
(unless (probe-file *quicklisp-setup*)
|
||||
(install-quicklisp *quicklisp-directory*))
|
||||
(load *quicklisp-setup*))
|
||||
(error (c)
|
||||
(format t "~%;;; Unable to load / install quicklisp. Error message follows:~%~A"
|
||||
c)))
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue