all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob ef4d4a486e74f70d4d295ec1a016ec8118258237 13480 bytes (raw)
name: gnu/packages/mes.scm 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
 
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Jan Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages mes)
  #:use-module (gnu packages)
  #:use-module (gnu packages base)
  #:use-module (gnu packages bootstrap)
  #:use-module (gnu packages commencement)
  #:use-module (gnu packages cross-base)
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages guile)
  #:use-module (gnu packages package-management)
  #:use-module (gnu packages perl)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system trivial)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix licenses)
  #:use-module (guix packages))

(define-public stage0-boot
 (let ((version "0.0.8")
        (revision "0")
        (commit "14843efa5ed13372b1ec32a76d19f27b3febab91"))
  (package
    (name "stage0-boot")
    (version (string-append version "-" revision "." (string-take commit 7)))
    (synopsis "Manually created initial hex programs for full source bootstrapping")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://gitlab.com/janneke/stage0"
                                  "/repository/archive.tar.gz?ref="
                                  commit))
              (file-name (string-append name "-" version ".tar.xz"))
              (sha256
               (base32
                "0ws5g4r1rnyfaxrnyqzh4qr3w2a3i3wljcc095rk897wi1xz23jz"))))
    (native-inputs
     `(("static-bash" ,@(assoc-ref %bootstrap-inputs "bash"))
       ("bash" ,(search-bootstrap-binary "bash" (%current-system)))
       ("tar" ,(search-bootstrap-binary "tar" (%current-system)))
       ("xz"  ,(search-bootstrap-binary "xz" (%current-system)))
       ("stage0-seed"
        ,(origin
           (method url-fetch)
           (uri (string-append "https://gitlab.com/janneke/stage0-seed"
                               "/repository/archive.tar.gz?ref="
                               "87039121e9ab4d48e9bade513c6f328cc9968583"))
           (file-name (string-append name "-seed" "-" version ".tar.xz"))
           (sha256
            (base32
             "0m18mv825nykj738gg9il60xb8xxc4015ypxgimhygdqxx0n66bp"))))))
    (supported-systems '("i686-linux" "x86_64-linux"))
    (build-system trivial-build-system)
    (arguments
     `(#:modules ((guix build utils))
       #:builder
       (begin
         (use-modules (guix build utils))
         (let* ((bash (assoc-ref %build-inputs "static-bash"))
                (tar (assoc-ref %build-inputs "tar"))
                (xz (assoc-ref %build-inputs "xz"))
                (source (assoc-ref %build-inputs "source"))
                (stage0-seed (assoc-ref %build-inputs "stage0-seed"))
                (out (assoc-ref %outputs "out"))
                (out/bin (string-append out "/bin")))
           (setenv "PATH" (string-append bash "/bin:"
                                         "../stage0-seed:"
                                         tar "/bin:"
                                         xz "/bin"))
           (format (current-error-port) "PATH=~s\n" (getenv "PATH"))
           (mkdir-p "source")
           (system* "tar" "--strip=1" "-C" "source" "-xvf" source)
           (mkdir-p "stage0-seed")
           (system* "tar" "--strip=1" "-C" "stage0-seed" "-xvf" stage0-seed)
           (chdir "source")
           (zero? (system (string-append
"set -ex;"
"mkdir -p " out/bin ";"
"hex Linux\\ Bootstrap/hex.hex > " out/bin "/hex;"
;; FIXME: exec-enable?
;;"hex Linux\\ Bootstrap/exec_enable.hex > " out/bin "/exec_enable;"
;;"exec_enable " out/bin "/hex"
;;"exec_enable " out/bin "/exec_enable"
"chmod +x " out/bin "/hex"
)))))))
    (description
     "Stage0 is the initial stage of a full source bootstrapping process.  It
contains hex0, the initial 400 byte self hosting hex assembler.  It also comes
with a Knight VM that runs Forth and Lisp.")
    (home-page "https://savannah.nongnu.org/projects/stage0/")
    (license gpl3+))))

