Commit | Line | Data |
---|---|---|
1c7a78f1 JN |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2017 Jan Nieuwenhuizen <janneke@gnu.org> | |
3 | ;;; | |
4 | ;;; This file is part of GNU Guix. | |
5 | ;;; | |
6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
7 | ;;; under the terms of the GNU General Public License as published by | |
8 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
9 | ;;; your option) any later version. | |
10 | ;;; | |
11 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | ;;; GNU General Public License for more details. | |
15 | ;;; | |
16 | ;;; You should have received a copy of the GNU General Public License | |
17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
18 | ||
19 | (define-module (gnu packages mes) | |
20 | #:use-module (gnu packages) | |
21 | #:use-module (gnu packages base) | |
22 | #:use-module (gnu packages commencement) | |
23 | #:use-module (gnu packages cross-base) | |
24 | #:use-module (gnu packages gcc) | |
25 | #:use-module (gnu packages guile) | |
26 | #:use-module (gnu packages package-management) | |
27 | #:use-module (gnu packages perl) | |
28 | #:use-module (guix build-system gnu) | |
4be01412 | 29 | #:use-module (guix download) |
1c7a78f1 JN |
30 | #:use-module (guix git-download) |
31 | #:use-module (guix licenses) | |
32 | #:use-module (guix packages)) | |
33 | ||
4be01412 JN |
34 | (define-public nyacc |
35 | (package | |
36 | (name "nyacc") | |
327df26f | 37 | (version "0.82.4") |
4be01412 JN |
38 | (source (origin |
39 | (method url-fetch) | |
40 | (uri (string-append "mirror://savannah/nyacc/" | |
41 | name "-" version ".tar.gz")) | |
238ee648 | 42 | (file-name (string-append name "-" version ".tar.gz")) |
4be01412 JN |
43 | (sha256 |
44 | (base32 | |
327df26f | 45 | "0ykz64jlf1kpxz3qqr0nmci57r5yqwyd3s2g93vrmcnpy9d7y22p")))) |
4be01412 JN |
46 | (build-system gnu-build-system) |
47 | (native-inputs | |
48 | `(("guile" ,guile-2.2))) | |
49 | (synopsis "LALR(1) Parser Generator in Guile") | |
50 | (description | |
51 | "NYACC is an LALR(1) parser generator implemented in Guile. | |
52 | The syntax and nomenclature should be considered not stable. It comes with | |
53 | extensive examples, including parsers for the Javascript and C99 languages.") | |
54 | (home-page "https://savannah.nongnu.org/projects/nyacc") | |
55 | (license (list gpl3+ lgpl3+)))) | |
56 | ||
1c7a78f1 | 57 | (define-public mes |
604e494d | 58 | (let ((triplet "i686-unknown-linux-gnu")) |
1c7a78f1 JN |
59 | (package |
60 | (name "mes") | |
f4353797 | 61 | (version "0.10") |
1c7a78f1 | 62 | (source (origin |
604e494d JN |
63 | (method url-fetch) |
64 | (uri (string-append "https://gitlab.com/janneke/mes" | |
65 | "/repository/archive.tar.gz?ref=v" | |
66 | version)) | |
67 | (file-name (string-append name "-" version ".tar.gz")) | |
1c7a78f1 | 68 | (sha256 |
604e494d | 69 | (base32 |
f4353797 | 70 | "0djmhnvha8phxgb4msysnjmy1nnllb08bnw4xhdayq8ppi4zdmcv")))) |
1c7a78f1 | 71 | (build-system gnu-build-system) |
e0bb0a81 JN |
72 | (supported-systems '("i686-linux" "x86_64-linux")) |
73 | (propagated-inputs | |
604e494d JN |
74 | `(("mescc-tools" ,mescc-tools) |
75 | ("nyacc" ,nyacc))) | |
1c7a78f1 JN |
76 | (native-inputs |
77 | `(("guile" ,guile-2.2) | |
5afc7373 MB |
78 | ,@(if (string-prefix? "x86_64-linux" (or (%current-target-system) |
79 | (%current-system))) | |
e0bb0a81 JN |
80 | ;; Use cross-compiler rather than #:system "i686-linux" to get |
81 | ;; MesCC 64 bit .go files installed ready for use with Guile. | |
82 | `(("i686-linux-binutils" ,(cross-binutils triplet)) | |
83 | ("i686-linux-gcc" ,(cross-gcc triplet))) | |
84 | '()) | |
85 | ("perl" ,perl))) ;build-aux/gitlog-to-changelog | |
1c7a78f1 JN |
86 | (arguments |
87 | `(#:phases | |
88 | (modify-phases %standard-phases | |
89 | (add-before 'install 'generate-changelog | |
90 | (lambda _ | |
91 | (with-output-to-file "ChangeLog" | |
92 | (lambda () | |
93 | (display "Please run | |
94 | build-aux/gitlog-to-changelog --srcdir=<git-checkout> > ChangeLog\n"))) | |
0e016722 JN |
95 | #t)) |
96 | (delete 'strip)))) ; binutil's strip b0rkes Mescc/M1/hex2 binaries | |
97 | (synopsis "Scheme interpreter and C compiler for full source bootstrapping") | |
1c7a78f1 | 98 | (description |
0e016722 JN |
99 | "Mes [Maxwell Equations of Software] aims to create full source |
100 | bootstrapping for GuixSD. It consists of a mutual self-hosting [close to | |
101 | Guile-] Scheme interpreter prototype in C and a Nyacc-based C compiler in | |
102 | [Guile] Scheme.") | |
1c7a78f1 JN |
103 | (home-page "https://gitlab.com/janneke/mes") |
104 | (license gpl3+)))) | |
9ae3fcb9 JN |
105 | |
106 | (define-public mescc-tools | |
107 | (package | |
108 | (name "mescc-tools") | |
3b56776f | 109 | (version "0.2") |
9ae3fcb9 JN |
110 | (source (origin |
111 | (method url-fetch) | |
112 | (uri (string-append | |
3b56776f | 113 | "https://github.com/oriansj/mescc-tools/archive/Release_" |
9ae3fcb9 JN |
114 | version |
115 | ".tar.gz")) | |
116 | (file-name (string-append name "-" version ".tar.gz")) | |
117 | (sha256 | |
118 | (base32 | |
3b56776f | 119 | "0gmyczh88xcsmrmxqksbpaqidchj5hfqxqk7apx40k9r3vav6mnz")))) |
9ae3fcb9 JN |
120 | (build-system gnu-build-system) |
121 | (supported-systems '("i686-linux" "x86_64-linux")) | |
122 | (arguments | |
123 | `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))) | |
124 | #:test-target "test" | |
125 | #:phases (modify-phases %standard-phases | |
126 | (delete 'configure)))) | |
127 | (synopsis "Tools for the full source bootstrapping process") | |
128 | (description | |
129 | "Mescc-tools is a collection of tools for use in a full source | |
3b56776f | 130 | bootstrapping process. Currently consists of the M1 macro assembler and the |
9ae3fcb9 | 131 | hex2 linker.") |
3b56776f | 132 | (home-page "https://github.com/oriansj/mescc-tools") |
9ae3fcb9 | 133 | (license gpl3+))) |