source: trunk/abcl/contrib/quicklisp/quicklisp-abcl.lisp @ 15008

Last change on this file since 15008 was 15008, checked in by Mark Evenson, 5 years ago

Normalize ASDF definitions to follow best practices

c.f. <https://gitlab.common-lisp.net/asdf/asdf/blob/master/doc/best_practices.md>

File size: 2.0 KB
Line 
1(in-package :cl-user)
2
3(defpackage quicklisp-abcl
4  (:nicknames :quicklisp-abcl)
5  (:use :cl
6        :asdf)
7  (:export :*quicklisp-parent-dir*))
8
9(in-package :quicklisp-abcl)
10
11(defvar *quicklisp-parent-dir* (user-homedir-pathname)
12  "Pathname reference to the parent directory of the local Quicklisp installation")
13
14(defmethod asdf:perform ((o asdf:load-op) (c (eql (asdf:find-system :quicklisp-abcl))))
15  (when (find :quicklisp *features*)
16    (return-from asdf:perform))
17  (let* ((setup-base
18          (merge-pathnames "quicklisp/setup" 
19                           *quicklisp-parent-dir*))
20         (setup-source
21          (probe-file (make-pathname :defaults setup-base
22                                     :type "lisp")))
23         (setup-fasl
24          (probe-file (make-pathname :defaults setup-base
25                                     :type "abcl"))))
26    (if setup-source
27           ;;; First try loading the Quicklisp setup as a compiled fasl if it exists
28        (if setup-fasl
29            (handler-case
30                (load setup-fasl)
31              ;; The fasl may be invalid (i.e. between abcl versions); if so, load source, and recompile
32              (error (e)
33                (declare (ignore e))
34                (when setup-source
35                  (load setup-source)
36                  (compile-file setup-source))))
37            ;; compilation only succeeds after QUICKLISP has been loaded fully
38            (when setup-source
39              (load setup-source)
40              (compile-file setup-source)))
41          ;;; Otherwise download Quicklisp and run its installation sequence
42        (progn 
43          (handler-case 
44              (load "https://beta.quicklisp.org/quicklisp.lisp")
45            (error (e)
46              (warn "Using insecure transport for remote installation of Quicklisp:~&~A~&." e)
47              (load "http://beta.quicklisp.org/quicklisp.lisp")))
48          (uiop:symbol-call :quicklisp-quickstart '#:install
49                            :path (merge-pathnames "quicklisp/" *quicklisp-parent-dir*))))))
50
Note: See TracBrowser for help on using the repository browser.