2020-01-22 01:50:05 +01:00
|
|
|
# JSON encoder & decoder
|
2021-04-10 02:13:18 +02:00
|
|
|
{ depot, pkgs, ... }:
|
2020-01-22 01:50:05 +01:00
|
|
|
|
2021-04-10 02:13:18 +02:00
|
|
|
let
|
|
|
|
inherit (depot.nix) buildLisp;
|
|
|
|
|
2022-06-18 15:29:36 +02:00
|
|
|
# https://github.com/sharplispers/cl-json/pull/12/
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "sternenseemann";
|
|
|
|
repo = "cl-json";
|
|
|
|
rev = "479685029c511cb2011f2f2a99ca6c63aa2e4865";
|
|
|
|
sha256 = "1663xlzb0wj6kd0wy2cmhafrwip7vy0wlfckc519aj9j18aak5ja";
|
|
|
|
};
|
|
|
|
|
|
|
|
getSrcs = subdir: map (f: src + ("/" + subdir + "/" + f));
|
2022-01-30 17:06:58 +01:00
|
|
|
in
|
|
|
|
buildLisp.library {
|
2020-01-22 01:50:05 +01:00
|
|
|
name = "cl-json";
|
2020-01-27 00:59:07 +01:00
|
|
|
deps = [ (buildLisp.bundled "asdf") ];
|
2020-01-22 01:50:05 +01:00
|
|
|
|
|
|
|
srcs = [ "${src}/cl-json.asd" ] ++
|
2022-06-18 15:29:36 +02:00
|
|
|
(getSrcs "src" [
|
2022-01-30 17:06:58 +01:00
|
|
|
"package.lisp"
|
|
|
|
"common.lisp"
|
|
|
|
"objects.lisp"
|
|
|
|
"camel-case.lisp"
|
|
|
|
"decoder.lisp"
|
|
|
|
"encoder.lisp"
|
|
|
|
"utils.lisp"
|
|
|
|
"json-rpc.lisp"
|
|
|
|
]);
|
2022-06-18 15:29:36 +02:00
|
|
|
|
|
|
|
tests = {
|
|
|
|
deps = [
|
|
|
|
depot.third_party.lisp.cl-unicode
|
|
|
|
depot.third_party.lisp.fiveam
|
|
|
|
];
|
|
|
|
srcs = [
|
|
|
|
# CLOS tests are broken upstream as well
|
|
|
|
# https://github.com/sharplispers/cl-json/issues/11
|
|
|
|
(pkgs.writeText "no-clos-tests.lisp" ''
|
|
|
|
(replace *features* (delete :cl-json-clos *features*))
|
|
|
|
'')
|
|
|
|
] ++ getSrcs "t" [
|
|
|
|
"package.lisp"
|
|
|
|
"testencoder.lisp"
|
|
|
|
"testdecoder.lisp"
|
|
|
|
"testmisc.lisp"
|
|
|
|
];
|
|
|
|
|
|
|
|
expression = "(fiveam:run! 'json-test::json)";
|
|
|
|
};
|
2020-01-22 01:50:05 +01:00
|
|
|
}
|