From d5a7f8c39423941f7d886383c9c954c33d5b6267 Mon Sep 17 00:00:00 2001 From: Andrii Riabchenko Date: Mon, 2 Oct 2023 22:26:23 +0300 Subject: [PATCH] new file: projects/duktape.org/package.yml new file: projects/duktape.org/test.c new file: projects/duktape.org/test.js --- projects/duktape.org/package.yml | 20 ++++++++++++++++++++ projects/duktape.org/test.c | 10 ++++++++++ projects/duktape.org/test.js | 1 + 3 files changed, 31 insertions(+) create mode 100644 projects/duktape.org/package.yml create mode 100644 projects/duktape.org/test.c create mode 100644 projects/duktape.org/test.js diff --git a/projects/duktape.org/package.yml b/projects/duktape.org/package.yml new file mode 100644 index 00000000..db0984cb --- /dev/null +++ b/projects/duktape.org/package.yml @@ -0,0 +1,20 @@ +distributable: + url: https://github.com/svaarala/duktape/releases/download/v{{version}}/duktape-{{version}}.tar.xz + strip-components: 1 +versions: + github: svaarala/duktape +build: + script: + - make -f Makefile.sharedlibrary install + - make -f Makefile.cmdline + - mkdir -p {{prefix}}/bin + - install duk {{prefix}}/bin/ + env: + INSTALL_PREFIX: "{{prefix}}" +provides: + - bin/duk +test: + script: + - duk test.js | grep "Hello World!" + - cc test.c -o test -lduktape -lm + - ./test diff --git a/projects/duktape.org/test.c b/projects/duktape.org/test.c new file mode 100644 index 00000000..f8baa339 --- /dev/null +++ b/projects/duktape.org/test.c @@ -0,0 +1,10 @@ +#include +#include "duktape.h" + +int main(int argc, char *argv[]) { + duk_context *ctx = duk_create_heap_default(); + duk_eval_string(ctx, "1 + 2"); + printf("1 + 2 = %d\\n", (int) duk_get_int(ctx, -1)); + duk_destroy_heap(ctx); + return 0; +} \ No newline at end of file diff --git a/projects/duktape.org/test.js b/projects/duktape.org/test.js new file mode 100644 index 00000000..178f0edd --- /dev/null +++ b/projects/duktape.org/test.js @@ -0,0 +1 @@ +console.log('Hello World!'); \ No newline at end of file