From patchwork Thu Feb 2 23:31:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Thompson, David" X-Patchwork-Id: 46623 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3A40227BBE9; Thu, 2 Feb 2023 23:33:25 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6A52A27BBEB for ; Thu, 2 Feb 2023 23:33:22 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNj4k-0001uF-65; Thu, 02 Feb 2023 18:33:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNj4h-0001tf-VX for guix-patches@gnu.org; Thu, 02 Feb 2023 18:33:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNj4g-0001GC-UQ for guix-patches@gnu.org; Thu, 02 Feb 2023 18:33:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pNj4g-0001LH-9a for guix-patches@gnu.org; Thu, 02 Feb 2023 18:33:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61243] Add WASM-4 fantasy console and prerequisites Resent-From: "Thompson, David" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 02 Feb 2023 23:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61243 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 61243@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16753807305088 (code B ref -1); Thu, 02 Feb 2023 23:33:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 Feb 2023 23:32:10 +0000 Received: from localhost ([127.0.0.1]:36136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNj3o-0001Jz-PK for submit@debbugs.gnu.org; Thu, 02 Feb 2023 18:32:09 -0500 Received: from lists.gnu.org ([209.51.188.17]:57890) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNj3m-0001Jq-6Q for submit@debbugs.gnu.org; Thu, 02 Feb 2023 18:32:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNj3j-00010H-Hz for guix-patches@gnu.org; Thu, 02 Feb 2023 18:32:04 -0500 Received: from mail-qv1-xf30.google.com ([2607:f8b0:4864:20::f30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNj3f-00019i-Rz for guix-patches@gnu.org; Thu, 02 Feb 2023 18:32:03 -0500 Received: by mail-qv1-xf30.google.com with SMTP id w15so1962256qvs.11 for ; Thu, 02 Feb 2023 15:31:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=worcester-edu.20210112.gappssmtp.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=wzFy04b+1ohAYCy4b7qXunw18tOpSVeHbaBJVqndumo=; b=WkauTERd7rMfCH9IoSqG0FkB38g5afOG3PRv5p5i4KtDMWGeDAcaoBGZkbqL2yLx1i Onm9D9Bh6PW26PwKxxsl1F+QPEQ47+KD7oEbcxLtRvyYcajl6pWjI2AROY0GpjAr93+b UB12ljPzlSY1kYiXxr8soPsx8bUKnRuvPCCeCvFFVHHd755y5DdnZGyV4woDIISstu62 2L5yUr+YpGWkrQCLKRgZAIGT1za0RPeSsf/w5Nb1NNe6c1DRlXmXhFfFWo8c3GWN3Cxd wO9OmIJqLzBtZhfksAZ+F6te8vqxw2TlSw3UulESRsvTTqLIilUzX8QxrQ6Uw11uy8vO nXSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=wzFy04b+1ohAYCy4b7qXunw18tOpSVeHbaBJVqndumo=; b=eGDgQoGgKrXFcKOqPewYhtPvgkBvYU2FDa78oLCZsB6M2TUU12dsI5Fkkvv8Jk7Tzw GKG96HULqdjVvMR9pIIBX2OdlvHa33fYG6DaNFCYRHoy82bjej7y6MI97CeX95cK+39t HwITNIO/f7038J8hUUUQ7C9QSkdDnDmw1xyr0YLHWYaPEl/zzNLXBb0Gy5oQHuNHHGuL pEd2YRu85ln/oU2tQgxxs2P0qXhVLCBy9UX9LT4mTytETCEJgPeQWL170bZ95DxP3MEN tG2OMAnJHaotGpPVf9Z7nZN9Y5av4n8wpLyahTQBN3jeJUzoHWPgLD1jlm9bCv86+8V8 x26g== X-Gm-Message-State: AO0yUKXhpiaPfFHb1Q5P5xTGpOAvCNuz2XuyAH80YOGsyDq0RhH38SlM to1vxbnlYoYTsCVJ82uxGbrO0cPeV9cUnWl8uEh7xW0yon8p0+CM X-Google-Smtp-Source: AK7set+/xsegJKrcF9RVg1cdr6nYfCFyhVQ4gj+YcAtekXOAnFs/7oxINlEpfCZVzBVFyzV6kr7fm7y8hFbzWD/EwFo= X-Received: by 2002:a0c:d611:0:b0:53f:a622:2215 with SMTP id c17-20020a0cd611000000b0053fa6222215mr480039qvj.32.1675380704905; Thu, 02 Feb 2023 15:31:44 -0800 (PST) MIME-Version: 1.0 From: "Thompson, David" Date: Thu, 2 Feb 2023 18:31:33 -0500 Message-ID: Received-SPF: pass client-ip=2607:f8b0:4864:20::f30; envelope-from=dthompson2@worcester.edu; helo=mail-qv1-xf30.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Hello all, This set of 4 patches adds WASM-4 (https://wasm4.org/), a fantasy console that runs game "cartridges" compiled to WebAssembly. It's a fun way to learn about WebAssembly using a relatively simple system. I've seen a WASM-4 game that was assembled using Racket, which I thought was pretty neat. It would be even cooler if someone did something like that with Guile! Packaging this thing was not exactly straightforward due to dependency bundling via git submodules, but I was able to unbundle everything. - Dave 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