diff --git a/Makefile b/Makefile index 8ef5402..41e006f 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ -LISP ?= sbcl +sbcl: + sbcl --script build.lisp -all: - $(LISP) --load build.lisp +ecl: + ecl --norc --load build.lisp diff --git a/build.lisp b/build.lisp index 0eb9720..820622f 100644 --- a/build.lisp +++ b/build.lisp @@ -1,14 +1,23 @@ +#-ecl (require :asdf) +#+ecl +(load "~/.local/share/common-lisp/asdf-3.3.7/build/asdf.lisp") + +(asdf:initialize-source-registry `(:source-registry (:tree ,(uiop:getcwd)) :ignore-inherited-configuration)) + #+sb-core-compression (defmethod asdf:perform ((o asdf:image-op) (c asdf:system)) (uiop:dump-image (asdf:output-file o c) :executable t :compression t)) -(asdf:load-asd "lspack.asd") +(asdf:load-asd (uiop:merge-pathnames* "lspack.asd" (uiop:getcwd))) (asdf:load-system "lspack/exe") +#-ecl +(lspack:load-templates) + (asdf:make "lspack/exe") (quit) diff --git a/doc/todo.org b/doc/todo.org index 6017d1d..ad4648e 100644 --- a/doc/todo.org +++ b/doc/todo.org @@ -2,5 +2,7 @@ - [ ] Load user config from $XDG_CONFIG_HOME/lspack/config.lisp - [ ] Load licenses at compile time + - [X] SBCL (v0.0.5) + - [ ] ECL - [ ] Install exe, licenses, manpage -- [ ] Compile with ECL +- [X] Compile with ECL (v0.0.5) diff --git a/lspack.asd b/lspack.asd index 5b2b260..879c18c 100644 --- a/lspack.asd +++ b/lspack.asd @@ -2,7 +2,7 @@ :author "Emre Akan" :description "Quickstart Common Lisp projects" :license "GPL-3.0" - :version "0.0.4" + :version "0.0.5" :depends-on ("uiop") :pathname "src/" :serial t diff --git a/src/license.lisp b/src/license.lisp index 0e2fe08..a417e52 100644 --- a/src/license.lisp +++ b/src/license.lisp @@ -135,9 +135,14 @@ `((format ,stream-sym "~&||#~%~%"))))))) (defmethod license-generate-writer ((license ) &optional commented) - (uiop:if-let (template (license-read-template license)) - (setf (license-writer license) - (compile nil (template-generate-writer template commented))))) + (format *error-output* "~&Loading template ~S... " (license-find-template license)) + (finish-output *error-output*) + (let ((template (license-read-template license))) + (unless (null template) + (setf (license-writer license) + (compile nil (template-generate-writer template commented))) + (format *error-output* "ok~%") + (license-writer license)))) (defmethod license-ensure-writer ((license ) &optional commented) (with-slots (writer) license @@ -145,3 +150,13 @@ writer (license-generate-writer license commented)))) +(defun templates-keywords-list () + (loop :for key :being :the :hash-keys :of *licenses* + :collect key)) + +(defun load-templates (&optional (templates (templates-keywords-list))) + (loop :for key :in templates + :do (license-ensure-writer (get-license key)) + (let ((notice (get-notice key))) + (unless (null notice) + (license-ensure-writer notice))))) diff --git a/src/package.lisp b/src/package.lisp index 7eedfea..31d9493 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -2,4 +2,5 @@ (:use :cl) (:export #:start #:*default-author* - #:*default-license*)) + #:*default-license* + #:load-templates))