1 ;;; GNU Mes --- Maxwell Equations of Software
2 ;;; Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
4 ;;; This file is part of GNU Mes.
6 ;;; Also borrowing code from:
7 ;;; guile-sdl2 --- FFI bindings for SDL2
8 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
10 ;;; GNU Mes is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Mes is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (git mes)
24 #:use-module (srfi srfi-1)
25 #:use-module (srfi srfi-26)
26 #:use-module (ice-9 match)
27 #:use-module (ice-9 popen)
28 #:use-module (ice-9 rdelim)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages base)
31 #:use-module (gnu packages commencement)
32 #:use-module (gnu packages cross-base)
33 #:use-module (gnu packages gcc)
34 #:use-module (gnu packages graphviz)
35 #:use-module (gnu packages guile)
36 #:use-module (gnu packages man)
37 #:use-module (gnu packages mes)
38 #:use-module (gnu packages package-management)
39 #:use-module (gnu packages version-control)
40 #:use-module (gnu packages perl)
41 #:use-module (gnu packages pkg-config)
42 #:use-module (gnu packages texinfo)
43 #:use-module (guix build-system gnu)
44 #:use-module (guix build-system trivial)
45 #:use-module (guix gexp)
46 #:use-module (guix download)
47 #:use-module (guix git-download)
48 #:use-module (guix licenses)
49 #:use-module (guix packages))
51 (define %source-dir (getcwd))
53 (define-public mescc-tools
60 "http://git.savannah.nongnu.org/cgit/mescc-tools.git/snapshot/"
61 name "-Release_" version
63 (file-name (string-append name "-" version ".tar.gz"))
66 "06jpvq6xfjzn2al6b4rdwd3zv3h4cvilc4n9gqcnjr9cr6wjpw2n"))))
67 (build-system gnu-build-system)
68 (supported-systems '("i686-linux" "x86_64-linux"))
70 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
73 #:phases (modify-phases %standard-phases
74 (delete 'configure))))
75 (synopsis "Tools for the full source bootstrapping process")
77 "Mescc-tools is a collection of tools for use in a full source
78 bootstrapping process. It consists of the M1 macro assembler, the hex2
79 linker, the blood-elf symbol table generator, the kaem shell, exec_enable and
81 (home-page "https://savannah.nongnu.org/projects/mescc-tools")
90 (uri (string-append "mirror://savannah/nyacc/nyacc-"
94 "0hl5qxx19i4x1r0839sxm19ziqq65g4hy97yik81cc2yb9yvgyv3"))
95 (modules '((guix build utils)))
98 (substitute* (find-files "." "^Makefile\\.in$")
99 (("^SITE_SCM_DIR =.*")
101 @prefix@/share/guile/site/@GUILE_EFFECTIVE_VERSION@\n")
102 (("^SITE_SCM_GO_DIR =.*")
104 @prefix@/lib/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache\n")
106 "INFODIR = @prefix@/share/info\n")
108 "DOCDIR = @prefix@/share/doc/$(PACKAGE_TARNAME)\n"))
110 (build-system gnu-build-system)
112 `(("pkg-config" ,pkg-config)))
114 `(("guile" ,guile-2.2)))
115 (synopsis "LALR(1) Parser Generator in Guile")
117 "NYACC is an LALR(1) parser generator implemented in Guile.
118 The syntax and nomenclature should be considered not stable. It comes with
119 extensive examples, including parsers for the Javascript and C99 languages.")
120 (home-page "https://savannah.nongnu.org/projects/nyacc")
121 (license (list gpl3+ lgpl3+))))
124 (let ((triplet "i686-unknown-linux-gnu")
132 "https://ftp.gnu.org/pub/gnu/mes/mes-" version ".tar.gz"))
134 (base32 #!mes!# "04pajp8v31na34ls4730ig5f6miiplhdvkmsb9ls1b8bbmw2vb4n"))))
135 (build-system gnu-build-system)
136 (supported-systems '("i686-linux" "x86_64-linux"))
138 `(("mescc-tools" ,mescc-tools)
143 ,@(if (string-prefix? "x86_64-linux" (or (%current-target-system)
145 ;; Use cross-compiler rather than #:system "i686-linux" to get
146 ;; MesCC 64 bit .go files installed ready for use with Guile.
147 `(("i686-linux-binutils" ,(cross-binutils triplet))
148 ("i686-linux-gcc" ,(cross-gcc triplet)))
150 ("graphviz" ,graphviz)
151 ("help2man" ,help2man)
152 ("perl" ,perl) ; build-aux/gitlog-to-changelog
153 ("texinfo" ,texinfo)))
155 `(#:strip-binaries? #f)) ; binutil's strip b0rkes MesCC/M1/hex2 binaries
156 (synopsis "Scheme interpreter and C compiler for full source bootstrapping")
158 "GNU Mes--Maxwell Equations of Software--brings the Reduced Binary Seed
159 bootstrap to Guix and aims to help create full source bootstrapping for
160 GNU/Linux distributions. It consists of a mutual self-hosting Scheme
161 interpreter in C and a Nyacc-based C compiler in Scheme and is compatible with
163 (home-page "https://www.gnu.org/software/mes")
166 (define-public mes.git
167 (let ((version "0.20")
169 (commit (read-string (open-pipe "git show HEAD | head -1 | cut -d ' ' -f 2" OPEN_READ))))
173 (version (string-append version "-" revision "." (string-take commit 7)))
174 (source (local-file %source-dir
176 #:select? (git-predicate %source-dir))))))