diff options
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | .gitmodules | 6 | ||||
-rw-r--r-- | Makefile | 46 | ||||
-rw-r--r-- | bundle.lisp | 32 | ||||
-rw-r--r-- | extreload.asd | 7 | ||||
m--------- | lib/sysexits | 0 | ||||
m--------- | lib/with-user-abort | 0 | ||||
-rw-r--r-- | src/option.lisp | 6 |
8 files changed, 87 insertions, 14 deletions
@@ -1,2 +1,6 @@ /dist/ *.fasl + +/bundle/ +/lib/extreload/ +system-index.txt diff --git a/.gitmodules b/.gitmodules index 4a28638..067aecd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,3 @@ -[submodule "l/lib/sysexits"] - path = lib/sysexits - url = https://github.com/teddywing/cl-sysexits.git [submodule "lib/wait-group"] path = lib/wait-group url = https://github.com/teddywing/cl-wait-group.git -[submodule "lib/with-user-abort"] - path = lib/with-user-abort - url = https://github.com/compufox/with-user-abort.git @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Teddy Wing +# Copyright (c) 2021–2022 Teddy Wing # # This file is part of Extreload. # @@ -16,6 +16,14 @@ # along with Extreload. If not, see <https://www.gnu.org/licenses/>. +prefix ?= /usr/local +exec_prefix ?= $(prefix) +bindir ?= $(exec_prefix)/bin +datarootdir ?= $(prefix)/share +mandir ?= $(datarootdir)/man +man1dir ?= $(mandir)/man1 + + LISP ?= sbcl VERSION := $(shell fgrep ':version' extreload.asd | awk -F '"' '{ print $$2 }') @@ -63,8 +71,36 @@ $(DIST_MAN_PAGE): $(DIST)/share/man/man1 $(MAN_PAGE) cp $(MAN_PAGE) $< -.PHONY: pkg -pkg: extreload_$(VERSION)_darwin-x86_64.tar.bz2 +bundle: extreload.asd src/*.lisp + mkdir -p lib/extreload + cp -a extreload.asd src lib/extreload/ -extreload_$(VERSION)_darwin-x86_64.tar.bz2: dist - tar cjv -s /dist/extreload_$(VERSION)_darwin-x86_64/ -f $@ dist + $(LISP) --load bundle.lisp + +bundle/bundled-local-projects/0000/extreload/extreload: bundle + $(LISP) --load bundle/bundle.lisp \ + --eval '(asdf:make :extreload)' \ + --eval '(quit)' + + +.PHONY: pkg +pkg: extreload_$(VERSION).tar.bz2 + +extreload_$(VERSION).tar.bz2: bundle extreload.asd src/*.lisp + git archive \ + --prefix=extreload_$(VERSION)/ \ + --output=extreload_$(VERSION).tar \ + HEAD + tar -r \ + -s ,bundle,extreload_$(VERSION)/bundle, \ + -f extreload_$(VERSION).tar \ + bundle + bzip2 extreload_$(VERSION).tar + + +.PHONY: install +install: bundle/bundled-local-projects/0000/extreload/extreload $(MAN_PAGE) + install -m 755 bundle/bundled-local-projects/0000/extreload/extreload $(DESTDIR)$(bindir) + + install -d $(DESTDIR)$(man1dir) + install -m 644 $(MAN_PAGE) $(DESTDIR)$(man1dir) diff --git a/bundle.lisp b/bundle.lisp new file mode 100644 index 0000000..6bc04ac --- /dev/null +++ b/bundle.lisp @@ -0,0 +1,32 @@ +;;; Copyright (c) 2022 Teddy Wing +;;; +;;; This file is part of Extreload. +;;; +;;; Extreload is free software: you can redistribute it and/or modify +;;; it under the terms of the GNU General Public License as published by +;;; the Free Software Foundation, either version 3 of the License, or +;;; (at your option) any later version. +;;; +;;; Extreload is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with Extreload. If not, see <https://www.gnu.org/licenses/>. + + +(setf ql:*local-project-directories* '("./lib")) + +(let ((dependencies (append + (asdf:system-depends-on (asdf:find-system :extreload)))) + (local-dependencies '("wait-group"))) + (ql:bundle-systems + (set-difference + (sort dependencies #'string-lessp) + local-dependencies + :test #'equal) + :to "./bundle" + :include-local-projects t)) + +(quit) diff --git a/extreload.asd b/extreload.asd index 19e736d..d0c943f 100644 --- a/extreload.asd +++ b/extreload.asd @@ -1,4 +1,4 @@ -;;; Copyright (c) 2021 Teddy Wing +;;; Copyright (c) 2021–2022 Teddy Wing ;;; ;;; This file is part of Extreload. ;;; @@ -16,6 +16,11 @@ ;;; along with Extreload. If not, see <https://www.gnu.org/licenses/>. +;; SSL is not required for Extreload. Including it can cause a dynamic library +;; load path error if the runtime paths are different from those on the build +;; machine. +(push :websocket-driver-no-ssl *features*) + (asdf:defsystem extreload :version "0.0.2" :depends-on (:jsown diff --git a/lib/sysexits b/lib/sysexits deleted file mode 160000 -Subproject 7691fd7f8181b29c7a7bcc39eecde2294a5b2e2 diff --git a/lib/with-user-abort b/lib/with-user-abort deleted file mode 160000 -Subproject 16cc952d95d045b46c958309a4e988895f65d53 diff --git a/src/option.lisp b/src/option.lisp index 2a4721f..5b01ca8 100644 --- a/src/option.lisp +++ b/src/option.lisp @@ -1,6 +1,6 @@ ;;;; Command line options. -;;; Copyright (c) 2021 Teddy Wing +;;; Copyright (c) 2021–2022 Teddy Wing ;;; ;;; This file is part of Extreload. ;;; @@ -60,6 +60,8 @@ with code `exit-code`." `condition` and exits with EX_USAGE." (exit-with-error condition sysexits:+usage+)) +(defconstant *version* (asdf:component-version (asdf:find-system :extreload))) + (defun parse-options () "Parse command line options." (multiple-value-bind (options free-args) @@ -79,7 +81,7 @@ with code `exit-code`." (opts:exit sysexits:+usage+)) (when-option (options :version) - (format t "~a~%" (asdf:component-version (asdf:find-system :extreload))) + (format t "~a~%" *version*) (opts:exit sysexits:+ok+)) |