feat(nix/buildLisp): Add 'bundled' function for built-in libraries

Makes it possible to add virtual dependencies on built-in libraries,
e.g. `buildLisp.bundled "sb-posix"`.
This commit is contained in:
Vincent Ambo 2020-01-26 23:58:31 +00:00
parent 479510005b
commit ca60eafa80

View file

@ -161,6 +161,13 @@ let
lispBinary = true;
};
# 'bundled' creates a "library" that calls 'require' on a built-in
# package, such as any of SBCL's sb-* packages.
bundled = name: (makeOverridable library) {
inherit name;
srcs = lib.singleton (builtins.toFile "${name}.lisp" "(require '${name})");
};
# 'sbclWith' creates an image with the specified libraries /
# programs loaded.
sbclWith = deps:
@ -173,4 +180,5 @@ in {
library = makeOverridable library;
program = makeOverridable program;
sbclWith = makeOverridable sbclWith;
bundled = makeOverridable bundled;
}