tvl-depot/third_party/lisp/mime4cl/default.nix
sterni 8f6955176f feat(3p/lisp/mime4cl): build using buildLisp
The following changes are required to make mime4cl build:

* file-position doesn't like to be called with NIL as the position
  argument, so we have to make sure to not do that in
  stream-file-position. My workaround is a bit clunky, but works.

* Tests discover the sample file via relative path resolution. This
  doesn't work when they are imported into the nix store as individual
  files. Instead we make use of the fact that DEFVAR is a no-op if the
  variable is already defined and inject a file via the nix build that
  sets the relevant ones. For the path to sample1.msg, we need to create
  a new variable.

Change-Id: I74eeda7bf2c2a4f64cc2b90e72081513ec3285d5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3270
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
2021-09-01 22:57:17 +00:00

48 lines
972 B
Nix

# Copyright (C) 2021 by the TVL Authors
# SPDX-License-Identifier: LGPL-2.1-or-later
{ depot, pkgs, ... }:
depot.nix.buildLisp.library {
name = "mime4cl";
deps = [
depot.third_party.lisp.sclf
depot.third_party.lisp.npg
];
srcs = [
./package.lisp
./endec.lisp
./streams.lisp
./mime.lisp
./address.lisp
];
tests = {
name = "mime4cl-tests";
srcs = [
./test/rt.lisp
./test/package.lisp
(pkgs.writeText "nix-samples.lisp" ''
(in-package :mime4cl-tests)
;; missing from the tarball completely
(defvar *samples-directory* (pathname "/this/does/not/exist"))
;; override auto discovery which doesn't work in store
(defvar *sample1-file* (pathname "${./test/sample1.msg}"))
'')
./test/endec.lisp
./test/address.lisp
./test/mime.lisp
];
expression = "(rtest:do-tests)";
};
# limited by sclf
brokenOn = [
"ccl"
"ecl"
];
}