Quicklisp

From FedoraProject

Revision as of 10:57, 5 April 2012 by Kushal (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Introduction

Quicklisp is a library manager for Common Lisp. It is providing an unified way to find and use various libraries in Common Lisp.

My idea is to provide the same libraries through rpm packages with help from quicklisp. So the first target is to package quicklisp. For a PoC I packaged it in two seperate packages, quicklisp and quicklisp-dist

 * quicklisp package contains the actual quicklisp source. It leaves under %{_libdir}/quicklisp/
 * quicklisp-dist package contains the files required for quicklisp to find and load any library.
   It is under $RPM_BUILD_ROOT%{_libdir}/quicklisp/dists/

Now all the libraries stay under this quicklisp structure as they stay in the user's home folder when they install it directly from quicklisp website.

Spec Example

Below is an example spec file for cl-json package.

Name:		quicklisp-cl-base64
Version:        20101006.git
Release:        1%{?dist}
Summary:        cl-base64
Group:          Library
License:        MIT
URL:            http://beta.quicklisp.org/archive/cl-base64/2010-10-06/cl-base64-20101006-git.tgz
Source0:        cl-base64-20101006-git.tgz
Requires:       quicklisp, quicklisp-dist

%description
Lisp package

%prep
%setup -q -n cl-base64-20101006-git
%build
#%%configure


%install
mkdir -p $RPM_BUILD_ROOT%{_libdir}/quicklisp/dists/quicklisp/software/cl-base64-20101006-git
cp -r * $RPM_BUILD_ROOT%{_libdir}/quicklisp/dists/quicklisp/software/cl-base64-20101006-git
mkdir -p $RPM_BUILD_ROOT%{_libdir}/quicklisp/dists/quicklisp/installed/releases/
mkdir -p $RPM_BUILD_ROOT%{_libdir}/quicklisp/dists/quicklisp/installed/systems/

echo "dists/quicklisp/software/cl-base64-20101006-git/" >  $RPM_BUILD_ROOT%{_libdir}/quicklisp/dists/quicklisp/installed/releases/cl-base64.txt

echo "dists/quicklisp/software/cl-base64-20101006-git/cl-base64.asd" >  $RPM_BUILD_ROOT%{_libdir}/quicklisp/dists/quicklisp/installed/systems/cl-base64.txt
%files
%defattr(-,root,root,-)
%doc

%{_libdir}/quicklisp/dists/quicklisp/installed/releases/cl-base64.txt
%{_libdir}/quicklisp/dists/quicklisp/software/cl-base64-20101006-git

%{_libdir}/quicklisp/dists/quicklisp/installed/systems/cl-base64.txt



%changelog

Now to use quicklisp in a user system , one just needs to load %{_libdir}/quicklisp/setup.lisp and rest of the code stays the same.

Problem I can see

There are packages which are written in C and automatically gets build when called by quicklisp to load for the first time. asdf does the compilation for quicklisp. We may have to create some rpm macro or use some shell script to do the build while building the rpm.