nixpkgs/pkgs/development/lisp-modules/lisp-packages.nix

104 lines
3.5 KiB
Nix

{stdenv, clwrapper, pkgs, sbcl, coreutils, nix, asdf}:
let lispPackages = rec {
inherit pkgs clwrapper stdenv;
nixLib = pkgs.lib;
callPackage = nixLib.callPackageWith lispPackages;
buildLispPackage = callPackage ./define-package.nix;
quicklisp = buildLispPackage rec {
baseName = "quicklisp";
version = "2019-02-16";
buildSystems = [];
description = "The Common Lisp package manager";
deps = [];
src = pkgs.fetchgit {
url = "https://github.com/quicklisp/quicklisp-client/";
rev = "refs/tags/version-${version}";
sha256 = "0x9b4vf36n2hh102gqgjxg5f5ymxcr9j5khn4rskjdprfgd8d1y9";
};
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
url = "https://beta.quicklisp.org/dist/quicklisp/2020-10-16/distinfo.txt";
sha256 = "sha256:090xjcnyqcv8az9n1a7m0f6vzz2nwcncy95ha7ixb7fnd2rj1n65";
};
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"
'';
};
};
quicklisp-to-nix-system-info = stdenv.mkDerivation {
pname = "quicklisp-to-nix-system-info";
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 {
pname = "quicklisp-to-nix";
version = "1.0.0";
src = ./quicklisp-to-nix;
buildDependencies = [sbcl quicklisp-to-nix-system-info];
buildInputs = with pkgs.lispPackages; [md5 cl-emb alexandria external-program];
touch = coreutils;
nix-prefetch-url = nix;
inherit quicklisp;
deps = [];
system-info = quicklisp-to-nix-system-info;
buildPhase = ''
${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)'
'';
installPhase = ''
mkdir -p $out/bin
cp quicklisp-to-nix $out/bin
'';
dontStrip = true;
};
clx-truetype = buildLispPackage rec {
baseName = "clx-truetype";
version = ''20160825-git'';
buildSystems = [ "clx-truetype" ];
parasites = [ "clx-truetype-test" ];
description = ''clx-truetype is pure common lisp solution for antialiased TrueType font rendering using CLX and XRender extension.'';
deps = with pkgs.lispPackages; [
alexandria bordeaux-threads cl-aa cl-fad cl-paths cl-paths-ttf cl-store
cl-vectors clx trivial-features zpb-ttf
];
src = pkgs.fetchurl {
url = ''http://beta.quicklisp.org/archive/clx-truetype/2016-08-25/clx-truetype-20160825-git.tgz'';
sha256 = ''0ndy067rg9w6636gxwlpnw7f3ck9nrnjb03444pprik9r3c9in67'';
};
packageName = "clx-truetype";
asdFilesToKeep = ["clx-truetype.asd"];
};
};
in lispPackages