1{stdenv, fetchurl}:
2
3let
4 inherit (stdenv.hostPlatform) system;
5 version = "21b";
6 downloadUrl = arch:
7 "http://common-lisp.net/project/cmucl/downloads/release/" +
8 "${version}/cmucl-${version}-${arch}.tar.bz2";
9 fetchDist = {arch, sha256}: fetchurl {
10 url = downloadUrl arch;
11 inherit sha256;
12 };
13 dist =
14 if system == "i686-linux" then fetchDist {
15 arch = "x86-linux";
16 sha256 = "13k3b5ygnbsq6n2i3r5i4ljw3r1qlskn2p5f4x9hrx6vfvbb3k7a";
17 }
18 else throw "Unsupported platform for cmucl.";
19in
20
21stdenv.mkDerivation {
22 pname = "cmucl-binary";
23 inherit version;
24
25 buildCommand = ''
26 mkdir -p $out
27 tar -C $out -xjf ${dist}
28 patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
29 $out/bin/lisp
30 '';
31
32 meta = {
33 description = "The CMU implementation of Common Lisp";
34 longDescription = ''
35 CMUCL is a free implementation of the Common Lisp programming language
36 which runs on most major Unix platforms. It mainly conforms to the
37 ANSI Common Lisp standard.
38 '';
39 license = stdenv.lib.licenses.free; # public domain
40 homepage = http://www.cons.org/cmucl/;
41 maintainers = [stdenv.lib.maintainers.tohl];
42 platforms = stdenv.lib.platforms.linux;
43 };
44}