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, 2019 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 pkg-config)
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-0.86
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 nyacc
63 (package
64 (inherit nyacc-0.86)
65 (version "0.99.0")
66 (source (origin
67 (method url-fetch)
68 (uri (string-append "mirror://savannah/nyacc/nyacc-"
69 version ".tar.gz"))
70 (sha256
71 (base32
72 "0hl5qxx19i4x1r0839sxm19ziqq65g4hy97yik81cc2yb9yvgyv3"))
73 (modules '((guix build utils)))
74 (snippet
75 '(begin
76 (substitute* (find-files "." "^Makefile\\.in$")
77 (("^SITE_SCM_DIR =.*")
78 "SITE_SCM_DIR = \
79 @prefix@/share/guile/site/@GUILE_EFFECTIVE_VERSION@\n")
80 (("^SITE_SCM_GO_DIR =.*")
81 "SITE_SCM_GO_DIR = \
82 @prefix@/lib/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache\n")
83 (("^INFODIR =.*")
84 "INFODIR = @prefix@/share/info\n")
85 (("^DOCDIR =.*")
86 "DOCDIR = @prefix@/share/doc/$(PACKAGE_TARNAME)\n"))
87 #t))))
88 (native-inputs
89 `(("pkg-config" ,pkg-config)))
90 (inputs
91 `(("guile" ,guile-2.2)))))
92
93 (define-public mes
94 (package
95 (name "mes")
96 (version "0.20")
97 (source (origin
98 (method url-fetch)
99 (uri (string-append "mirror://gnu/mes/"
100 "mes-" version ".tar.gz"))
101 (sha256
102 (base32
103 "04pajp8v31na34ls4730ig5f6miiplhdvkmsb9ls1b8bbmw2vb4n"))))
104 (build-system gnu-build-system)
105 (supported-systems '("i686-linux" "x86_64-linux"))
106 (propagated-inputs
107 `(("mescc-tools" ,mescc-tools)
108 ("nyacc" ,nyacc)))
109 (native-inputs
110 `(("guile" ,guile-2.2)
111 ,@(let ((target-system (or (%current-target-system)
112 (%current-system))))
113 (cond
114 ((string-prefix? "x86_64-linux" target-system)
115 ;; Use cross-compiler rather than #:system "i686-linux" to get
116 ;; MesCC 64 bit .go files installed ready for use with Guile.
117 `(("i686-linux-binutils" ,(cross-binutils "i686-unknown-linux-gnu"))
118 ("i686-linux-gcc" ,(cross-gcc "i686-unknown-linux-gnu"))))
119 (else
120 '())))
121 ("graphviz" ,graphviz)
122 ("help2man" ,help2man)
123 ("perl" ,perl) ; build-aux/gitlog-to-changelog
124 ("texinfo" ,texinfo)))
125 (arguments
126 `(#:strip-binaries? #f)) ; binutil's strip b0rkes MesCC/M1/hex2 binaries
127 (synopsis "Scheme interpreter and C compiler for full source bootstrapping")
128 (description
129 "GNU Mes--Maxwell Equations of Software--brings the Reduced Binary Seed
130 bootstrap to Guix and aims to help create full source bootstrapping for
131 GNU/Linux distributions. It consists of a mutual self-hosting Scheme
132 interpreter in C and a Nyacc-based C compiler in Scheme and is compatible with
133 Guile.")
134 (home-page "https://gnu.org/software/mes")
135 (license gpl3+)))
136
137 (define-public mescc-tools
138 (let ((commit "bb062b0da7bf2724ca40f9002b121579898d4ef7")
139 (revision "0")
140 (version "0.5.2"))
141 (package
142 (name "mescc-tools")
143 (version (string-append version "-" revision "." (string-take commit 7)))
144 (source (origin
145 (method url-fetch)
146 (uri (string-append
147 "https://git.savannah.nongnu.org/cgit/mescc-tools.git/snapshot/"
148 name "-" commit
149 ".tar.gz"))
150 (sha256
151 (base32
152 "1h6j57wyf91i42b26f8msbv6451cw3nm4nmpl1fckp9c7vi8mwkh"))))
153 (build-system gnu-build-system)
154 (supported-systems '("i686-linux" "x86_64-linux"))
155 (arguments
156 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
157 #:test-target "test"
158 #:phases (modify-phases %standard-phases
159 (delete 'configure))))
160 (synopsis "Tools for the full source bootstrapping process")
161 (description
162 "Mescc-tools is a collection of tools for use in a full source
163 bootstrapping process. It consists of the M1 macro assembler, the hex2
164 linker, the blood-elf symbol table generator, the kaem shell, exec_enable and
165 get_machine.")
166 (home-page "https://savannah.nongnu.org/projects/mescc-tools")
167 (license gpl3+))))
168
169 (define-public mescc-tools-0.6.1
170 (package
171 (inherit mescc-tools)
172 (name "mescc-tools")
173 (version "0.6.1")
174 (source (origin
175 (method url-fetch)
176 (uri (string-append
177 "http://git.savannah.nongnu.org/cgit/mescc-tools.git/snapshot/"
178 name "-Release_" version
179 ".tar.gz"))
180 (file-name (string-append name "-" version ".tar.gz"))
181 (sha256
182 (base32
183 "06jpvq6xfjzn2al6b4rdwd3zv3h4cvilc4n9gqcnjr9cr6wjpw2n"))))))