From e227587b4e50313fdbda4acf7992b7a4ded23260 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 2 Feb 2023 14:04:48 -0500 Subject: [PATCH 1/4] gnu: Add wasm3. * gnu/packages/web.scm (wasm3): New variable. --- gnu/packages/web.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index a29f53108c..c527ff80df 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -61,6 +61,7 @@ ;;; Copyright © 2022 jgart ;;; Copyright © 2023 Paul A. Patience ;;; Copyright © 2022 Bruno Victal +;;; Copyright © 2023 David Thompson ;;; ;;; This file is part of GNU Guix. ;;; @@ -1557,6 +1558,53 @@ (define-public wabt other systems that want to manipulate WebAssembly files.") (license license:asl2.0))) +(define-public wasm3 + (package + (name "wasm3") + (version "0.5.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/wasm3/wasm3") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "07zzmk776j8ydyxhrnnjiscbhhmz182a62r6aix6kfk5kq2cwia2")))) + (build-system cmake-build-system) + (arguments + ;; The default WASI option "uvwasi" causes CMake to initiate a 'git + ;; clone' which cannot happen within the build container. + '(#:configure-flags '("-DBUILD_WASI=simple") + ;; No check target. There are tests but they require a network + ;; connection to download the WebAssembly core test suite. + #:tests? #f + ;; There is no install target. Instead, we have to manually copy the + ;; wasm3 build artifacts to the output directory. + #:phases + (modify-phases %standard-phases + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bindir (string-append out "/bin")) + (includedir (string-append out "/include")) + (libdir (string-append out "/lib"))) + (mkdir-p bindir) + (mkdir-p includedir) + (mkdir-p libdir) + (copy-file "wasm3" (string-append bindir "/wasm3")) + (for-each (lambda (header) + (copy-file header + (string-append includedir "/" + (basename header)))) + (find-files "../source/source" "\\.h$")) + (copy-file "source/libm3.a" + (string-append libdir "/libm3.a")))))))) + (home-page "https://github.com/wasm3/wasm3") + (synopsis "WebAssembly interpreter") + (description "WASM3 is a fast WebAssembly interpreter.") + (license license:expat))) + (define-public websocketpp (package (name "websocketpp") -- 2.39.1