Merge branch 'staging' into core-updates
[jackhill/guix/guix.git] / gnu / packages / mes.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017,2018 Jan Nieuwenhuizen <janneke@gnu.org>
3 ;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages mes)
22 #:use-module (gnu packages)
23 #:use-module (gnu packages base)
24 #:use-module (gnu packages cross-base)
25 #:use-module (gnu packages gcc)
26 #:use-module (gnu packages graphviz)
27 #:use-module (gnu packages guile)
28 #:use-module (gnu packages man)
29 #:use-module (gnu packages package-management)
30 #:use-module (gnu packages perl)
31 #:use-module (gnu packages texinfo)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix download)
34 #:use-module (guix git-download)
35 #:use-module (guix licenses)
36 #:use-module (guix packages))
37
38 (define-public nyacc
39 (package
40 (name "nyacc")
41 (version "0.86.0")
42 (source (origin
43 (method url-fetch)
44 (uri (string-append "mirror://savannah/nyacc/"
45 name "-" version ".tar.gz"))
46 (patches (search-patches "nyacc-binary-literals.patch"))
47 (sha256
48 (base32
49 "0lkd9lyspvhxlfs0496gsllwinh62jk9wij6gpadvx9gwz6yavd9"))))
50 (build-system gnu-build-system)
51 (native-inputs
52 `(("guile" ,guile-2.2)))
53 (synopsis "LALR(1) Parser Generator in Guile")
54 (description
55 "NYACC is an LALR(1) parser generator implemented in Guile.
56 The syntax and nomenclature should be considered not stable. It comes with
57 extensive examples, including parsers for the Javascript and C99 languages.")
58 (home-page "https://savannah.nongnu.org/projects/nyacc")
59 (license (list gpl3+ lgpl3+))))
60
61 (define-public mes
62 (package
63 (name "mes")
64 (version "0.19")
65 (source (origin
66 (method url-fetch)
67 (uri (string-append "mirror://gnu/mes/"
68 "mes-" version ".tar.gz"))
69 (sha256
70 (base32
71 "15h4yhaywdc0djpjlin2jz1kzahpqxfki0r0aav1qm9nxxmnp1l0"))))
72 (build-system gnu-build-system)
73 (supported-systems '("i686-linux" "x86_64-linux"))
74 (propagated-inputs
75 `(("mescc-tools" ,mescc-tools)
76 ("nyacc" ,nyacc)))
77 (native-inputs
78 `(("guile" ,guile-2.2)
79 ,@(let ((target-system (or (%current-target-system)
80 (%current-system))))
81 (cond
82 ((string-prefix? "x86_64-linux" target-system)
83 ;; Use cross-compiler rather than #:system "i686-linux" to get
84 ;; MesCC 64 bit .go files installed ready for use with Guile.
85 `(("i686-linux-binutils" ,(cross-binutils "i686-unknown-linux-gnu"))
86 ("i686-linux-gcc" ,(cross-gcc "i686-unknown-linux-gnu"))))
87 (else
88 '())))
89 ("graphviz" ,graphviz)
90 ("help2man" ,help2man)
91 ("perl" ,perl) ; build-aux/gitlog-to-changelog
92 ("texinfo" ,texinfo)))
93 (arguments
94 `(#:strip-binaries? #f)) ; binutil's strip b0rkes MesCC/M1/hex2 binaries
95 (synopsis "Scheme interpreter and C compiler for full source bootstrapping")
96 (description
97 "GNU Mes--Maxwell Equations of Software--brings the Reduced Binary Seed
98 bootstrap to Guix and aims to help create full source bootstrapping for
99 GNU/Linux distributions. It consists of a mutual self-hosting Scheme
100 interpreter in C and a Nyacc-based C compiler in Scheme and is compatible with
101 Guile.")
102 (home-page "https://gnu.org/software/mes")
103 (license gpl3+)))
104
105 (define-public mescc-tools
106 (let ((commit "bb062b0da7bf2724ca40f9002b121579898d4ef7")
107 (revision "0")
108 (version "0.5.2"))
109 (package
110 (name "mescc-tools")
111 (version (string-append version "-" revision "." (string-take commit 7)))
112 (source (origin
113 (method url-fetch)
114 (uri (string-append
115 "https://git.savannah.nongnu.org/cgit/mescc-tools.git/snapshot/"
116 name "-" commit
117 ".tar.gz"))
118 (sha256
119 (base32
120 "1h6j57wyf91i42b26f8msbv6451cw3nm4nmpl1fckp9c7vi8mwkh"))))
121 (build-system gnu-build-system)
122 (supported-systems '("i686-linux" "x86_64-linux"))
123 (arguments
124 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
125 #:test-target "test"
126 #:phases (modify-phases %standard-phases
127 (delete 'configure))))
128 (synopsis "Tools for the full source bootstrapping process")
129 (description
130 "Mescc-tools is a collection of tools for use in a full source
131 bootstrapping process. It consists of the M1 macro assembler, the hex2
132 linker, the blood-elf symbol table generator, the kaem shell, exec_enable and
133 get_machine.")
134 (home-page "https://savannah.nongnu.org/projects/mescc-tools")
135 (license gpl3+))))