Created
February 26, 2009 16:04
-
-
Save youz/70927 to your computer and use it in GitHub Desktop.
ASDF settings for SBCL on Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require :asdf) | |
(in-package :asdf) | |
(defvar *win-central-registry* | |
`((,(user-homedir-pathname) ".sbcl/site/") | |
(,(sb-ext:posix-getenv "SBCL_HOME") "site/"))) | |
(defun win-sysdef-search (system) | |
(dolist (dir *win-central-registry*) | |
(let ((files (directory | |
(merge-pathnames | |
(make-pathname :directory '(:relative :wild) | |
:name (coerce-name system) | |
:type "asd" | |
:case :local) | |
(merge-pathnames (cadr dir) (truename (car dir))))))) | |
(when files | |
(return (car (sort files #'string> :key #'namestring))))))) | |
(pushnew `win-sysdef-search asdf:*system-definition-search-functions*) | |
(require :asdf-install) | |
(in-package :asdf-install) | |
(setq *tar-program* "C:/Msys/1.0.11/bin/tar.exe") | |
(labels ((pathstr (win-path) | |
(cl:substitute #\/ #\\ (namestring win-path))) | |
(tar (args) | |
(with-output-to-string (o) | |
(let ((process (sb-ext:run-program *tar-program* | |
args | |
:search t | |
:wait nil | |
:output :stream))) | |
(prog1 (loop for l = (read-line (process-output process) nil nil) | |
while l | |
do (write-line l o)) | |
(process-wait process) | |
(process-close process)))))) | |
(defun get-tar-directory (packagename) | |
(let* ((tar (tar (list "-tzf" (pathstr packagename)))) | |
(first-line (subseq tar 0 (position #\newline tar)))) | |
(if (find #\/ first-line) | |
(subseq first-line 0 (position #\/ first-line)) | |
first-line))) | |
(defun untar-package (source packagename) | |
(tar (list "-C" (pathstr source) | |
"-xzvf" (pathstr packagename))))) | |
(in-package :cl-user) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment