wiki:HintsForAsdfAndOpenmcl

Version 1 (modified by bfulgham, 7 years ago) (diff)

--

Hints for using ASDF with OpenMCL

Introduction

 ASDF is a system definition facility. Starting with OpenMCL 0.14.2, it is included as part of the standard distribution and can be used with a simple: (require 'asdf).

OpenMCL also includes  ASDF-INSTALL, a CPAN-style repository for Common Lisp. The site includes an enumeration of all the useful code it can fetch and install for you.

You may need to add following to ~/.asdf-install to disable gpg sig verification:

(setq asdf-install:*verify-gpg-signatures* nil)

Set-up

Prepare the system so that admin users can use asdf-install to install packages for the entire system:

GNU Privacy Guard

You will need the  GNU Privacy Guard (GPG) to confirm that the packages you download and install have not been corrupted or tampered with by an attacker. If you do not already have GPG, you will need to install it using either your package installer (e.g., MacPorts? or Fink), or by downloading a  native Mac port of the software.

Once you have a copy of GPG, make sure to add the appropriate public keysFootNote(For more information about public key encryption and its uses, read the [http://en.wikipedia.org/wiki/Public-key_cryptography Wikipedia write-up] on the subject.)? to your local keychain so that you can easily verify the integrity of downloaded software.

   gpg --search-keys eweitz@common-lisp.net # Add Dr. Edmund Weitz to your key ring 

Prepare Your System

Once OpenMCL is installed, there are a few directories that need to be setup (and permissions verified) so that you can use ASDF-Install with minimum effort. The instructions are different depending on the method used to obtain OpenMCL.

For Fink Users

   sudo chmod -R g+w /sw/lib/openmcl/ccl    # The admin group can write into all this directory tree.
   sudo mkdir /usr/local/asdf-install       # Create a directory where the files shall go
   sudo chgrp admin /usr/local/asdf-install # Make sure it belongs to the admin group
   sudo chmod g+w /usr/local/asdf-install   # The admin group can write into all this directory tree 

Now you're ready to start OpenMCL and run asdf-install:

A recipe to get you started:

   ? (require 'asdf)                                  ; load the bundled version of ASDF
   ASDF
   NIL
   ? (pushnew "ccl:tools;asdf-install;"
        asdf:*central-registry* :test #'string-equal) ; add bundled version of ASDF-install to load path
   ? (asdf:operate 'asdf:load-op 'asdf-install)       ; load the bundled version of ASDF-install 

For MacPorts? Users

These paths are different if you used  MacPorts to install the software. The tools/asdf-install directory will already exist after the port install, so you just need to change the file permissions.

   sudo chgrp admin /opt/local/share/openmcl/1.0/tools/asdf-install
   sudo chmod -R g+w /opt/local/share/openmcl/1.0/tools/asdf-install
   sudo mkdir /usr/local/asdf-install  # create a directory where the files shall go 

Then configure your openmcl-init.lisp:

   ? (require 'asdf) ; load the bundled version of ASDF
   ASDF
   NIL
   ? (pushnew "ccl:tools;tools;asdf-install;"
        asdf:*central-registry* :test #'string-equal) ; add bundled version of ASDF-install to load path
   ? (asdf:operate 'asdf:load-op 'asdf-install)       ; load the bundled version of ASDF-install 

... And Beyond

If you incorporated the above steps into your OpenMCL ~/.asdf-install file, then you can install random stuff on demand quite quickly.

For example, to install the md5 support:

? (asdf-install:install 'md5)
Install where?
0) System-wide install: 
   System in /usr/local/asdf-install/site-systems/
   Files in /usr/local/asdf-install/site/ 
1) Personal installation: 
   System in /Users/brent/.asdf-install-dir/systems/
   Files in /Users/brent/.asdf-install-dir/site/ 
2) Abort installation.
 --> 0
;;; ASDF-INSTALL: Downloading 9030 bytes from http://files.b9.com/md5/md5-1.8.5.tar.gz to MD5.asdf-install-tmp ...

;;; ASDF-INSTALL: Installing MD5.asdf-install-tmp in /usr/local/asdf-install/site/, /usr/local/asdf-install/site-systems/
md5-1.8.5/
md5-1.8.5/md5.asd
md5-1.8.5/md5.lisp

#P"/usr/local/asdf-install/site/md5-1.8.5/" 
#P"/usr/local/asdf-install/site/md5-1.8.5/" ;;; ASDF-INSTALL: Loading system "md5" via ASDF.
; loading system definition from /usr/local/asdf-install/site-systems/md5.asd into #<Package "ASDF2102">
; registering #<SYSTEM MD5 #x8A653AE> as MD5
NIL
? 

See also the  ASDF-Install tutorial.

FootNote?