From d1dfa88f1e320b1839fbac7e9f1c636b032483a6 Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Mon, 5 Feb 2018 11:47:54 +0100 Subject: gnu: Add duktape. --- gnu/packages/javascript.scm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/gnu/packages/javascript.scm b/gnu/packages/javascript.scm index e2742faa11..1973fadc56 100644 --- a/gnu/packages/javascript.scm +++ b/gnu/packages/javascript.scm @@ -438,3 +438,40 @@ to use, and is very similar to Lua. There is no need to interact with byzantine C++ template mechanisms, or worry about marking and unmarking garbage collection roots, or wrestle with obscure build systems.") (license license:isc))) + +(define-public duktape + (package + (name "duktape") + (version "1.3.1") + (source + (origin + (method url-fetch) + ;; Use the GitHub source for ease of updating. + (uri (string-append "https://github.com/svaarala/duktape/releases/download/v" + version "/duktape-" version ".tar.xz")) + (sha256 + (base32 + "0rd9wz5716qhzqwwj26i2x5m8dd020rvaf2i08sa4jxrl6nk3cil")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; Tests require many dependencies including v8. + #:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + ;; Installing is simply copying source code files so they can be + ;; embedded elsewhere. + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (src (string-append out "/src"))) + (install-file "src/duktape.c" src) + (install-file "src/duktape.h" src))))))) + (synopsis "Embeddable JavaScript engine") + (description + "Duktape is an embeddable Javascript engine, with a focus on portability +and compact footprint. Duktape is easy to integrate into a C/C++ project: add +@code{duktape.c}, @code{duktape.h}, and @code{duk_config.h} to your build, and +use the Duktape API to call Ecmascript functions from C code and vice versa.") + (home-page "http://duktape.org") + (license license:expat))) -- cgit v1.2.3