Commit | Line | Data |
---|---|---|
1c7a78f1 | 1 | ;;; GNU Guix --- Functional package management for GNU |
6e5fc6c7 | 2 | ;;; Copyright © 2017, 2018, 2019, 2020 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> |
1c7a78f1 JN |
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) | |
4e23d650 JN |
24 | #:use-module (gnu packages bash) |
25 | #:use-module (gnu packages bootstrap) | |
26 | #:use-module (gnu packages compression) | |
1c7a78f1 JN |
27 | #:use-module (gnu packages cross-base) |
28 | #:use-module (gnu packages gcc) | |
256d5c6e | 29 | #:use-module (gnu packages graphviz) |
1c7a78f1 | 30 | #:use-module (gnu packages guile) |
00c86a88 | 31 | #:use-module (gnu packages man) |
1c7a78f1 JN |
32 | #:use-module (gnu packages package-management) |
33 | #:use-module (gnu packages perl) | |
b8016467 | 34 | #:use-module (gnu packages pkg-config) |
00c86a88 | 35 | #:use-module (gnu packages texinfo) |
1c7a78f1 | 36 | #:use-module (guix build-system gnu) |
4be01412 | 37 | #:use-module (guix download) |
1c7a78f1 JN |
38 | #:use-module (guix git-download) |
39 | #:use-module (guix licenses) | |
066cb9ba JN |
40 | #:use-module (guix packages) |
41 | #:use-module (guix utils)) | |
1c7a78f1 | 42 | |
b8016467 | 43 | (define-public nyacc-0.86 |
bffd8fcd | 44 | ;; Nyacc used for bootstrap. |
4be01412 JN |
45 | (package |
46 | (name "nyacc") | |
445ecce9 | 47 | (version "0.86.0") |
4be01412 JN |
48 | (source (origin |
49 | (method url-fetch) | |
50 | (uri (string-append "mirror://savannah/nyacc/" | |
51 | name "-" version ".tar.gz")) | |
445ecce9 | 52 | (patches (search-patches "nyacc-binary-literals.patch")) |
4be01412 JN |
53 | (sha256 |
54 | (base32 | |
445ecce9 | 55 | "0lkd9lyspvhxlfs0496gsllwinh62jk9wij6gpadvx9gwz6yavd9")))) |
4be01412 JN |
56 | (build-system gnu-build-system) |
57 | (native-inputs | |
58 | `(("guile" ,guile-2.2))) | |
59 | (synopsis "LALR(1) Parser Generator in Guile") | |
60 | (description | |
61 | "NYACC is an LALR(1) parser generator implemented in Guile. | |
62 | The syntax and nomenclature should be considered not stable. It comes with | |
63 | extensive examples, including parsers for the Javascript and C99 languages.") | |
64 | (home-page "https://savannah.nongnu.org/projects/nyacc") | |
65 | (license (list gpl3+ lgpl3+)))) | |
66 | ||
b8016467 LC |
67 | (define-public nyacc |
68 | (package | |
69 | (inherit nyacc-0.86) | |
86c3a506 | 70 | (version "0.99.0") |
b8016467 LC |
71 | (source (origin |
72 | (method url-fetch) | |
73 | (uri (string-append "mirror://savannah/nyacc/nyacc-" | |
74 | version ".tar.gz")) | |
75 | (sha256 | |
76 | (base32 | |
86c3a506 | 77 | "0hl5qxx19i4x1r0839sxm19ziqq65g4hy97yik81cc2yb9yvgyv3")) |
b8016467 LC |
78 | (modules '((guix build utils))) |
79 | (snippet | |
80 | '(begin | |
81 | (substitute* (find-files "." "^Makefile\\.in$") | |
82 | (("^SITE_SCM_DIR =.*") | |
83 | "SITE_SCM_DIR = \ | |
84 | @prefix@/share/guile/site/@GUILE_EFFECTIVE_VERSION@\n") | |
85 | (("^SITE_SCM_GO_DIR =.*") | |
86 | "SITE_SCM_GO_DIR = \ | |
87 | @prefix@/lib/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache\n") | |
88 | (("^INFODIR =.*") | |
89 | "INFODIR = @prefix@/share/info\n") | |
90 | (("^DOCDIR =.*") | |
91 | "DOCDIR = @prefix@/share/doc/$(PACKAGE_TARNAME)\n")) | |
92 | #t)))) | |
93 | (native-inputs | |
94 | `(("pkg-config" ,pkg-config))) | |
95 | (inputs | |
96 | `(("guile" ,guile-2.2))))) | |
97 | ||
bffd8fcd JN |
98 | (define-public mes-0.19 |
99 | ;; Mes used for bootstrap. | |
0a01bb55 DM |
100 | (package |
101 | (name "mes") | |
bffd8fcd | 102 | (version "0.19") |
0a01bb55 DM |
103 | (source (origin |
104 | (method url-fetch) | |
105 | (uri (string-append "mirror://gnu/mes/" | |
106 | "mes-" version ".tar.gz")) | |
107 | (sha256 | |
108 | (base32 | |
bffd8fcd | 109 | "15h4yhaywdc0djpjlin2jz1kzahpqxfki0r0aav1qm9nxxmnp1l0")))) |
0a01bb55 DM |
110 | (build-system gnu-build-system) |
111 | (supported-systems '("i686-linux" "x86_64-linux")) | |
112 | (propagated-inputs | |
bffd8fcd JN |
113 | `(("mescc-tools" ,mescc-tools-0.5.2) |
114 | ("nyacc" ,nyacc-0.86))) | |
0a01bb55 DM |
115 | (native-inputs |
116 | `(("guile" ,guile-2.2) | |
117 | ,@(let ((target-system (or (%current-target-system) | |
118 | (%current-system)))) | |
119 | (cond | |
120 | ((string-prefix? "x86_64-linux" target-system) | |
121 | ;; Use cross-compiler rather than #:system "i686-linux" to get | |
122 | ;; MesCC 64 bit .go files installed ready for use with Guile. | |
123 | `(("i686-linux-binutils" ,(cross-binutils "i686-unknown-linux-gnu")) | |
124 | ("i686-linux-gcc" ,(cross-gcc "i686-unknown-linux-gnu")))) | |
125 | (else | |
126 | '()))) | |
127 | ("graphviz" ,graphviz) | |
128 | ("help2man" ,help2man) | |
129 | ("perl" ,perl) ; build-aux/gitlog-to-changelog | |
130 | ("texinfo" ,texinfo))) | |
131 | (arguments | |
132 | `(#:strip-binaries? #f)) ; binutil's strip b0rkes MesCC/M1/hex2 binaries | |
133 | (synopsis "Scheme interpreter and C compiler for full source bootstrapping") | |
134 | (description | |
135 | "GNU Mes--Maxwell Equations of Software--brings the Reduced Binary Seed | |
c9941771 JN |
136 | bootstrap to Guix and aims to help create full source bootstrapping for |
137 | GNU/Linux distributions. It consists of a mutual self-hosting Scheme | |
138 | interpreter in C and a Nyacc-based C compiler in Scheme and is compatible with | |
139 | Guile.") | |
8c0dcf3e | 140 | (home-page "https://www.gnu.org/software/mes/") |
0a01bb55 | 141 | (license gpl3+))) |
9ae3fcb9 | 142 | |
bffd8fcd JN |
143 | (define-public mes |
144 | (package | |
145 | (inherit mes-0.19) | |
6e5fc6c7 | 146 | (version "0.22") |
bffd8fcd JN |
147 | (source (origin |
148 | (method url-fetch) | |
149 | (uri (string-append "mirror://gnu/mes/" | |
150 | "mes-" version ".tar.gz")) | |
151 | (sha256 | |
152 | (base32 | |
6e5fc6c7 | 153 | "0p1jsrrmcbc0zrvbvnjbb6iyxr0in71km293q8qj6gnar6bw09av")))) |
bffd8fcd JN |
154 | (propagated-inputs |
155 | `(("mescc-tools" ,mescc-tools) | |
4e23d650 JN |
156 | ("nyacc" ,nyacc))) |
157 | (native-search-paths | |
158 | (list (search-path-specification | |
159 | (variable "C_INCLUDE_PATH") | |
160 | (files '("include"))) | |
161 | (search-path-specification | |
162 | (variable "LIBRARY_PATH") | |
6e5fc6c7 JN |
163 | (files '("lib"))) |
164 | (search-path-specification | |
165 | (variable "MES_PREFIX") | |
166 | (separator #f) | |
167 | (files '(""))))))) | |
4e23d650 JN |
168 | |
169 | (define-public mes-rb5 | |
170 | ;; This is the Reproducible-Builds summit 5's Mes, also built on Debian | |
171 | ;; GNU/Linux and NixOS to produce the same, bit-for-bit identical result. | |
172 | (package | |
173 | (inherit mes) | |
174 | (name "mes-rb5") | |
175 | (inputs '()) | |
176 | (propagated-inputs '()) | |
177 | (native-inputs | |
178 | `(("bash" ,bash) | |
179 | ("coreutils" ,coreutils) | |
180 | ("grep" ,grep) | |
181 | ("guile" ,guile-2.2) | |
6e5fc6c7 | 182 | ("gzip" ,gzip) |
4e23d650 JN |
183 | ("libc" ,glibc) |
184 | ("locales" ,glibc-utf8-locales) | |
185 | ("make" ,gnu-make) | |
186 | ("mes" ,mes) | |
187 | ("mescc-tools" ,mescc-tools) | |
188 | ("nyacc" ,nyacc) | |
189 | ("sed" ,sed) | |
6e5fc6c7 | 190 | ("tar" ,tar))) |
4e23d650 JN |
191 | (supported-systems '("i686-linux")) |
192 | (arguments | |
193 | `(#:implicit-inputs? #f | |
194 | #:strip-binaries? #f ; binutil's strip b0rkes MesCC/M1/hex2 binaries | |
195 | #:modules ((guix build gnu-build-system) | |
196 | (guix build utils) | |
197 | (ice-9 popen) | |
198 | (ice-9 rdelim)) | |
199 | #:phases | |
200 | (modify-phases %standard-phases | |
201 | (add-before 'configure 'setenv | |
202 | (lambda _ | |
203 | (setenv "AR" "mesar") | |
204 | (setenv "CC" "mescc") | |
205 | (setenv "GUILD" "true") | |
206 | (setenv "SCHEME" "mes") | |
207 | (setenv "LC_ALL" "en_US.UTF-8") | |
208 | #t)) | |
209 | (replace 'configure | |
210 | (lambda _ | |
211 | (let ((out (assoc-ref %outputs "out"))) | |
212 | (invoke "sh" "configure.sh" | |
213 | (string-append "--prefix=" out) | |
214 | "--host=i686-unkown-linux-gnu" | |
215 | "--with-courage")))) | |
216 | (replace 'build | |
217 | (lambda _ | |
218 | (invoke "sh" "bootstrap.sh"))) | |
219 | (replace 'check | |
220 | (lambda _ | |
6e5fc6c7 JN |
221 | (copy-file "bin/mes-mescc" "bin/mes-mescc-0.21") |
222 | (system* "sed" "-i" "s/0\\.22/0\\.21/" "bin/mes-mescc-0.21") | |
4e23d650 JN |
223 | (let ((sha256sum |
224 | (read-delimited | |
225 | " " | |
6e5fc6c7 | 226 | (open-pipe* OPEN_READ "sha256sum" "bin/mes-mescc-0.21")))) |
4e23d650 JN |
227 | (unless |
228 | (equal? | |
229 | sha256sum | |
230 | "9e0bcb1633c58e7bc415f6ea27cee7951d6b0658e13cdc147e992b31a14625fb") | |
231 | (throw 'error "mes checksum failure")) | |
232 | #t))) | |
233 | (replace 'install | |
234 | (lambda _ | |
235 | (invoke "sh" "install.sh")))))))) | |
bffd8fcd | 236 | |
066cb9ba JN |
237 | (define-public mescc-tools-0.5.2 |
238 | ;; Mescc-tools used for bootstrap. | |
7cbf6f1c JN |
239 | (let ((commit "bb062b0da7bf2724ca40f9002b121579898d4ef7") |
240 | (revision "0") | |
241 | (version "0.5.2")) | |
242 | (package | |
243 | (name "mescc-tools") | |
81a4ca08 | 244 | (version (git-version version revision commit)) |
7cbf6f1c | 245 | (source (origin |
81a4ca08 LC |
246 | (method git-fetch) |
247 | (uri (git-reference | |
248 | (url "https://git.savannah.nongnu.org/r/mescc-tools.git") | |
249 | (commit commit))) | |
250 | (file-name (git-file-name name version)) | |
7cbf6f1c JN |
251 | (sha256 |
252 | (base32 | |
81a4ca08 | 253 | "1nc6rnax66vmhqsjg0kgx23pihdcxmww6v325ywf59vsq1jqjvff")))) |
7cbf6f1c JN |
254 | (build-system gnu-build-system) |
255 | (supported-systems '("i686-linux" "x86_64-linux")) | |
256 | (arguments | |
257 | `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))) | |
258 | #:test-target "test" | |
259 | #:phases (modify-phases %standard-phases | |
260 | (delete 'configure)))) | |
261 | (synopsis "Tools for the full source bootstrapping process") | |
262 | (description | |
263 | "Mescc-tools is a collection of tools for use in a full source | |
8a502c3b JN |
264 | bootstrapping process. It consists of the M1 macro assembler, the hex2 |
265 | linker, the blood-elf symbol table generator, the kaem shell, exec_enable and | |
266 | get_machine.") | |
267 | (home-page "https://savannah.nongnu.org/projects/mescc-tools") | |
7cbf6f1c | 268 | (license gpl3+)))) |
9ff87bb9 | 269 | |
066cb9ba | 270 | (define-public mescc-tools |
9ae3fcb9 | 271 | (package |
066cb9ba | 272 | (inherit mescc-tools-0.5.2) |
9ae3fcb9 | 273 | (name "mescc-tools") |
9aed1de3 | 274 | (version "0.6.1") |
9ae3fcb9 | 275 | (source (origin |
81a4ca08 LC |
276 | (method git-fetch) |
277 | (uri (git-reference | |
278 | (url "https://git.savannah.nongnu.org/r/mescc-tools.git") | |
279 | (commit (string-append "Release_" version)))) | |
280 | (file-name (string-append "mescc-tools-" version "-checkout")) | |
9ae3fcb9 JN |
281 | (sha256 |
282 | (base32 | |
81a4ca08 | 283 | "1cgxcdza6ws725x84i31la7jxmlk5a3nsij5shz1zljg0i36kj99")))) |
066cb9ba JN |
284 | (arguments |
285 | (substitute-keyword-arguments (package-arguments mescc-tools-0.5.2) | |
286 | ((#:make-flags _) | |
287 | `(list (string-append "PREFIX=" (assoc-ref %outputs "out")) | |
288 | "CC=gcc")))))) | |
99b340f5 JN |
289 | |
290 | (define-public m2-planet | |
291 | (let ((commit "b87ddb0051b168ea45f8d49a610dcd069263336a") | |
292 | (revision "2")) | |
293 | (package | |
294 | (name "m2-planet") | |
295 | (version (string-append "1.4.0-" revision "." (string-take commit 7))) | |
296 | (source (origin | |
297 | (method git-fetch) | |
298 | (uri (git-reference | |
b0e7b699 | 299 | (url "https://github.com/oriansj/m2-planet") |
99b340f5 JN |
300 | (commit commit))) |
301 | (file-name (git-file-name name version)) | |
302 | (sha256 | |
303 | (base32 | |
304 | "0yyc0fcbbxi9jqa1n76x0rwspdrwmc8g09jlmsw9c35nflrhmz8q")))) | |
305 | (native-inputs | |
306 | `(("mescc-tools" ,mescc-tools))) | |
307 | (build-system gnu-build-system) | |
308 | (arguments | |
309 | `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))) | |
310 | #:tests? #f | |
311 | #:phases (modify-phases %standard-phases | |
312 | (delete 'bootstrap) | |
313 | (delete 'configure)))) | |
314 | (synopsis "The PLAtform NEutral Transpiler") | |
315 | (description | |
316 | "M2-Planet, the PLAtform NEutral Transpiler, when combined with | |
317 | mescc-tools, compiles a subset of the C language into working binaries with | |
71a5a1d1 | 318 | introspective steps in between. It is self-hosting and for bootstrapping it |
99b340f5 JN |
319 | also has an implementation in the M1 macro assembly language. M2-Planet is |
320 | built as Phase-5 of the full source bootstrapping process and is capable of | |
321 | building GNU Mes.") | |
322 | (home-page "https://github.com/oriansj/m2-planet") | |
323 | (license gpl3+)))) |