(define-public mescc-tools-boot
 (let ((version "0.2")
        (revision "0")
        (commit "fbb9004499c533fd1df7270480a4ff9375ca1f55"))
  (package
    (name "mescc-tools-boot")
    (version (string-append version "-" revision "." (string-take commit 7)))
    (synopsis "Tools for the full source bootstrapping process")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://gitlab.com/janneke/mescc-tools"
                                  "/repository/archive.tar.gz?ref="
                                  commit))
              (file-name (string-append name "-" version ".tar.xz"))
              (sha256
               (base32
                "1m0syjc2f3pk5fl7msf0v8n7j29wh1bsma269sminp9wh7905m09"))))
    (native-inputs
     `(("static-bash" ,@(assoc-ref %bootstrap-inputs "bash"))
       ("bash" ,(search-bootstrap-binary "bash" (%current-system)))
       ("tar" ,(search-bootstrap-binary "tar" (%current-system)))
       ("xz"  ,(search-bootstrap-binary "xz" (%current-system)))
       ("stage0" ,stage0-boot)
       ("mescc-tools-seed"
        ,(origin
           (method url-fetch)
           (uri (string-append "https://gitlab.com/janneke/mescc-tools-seed"
                               "/repository/archive.tar.gz?ref="
                               "9ec08e82fe2cac94e776470afe1e6a6a59c79159"))
           (file-name (string-append name "-seed" "-" version ".tar.xz"))
           (sha256
            (base32
             "0liysc4gzsrmankfksd44wbr451sy3pf5c79y2bw74dcnjpx1df2"))))
       ("mes-source" ,(package-source mes-boot))
       ("mes-seed"
        ,(origin
           (method url-fetch)
           (uri (string-append "https://gitlab.com/janneke/mes-seed"
                               "/repository/archive.tar.gz?ref="
                               "d53d5998666873a79fbd9b4f6742d11affa34b44"))
           (file-name (string-append "mes-seed-0.11" ".tar.xz"))
           (sha256
            (base32
             "00zk4vfxqjyy3x4s5bdx59zicfqvxyvsbb9mfs4zkwyka64flk34"))))))
    (supported-systems '("i686-linux" "x86_64-linux"))
    (build-system trivial-build-system)
    (arguments
     `(#:modules ((guix build utils))
       #:builder
       (begin
         (use-modules (guix build utils))
         (let* ((bash (assoc-ref %build-inputs "static-bash"))
                (tar (assoc-ref %build-inputs "tar"))
                (xz (assoc-ref %build-inputs "xz"))
                (source (assoc-ref %build-inputs "source"))
                (mescc-tools-seed (assoc-ref %build-inputs "mescc-tools-seed"))
                (mes-seed (assoc-ref %build-inputs "mes-seed"))
                (mes-source (assoc-ref %build-inputs "mes-source"))
                (out (assoc-ref %outputs "out"))
                (out/bin (string-append out "/bin")))
           (setenv "PATH" (string-append bash "/bin:"
                                         "../mescc-tools-seed:"
                                         tar "/bin:"
                                         xz "/bin"))
           (format (current-error-port) "PATH=~s\n" (getenv "PATH"))
           (mkdir-p "source")
           (system* "tar" "--strip=1" "-C" "source" "-xvf" source)
           (mkdir-p "mescc-tools-seed")
           (system* "tar" "--strip=1" "-C" "mescc-tools-seed" "-xvf" mescc-tools-seed)
           (mkdir-p "mes-source")
           (system* "tar" "--strip=1" "-C" "mes-source" "-xvf" mes-source)
           (mkdir-p "mes-seed")
           (system* "tar" "--strip=1" "-C" "mes-seed" "-xvf" mes-seed)
           (chdir "source")
           (zero? (system (string-append
"set -ex;"
"mkdir -p " out/bin ";"
"M1 --LittleEndian --Architecture=1 -f ../mes-source/stage0/x86.M1 -f ../mescc-tools-seed/hex2.M1 > hex2.hex2;"
"M1 --LittleEndian --Architecture=1 -f ../mes-source/stage0/x86.M1 -f ../mes-seed/crt1.M1 > crt1.hex2;"
"M1 --LittleEndian --Architecture=1 -f ../mes-source/stage0/x86.M1 -f ../mes-seed/libc-mes+tcc.M1 > libc-mes+tcc.hex2;"

"hex2 --LittleEndian --Architecture=1 --BaseAddress=0x1000000 -f ../mes-source/stage0/elf32-header.hex2 -f crt1.hex2 -f libc-mes+tcc.hex2 -f hex2.hex2 -f ../mes-source/stage0/elf32-footer-single-main.hex2 > " out/bin "/hex2;"
"chmod +x " out/bin "/hex2;"

;; FIXME: MORTAL SIN HERE
;; M1 cannot be bootstrapped yet
"cp ../mescc-tools-seed/M1 " out/bin "/M1")))))))

    (description
     "Mescc-tools is a collection of tools for use in a full source
bootstrapping process.  Currently consists of the M1 macro assembler and the
hex2 linker.")
    (home-page "https://github.com/oriansj/mescc-tools")
    (license gpl3+))))


