Clasp bin (#475)

* Add install clasp-bin

* Fix path

* add install-clasp-bin.lisp on Makefile.am

Co-authored-by: SANO Masatoshi <snmsts@gmail.com>
This commit is contained in:
gos-k 2021-04-29 17:47:39 +09:00 committed by GitHub
parent f1555cd79c
commit 81635defae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 77 additions and 2 deletions

View file

@ -65,7 +65,8 @@ LISPS = helper.el \
install.ros \
util-install.lisp util-install-quicklisp.lisp \
install+7zip.lisp install-abcl-bin.lisp install-allegro.lisp \
install-ccl-bin.lisp install-clasp.lisp install-clisp.lisp \
install-ccl-bin.lisp install-clasp-bin.lisp install-clasp.lisp \
install-clisp.lisp \
install-cmu-bin.lisp install-ecl.lisp install-quicklisp.lisp \
install-sbcl-bin.lisp install-sbcl.lisp install-sbcl-source.lisp \
install-slime.lisp install-sly.lisp \

View file

@ -0,0 +1,70 @@
(roswell:include "util-install-quicklisp")
(defpackage :roswell.install.clasp-bin
(:use :cl :roswell.install :roswell.util :roswell.locations))
(in-package :roswell.install.clasp-bin)
(defun clasp-bin-get-version ()
(format *error-output* "Checking version to install...~%")
(cddr (github-version (clasp-git-version-uri)
"clasp"
(lambda (href) (subseq href (1+ (position #\/ href :from-end t)))))))
(defun clasp-bin-argv-parse (argv)
(format *error-output* "~&Installing clasp-bin/~A...~%" (getf argv :version))
(when (position "--without-install" (getf argv :argv) :test 'equal)
(set-opt "without-install" t))
(cons t argv))
(defun clasp-bin-download (argv)
(let* ((uname (uname))
(version (getf argv :version))
(name (format nil "~@{~A~}" "clasp-" version "-x86-64-" uname)))
(set-opt "as" version)
(set-opt "download.uri" (or (opt "download.uri")
(format nil "~@{~A~}" (clasp-bin-uri)
version "/" name "-binary" ".tar.gz")))
(set-opt "download.archive" (let ((pos (position #\/ (opt "download.uri") :from-end t)))
(when pos
(merge-pathnames (format nil "archives/~A" (subseq (opt "download.uri") (1+ pos))) (homedir)))))
`((,(opt "download.archive") ,(opt "download.uri")))))
(defun clasp-bin-expand (argv)
(format t "~%Extracting archive:~A~%" (opt "download.archive"))
(let* ((impls (merge-pathnames (format nil "impls/~A/~A/clasp-bin/" (uname-m) (uname)) (homedir)))
(path (merge-pathnames (format nil "~A/" (opt "as")) impls))
(version (getf argv :version))
(uname (uname)))
(expand (opt "download.archive") (ensure-directories-exist impls))
(and (probe-file path)
(uiop/filesystem:delete-directory-tree
path :validate t))
(ql-impl-util:rename-directory
(merge-pathnames (format nil "~@{~A~}" "clasp-" version "-x86-64-" uname "/") impls)
(merge-pathnames (opt "as") impls)))
(cons t argv))
(defun clasp-bin-help (argv)
(format t "clasp-bin install options~%")
(flet ((fmt (param default more)
(format t "--~A~A ~A~%~5T~A~%"
(cond ((eql default t) "without-")
((null default) "with-")
(t ""))
param
(or (and (not (null default))
(not (eql default t))
default)
"")
more)))
(fmt "install" t "Download archive"))
(cons t argv))
(defun clasp-bin (type)
(case type
(:help '(clasp-bin-help))
(:install `(,(decide-version 'clasp-bin-get-version)
clasp-bin-argv-parse
,(decide-download 'clasp-bin-download)
clasp-bin-expand
setup))
(:list 'clasp-bin-get-version)))

View file

@ -19,6 +19,7 @@
(defuri allegro-uri "http://www.franz.com/")
(defuri abcl-bin-uri "https://common-lisp.net/project/armedbear/releases/")
(defuri ccl-bin-uri "https://github.com/roswell/ccl_bin/releases/download/")
(defuri clasp-bin-uri "https://github.com/roswell/clasp_bin/releases/download/")
(defuri clisp-uri "http://sourceforge.net/projects/clisp/files/clisp/")
(defuri cmu-bin-uri "https://common-lisp.net/project/cmucl/downloads/")
(defuri quicklisp-uri "http://beta.quicklisp.org/")
@ -34,6 +35,7 @@
(defuri ecl-git-version-uri "https://github.com/roswell/ecl/releases.atom")
(defuri sbcl-git-version-uri "https://github.com/sbcl/sbcl/releases.atom")
(defuri ccl-git-version-uri "https://github.com/roswell/ccl_bin/releases.atom")
(defuri clasp-git-version-uri "https://github.com/roswell/clasp_bin/releases.atom")
(defuri slime-git-version-uri"https://github.com/slime/slime/releases.atom")
(defuri sly-git-version-uri "https://github.com/joaotavora/sly/releases.atom")
(defuri npt-git-version-uri "https://github.com/nptcl/npt/releases.atom")

View file

@ -209,6 +209,7 @@
(system "install-abcl-bin")
(system "install-allegro")
(system "install-ccl-bin")
(system "install-clasp-bin")
(system "install-clasp")
(system "install-clisp")
(system "install-cmu-bin")

View file

@ -15,7 +15,7 @@ char** cmd_run_clasp(int argc,char** argv,struct sub_command* cmd) {
LVal ret=0;
char *bin=cat(home,impl_path,SLASH,"clasp",EXE_EXTENTION,NULL);
char *bin=cat(home,impl_path,SLASH,"build/boehm/iclasp-boehm",EXE_EXTENTION,NULL);
s(arch),s(os);
ret=conss(bin,ret);
s(impl_path);

View file

@ -10,6 +10,7 @@ struct run_impl_t impls_to_run[]={
{"ccl-bin",&cmd_run_ccl},
{"ccl32",&cmd_run_ccl},
{"clasp",&cmd_run_clasp},
{"clasp-bin",&cmd_run_clasp},
{"clisp",&cmd_run_clisp},
{"clisp32",&cmd_run_clisp},
{"ecl",&cmd_run_ecl},