2014-11-29 06:14:53 +00:00
|
|
|
{ stdenv, fetchsvn, gcc, glibc, m4, coreutils }:
|
2014-11-27 22:48:07 +00:00
|
|
|
|
2015-09-27 21:40:05 +01:00
|
|
|
let
|
|
|
|
options = rec {
|
2015-10-01 10:20:24 +01:00
|
|
|
/* TODO: there are also MacOS, FreeBSD and Windows versions */
|
2015-09-27 21:40:05 +01:00
|
|
|
x86_64-linux = {
|
|
|
|
arch = "linuxx86";
|
2016-08-23 17:28:23 +01:00
|
|
|
sha256 = "0g6mkl207ri3ib9w85i9w0sv7srz784pbxidz0d95p6qkvg6shba";
|
2015-09-27 21:40:05 +01:00
|
|
|
runtime = "lx86cl64";
|
|
|
|
kernel = "linuxx8664";
|
|
|
|
};
|
|
|
|
i686-linux = {
|
|
|
|
arch = "linuxx86";
|
|
|
|
sha256 = x86_64-linux.sha256;
|
|
|
|
runtime = "lx86cl";
|
|
|
|
kernel = "linuxx8632";
|
|
|
|
};
|
|
|
|
armv7l-linux = {
|
|
|
|
arch = "linuxarm";
|
2016-01-13 22:50:22 +00:00
|
|
|
sha256 = "0k6wxwyg3pmbb5xdkwma0i3rvbjmy3p604g4minjjc1drzsn1i0q";
|
2015-09-27 21:40:05 +01:00
|
|
|
runtime = "armcl";
|
|
|
|
kernel = "linuxarm";
|
|
|
|
};
|
|
|
|
armv6l-linux = armv7l-linux;
|
|
|
|
};
|
|
|
|
cfg = options.${stdenv.system};
|
|
|
|
in
|
2015-10-01 10:20:24 +01:00
|
|
|
|
|
|
|
assert builtins.hasAttr stdenv.system options;
|
|
|
|
|
2014-11-27 22:48:07 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "ccl-${version}";
|
2016-01-13 22:50:22 +00:00
|
|
|
version = "1.11";
|
2014-11-27 22:48:07 +00:00
|
|
|
revision = "16313";
|
|
|
|
|
|
|
|
src = fetchsvn {
|
2015-09-27 21:40:05 +01:00
|
|
|
url = "http://svn.clozure.com/publicsvn/openmcl/release/${version}/${cfg.arch}/ccl";
|
2014-11-27 22:48:07 +00:00
|
|
|
rev = revision;
|
2015-09-27 21:40:05 +01:00
|
|
|
sha256 = cfg.sha256;
|
2010-02-24 09:04:29 +00:00
|
|
|
};
|
|
|
|
|
2014-11-27 22:48:07 +00:00
|
|
|
buildInputs = [ gcc glibc m4 ];
|
|
|
|
|
2015-09-27 21:40:05 +01:00
|
|
|
CCL_RUNTIME = cfg.runtime;
|
|
|
|
CCL_KERNEL = cfg.kernel;
|
2014-11-27 22:48:07 +00:00
|
|
|
|
2014-11-29 06:14:53 +00:00
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace lisp-kernel/${CCL_KERNEL}/Makefile \
|
|
|
|
--replace "svnversion" "echo ${revision}" \
|
|
|
|
--replace "/bin/rm" "${coreutils}/bin/rm" \
|
|
|
|
--replace "/bin/echo" "${coreutils}/bin/echo"
|
|
|
|
|
|
|
|
substituteInPlace lisp-kernel/m4macros.m4 \
|
|
|
|
--replace "/bin/pwd" "${coreutils}/bin/pwd"
|
|
|
|
'';
|
2010-02-24 09:04:29 +00:00
|
|
|
|
2014-11-29 06:14:53 +00:00
|
|
|
buildPhase = ''
|
2014-11-27 22:48:07 +00:00
|
|
|
make -C lisp-kernel/${CCL_KERNEL} clean
|
|
|
|
make -C lisp-kernel/${CCL_KERNEL} all
|
|
|
|
|
|
|
|
./${CCL_RUNTIME} -n -b -e '(ccl:rebuild-ccl :full t)' -e '(ccl:quit)'
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p "$out/share"
|
2014-11-27 22:48:07 +00:00
|
|
|
cp -r . "$out/share/ccl-installation"
|
2010-02-24 09:04:29 +00:00
|
|
|
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p "$out/bin"
|
2014-11-27 22:48:07 +00:00
|
|
|
echo -e '#!/bin/sh\n'"$out/share/ccl-installation/${CCL_RUNTIME}"' "$@"\n' > "$out"/bin/"${CCL_RUNTIME}"
|
|
|
|
chmod a+x "$out"/bin/"${CCL_RUNTIME}"
|
|
|
|
'';
|
|
|
|
|
2015-10-01 10:20:24 +01:00
|
|
|
meta = with stdenv.lib; {
|
2010-02-24 09:04:29 +00:00
|
|
|
description = "Clozure Common Lisp";
|
2014-11-27 22:48:07 +00:00
|
|
|
homepage = http://ccl.clozure.com/;
|
2015-11-24 22:26:26 +00:00
|
|
|
maintainers = with maintainers; [ raskin muflax tohl ];
|
2015-10-01 10:20:24 +01:00
|
|
|
platforms = attrNames options;
|
|
|
|
license = licenses.lgpl21;
|
2010-02-24 09:04:29 +00:00
|
|
|
};
|
|
|
|
}
|