{ "name": "json-glib", "version": "1.8.0", "summary": "JSON-GLib: JSON parsing and generation for GLib and GObject, with json-glib-validate and json-glib-format", "category": "library", "license": "LGPL-2.1-or-later", "homepage": "https://gitlab.gnome.org/GNOME/json-glib", "source": { "url": "https://download.gnome.org/sources/json-glib/1.8/json-glib-1.8.0.tar.xz", "sha256": "97ef5eb92ca811039ad50a65f06633f1aae64792789307be7170795d8b319454" }, "watch": {"kind": "index", "url": "https://download.gnome.org/sources/json-glib/cache.json", "regex": "\"(1\\.[0-9]*[02468]\\.[0-9]+)\": \\{", "pin": "1.8", "checksum": "https://download.gnome.org/sources/json-glib/{major}.{minor}/json-glib-{version}.sha256sum"}, "deps": [ "glib" ], "env_packages": [], "static": true, "nss": true, "check": "printf '{\"name\":\"bvs\",\"apps\":[1,2,3],\"ok\":true}' > \"${TMPDIR:-/tmp}/bvs-jg.json\" && bin/json-glib-validate \"${TMPDIR:-/tmp}/bvs-jg.json\" && bin/json-glib-format --prettify \"${TMPDIR:-/tmp}/bvs-jg.json\" | has -c '\"apps\"' && printf '{\"broken\": [1, 2' > \"${TMPDIR:-/tmp}/bvs-jg-bad.json\" && ! bin/json-glib-validate \"${TMPDIR:-/tmp}/bvs-jg-bad.json\" 2>/dev/null && rm -f \"${TMPDIR:-/tmp}\"/bvs-jg*.json && check_lib json-glib-1.0 json-glib/json-glib.h 'JsonParser *p = json_parser_new(); GError *e = NULL; if (!json_parser_load_from_data(p, \"{\\\"nas\\\": {\\\"apps\\\": [\\\"tmux\\\", \\\"htop\\\"]}}\", -1, &e)) return 1; JsonReader *r = json_reader_new(json_parser_get_root(p)); json_reader_read_member(r, \"nas\"); json_reader_read_member(r, \"apps\"); json_reader_read_element(r, 1); const char *s = json_reader_get_string_value(r); JsonBuilder *b = json_builder_new(); json_builder_begin_object(b); json_builder_set_member_name(b, \"second\"); json_builder_add_string_value(b, s); json_builder_end_object(b); JsonGenerator *g = json_generator_new(); json_generator_set_root(g, json_builder_get_root(b)); gchar *out = json_generator_to_data(g, NULL); printf(\"json-glib %s: read %s, wrote %s\\n\", JSON_VERSION_S, s, out); return strcmp(out, \"{\\\"second\\\":\\\"htop\\\"}\") != 0;' | grep 'wrote {\"second\":\"htop\"}'" }