* [bug#52280] [PATCH] gnu: Add guile-smc
@ 2021-12-04 17:52 Artyom V. Poptsov
2021-12-04 21:45 ` bug#52280: " Ludovic Courtès
0 siblings, 1 reply; 2+ messages in thread
From: Artyom V. Poptsov @ 2021-12-04 17:52 UTC (permalink / raw)
To: 52280
[-- Attachment #1.1: Type: text/plain, Size: 166 bytes --]
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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-Add-guile-smc.patch --]
[-- Type: text/x-diff, Size: 5071 bytes --]
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(+)
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
[-- Attachment #1.3: Type: text/plain, Size: 207 bytes --]
--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
Home page: https://memory-heap.org/~avp/
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* bug#52280: [PATCH] gnu: Add guile-smc
2021-12-04 17:52 [bug#52280] [PATCH] gnu: Add guile-smc Artyom V. Poptsov
@ 2021-12-04 21:45 ` Ludovic Courtès
0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2021-12-04 21:45 UTC (permalink / raw)
To: Artyom V. Poptsov; +Cc: 52280-done
[-- Attachment #1: Type: text/plain, Size: 425 bytes --]
Hello,
poptsov.artyom@gmail.com (Artyom V. Poptsov) skribis:
> 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’.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1034 bytes --]
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-04 21:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-04 17:52 [bug#52280] [PATCH] gnu: Add guile-smc Artyom V. Poptsov
2021-12-04 21:45 ` bug#52280: " Ludovic Courtès
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.