2017-08-01 04:29:53 +02:00
|
|
|
{stdenv, clwrapper, pkgs, sbcl, coreutils, nix, asdf}:
|
2013-10-13 08:57:30 +02:00
|
|
|
let lispPackages = rec {
|
|
|
|
inherit pkgs clwrapper stdenv;
|
|
|
|
nixLib = pkgs.lib;
|
|
|
|
callPackage = nixLib.callPackageWith lispPackages;
|
|
|
|
|
|
|
|
buildLispPackage = callPackage ./define-package.nix;
|
|
|
|
|
2016-03-25 17:57:45 +01:00
|
|
|
quicklisp = buildLispPackage rec {
|
|
|
|
baseName = "quicklisp";
|
2017-08-01 04:33:21 +02:00
|
|
|
version = "2017-03-06";
|
2017-04-01 08:08:02 +02:00
|
|
|
|
2017-08-01 04:29:53 +02:00
|
|
|
buildSystems = [];
|
2017-04-01 08:08:02 +02:00
|
|
|
|
2016-03-25 17:57:45 +01:00
|
|
|
description = "The Common Lisp package manager";
|
|
|
|
deps = [];
|
|
|
|
src = pkgs.fetchgit {
|
|
|
|
url = "https://github.com/quicklisp/quicklisp-client/";
|
|
|
|
rev = "refs/tags/version-${version}";
|
2017-08-01 04:33:21 +02:00
|
|
|
sha256 = "11ywk7ggc1axivpbqvrd7m1lxsj4yp38d1h9w1d8i9qnn7zjpqj4";
|
2016-03-25 17:57:45 +01:00
|
|
|
};
|
|
|
|
overrides = x: rec {
|
|
|
|
inherit clwrapper;
|
|
|
|
quicklispdist = pkgs.fetchurl {
|
|
|
|
# Will usually be replaced with a fresh version anyway, but needs to be
|
|
|
|
# a valid distinfo.txt
|
2018-02-12 20:38:21 +01:00
|
|
|
url = "http://beta.quicklisp.org/dist/quicklisp/2018-01-31/distinfo.txt";
|
|
|
|
sha256 = "0z28yz205cl8pa8lbflw9072mywg69jx0gf091rhx2wjjf9h14qy";
|
2016-03-25 17:57:45 +01:00
|
|
|
};
|
|
|
|
buildPhase = '' true; '';
|
|
|
|
postInstall = ''
|
|
|
|
substituteAll ${./quicklisp.sh} "$out"/bin/quicklisp
|
|
|
|
chmod a+x "$out"/bin/quicklisp
|
|
|
|
cp "${quicklispdist}" "$out/lib/common-lisp/quicklisp/quicklisp-distinfo.txt"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2017-08-01 04:29:53 +02:00
|
|
|
|
|
|
|
quicklisp-to-nix-system-info = stdenv.mkDerivation rec {
|
|
|
|
name = "quicklisp-to-nix-system-info-${version}";
|
|
|
|
version = "1.0.0";
|
|
|
|
src = ./quicklisp-to-nix;
|
|
|
|
nativeBuildInputs = [sbcl];
|
|
|
|
buildInputs = [
|
|
|
|
lispPackages.quicklisp coreutils
|
|
|
|
];
|
|
|
|
touch = coreutils;
|
|
|
|
nix-prefetch-url = nix;
|
|
|
|
inherit quicklisp;
|
|
|
|
buildPhase = ''
|
|
|
|
${sbcl}/bin/sbcl --eval '(load #P"${asdf}/lib/common-lisp/asdf/build/asdf.lisp")' --load $src/system-info.lisp --eval '(ql-to-nix-system-info::dump-image)'
|
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp quicklisp-to-nix-system-info $out/bin
|
|
|
|
'';
|
|
|
|
dontStrip = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
quicklisp-to-nix = stdenv.mkDerivation rec {
|
|
|
|
name = "quicklisp-to-nix-${version}";
|
|
|
|
version = "1.0.0";
|
|
|
|
src = ./quicklisp-to-nix;
|
|
|
|
buildDependencies = [sbcl quicklisp-to-nix-system-info];
|
2017-09-04 18:58:56 +02:00
|
|
|
buildInputs = with pkgs.lispPackages; [md5 cl-emb alexandria external-program];
|
2017-08-01 04:29:53 +02:00
|
|
|
touch = coreutils;
|
|
|
|
nix-prefetch-url = nix;
|
|
|
|
inherit quicklisp;
|
|
|
|
deps = [];
|
|
|
|
system-info = quicklisp-to-nix-system-info;
|
|
|
|
buildPhase = ''
|
2017-12-19 17:55:22 +01:00
|
|
|
${clwrapper}/bin/cl-wrapper.sh "${sbcl}/bin/sbcl" --eval '(load #P"${asdf}/lib/common-lisp/asdf/build/asdf.lisp")' --load $src/ql-to-nix.lisp --eval '(ql-to-nix::dump-image)'
|
2017-08-01 04:29:53 +02:00
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp quicklisp-to-nix $out/bin
|
|
|
|
'';
|
|
|
|
dontStrip = true;
|
|
|
|
};
|
2013-10-13 08:57:30 +02:00
|
|
|
};
|
|
|
|
in lispPackages
|