[PATCH] gnu: Add guile-smc

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Artyom V. Poptsov
Owner
unassigned
Submitted by
Artyom V. Poptsov
Severity
normal

Debbugs page

Artyom V. Poptsov wrote 3 years ago
(address . guix-patches@gnu.org)
87lf106ywj.fsf@gmail.com
Hello Guixers,

this patch adds Guile-SMC[1] -- the GNU Guile State Machine Compiler.

Thanks,

- Artyom

References:
From b3ad6d1c8973647a4dd2efedaa6d70957429f5e2 Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
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(+)

Toggle diff (105 lines)
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 <rotating-log>\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
--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmGrqswACgkQ6cWi2QiY
oC/2AQgAjWm9dG1oTRX5Y1YnRZ1Tx+d3mzVSqeFdBGVdh0vnXSm4KBpqCr92fdKn
P8n8f4zEpVVhaAtBBpejrX+x+BfmWeQ5kpcWpDcZSxXk5ZF83wbjyzfQH/u+CqIG
A4co3UwHI9b8yHGSyH4d1KqBV9Pb5PLw80EGs1QuqjfOz9Q38zKLYCmTUYJ68ZYa
tCDpu3dCDpVDyqKdhjESHTgf6obXN/j1BGhkxbsFZbkPccfw2nYRLrC9tHd2O1dZ
6Y+jxmBgDXTkvWbTs4P4kJ13apkvuD2XDQuWLt0Rqo7hSFEqV6wS2uLxQ5FQl/5u
7NHa/eHdcdUgwpuIk2hVeNtU/8CSHQ==
=BT0l
-----END PGP SIGNATURE-----

Ludovic Courtès wrote 3 years ago
(name . Artyom V. Poptsov)(address . poptsov.artyom@gmail.com)(address . 52280-done@debbugs.gnu.org)
87pmqcujro.fsf@gnu.org
Hello,

poptsov.artyom@gmail.com (Artyom V. Poptsov) skribis:

Toggle quote (7 lines)
> From b3ad6d1c8973647a4dd2efedaa6d70957429f5e2 Mon Sep 17 00:00:00 2001
> From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
> Date: Sat, 4 Dec 2021 20:40:46 +0300
> Subject: [PATCH] gnu: Add guile-smc
>
> * gnu/packages/guile-xyz.scm (guile-smc): New variable.

Applied with the changes below to placate ‘guix lint’.

Thanks!

Ludo’.
Toggle diff (20 lines)
diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 1b1acc637c..508b4b44d5 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -4929,11 +4929,11 @@ (define-public guile-smc
("guile-lib" ,guile-lib)
("inetutils" ,inetutils)))
(home-page "https://github.com/artyom-poptsov/guile-smc")
- (synopsis "GNU Guile state machine compiler.")
+ (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/,
+ "Guile-SMC is a state machine compiler that allows users 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
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 52280@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 52280
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help