Skip to content

Commit

Permalink
fixup! Support installation of additional systems
Browse files Browse the repository at this point in the history
  • Loading branch information
foretspaisibles committed Sep 15, 2023
1 parent db30cf2 commit a0ae937
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 51 deletions.
2 changes: 0 additions & 2 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,5 @@ runs:
PACKAGE=${{ github.repository }}
QUICKLISP_HOME=${HOME}/quicklisp
QUICKLISP_ADDITIONAL_SYSTEMS='${{ inputs.additional-systems }}'
/bin/sh -x
${{ github.action_path }}/with_lisp_implementation ${{ inputs.implementation }}
${{ github.action_path }}/load-quicklisp.lisp
${{ github.action_path }}/setup-quicklisp.lisp
41 changes: 0 additions & 41 deletions load-quicklisp.lisp

This file was deleted.

44 changes: 36 additions & 8 deletions setup-quicklisp.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,32 @@
(require '#:asdf)
(require '#:uiop)

(labels
((select-quicklisp (process)
(uiop:run-program '("sed" "-n" "-e" "/quicklisp[.]lisp$/{s/^ *//;p;}")
:input (uiop:process-info-output process)
:output :string))
(ubuntu-quicklisp ()
(select-quicklisp
(uiop:launch-program '("dpkg" "-L" "cl-quicklisp")
:output :stream)))
(macports-quicklisp ()
(select-quicklisp
(uiop:launch-program '("port" "contents" "cl-quicklisp")
:output :stream)))
(find-quicklisp ()
(cond
((uiop:os-macosx-p)
(macports-quicklisp))
((uiop:os-unix-p)
(ubuntu-quicklisp))))
(quicklisp-pathname ()
(pathname (string-trim '(#\Space #\Newline #\Return #\Tab)
(find-quicklisp)))))
(load (quicklisp-pathname)))

(defpackage #:org.melusina.lisp-action/setup-quicklisp
(:use #:common-lisp)
(:export #:entrypoint))
(:use #:common-lisp))

(in-package #:org.melusina.lisp-action/setup-quicklisp)

Expand Down Expand Up @@ -52,30 +75,35 @@ to job output."

(defun install-quicklisp ()
(quicklisp-quickstart:install :path *quicklisp-home*)
(ql-util:without-prompting
(ql:add-to-init-file)))
(eval
(list
(find-symbol "WITHOUT-PROMPTING" "QL-UTIL")
(list (find-symbol "ADD-TO-INIT-FILE" "QL")))))

(defun register-local-projects ()
(when *quicklisp-register-local-projects*
(let ((workspace
(uiop:getenv "GITHUB_WORKSPACE"))
(init-file
(merge-pathnames
(ql-impl-util::init-file-name)
(funcall
(find-symbol "INIT-FILE-NAME" "QL-IMPL-UTIL"))
(user-homedir-pathname))))
(when workspace
(pushnew (pathname workspace)
ql:*local-project-directories*)
(symbol-value (find-symbol "*LOCAL-PROJECT-DIRECTORIES*" "QL")))
(with-open-file (output init-file
:direction :output
:if-exists :append :if-does-not-exist :create)
(format output "~&#+quicklisp~&(pushnew #p~S ql:*local-project-directories*)"
workspace))))
(ql:register-local-projects)))
(funcall (find-symbol "REGISTER-LOCAL-PROJECTS" "QL"))))

(defun load-additional-systems ()
(when *quicklisp-additional-systems*
(ql:quickload *quicklisp-additional-systems*)))
(funcall
(find-symbol "QUICKLOAD" "QL")
*quicklisp-additional-systems*)))

(defun write-quicklisp-details ()
"Write details about the current Common Lisp Implementation."
Expand Down

0 comments on commit a0ae937

Please sign in to comment.