From 57ac9ca3a4dcfe1293ee307b214189505c1665d2 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 25 Nov 2022 08:02:51 -0500 Subject: [PATCH] +json-c --- projects/github.com/json-c/json-c/fixture.c | 9 +++++++ projects/github.com/json-c/json-c/package.yml | 26 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 projects/github.com/json-c/json-c/fixture.c create mode 100644 projects/github.com/json-c/json-c/package.yml diff --git a/projects/github.com/json-c/json-c/fixture.c b/projects/github.com/json-c/json-c/fixture.c new file mode 100644 index 00000000..e4defe2b --- /dev/null +++ b/projects/github.com/json-c/json-c/fixture.c @@ -0,0 +1,9 @@ +#include +#include +int main() { + json_object *obj = json_object_new_object(); + json_object *value = json_object_new_string("value"); + json_object_object_add(obj, "key", value); + printf("%s\n", json_object_to_json_string(obj)); + return 0; +} diff --git a/projects/github.com/json-c/json-c/package.yml b/projects/github.com/json-c/json-c/package.yml new file mode 100644 index 00000000..087d4331 --- /dev/null +++ b/projects/github.com/json-c/json-c/package.yml @@ -0,0 +1,26 @@ +distributable: + url: https://s3.amazonaws.com/json-c_releases/releases/json-c-{{ version.raw }}.tar.gz + strip-components: 1 + +versions: + github: json-c/json-c/tags + strip: + - /^json-c-/ + - /-\d{8}/ # calver + +build: + dependencies: + cmake.org: 3 + tea.xyz/gx/cc: c99 + tea.xyz/gx/make: '*' + working-directory: build + script: | + cmake .. -DCMAKE_INSTALL_PREFIX="{{prefix}}" -DCMAKE_BUILD_TYPE=Release + make --jobs {{ hw.concurrency }} install + +test: + dependencies: + tea.xyz/gx/cc: c99 + script: | + cc fixture.c -ljson-c + ./a.out