Commit fa225349 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

Tweak the asdf-tools script some more.

Use CCL by default, which will be more portable.
More tweaking of system loading configuration.
parent 5da1cd72
":" ; exec sbcl --script "$0" "$@" ; exit # -*- Lisp -*- ":" ; exec ${CCL:-ccl} --load "$0" -- "$@" ; exit # -*- Lisp -*-
;;;;; Really runs on any decent Common Lisp implementation #|
;;;;; Can also be invoked by cl-launch 4: asdf-tools could also run on SBCL, or on any decent Common Lisp implementation,
;;;;; cl-launch -sp asdf-tools -r entry-point -- "$@" including using cl-launch, but CCL is the single implementation that has decent
portable support on all of Windows, Linux (x64, x86, ARM), MacOS X
":" ; exec ${SBCL:-sbcl} --script "$0" "$@" ; exit
":" ; cl-launch -l ccl -Q -sp asdf-tools -r entry-point -- "$@"
|#
(in-package :cl-user) ;; That may be default, but let's make double sure and tell SLIME. (in-package :cl-user) ;; That may be default, but let's make double sure and tell SLIME.
...@@ -13,24 +17,28 @@ ...@@ -13,24 +17,28 @@
(or *compile-file-truename* *load-truename* (truename *default-pathname-defaults*)))))) (or *compile-file-truename* *load-truename* (truename *default-pathname-defaults*))))))
;;; ASDF3 is loaded, now use it! ;;; ASDF3 is loaded, now use it!
(in-package :asdf)
(eval-when (:compile-toplevel :load-toplevel :execute) (eval-when (:compile-toplevel :load-toplevel :execute)
;; For bootstrap purposes, avoid having to extract cl-launch.asd into ext/cl-launch/ ;; For bootstrap purposes, avoid having to extract cl-launch.asd into ext/cl-launch/
(let ((cl-launch-dir (uiop:subpathname (uiop:current-lisp-file-pathname) "../ext/cl-launch/"))) (let* ((asdf-dir (pathname-parent-directory-pathname
(when (uiop:probe-file* (uiop:subpathname cl-launch-dir "dispatch.lisp")) (ensure-absolute-pathname (current-lisp-file-pathname) 'getcwd)))
(asdf:register-preloaded-system (cl-launch-dir (subpathname asdf-dir "ext/cl-launch/")))
:cl-launch/dispatch (when (and (not (find-system "cl-launch/dispatch" nil))
:class :package-inferred-system (probe-file* (subpathname cl-launch-dir "dispatch.lisp")))
:source-file nil (eval `(defsystem "cl-launch/dispatch"
:pathname cl-launch-dir :class :package-inferred-system
:components '((cl-source-file "lisp" :pathname "dispatch.lisp"))))) :source-file nil
;; Load either with or without quicklisp :pathname ,cl-launch-dir
#-quicklisp :components ((cl-source-file "lisp" :pathname "dispatch.lisp"))))))
(asdf:load-system :asdf-tools :verbose nil) ;; Depending on whether Quicklisp was loaded or not, either use it or use regular load-system
#+quicklisp (defun load-sys (system)
(let ((*standard-output* (make-broadcast-stream))) (if (featurep :quicklisp)
(ql:quickload :asdf-tools))) (let ((*standard-output* (make-broadcast-stream))) ;; be quiet
(ql:quickload system))
(in-package :asdf-tools) (load-system system :verbose nil)))
;; Finally, load asdf-tools
(load-sys "asdf-tools"))
;;; Actually run the stuff! ;;; asdf-tools is loaded, now actually run it!
(restore-image :entry-point 'entry-point :lisp-interaction nil) (restore-image :entry-point 'asdf-tools::entry-point :lisp-interaction nil)
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
;; we'd move this form right below the (funcall 'require "asdf") above. ;; we'd move this form right below the (funcall 'require "asdf") above.
;; See also notes in try-load-quicklisp. ;; See also notes in try-load-quicklisp.
(try-load-quicklisp)) (try-load-quicklisp))
;; User-configurable parts ;; ****** User-configurable parts ******
(required-asdf-version () "3.1.2") ;; In the end, we want at least ASDF 3.1.2 (required-asdf-version () "3.1.2") ;; In the end, we want at least ASDF 3.1.2
(asdf-lisp () (asdf-lisp ()
;; Here, define where your Lisp source code hierarchy stores its copy of ASDF. ;; Here, define where your Lisp source code hierarchy stores its copy of ASDF.
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
;; The above should already cover all paths that we use; ;; The above should already cover all paths that we use;
;; we don't want user configuration to interfere with the build. ;; we don't want user configuration to interfere with the build.
:ignore-inherited-configuration))) :ignore-inherited-configuration)))
;; No more user-configurable parts below. ;; ****** No more user-configurable parts below. ******
(asdf-call 'initialize-source-registry source-registry) (asdf-call 'initialize-source-registry source-registry)
(asdf-call 'initialize-output-translations output-translations)))) (asdf-call 'initialize-output-translations output-translations))))
;; Configure the printer ;; Configure the printer
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment