Merge branch 'master' 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 commencement)
25 #:use-module (gnu packages cross-base)
26 #:use-module (gnu packages gcc)
27 #:use-module (gnu packages graphviz)
28 #:use-module (gnu packages guile)
29 #:use-module (gnu packages man)
30 #:use-module (gnu packages package-management)
31 #:use-module (gnu packages perl)
32 #:use-module (gnu packages texinfo)
33 #:use-module (guix build-system gnu)
34 #:use-module (guix download)
35 #:use-module (guix git-download)
36 #:use-module (guix licenses)
37 #:use-module (guix packages))
38
39 (define-public nyacc
40 (package
41 (name "nyacc")
42 (version "0.86.0")
43 (source (origin
44 (method url-fetch)
45 (uri (string-append "mirror://savannah/nyacc/"
46 name "-" version ".tar.gz"))
47 (patches (search-patches "nyacc-binary-literals.patch"))
48 (sha256
49 (base32
50 "0lkd9lyspvhxlfs0496gsllwinh62jk9wij6gpadvx9gwz6yavd9"))))
51 (build-system gnu-build-system)
52 (native-inputs
53 `(("guile" ,guile-2.2)))
54 (synopsis "LALR(1) Parser Generator in Guile")
55 (description
56 "NYACC is an LALR(1) parser generator implemented in Guile.
57 The syntax and nomenclature should be considered not stable. It comes with
58 extensive examples, including parsers for the Javascript and C99 languages.")
59 (home-page "https://savannah.nongnu.org/projects/nyacc")
60 (license (list gpl3+ lgpl3+))))
61
62 (define-public mes
63 (let ((triplet "i686-unknown-linux-gnu"))
64 (package
65 (name "mes")
66 (version "0.17.1")
67 (source (origin
68 (method url-fetch)
69 (uri (string-append "mirror://gnu/mes/"
70 "mes-" version ".tar.gz"))
71 (patches (search-patches "mes-nyacc-0.86.0.patch"))
72 (sha256
73 (base32
74 "02g8zig53ffd0ai8kqhv2zj7bj2366a8hr6ydkwakmi2d1amyrna"))))
75 (build-system gnu-build-system)
76 (supported-systems '("i686-linux" "x86_64-linux"))
77 (propagated-inputs
78 `(("mescc-tools" ,mescc-tools)
79 ("nyacc" ,nyacc)))
80 (native-inputs
81 `(("guile" ,guile-2.2)
82 ,@(if (not (string-prefix? "i686-linux" (or (%current-target-system)
83 (%current-system))))
84 ;; Use cross-compiler rather than #:system "i686-linux" to get
85 ;; MesCC 64 bit .go files installed ready for use with Guile.
86 `(("i686-linux-binutils" ,(cross-binutils triplet))
87 ("i686-linux-gcc" ,(cross-gcc triplet)))
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] aims to create full source
98 bootstrapping for GuixSD. It consists of a mutual self-hosting [close to
99 Guile-] Scheme interpreter prototype in C and a Nyacc-based C compiler in
100 [Guile] Scheme.")
101 (home-page "https://gnu.org/software/mes")
102 (license gpl3+))))
103
104 (define-public mescc-tools
105 (package
106 (name "mescc-tools")
107 (version "0.5.2")
108 (source (origin
109 (method url-fetch)
110 (uri (string-append
111 "http://git.savannah.nongnu.org/cgit/mescc-tools.git/snapshot/"
112 name "-Release_" version
113 ".tar.gz"))
114 (file-name (string-append name "-" version ".tar.gz"))
115 (sha256
116 (base32
117 "01x7bhmgwyf6mc2g1hcvibhps98nllacqm4f0j5l51b1mbi18pc2"))))
118 (build-system gnu-build-system)
119 (supported-systems '("i686-linux" "x86_64-linux"))
120 (arguments
121 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
122 #:test-target "test"
123 #:phases (modify-phases %standard-phases
124 (delete 'configure))))
125 (synopsis "Tools for the full source bootstrapping process")
126 (description
127 "Mescc-tools is a collection of tools for use in a full source
128 bootstrapping process. It consists of the M1 macro assembler, the hex2
129 linker, the blood-elf symbol table generator, the kaem shell, exec_enable and
130 get_machine.")
131 (home-page "https://savannah.nongnu.org/projects/mescc-tools")
132 (license gpl3+)))