;;;;This file attempts to get a bunch of dependencies.
;;;; $LISP --load cl-wav-agnostic-deps-clone.lisp
(require 'asdf)

;;; Ensure the two source directories asdf likes are there
(flet ((ensure-dir (path) 
        (uiop/pathname:ensure-pathname path :ensure-directories-exist t)))
 (dolist (path (list #p"~/.local/share/common-lisp/source/"
	            #p"~/common-lisp/"))
        (ensure-dir path)))

;;; Attempt to clone all the deps into asdf's
;;; ~/.local/share/common-lisp/source/
;;; "https://github.com/phantomics/april.git" ; Too complex for me atm
(flet ((git-clone-tmp (url) 
       (uiop:run-program `("git" "clone" ,url) :error t)))
 (uiop:chdir #p"~/.local/share/common-lisp/source/")
 (dolist (url
      (list "https://gitlab.common-lisp.net/alexandria/alexandria.git"
	   "https://github.com/lmj/lparallel.git"

	   "https://github.com/RobBlackwell/cl-riff.git"
	   "https://github.com/RobBlackwell/cl-wav.git"

	   "https://github.com/sionescu/global-vars.git"
	   "https://github.com/trivial-features/trivial-features.git"
	   "https://github.com/trivial-garbage/trivial-garbage.git"
	   "https://github.com/sionescu/bordeaux-threads.git"
	   "https://github.com/ahefner/bordeaux-fft.git"))
   (ignore-errors (git-clone-tmp url))))

(uiop:quit 0)