Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mpasternacki
Created November 23, 2009 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpasternacki/241051 to your computer and use it in GitHub Desktop.
Save mpasternacki/241051 to your computer and use it in GitHub Desktop.
Local ASDF-Install Sandbox

Local ASDF-Install Sandbox

I needed an installation of ADSF-Install that wouldn’t interfere with system-wide, user-wide or even project-wide settings but that would allow me to fetch, e.g., Tinaa and document my project. So, I want to create ASDF-install sandbox that would be completely self-contained. And I did. Here’s how:

First, download ASDF-Install using darcs:

darcs get http://common-lisp.net/project/asdf-install/darcs/asdf-install

Downloaded ASDF-install directory will be our sandox (yes, the self-contained sandbox is this self-contained it uses own local copy of ASDF-Install itself). Now, let’s create place for downloaded systems in sandbox and, to avoid overpopulating ASDF:*CENTRAL-REGISTRY*, symlink asdf-install itself there:

cd asdf-install
mkdir site/ systems/
cd systems/
ln -s ../asdf-install/*.asd .

Next, copy load.lisp file to sandbox directory. Load it and enjoy.

(flet
((load-subdir (name)
(make-pathname
:name nil :type nil :version nil
:defaults
(merge-pathnames (concatenate 'string name "/")
*load-truename*)))
(a-i-symbol (name)
(intern (string name)
(find-package #.(string '#:asdf-install)))))
(pushnew (load-subdir "systems") asdf:*central-registry*)
(asdf:operate 'asdf:load-op :asdf-install)
(setf (symbol-value (a-i-symbol '#:*locations*))
`((,(load-subdir "site")
,(load-subdir "systems")
"Semi-local installation")))
(push '(:absolute "bin")
(symbol-value (a-i-symbol '#:*shell-search-paths*))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment