2017-08-01 03:29:53 +01:00
|
|
|
{stdenv, clwrapper, pkgs, sbcl, coreutils, nix, asdf}:
|
2013-10-13 07:57:30 +01:00
|
|
|
let lispPackages = rec {
|
|
|
|
inherit pkgs clwrapper stdenv;
|
|
|
|
nixLib = pkgs.lib;
|
|
|
|
callPackage = nixLib.callPackageWith lispPackages;
|
|
|
|
|
|
|
|
buildLispPackage = callPackage ./define-package.nix;
|
|
|
|
|
2016-03-25 16:57:45 +00:00
|
|
|
quicklisp = buildLispPackage rec {
|
|
|
|
baseName = "quicklisp";
|
2020-03-15 21:32:17 +00:00
|
|
|
version = "2019-02-16";
|
2017-04-01 07:08:02 +01:00
|
|
|
|
2017-08-01 03:29:53 +01:00
|
|
|
buildSystems = [];
|
2017-04-01 07:08:02 +01:00
|
|
|
|
2016-03-25 16:57:45 +00:00
|
|
|
description = "The Common Lisp package manager";
|
|
|
|
deps = [];
|
|
|
|
src = pkgs.fetchgit {
|
|
|
|
url = "https://github.com/quicklisp/quicklisp-client/";
|
|
|
|
rev = "refs/tags/version-${version}";
|
2020-03-15 21:32:17 +00:00
|
|
|
sha256 = "0x9b4vf36n2hh102gqgjxg5f5ymxcr9j5khn4rskjdprfgd8d1y9";
|
2016-03-25 16:57:45 +00: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
|
2020-03-15 21:34:16 +00:00
|
|
|
url = "https://beta.quicklisp.org/dist/quicklisp/2019-12-27/distinfo.txt";
|
|
|
|
sha256 = "0fz0k7ydmddxvxyid0nkifap21n6bxap602qhqsac2dxglv3i4cs";
|
2016-03-25 16:57:45 +00: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 03:29:53 +01:00
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
quicklisp-to-nix-system-info = stdenv.mkDerivation {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "quicklisp-to-nix-system-info";
|
2017-08-01 03:29:53 +01:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
quicklisp-to-nix = stdenv.mkDerivation {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "quicklisp-to-nix";
|
2017-08-01 03:29:53 +01:00
|
|
|
version = "1.0.0";
|
|
|
|
src = ./quicklisp-to-nix;
|
|
|
|
buildDependencies = [sbcl quicklisp-to-nix-system-info];
|
2017-09-04 17:58:56 +01:00
|
|
|
buildInputs = with pkgs.lispPackages; [md5 cl-emb alexandria external-program];
|
2017-08-01 03:29:53 +01:00
|
|
|
touch = coreutils;
|
|
|
|
nix-prefetch-url = nix;
|
|
|
|
inherit quicklisp;
|
|
|
|
deps = [];
|
|
|
|
system-info = quicklisp-to-nix-system-info;
|
|
|
|
buildPhase = ''
|
2017-12-19 16:55:22 +00: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 03:29:53 +01:00
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp quicklisp-to-nix $out/bin
|
|
|
|
'';
|
|
|
|
dontStrip = true;
|
|
|
|
};
|
2013-10-13 07:57:30 +01:00
|
|
|
};
|
|
|
|
in lispPackages
|