(define-public nyacc
  (package
    (name "nyacc")
    (version "0.82.4")
    (source (origin
              (method url-fetch)
              (uri (string-append "mirror://savannah/nyacc/"
                                  name "-" version ".tar.gz"))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "0ykz64jlf1kpxz3qqr0nmci57r5yqwyd3s2g93vrmcnpy9d7y22p"))))
    (build-system gnu-build-system)
    (native-inputs
     `(("guile" ,guile-2.2)))
    (synopsis "LALR(1) Parser Generator in Guile")
    (description
     "NYACC is an LALR(1) parser generator implemented in Guile.
The syntax and nomenclature should be considered not stable.  It comes with
extensive examples, including parsers for the Javascript and C99 languages.")
    (home-page "https://savannah.nongnu.org/projects/nyacc")
    (license (list gpl3+ lgpl3+))))

(define-public mes
  (let ((triplet "i686-unknown-linux-gnu"))
    (package
      (name "mes")
      (version "0.11")
      (source (origin
                (method url-fetch)
                (uri (string-append "https://gitlab.com/janneke/mes"
                                    "/repository/archive.tar.gz?ref=v"
                                    version))
                (file-name (string-append name "-" version ".tar.gz"))
                (sha256
                 (base32
                  "0m0kk7rxl8q7pjdmis36bwgv1i824nn3d7k3xxm8j64bl0gbhkmr"))))
      (build-system gnu-build-system)
      (supported-systems '("i686-linux" "x86_64-linux"))
      (propagated-inputs
       `(("mescc-tools" ,mescc-tools)
         ("nyacc" ,nyacc)))
      (native-inputs
       `(("guile" ,guile-2.2)
         ,@(if (string-prefix? "x86_64-linux" (or (%current-target-system)
                                                  (%current-system)))
               ;; Use cross-compiler rather than #:system "i686-linux" to get
               ;; MesCC 64 bit .go files installed ready for use with Guile.
               `(("i686-linux-binutils" ,(cross-binutils triplet))
                 ("i686-linux-gcc" ,(cross-gcc triplet)))
               '())
         ("perl" ,perl)))               ;build-aux/gitlog-to-changelog
      (arguments
       `(#:phases
         (modify-phases %standard-phases
           (add-before 'install 'generate-changelog
             (lambda _
               (with-output-to-file "ChangeLog"
                 (lambda ()
                   (display "Please run
    build-aux/gitlog-to-changelog --srcdir=<git-checkout> > ChangeLog\n")))
               #t))
           (delete 'strip)))) ; binutil's strip b0rkes MesCC/M1/hex2 binaries
      (synopsis "Scheme interpreter and C compiler for full source bootstrapping")
      (description
       "Mes [Maxwell Equations of Software] aims to create full source
bootstrapping for GuixSD.  It consists of a mutual self-hosting [close to
Guile-] Scheme interpreter prototype in C and a Nyacc-based C compiler in
[Guile] Scheme.")
      (home-page "https://gitlab.com/janneke/mes")
      (license gpl3+))))

(define-public mescc-tools
  (package
    (name "mescc-tools")
    (version "0.2")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "https://github.com/oriansj/mescc-tools/archive/Release_"
                    version
                    ".tar.gz"))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "0gmyczh88xcsmrmxqksbpaqidchj5hfqxqk7apx40k9r3vav6mnz"))))
    (build-system gnu-build-system)
    (supported-systems '("i686-linux" "x86_64-linux"))
    (arguments
     `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
       #:test-target "test"
       #:phases (modify-phases %standard-phases
                  (delete 'configure))))
    (synopsis "Tools for the full source bootstrapping process")
    (description
     "Mescc-tools is a collection of tools for use in a full source
bootstrapping process.  Currently consists of the M1 macro assembler and the
hex2 linker.")
    (home-page "https://github.com/oriansj/mescc-tools")
    (license gpl3+)))

debug log:

solving ef4d4a486 ...
found ef4d4a486 in https://yhetil.org/guix/877eulkii1.fsf@gnu.org/
found 1e3631a1e in https://yhetil.org/guix/877eulkii1.fsf@gnu.org/
found dfa421177 in https://git.savannah.gnu.org/cgit/guix.git
preparing index
index prepared:
100644 dfa4211773a9fd2a5c6832f106ec938ee7dd631b	gnu/packages/mes.scm

applying [1/2] https://yhetil.org/guix/877eulkii1.fsf@gnu.org/
diff --git a/gnu/packages/mes.scm b/gnu/packages/mes.scm
index dfa421177..1e3631a1e 100644


applying [2/2] https://yhetil.org/guix/877eulkii1.fsf@gnu.org/
diff --git a/gnu/packages/mes.scm b/gnu/packages/mes.scm
index 1e3631a1e..ef4d4a486 100644

Checking patch gnu/packages/mes.scm...
Applied patch gnu/packages/mes.scm cleanly.
Checking patch gnu/packages/mes.scm...
Applied patch gnu/packages/mes.scm cleanly.

index at:
100644 ef4d4a486e74f70d4d295ec1a016ec8118258237	gnu/packages/mes.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.