diff options
Diffstat (limited to 'third_party/lisp/cl-json.nix')
-rw-r--r-- | third_party/lisp/cl-json.nix | 65 |
1 files changed, 46 insertions, 19 deletions
diff --git a/third_party/lisp/cl-json.nix b/third_party/lisp/cl-json.nix index 3652bd0793..6b82fac772 100644 --- a/third_party/lisp/cl-json.nix +++ b/third_party/lisp/cl-json.nix @@ -1,26 +1,53 @@ # JSON encoder & decoder -{ depot, ... }: +{ depot, pkgs, ... }: -with depot.nix; -let src = depot.third_party.fetchFromGitHub { - owner = "hankhero"; - repo = "cl-json"; - rev = "6dfebb9540bfc3cc33582d0c03c9ec27cb913e79"; - sha256 = "0fx3m3x3s5ji950yzpazz4s0img3l6b3d6l3jrfjv0lr702496lh"; -}; -in buildLisp.library { +let + inherit (depot.nix) buildLisp; + + # https://github.com/sharplispers/cl-json/pull/12/ + src = pkgs.fetchFromGitHub { + owner = "sternenseemann"; + repo = "cl-json"; + rev = "c059bec94e28a11102a994d6949e2e52764f21fd"; + sha256 = "0l07syw1b1x2zi8kj4iph3rf6vi6c16b7fk69iv7x27wrdsr1qwj"; + }; + + getSrcs = subdir: map (f: src + ("/" + subdir + "/" + f)); +in +buildLisp.library { name = "cl-json"; deps = [ (buildLisp.bundled "asdf") ]; srcs = [ "${src}/cl-json.asd" ] ++ - (map (f: src + ("/src/" + f)) [ - "package.lisp" - "common.lisp" - "objects.lisp" - "camel-case.lisp" - "decoder.lisp" - "encoder.lisp" - "utils.lisp" - "json-rpc.lisp" - ]); + (getSrcs "src" [ + "package.lisp" + "common.lisp" + "objects.lisp" + "camel-case.lisp" + "decoder.lisp" + "encoder.lisp" + "utils.lisp" + "json-rpc.lisp" + ]); + + 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)"; + }; } |