Merge branch 'master' into staging
[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.83.3")
43 (source (origin
44 (method url-fetch)
45 (uri (string-append "mirror://savannah/nyacc/"
46 name "-" version ".tar.gz"))
47 (file-name (string-append name "-" version ".tar.gz"))
48 (sha256
49 (base32
50 "0120n0mdb6r58c4jc024dhwqy5s8a20waknijfhqjc59a884lrd6"))))
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-for-mes
63 (package
64 (inherit nyacc)
65 (version "0.80.42")
66 (source (origin
67 (method url-fetch)
68 (uri (string-append "https://gitlab.com/janneke/nyacc"
69 "/-/archive/v" version
70 "/nyacc-" version ".tar.gz"))
71 (sha256
72 (base32
73 "0c8c8kxir0h2d4nxr131xbkfs7c80haipmkp2g6677sh14wn0b3y"))))))
74
75 (define-public mes
76 (let ((triplet "i686-unknown-linux-gnu"))
77 (package
78 (name "mes")
79 (version "0.17")
80 (source (origin
81 (method url-fetch)
82 (uri (string-append "http://alpha.gnu.org/gnu/mes/"
83 "mes-" version ".tar.gz"))
84 (sha256
85 (base32
86 "1j32x4zqy2cqjlg9m35f2411mwac2b0p5ch4hm99gddmfbxzgyhg"))))
87 (build-system gnu-build-system)
88 (supported-systems '("i686-linux" "x86_64-linux"))
89 (propagated-inputs
90 `(("mescc-tools" ,mescc-tools)
91 ("nyacc" ,nyacc-for-mes)))
92 (native-inputs
93 `(("guile" ,guile-2.2)
94 ,@(if (not (string-prefix? "i686-linux" (or (%current-target-system)
95 (%current-system))))
96 ;; Use cross-compiler rather than #:system "i686-linux" to get
97 ;; MesCC 64 bit .go files installed ready for use with Guile.
98 `(("i686-linux-binutils" ,(cross-binutils triplet))
99 ("i686-linux-gcc" ,(cross-gcc triplet)))
100 '())
101 ("graphviz" ,graphviz)
102 ("help2man" ,help2man)
103 ("perl" ,perl) ; build-aux/gitlog-to-changelog
104 ("texinfo" ,texinfo)))
105 (arguments
106 `(#:strip-binaries? #f)) ; binutil's strip b0rkes MesCC/M1/hex2 binaries
107 (synopsis "Scheme interpreter and C compiler for full source bootstrapping")
108 (description
109 "GNU Mes [Maxwell Equations of Software] aims to create full source
110 bootstrapping for GuixSD. It consists of a mutual self-hosting [close to
111 Guile-] Scheme interpreter prototype in C and a Nyacc-based C compiler in
112 [Guile] Scheme.")
113 (home-page "https://gnu.org/software/mes")
114 (license gpl3+))))
115
116 (define-public mescc-tools
117 (package
118 (name "mescc-tools")
119 (version "0.5.1")
120 (source (origin
121 (method url-fetch)
122 (uri (string-append
123 "https://github.com/oriansj/mescc-tools/archive/Release_"
124 version
125 ".tar.gz"))
126 (file-name (string-append name "-" version ".tar.gz"))
127 (sha256
128 (base32
129 "0rsxbjc3bg0jl3h7ai4hndxx2iyyk8bvwj9nd3xv2vgz3bmypnah"))))
130 (build-system gnu-build-system)
131 (supported-systems '("i686-linux" "x86_64-linux"))
132 (arguments
133 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
134 #:test-target "test"
135 #:phases (modify-phases %standard-phases
136 (delete 'configure)
137 (add-after 'install 'install-2
138 (lambda _
139 (let ((out (assoc-ref %outputs "out")))
140 (copy-file "bin/blood-elf" (string-append out "/bin/blood-elf"))))))))
141 (synopsis "Tools for the full source bootstrapping process")
142 (description
143 "Mescc-tools is a collection of tools for use in a full source
144 bootstrapping process. Currently consists of the M1 macro assembler and the
145 hex2 linker.")
146 (home-page "https://github.com/oriansj/mescc-tools")
147 (license gpl3+)))