about summary refs log tree commit diff
path: root/third_party/lisp/qbase64/default.nix
blob: 40a93e04f0629c5b013bcac9517c813dd0197e27 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{ depot, pkgs, ... }:

let
  src = pkgs.applyPatches {
    src = pkgs.fetchFromGitHub {
      owner = "chaitanyagupta";
      repo = "qbase64";
      rev = "4ac193ed6b35a867ca453ed74acc128c9a077407";
      sha256 = "06daqqfdd51wkx0pyxgz7zq4ibzsqsgn3qs04jabx67gyybgnmjm";
    };

    patches = [
      # qbase64 expects macOS base64
      ./coreutils-base64.patch
    ];
  };

  getSrcs = builtins.map (p: "${src}/${p}");

in

depot.nix.buildLisp.library {
  name = "qbase64";

  srcs = getSrcs [
    "package.lisp"
    "utils.lisp"
    "stream-utils.lisp"
    "qbase64.lisp"
  ];

  deps = [
    depot.third_party.lisp.trivial-gray-streams
    depot.third_party.lisp.metabang-bind
  ];

  tests = {
    name = "qbase64-tests";

    srcs = getSrcs [
      "qbase64-test.lisp"
    ];

    deps = [
      {
        sbcl = depot.nix.buildLisp.bundled "uiop";
        default = depot.nix.buildLisp.bundled "asdf";
      }
      depot.third_party.lisp.fiveam
      depot.third_party.lisp.cl-fad
    ];

    expression = ''
      (fiveam:run! '(qbase64-test::encoder 'qbase64-test::decoder))
    '';
  };
}