gnu: emacs-svg-icon: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / mes.scm
CommitLineData
1c7a78f1 1;;; GNU Guix --- Functional package management for GNU
1d684aed 2;;; Copyright © 2017, 2018, 2019, 2020, 2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
beb7e659 3;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
05ee5102 4;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
ebeb018c 5;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
1c7a78f1
JN
6;;;
7;;; This file is part of GNU Guix.
8;;;
9;;; GNU Guix is free software; you can redistribute it and/or modify it
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
14;;; GNU Guix is distributed in the hope that it will be useful, but
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22(define-module (gnu packages mes)
23 #:use-module (gnu packages)
24 #:use-module (gnu packages base)
4e23d650
JN
25 #:use-module (gnu packages bash)
26 #:use-module (gnu packages bootstrap)
27 #:use-module (gnu packages compression)
1c7a78f1
JN
28 #:use-module (gnu packages cross-base)
29 #:use-module (gnu packages gcc)
256d5c6e 30 #:use-module (gnu packages graphviz)
1c7a78f1 31 #:use-module (gnu packages guile)
00c86a88 32 #:use-module (gnu packages man)
1c7a78f1
JN
33 #:use-module (gnu packages package-management)
34 #:use-module (gnu packages perl)
b8016467 35 #:use-module (gnu packages pkg-config)
00c86a88 36 #:use-module (gnu packages texinfo)
1c7a78f1 37 #:use-module (guix build-system gnu)
4be01412 38 #:use-module (guix download)
1c7a78f1
JN
39 #:use-module (guix git-download)
40 #:use-module (guix licenses)
066cb9ba
JN
41 #:use-module (guix packages)
42 #:use-module (guix utils))
1c7a78f1 43
b8016467 44(define-public nyacc-0.86
bffd8fcd 45 ;; Nyacc used for bootstrap.
4be01412
JN
46 (package
47 (name "nyacc")
445ecce9 48 (version "0.86.0")
4be01412
JN
49 (source (origin
50 (method url-fetch)
51 (uri (string-append "mirror://savannah/nyacc/"
52 name "-" version ".tar.gz"))
445ecce9 53 (patches (search-patches "nyacc-binary-literals.patch"))
4be01412
JN
54 (sha256
55 (base32
445ecce9 56 "0lkd9lyspvhxlfs0496gsllwinh62jk9wij6gpadvx9gwz6yavd9"))))
4be01412
JN
57 (build-system gnu-build-system)
58 (native-inputs
59 `(("guile" ,guile-2.2)))
60 (synopsis "LALR(1) Parser Generator in Guile")
61 (description
62 "NYACC is an LALR(1) parser generator implemented in Guile.
63The syntax and nomenclature should be considered not stable. It comes with
64extensive examples, including parsers for the Javascript and C99 languages.")
65 (home-page "https://savannah.nongnu.org/projects/nyacc")
66 (license (list gpl3+ lgpl3+))))
67
4e896da4 68(define-public nyacc-0.99
b8016467
LC
69 (package
70 (inherit nyacc-0.86)
86c3a506 71 (version "0.99.0")
b8016467
LC
72 (source (origin
73 (method url-fetch)
74 (uri (string-append "mirror://savannah/nyacc/nyacc-"
75 version ".tar.gz"))
76 (sha256
77 (base32
86c3a506 78 "0hl5qxx19i4x1r0839sxm19ziqq65g4hy97yik81cc2yb9yvgyv3"))
b8016467
LC
79 (modules '((guix build utils)))
80 (snippet
81 '(begin
82 (substitute* (find-files "." "^Makefile\\.in$")
83 (("^SITE_SCM_DIR =.*")
84 "SITE_SCM_DIR = \
85@prefix@/share/guile/site/@GUILE_EFFECTIVE_VERSION@\n")
86 (("^SITE_SCM_GO_DIR =.*")
87 "SITE_SCM_GO_DIR = \
88@prefix@/lib/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache\n")
89 (("^INFODIR =.*")
90 "INFODIR = @prefix@/share/info\n")
91 (("^DOCDIR =.*")
92 "DOCDIR = @prefix@/share/doc/$(PACKAGE_TARNAME)\n"))
93 #t))))
94 (native-inputs
95 `(("pkg-config" ,pkg-config)))
96 (inputs
97 `(("guile" ,guile-2.2)))))
98
4e896da4
LC
99(define-public nyacc
100 (package
101 (inherit nyacc-0.99)
ebeb018c 102 (version "1.03.6")
4e896da4
LC
103 (source (origin
104 (method url-fetch)
105 (uri (string-append "mirror://savannah/nyacc/nyacc-"
106 version ".tar.gz"))
107 (sha256
108 (base32
ebeb018c 109 "1s7kli288l4pizjaarx8m6jg7g0mgfy8rpbs9lpzg8la7wr5rvp4"))
95b16cd8
RW
110 (modules '((guix build utils)))
111 (snippet
112 '(begin
113 (substitute* "configure"
114 (("GUILE_GLOBAL_SITE=\\$prefix.*")
115 "GUILE_GLOBAL_SITE=\
116$prefix/share/guile/site/$GUILE_EFFECTIVE_VERSION\n"))
117 #t))))
4e896da4
LC
118 (inputs
119 `(("guile" ,guile-3.0)))))
120
8b05461c
JN
121(define-public nyacc-1.00.2
122 (package
123 (inherit nyacc)
124 (version "1.00.2")
125 (source (origin
126 (method url-fetch)
127 (uri (string-append "mirror://savannah/nyacc/nyacc-"
128 version ".tar.gz"))
129 (modules '((guix build utils)))
130 (snippet
131 '(begin
132 (substitute* (find-files "." "^Makefile\\.in$")
133 (("^SITE_SCM_DIR =.*")
134 "SITE_SCM_DIR = \
135@prefix@/share/guile/site/@GUILE_EFFECTIVE_VERSION@\n")
136 (("^SITE_SCM_GO_DIR =.*")
137 "SITE_SCM_GO_DIR = \
138@prefix@/lib/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache\n")
139 (("^INFODIR =.*")
140 "INFODIR = @prefix@/share/info\n")
141 (("^DOCDIR =.*")
142 "DOCDIR = @prefix@/share/doc/$(PACKAGE_TARNAME)\n"))
143 #t))
144 (sha256
145 (base32
146 "065ksalfllbdrzl12dz9d9dcxrv97wqxblslngsc6kajvnvlyvpk"))))
147 (inputs
148 `(("guile" ,guile-2.2)))))
149
bffd8fcd
JN
150(define-public mes-0.19
151 ;; Mes used for bootstrap.
0a01bb55
DM
152 (package
153 (name "mes")
bffd8fcd 154 (version "0.19")
0a01bb55
DM
155 (source (origin
156 (method url-fetch)
157 (uri (string-append "mirror://gnu/mes/"
158 "mes-" version ".tar.gz"))
159 (sha256
160 (base32
bffd8fcd 161 "15h4yhaywdc0djpjlin2jz1kzahpqxfki0r0aav1qm9nxxmnp1l0"))))
0a01bb55
DM
162 (build-system gnu-build-system)
163 (supported-systems '("i686-linux" "x86_64-linux"))
164 (propagated-inputs
bffd8fcd
JN
165 `(("mescc-tools" ,mescc-tools-0.5.2)
166 ("nyacc" ,nyacc-0.86)))
0a01bb55
DM
167 (native-inputs
168 `(("guile" ,guile-2.2)
169 ,@(let ((target-system (or (%current-target-system)
170 (%current-system))))
171 (cond
172 ((string-prefix? "x86_64-linux" target-system)
173 ;; Use cross-compiler rather than #:system "i686-linux" to get
174 ;; MesCC 64 bit .go files installed ready for use with Guile.
175 `(("i686-linux-binutils" ,(cross-binutils "i686-unknown-linux-gnu"))
176 ("i686-linux-gcc" ,(cross-gcc "i686-unknown-linux-gnu"))))
177 (else
178 '())))
179 ("graphviz" ,graphviz)
180 ("help2man" ,help2man)
181 ("perl" ,perl) ; build-aux/gitlog-to-changelog
182 ("texinfo" ,texinfo)))
183 (arguments
184 `(#:strip-binaries? #f)) ; binutil's strip b0rkes MesCC/M1/hex2 binaries
185 (synopsis "Scheme interpreter and C compiler for full source bootstrapping")
186 (description
187 "GNU Mes--Maxwell Equations of Software--brings the Reduced Binary Seed
c9941771
JN
188bootstrap to Guix and aims to help create full source bootstrapping for
189GNU/Linux distributions. It consists of a mutual self-hosting Scheme
190interpreter in C and a Nyacc-based C compiler in Scheme and is compatible with
191Guile.")
8c0dcf3e 192 (home-page "https://www.gnu.org/software/mes/")
0a01bb55 193 (license gpl3+)))
9ae3fcb9 194
bffd8fcd
JN
195(define-public mes
196 (package
197 (inherit mes-0.19)
1d684aed 198 (version "0.23")
bffd8fcd
JN
199 (source (origin
200 (method url-fetch)
201 (uri (string-append "mirror://gnu/mes/"
202 "mes-" version ".tar.gz"))
203 (sha256
204 (base32
1d684aed 205 "0mnryfkl0dwbr5gxp16j5s95gw7z1vm1fqa1pxabp0aiar1hw53s"))))
73272954 206 (supported-systems '("armhf-linux" "i686-linux" "x86_64-linux"))
bffd8fcd
JN
207 (propagated-inputs
208 `(("mescc-tools" ,mescc-tools)
ba485217 209 ("nyacc" ,nyacc-1.00.2)))
4e23d650
JN
210 (native-search-paths
211 (list (search-path-specification
212 (variable "C_INCLUDE_PATH")
213 (files '("include")))
214 (search-path-specification
215 (variable "LIBRARY_PATH")
6e5fc6c7
JN
216 (files '("lib")))
217 (search-path-specification
218 (variable "MES_PREFIX")
219 (separator #f)
220 (files '("")))))))
4e23d650
JN
221
222(define-public mes-rb5
223 ;; This is the Reproducible-Builds summit 5's Mes, also built on Debian
224 ;; GNU/Linux and NixOS to produce the same, bit-for-bit identical result.
225 (package
226 (inherit mes)
227 (name "mes-rb5")
1d684aed
JN
228 (version "0.22")
229 (source (origin
230 (method url-fetch)
231 (uri (string-append "mirror://gnu/mes/"
232 "mes-" version ".tar.gz"))
233 (sha256
234 (base32
235 "0p1jsrrmcbc0zrvbvnjbb6iyxr0in71km293q8qj6gnar6bw09av"))))
236 (supported-systems '("i686-linux" "x86_64-linux"))
4e23d650
JN
237 (inputs '())
238 (propagated-inputs '())
239 (native-inputs
240 `(("bash" ,bash)
241 ("coreutils" ,coreutils)
242 ("grep" ,grep)
243 ("guile" ,guile-2.2)
6e5fc6c7 244 ("gzip" ,gzip)
4e23d650
JN
245 ("libc" ,glibc)
246 ("locales" ,glibc-utf8-locales)
247 ("make" ,gnu-make)
248 ("mes" ,mes)
249 ("mescc-tools" ,mescc-tools)
4e896da4 250 ("nyacc" ,nyacc-0.99)
4e23d650 251 ("sed" ,sed)
6e5fc6c7 252 ("tar" ,tar)))
4e23d650
JN
253 (supported-systems '("i686-linux"))
254 (arguments
255 `(#:implicit-inputs? #f
256 #:strip-binaries? #f ; binutil's strip b0rkes MesCC/M1/hex2 binaries
257 #:modules ((guix build gnu-build-system)
258 (guix build utils)
259 (ice-9 popen)
260 (ice-9 rdelim))
261 #:phases
262 (modify-phases %standard-phases
263 (add-before 'configure 'setenv
264 (lambda _
265 (setenv "AR" "mesar")
266 (setenv "CC" "mescc")
267 (setenv "GUILD" "true")
268 (setenv "SCHEME" "mes")
269 (setenv "LC_ALL" "en_US.UTF-8")
270 #t))
271 (replace 'configure
272 (lambda _
273 (let ((out (assoc-ref %outputs "out")))
274 (invoke "sh" "configure.sh"
275 (string-append "--prefix=" out)
276 "--host=i686-unkown-linux-gnu"
277 "--with-courage"))))
278 (replace 'build
279 (lambda _
280 (invoke "sh" "bootstrap.sh")))
281 (replace 'check
282 (lambda _
6e5fc6c7
JN
283 (copy-file "bin/mes-mescc" "bin/mes-mescc-0.21")
284 (system* "sed" "-i" "s/0\\.22/0\\.21/" "bin/mes-mescc-0.21")
4e23d650
JN
285 (let ((sha256sum
286 (read-delimited
287 " "
6e5fc6c7 288 (open-pipe* OPEN_READ "sha256sum" "bin/mes-mescc-0.21"))))
4e23d650
JN
289 (unless
290 (equal?
291 sha256sum
292 "9e0bcb1633c58e7bc415f6ea27cee7951d6b0658e13cdc147e992b31a14625fb")
293 (throw 'error "mes checksum failure"))
294 #t)))
295 (replace 'install
296 (lambda _
297 (invoke "sh" "install.sh"))))))))
bffd8fcd 298
066cb9ba
JN
299(define-public mescc-tools-0.5.2
300 ;; Mescc-tools used for bootstrap.
7cbf6f1c
JN
301 (let ((commit "bb062b0da7bf2724ca40f9002b121579898d4ef7")
302 (revision "0")
303 (version "0.5.2"))
304 (package
305 (name "mescc-tools")
81a4ca08 306 (version (git-version version revision commit))
7cbf6f1c 307 (source (origin
81a4ca08
LC
308 (method git-fetch)
309 (uri (git-reference
310 (url "https://git.savannah.nongnu.org/r/mescc-tools.git")
311 (commit commit)))
312 (file-name (git-file-name name version))
7cbf6f1c
JN
313 (sha256
314 (base32
81a4ca08 315 "1nc6rnax66vmhqsjg0kgx23pihdcxmww6v325ywf59vsq1jqjvff"))))
7cbf6f1c
JN
316 (build-system gnu-build-system)
317 (supported-systems '("i686-linux" "x86_64-linux"))
318 (arguments
319 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
320 #:test-target "test"
321 #:phases (modify-phases %standard-phases
322 (delete 'configure))))
323 (synopsis "Tools for the full source bootstrapping process")
324 (description
325 "Mescc-tools is a collection of tools for use in a full source
8a502c3b
JN
326bootstrapping process. It consists of the M1 macro assembler, the hex2
327linker, the blood-elf symbol table generator, the kaem shell, exec_enable and
328get_machine.")
329 (home-page "https://savannah.nongnu.org/projects/mescc-tools")
7cbf6f1c 330 (license gpl3+))))
9ff87bb9 331
066cb9ba 332(define-public mescc-tools
9ae3fcb9 333 (package
066cb9ba 334 (inherit mescc-tools-0.5.2)
9ae3fcb9 335 (name "mescc-tools")
87a8eaf6
JN
336 (version "0.7.0")
337 (source
338 (origin
339 (method url-fetch)
340 (uri (string-append
341 "http://git.savannah.nongnu.org/cgit/mescc-tools.git/snapshot/"
342 name "-Release_" version
343 ".tar.gz"))
344 (file-name (string-append name "-" version ".tar.gz"))
345 (sha256
346 (base32
347 "1p1ijia4rm3002f5sypidl9v5gq0mlch9b0n61rpxkdsaaxjqax3"))))
7982adb4
JN
348 (supported-systems '("armhf-linux" "aarch64-linux"
349 "i686-linux" "x86_64-linux"))
066cb9ba
JN
350 (arguments
351 (substitute-keyword-arguments (package-arguments mescc-tools-0.5.2)
352 ((#:make-flags _)
353 `(list (string-append "PREFIX=" (assoc-ref %outputs "out"))
87a8eaf6
JN
354 "CC=gcc"))
355 ((#:phases phases)
356 `(modify-phases ,phases
357 (add-after 'unpack 'patch-prefix
358 (lambda _
359 (substitute* "sha256.sh"
360 (("/usr/bin/sha256sum") (which "sha256sum")))
361 #t))))))))
99b340f5
JN
362
363(define-public m2-planet
364 (let ((commit "b87ddb0051b168ea45f8d49a610dcd069263336a")
365 (revision "2"))
366 (package
367 (name "m2-planet")
368 (version (string-append "1.4.0-" revision "." (string-take commit 7)))
369 (source (origin
370 (method git-fetch)
371 (uri (git-reference
b0e7b699 372 (url "https://github.com/oriansj/m2-planet")
99b340f5
JN
373 (commit commit)))
374 (file-name (git-file-name name version))
375 (sha256
376 (base32
377 "0yyc0fcbbxi9jqa1n76x0rwspdrwmc8g09jlmsw9c35nflrhmz8q"))))
378 (native-inputs
379 `(("mescc-tools" ,mescc-tools)))
380 (build-system gnu-build-system)
381 (arguments
382 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
383 #:tests? #f
384 #:phases (modify-phases %standard-phases
385 (delete 'bootstrap)
386 (delete 'configure))))
387 (synopsis "The PLAtform NEutral Transpiler")
388 (description
389 "M2-Planet, the PLAtform NEutral Transpiler, when combined with
390mescc-tools, compiles a subset of the C language into working binaries with
71a5a1d1 391introspective steps in between. It is self-hosting and for bootstrapping it
99b340f5
JN
392also has an implementation in the M1 macro assembly language. M2-Planet is
393built as Phase-5 of the full source bootstrapping process and is capable of
394building GNU Mes.")
395 (home-page "https://github.com/oriansj/m2-planet")
396 (license gpl3+))))