summary refs log tree commit diff
path: root/pkgs/development/lisp-modules/quicklisp-to-nix/nix-package.emb
blob: a798a452365cda71757ae222baa9451aa46ad029 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
args @ { fetchurl, ... }:
rec {
  baseName = ''<% @var filename %>'';
  version = ''<% @var version %>'';<% @if testname %>

  testSystems = ["<% @var testname %>"];<% @endif %>

  description = ''<% @var description %>'';

  deps = [ <% @loop deps %>args."<% @var name %>" <% @endloop %>];

  src = fetchurl {
    url = ''<% @var url %>'';
    sha256 = ''<% @var sha256 %>'';
  };

  overrides = x: {
    postInstall = ''
      find "$out/lib/common-lisp/" -name '*.asd' | grep -iv '/<% @var name %>[.]asd${"$"}' |
        while read f; do
          CL_SOURCE_REGISTRY= \
          NIX_LISP_PRELAUNCH_HOOK="nix_lisp_run_single_form '(asdf:load-system :$(basename "$f" .asd))'" \
            "$out"/bin/*-lisp-launcher.sh ||
          mv "$f"{,.sibling}; done || true
    '';
  };
}
/* <%= cl-emb-intern::topenv %> */