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";
|
2022-08-30 15:23:09 +02:00
|
|
|
rev = "c059bec94e28a11102a994d6949e2e52764f21fd";
|
|
|
|
sha256 = "0l07syw1b1x2zi8kj4iph3rf6vi6c16b7fk69iv7x27wrdsr1qwj";
|
2022-06-18 15:29:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
}
|