gnu: emacs-helm: Update to 3.8.7.
[jackhill/guix/guix.git] / gnu / packages / dezyne.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages dezyne)
20 #:use-module (guix build-system gnu)
21 #:use-module (guix download)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix gexp)
24 #:use-module (guix packages)
25 #:use-module (gnu packages base)
26 #:use-module (gnu packages bash)
27 #:use-module (gnu packages guile)
28 #:use-module (gnu packages maths)
29 #:use-module (gnu packages pkg-config))
30
31 (define-public dezyne
32 (package
33 (name "dezyne")
34 (version "2.15.4")
35 (source
36 (origin
37 (method url-fetch)
38 (uri (string-append "https://dezyne.org/download/dezyne/"
39 name "-" version ".tar.gz"))
40 (sha256
41 (base32 "0d0jnnb3pgmspsz5qbgf33wsav5yp8wb45igns1sfinaz743n870"))))
42 (inputs (list bash-minimal
43 guile-3.0-latest
44 guile-json-4
45 guile-readline
46 mcrl2-minimal
47 sed))
48 (native-inputs (list guile-3.0-latest pkg-config))
49 (build-system gnu-build-system)
50 (arguments
51 (list
52 #:modules `((ice-9 popen)
53 ,@%gnu-build-system-modules)
54 #:phases
55 #~(modify-phases %standard-phases
56 (add-before 'configure 'setenv
57 (lambda _
58 (setenv "GUILE_AUTO_COMPILE" "0")))
59 (add-after 'install 'install-readmes
60 (lambda* (#:key outputs #:allow-other-keys)
61 (let* ((out (assoc-ref outputs "out"))
62 (base (string-append #$name "-" #$version))
63 (doc (string-append out "/share/doc/" base)))
64 (mkdir-p doc)
65 (copy-file "NEWS" (string-append doc "/NEWS")))))
66 (add-after 'install 'wrap-binaries
67 (lambda* (#:key inputs outputs #:allow-other-keys)
68 (let* ((out (assoc-ref outputs "out"))
69 (bash (assoc-ref %build-inputs "bash-minimal"))
70 (guile (assoc-ref %build-inputs "guile"))
71 (json (assoc-ref %build-inputs "guile-json"))
72 (mcrl2 (assoc-ref %build-inputs "mcrl2-minimal"))
73 (readline (assoc-ref %build-inputs "guile-readline"))
74 (sed (assoc-ref %build-inputs "sed"))
75 (effective (read
76 (open-pipe* OPEN_READ
77 "guile" "-c"
78 "(write (effective-version))")))
79 (path (list (string-append bash "/bin")
80 (string-append guile "/bin")
81 (string-append mcrl2 "/bin")
82 (string-append sed "/bin")))
83 (scm-dir (string-append "/share/guile/site/" effective))
84 (scm-path
85 (list (string-append out scm-dir)
86 (string-append json scm-dir)
87 (string-append readline scm-dir)))
88 (go-dir (string-append "/lib/guile/" effective
89 "/site-ccache/"))
90 (go-path (list (string-append out go-dir)
91 (string-append json go-dir)
92 (string-append readline go-dir))))
93 (wrap-program (string-append out "/bin/dzn")
94 `("PATH" ":" prefix ,path)
95 `("GUILE_AUTO_COMPILE" ":" = ("0"))
96 `("GUILE_LOAD_PATH" ":" prefix ,scm-path)
97 `("GUILE_LOAD_COMPILED_PATH" ":" prefix ,go-path))))))))
98 (synopsis "Programming language with verifyable formal semantics")
99 (description "Dezyne is a programming language and a set of tools to
100 specify, validate, verify, simulate, document, and implement concurrent
101 control software for embedded and cyber-physical systems. The Dezyne language
102 has formal semantics expressed in @url{https://mcrl2.org,mCRL2}.")
103 (home-page "https://dezyne.org")
104 (license (list license:agpl3+ ;Dezyne itself
105 license:lgpl3+ ;Dezyne runtime library
106 license:cc0)))) ;Code snippets, images, test data