abcl-build: sensibly refactor download from unpacking

parent a661a972
......@@ -161,6 +161,7 @@ be in a directory named '../ansi-test/'."
(:file "platform")
(:file "customizations-default")
(:file "install")
(:file "ant")
(:file "build-abcl")))))
(defsystem abcl/build/t
:description "Test ABCL build system."
......
(in-package abcl-build)
(defun install/ant ()
(let ((uri
#p"http://archive.apache.org/dist/ant/binaries/apache-ant-1.9.4-bin.zip"
#+nil ;; https on OPEN fails; probably attempting to upgrade
#p"https://archive.apache.org/dist/ant/binaries/apache-ant-1.9.4-bin.zip"
#+nil ;; need apache-ant-1.9 for JVM version 49.0
#p"http://www-eu.apache.org/dist/ant/binaries/apache-ant-1.10.1-bin.zip"))
(let ((root (install uri :type :unpack/zip)))
(values
(merge-pathnames "bin/ant" root)
root
(directory (merge-pathnames "*.*" root))))))
......@@ -10,12 +10,31 @@
(install-zip uri type))
(defun install-zip (uri binary-unzip)
(let ((directory (make-pathname :defaults uri :host nil :device nil :name nil :version nil))
(archive (make-pathname :defaults uri :host nil :device nil :directory nil)))
(ensure-directories-exist directory)
(uiop:copy-file
(open uri :direction :input)
(merge-pathnames archive directory))))
(let ((archive
(download-artifact uri))
(root
(uiop/configuration:xdg-data-home
(concatenate 'string
"abcl/"
(pathname-name uri)
"/"))))
(ensure-directories-exist root)
(sys:unzip archive root)
root))
(defun download-artifact (uri)
(let* ((root
(uiop/configuration:xdg-data-home "abcl/dist/"))
(archive
(make-pathname :defaults uri :host nil :device nil :directory nil))
(destination
(merge-pathnames archive root)))
(ensure-directories-exist destination)
(uiop:copy-file
(open uri :direction :input)
destination)
destination))
......@@ -4,6 +4,10 @@
(:export
#:install
#:install/ant
#:install-zip
#:download-artifact
#:platform
......
......@@ -9,6 +9,10 @@
(ok
(directory (merge-pathnames "*.*" path))))
(plan 1)
(ok
(build-abcl::install/ant))
(finalize)
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