From patchwork Sat Dec 4 17:52:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Artyom V. Poptsov" X-Patchwork-Id: 34957 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 80A7827BBEB; Sat, 4 Dec 2021 17:53:21 +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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 D179427BBEA for ; Sat, 4 Dec 2021 17:53:20 +0000 (GMT) Received: from localhost ([::1]:44810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtZDs-0004OC-1Y for patchwork@mira.cbaines.net; Sat, 04 Dec 2021 12:53:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtZDa-0004Nz-O3 for guix-patches@gnu.org; Sat, 04 Dec 2021 12:53:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43346) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtZDZ-0006ZC-UP for guix-patches@gnu.org; Sat, 04 Dec 2021 12:53:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mtZDZ-0004VJ-TN for guix-patches@gnu.org; Sat, 04 Dec 2021 12:53:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52280] [PATCH] gnu: Add guile-smc Resent-From: poptsov.artyom@gmail.com (Artyom V. Poptsov) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 17:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52280 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52280@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163864034817272 (code B ref -1); Sat, 04 Dec 2021 17:53:01 +0000 Received: (at submit) by debbugs.gnu.org; 4 Dec 2021 17:52:28 +0000 Received: from localhost ([127.0.0.1]:54892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtZD2-0004UV-A7 for submit@debbugs.gnu.org; Sat, 04 Dec 2021 12:52:28 -0500 Received: from lists.gnu.org ([209.51.188.17]:46434) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtZCx-0004UK-Gi for submit@debbugs.gnu.org; Sat, 04 Dec 2021 12:52:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56194) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtZCw-0004Kt-To for guix-patches@gnu.org; Sat, 04 Dec 2021 12:52:22 -0500 Received: from [2a00:1450:4864:20::236] (port=39513 helo=mail-lj1-x236.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtZCu-0006V1-VB for guix-patches@gnu.org; Sat, 04 Dec 2021 12:52:22 -0500 Received: by mail-lj1-x236.google.com with SMTP id m12so12571166ljj.6 for ; Sat, 04 Dec 2021 09:52:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:user-agent:mime-version; bh=X1Wy6G+ifv0mfodKmMVumYFbxB9oxY++m6g1YObR3nI=; b=VvyStzBBWl+WiPJ7FMyvdzfxEOqJ9j+94saER6m5eq7C/rLhQpyl67Ag91fxDS71pi 8g9bpwvUc/ftNCTq3WbxWAG8JcZNxrIB3wxtDIqYt83sNNB6h7hziPeRjpjo5DbouAq7 f/vSgR0DrYPw8Qfasqx4dCkpRqkG5/cZvBfsaPZsbjV7ErEH9UMHdwQx96le9Jv4KU8h 2c8GW6I7e9dF+MaNQEqvUA0ULCu4SSIIO+7xErCksmY+3vG5Xz2qaV05rEUOAZfiS3ok Usz9WO5sbftmnjK1gkk8KeU2EMq76knB61yhRoCfmttgUPhOOxLLUczIVM1FWdjtVtls pQxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version; bh=X1Wy6G+ifv0mfodKmMVumYFbxB9oxY++m6g1YObR3nI=; b=OCJ9krh64qhG5xC4cKi0csCnlgabHoQ0BJ9oEZ+UAnY+tAHSYylY28qAh1iJjVPAA5 /+RSXpR2IRWfSopDMtg8TVU/VZbHdK/2jL72fa/u76q9h16iHCfvFv3QxIxNXprBYUmK Ehkzl4YtqrggdOEzycAwBqSVNgD1hk6X6TcNNoh5F5vzRGgeWS9vPtvGYeFGLcyQGHuB VAXm4ysk6uGBwEA3pBLPaW4QEXw1nxNnoFoBHSaQnm1EEi44LjBuM0tSEFuo97jasx5h mN8tBnA6jBIBwgITOY9B8okwfGR64a/YyVUQSCpRSHb/op4uC9eJJMCykt3HBFK+LdJv dt7w== X-Gm-Message-State: AOAM5300TPFROGv6oKU71PsqXRPVB0Tp94nU5mT86C+PQp+HLQefN/uS we8qImfpzPfXMi75wnF7/+nnjSSFS4M= X-Google-Smtp-Source: ABdhPJxlFddYNupfv1jh49CBpgCSAnqz9tbFTqo7ICVHOGTF0xOR17/fwPQteZiJxwEz1KWlhwCmag== X-Received: by 2002:a2e:7819:: with SMTP id t25mr25934601ljc.374.1638640338826; Sat, 04 Dec 2021 09:52:18 -0800 (PST) Received: from elephant ([5.164.193.196]) by smtp.gmail.com with ESMTPSA id bi34sm829290lfb.12.2021.12.04.09.52.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Dec 2021 09:52:18 -0800 (PST) From: poptsov.artyom@gmail.com (Artyom V. Poptsov) Date: Sat, 04 Dec 2021 20:52:12 +0300 Message-ID: <87lf106ywj.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::236 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::236; envelope-from=poptsov.artyom@gmail.com; helo=mail-lj1-x236.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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" X-getmail-retrieved-from-mailbox: Patches Hello Guixers, this patch adds Guile-SMC[1] -- the GNU Guile State Machine Compiler. Thanks, - Artyom References: 1: https://github.com/artyom-poptsov/guile-smc From b3ad6d1c8973647a4dd2efedaa6d70957429f5e2 Mon Sep 17 00:00:00 2001 From: "Artyom V. Poptsov" Date: Sat, 4 Dec 2021 20:40:46 +0300 Subject: [PATCH] gnu: Add guile-smc * gnu/packages/guile-xyz.scm (guile-smc): New variable. --- gnu/packages/guile-xyz.scm | 88 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm index cbc3ffa595..1b1acc637c 100644 --- a/gnu/packages/guile-xyz.scm +++ b/gnu/packages/guile-xyz.scm @@ -58,6 +58,7 @@ (define-module (gnu packages guile-xyz) #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu packages) + #:use-module (gnu packages admin) #:use-module (gnu packages algebra) #:use-module (gnu packages aspell) #:use-module (gnu packages autotools) @@ -4856,3 +4857,90 @@ high-level API for network management that uses rtnetlink.") as well as the @samp{gitlab-cli} command line tool for interacting with a GitLab instance.") (license license:gpl3))) + +(define-public guile-smc + (package + (name "guile-smc") + (version "0.3.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/artyom-poptsov/guile-smc") + (commit (string-append "v" version)))) + (file-name (string-append name "-" version)) + (sha256 + (base32 + "0szkjmasi70m1vppck7nhdxg4lnxzjq6mihi6r1552s8sxm5z008")))) + (build-system gnu-build-system) + (arguments + `(#:make-flags '("GUILE_AUTO_COMPILE=0") ;to prevent guild warnings + #:modules (((guix build guile-build-system) + #:select (target-guile-effective-version)) + ,@%gnu-build-system-modules) + #:imported-modules ((guix build guile-build-system) + ,@%gnu-build-system-modules) + #:phases + (modify-phases %standard-phases + (delete 'strip) + (add-after 'configure 'patch + (lambda* (#:key inputs outputs #:allow-other-keys) + (substitute* "modules/smc/core/log.scm" + ((" #:use-module \\(logging logger\\)") + (string-append + " #:use-module (logging logger)\n" + " #:use-module (logging rotating-log)")) + (("#:init-value \"logger\"") + (format #f + "#:init-value \"~a/bin/logger\"" + (assoc-ref inputs "inetutils"))) + (("\\(add-handler! %logger %syslog\\)") + (string-append + "(add-handler! %logger\n" + " (make \n" + " #:file-name \"smc.log\"))\n"))) + #t)) + (add-after 'install 'wrap-program + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (guile-lib (assoc-ref inputs "guile-lib")) + (version (target-guile-effective-version)) + (scm (string-append "/share/guile/site/" + version)) + (go (string-append "/lib/guile/" + version "/site-ccache"))) + (wrap-program (string-append bin "/smc") + `("GUILE_LOAD_PATH" prefix + (,(string-append out scm) + ,(string-append guile-lib scm))) + `("GUILE_LOAD_COMPILED_PATH" prefix + (,(string-append out go) + ,(string-append guile-lib go))))) + #t))))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("pkg-config" ,pkg-config) + ("texinfo" ,texinfo))) + (inputs + `(("bash" ,bash-minimal) + ("guile" ,guile-3.0) + ("guile-lib" ,guile-lib) + ("inetutils" ,inetutils))) + (home-page "https://github.com/artyom-poptsov/guile-smc") + (synopsis "GNU Guile state machine compiler.") + (description + "Guile-SMC is a state machine compiler that allows to describe finite +state machines (FSMs) in Scheme in terms of transition tables. It is capable +to generate such transition tables from a @url{https://plantuml.com/, +PlantUML} state diagrams. + +A transition table can be verified and checked for dead-ends and infinite +loops. Also Guile-SMC FSMs gather statistics when they run. + +Guile-SMC comes with a Scheme program called @command{smc} -- a state machine +compiler itself. It produces a Scheme code for an FSM from the PlantUML +format. This tool is meant to be called on a PlantUML file when a program +with a FSM is being built (for example, from a Makefile.)") + (license license:gpl3))) -- 2.25.1