gnu: %tinycc-seed: Update for mes 0.18.
[jackhill/guix/guix.git] / gnu / packages / bootstrap.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages bootstrap)
23 #:use-module (guix licenses)
24 #:use-module (gnu packages)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system)
28 #:use-module (guix build-system gnu)
29 #:use-module (guix build-system trivial)
30 #:use-module ((guix store)
31 #:select (run-with-store add-to-store add-text-to-store))
32 #:use-module ((guix derivations)
33 #:select (derivation derivation->output-path))
34 #:use-module ((guix utils) #:select (gnu-triplet->nix-system))
35 #:use-module (guix memoization)
36 #:use-module (srfi srfi-1)
37 #:use-module (srfi srfi-26)
38 #:use-module (ice-9 match)
39 #:export (bootstrap-origin
40 package-with-bootstrap-guile
41 glibc-dynamic-linker
42
43 bootstrap-guile-origin
44
45 %bootstrap-guile
46 %bootstrap-coreutils&co
47 %bootstrap-linux-libre-headers
48 %bootstrap-binutils
49 %bootstrap-gcc
50 %bootstrap-glibc
51 %bootstrap-inputs
52 %mescc-tools-seed
53 %mes-seed
54 %srfi-43
55 %tinycc-seed))
56
57 ;;; Commentary:
58 ;;;
59 ;;; Pre-built packages that are used to bootstrap the
60 ;;; distribution--i.e., to build all the core packages from scratch.
61 ;;;
62 ;;; Code:
63
64
65 \f
66 ;;;
67 ;;; Helper procedures.
68 ;;;
69
70 (define (bootstrap-origin source)
71 "Return a variant of SOURCE, an <origin> instance, whose method uses
72 %BOOTSTRAP-GUILE to do its job."
73 (define (boot fetch)
74 (lambda* (url hash-algo hash
75 #:optional name #:key system)
76 (fetch url hash-algo hash name
77 #:guile %bootstrap-guile
78 #:system system)))
79
80 (define %bootstrap-patch-inputs
81 ;; Packages used when an <origin> has a non-empty 'patches' field.
82 `(("tar" ,%bootstrap-coreutils&co)
83 ("xz" ,%bootstrap-coreutils&co)
84 ("bzip2" ,%bootstrap-coreutils&co)
85 ("gzip" ,%bootstrap-coreutils&co)
86 ("patch" ,%bootstrap-coreutils&co)))
87
88 (let ((orig-method (origin-method source)))
89 (origin (inherit source)
90 (method (cond ((eq? orig-method url-fetch)
91 (boot url-fetch))
92 (else orig-method)))
93 (patch-guile %bootstrap-guile)
94 (patch-inputs %bootstrap-patch-inputs)
95
96 ;; Patches can be origins as well, so process them.
97 (patches (map (match-lambda
98 ((? origin? patch)
99 (bootstrap-origin patch))
100 (patch patch))
101 (origin-patches source))))))
102
103 (define* (package-from-tarball name source program-to-test description
104 #:key snippet)
105 "Return a package that correspond to the extraction of SOURCE.
106 PROGRAM-TO-TEST is #f or a string: the program to run after extraction of
107 SOURCE to check whether everything is alright. If SNIPPET is provided, it is
108 evaluated after extracting SOURCE. SNIPPET should return true if successful,
109 or false to signal an error."
110 (package
111 (name name)
112 (version "0")
113 (build-system trivial-build-system)
114 (arguments
115 `(#:guile ,%bootstrap-guile
116 #:modules ((guix build utils))
117 #:builder
118 (let ((out (assoc-ref %outputs "out"))
119 (tar (assoc-ref %build-inputs "tar"))
120 (xz (assoc-ref %build-inputs "xz"))
121 (tarball (assoc-ref %build-inputs "tarball")))
122 (use-modules (guix build utils))
123
124 (mkdir out)
125 (copy-file tarball "binaries.tar.xz")
126 (invoke xz "-d" "binaries.tar.xz")
127 (let ((builddir (getcwd)))
128 (with-directory-excursion out
129 (invoke tar "xvf"
130 (string-append builddir "/binaries.tar"))
131 ,@(if snippet (list snippet) '())
132 (or (not ,program-to-test)
133 (invoke (string-append "bin/" ,program-to-test)
134 "--version")))))))
135 (inputs
136 `(("tar" ,(search-bootstrap-binary "tar" (%current-system)))
137 ("xz" ,(search-bootstrap-binary "xz" (%current-system)))
138 ("tarball" ,(bootstrap-origin (source (%current-system))))))
139 (source #f)
140 (synopsis description)
141 (description description)
142 (home-page #f)
143 (license gpl3+)))
144
145 (define package-with-bootstrap-guile
146 (mlambdaq (p)
147 "Return a variant of P such that all its origins are fetched with
148 %BOOTSTRAP-GUILE."
149 (define rewritten-input
150 (match-lambda
151 ((name (? origin? o))
152 `(,name ,(bootstrap-origin o)))
153 ((name (? package? p) sub-drvs ...)
154 `(,name ,(package-with-bootstrap-guile p) ,@sub-drvs))
155 (x x)))
156
157 (package (inherit p)
158 (source (match (package-source p)
159 ((? origin? o) (bootstrap-origin o))
160 (s s)))
161 (inputs (map rewritten-input
162 (package-inputs p)))
163 (native-inputs (map rewritten-input
164 (package-native-inputs p)))
165 (propagated-inputs (map rewritten-input
166 (package-propagated-inputs p)))
167 (replacement (and=> (package-replacement p)
168 package-with-bootstrap-guile)))))
169
170 (define* (glibc-dynamic-linker
171 #:optional (system (or (and=> (%current-target-system)
172 gnu-triplet->nix-system)
173 (%current-system))))
174 "Return the name of Glibc's dynamic linker for SYSTEM."
175 ;; See the 'SYSDEP_KNOWN_INTERPRETER_NAMES' cpp macro in libc.
176 (cond ((string=? system "x86_64-linux") "/lib/ld-linux-x86-64.so.2")
177 ((string=? system "i686-linux") "/lib/ld-linux.so.2")
178 ((string=? system "armhf-linux") "/lib/ld-linux-armhf.so.3")
179 ((string=? system "mips64el-linux") "/lib/ld.so.1")
180 ((string=? system "i586-gnu") "/lib/ld.so.1")
181 ((string=? system "i686-gnu") "/lib/ld.so.1")
182 ((string=? system "aarch64-linux") "/lib/ld-linux-aarch64.so.1")
183 ((string=? system "powerpc-linux") "/lib/ld.so.1")
184 ((string=? system "powerpc64le-linux") "/lib/ld64.so.2")
185 ((string=? system "alpha-linux") "/lib/ld-linux.so.2")
186 ((string=? system "s390x-linux") "/lib/ld64.so.1")
187
188 ;; XXX: This one is used bare-bones, without a libc, so add a case
189 ;; here just so we can keep going.
190 ((string=? system "arm-eabi") "no-ld.so")
191 ((string=? system "xtensa-elf") "no-ld.so")
192 ((string=? system "avr") "no-ld.so")
193 ((string=? system "propeller-elf") "no-ld.so")
194 ((string=? system "i686-mingw") "no-ld.so")
195 ((string=? system "vc4-elf") "no-ld.so")
196
197 (else (error "dynamic linker name not known for this system"
198 system))))
199
200 \f
201 ;;;
202 ;;; Bootstrap packages.
203 ;;;
204
205 (define %bootstrap-base-urls
206 ;; This is where the initial binaries come from.
207 '("https://alpha.gnu.org/gnu/guix/bootstrap"
208 "http://alpha.gnu.org/gnu/guix/bootstrap"
209 "ftp://alpha.gnu.org/gnu/guix/bootstrap"
210 "http://www.fdn.fr/~lcourtes/software/guix/packages"
211 "http://flashner.co.il/guix/bootstrap"))
212
213 (define (bootstrap-guile-url-path system)
214 "Return the URI for FILE."
215 (string-append "/" system
216 (match system
217 ("aarch64-linux"
218 "/20170217/guile-2.0.14.tar.xz")
219 ("armhf-linux"
220 "/20150101/guile-2.0.11.tar.xz")
221 (_
222 "/20131110/guile-2.0.9.tar.xz"))))
223
224 (define (bootstrap-guile-hash system)
225 "Return the SHA256 hash of the Guile bootstrap tarball for SYSTEM."
226 (match system
227 ("x86_64-linux"
228 (base32 "1w2p5zyrglzzniqgvyn1b55vprfzhgk8vzbzkkbdgl5248si0yq3"))
229 ("i686-linux"
230 (base32 "0im800m30abgh7msh331pcbjvb4n02smz5cfzf1srv0kpx3csmxp"))
231 ("mips64el-linux"
232 (base32 "0fzp93lvi0hn54acc0fpvhc7bvl0yc853k62l958cihk03q80ilr"))
233 ("armhf-linux"
234 (base32 "1mi3brl7l58aww34rawhvja84xc7l1b4hmwdmc36fp9q9mfx0lg5"))
235 ("aarch64-linux"
236 (base32 "1giy2aprjmn5fp9c4s9r125fljw4wv6ixy5739i5bffw4jgr0f9r"))))
237
238 (define (bootstrap-guile-origin system)
239 "Return an <origin> object for the Guile tarball of SYSTEM."
240 (origin
241 (method url-fetch)
242 (uri (map (cute string-append <> (bootstrap-guile-url-path system))
243 %bootstrap-base-urls))
244 (sha256 (bootstrap-guile-hash system))))
245
246 (define (download-bootstrap-guile store system)
247 "Return a derivation that downloads the bootstrap Guile tarball for SYSTEM."
248 (let* ((path (bootstrap-guile-url-path system))
249 (base (basename path))
250 (urls (map (cut string-append <> path) %bootstrap-base-urls)))
251 (run-with-store store
252 (url-fetch urls 'sha256 (bootstrap-guile-hash system)
253 #:system system))))
254
255 (define* (raw-build store name inputs
256 #:key outputs system search-paths
257 #:allow-other-keys)
258 (define (->store file)
259 (add-to-store store file #t "sha256"
260 (or (search-bootstrap-binary file
261 system)
262 (error "bootstrap binary not found"
263 file system))))
264
265 (let* ((tar (->store "tar"))
266 (xz (->store "xz"))
267 (mkdir (->store "mkdir"))
268 (bash (->store "bash"))
269 (guile (download-bootstrap-guile store system))
270 ;; The following code, run by the bootstrap guile after it is
271 ;; unpacked, creates a wrapper for itself to set its load path.
272 ;; This replaces the previous non-portable method based on
273 ;; reading the /proc/self/exe symlink.
274 (make-guile-wrapper
275 '(begin
276 (use-modules (ice-9 match))
277 (match (command-line)
278 ((_ out bash)
279 (let ((bin-dir (string-append out "/bin"))
280 (guile (string-append out "/bin/guile"))
281 (guile-real (string-append out "/bin/.guile-real"))
282 ;; We must avoid using a bare dollar sign in this code,
283 ;; because it would be interpreted by the shell.
284 (dollar (string (integer->char 36))))
285 (chmod bin-dir #o755)
286 (rename-file guile guile-real)
287 (call-with-output-file guile
288 (lambda (p)
289 (format p "\
290 #!~a
291 export GUILE_SYSTEM_PATH=~a/share/guile/2.0
292 export GUILE_SYSTEM_COMPILED_PATH=~a/lib/guile/2.0/ccache
293 exec -a \"~a0\" ~a \"~a@\"\n"
294 bash out out dollar guile-real dollar)))
295 (chmod guile #o555)
296 (chmod bin-dir #o555))))))
297 (builder
298 (add-text-to-store store
299 "build-bootstrap-guile.sh"
300 (format #f "
301 echo \"unpacking bootstrap Guile to '$out'...\"
302 ~a $out
303 cd $out
304 ~a -dc < $GUILE_TARBALL | ~a xv
305
306 # Use the bootstrap guile to create its own wrapper to set the load path.
307 GUILE_SYSTEM_PATH=$out/share/guile/2.0 \
308 GUILE_SYSTEM_COMPILED_PATH=$out/lib/guile/2.0/ccache \
309 $out/bin/guile -c ~s $out ~a
310
311 # Sanity check.
312 $out/bin/guile --version~%"
313 mkdir xz tar
314 (format #f "~s" make-guile-wrapper)
315 bash)
316 (list mkdir xz tar bash))))
317 (derivation store name
318 bash `(,builder)
319 #:system system
320 #:inputs `((,bash) (,builder) (,guile))
321 #:env-vars `(("GUILE_TARBALL"
322 . ,(derivation->output-path guile))))))
323
324 (define* (make-raw-bag name
325 #:key source inputs native-inputs outputs
326 system target)
327 (bag
328 (name name)
329 (system system)
330 (build-inputs inputs)
331 (build raw-build)))
332
333 (define %bootstrap-guile
334 ;; The Guile used to run the build scripts of the initial derivations.
335 ;; It is just unpacked from a tarball containing a pre-built binary.
336 ;; This is typically built using %GUILE-BOOTSTRAP-TARBALL below.
337 ;;
338 ;; XXX: Would need libc's `libnss_files2.so' for proper `getaddrinfo'
339 ;; support (for /etc/services).
340 (let ((raw (build-system
341 (name 'raw)
342 (description "Raw build system with direct store access")
343 (lower make-raw-bag))))
344 (package
345 (name "guile-bootstrap")
346 (version "2.0")
347 (source #f)
348 (build-system raw)
349 (synopsis "Bootstrap Guile")
350 (description "Pre-built Guile for bootstrapping purposes.")
351 (home-page #f)
352 (license lgpl3+))))
353
354 (define %bootstrap-coreutils&co
355 (package-from-tarball "bootstrap-binaries"
356 (lambda (system)
357 (origin
358 (method url-fetch)
359 (uri (map (cut string-append <> "/" system
360 (match system
361 ("armhf-linux"
362 "/20150101/static-binaries.tar.xz")
363 ("aarch64-linux"
364 "/20170217/static-binaries.tar.xz")
365 (_
366 "/20131110/static-binaries.tar.xz")))
367 %bootstrap-base-urls))
368 (sha256
369 (match system
370 ("x86_64-linux"
371 (base32
372 "0c533p9dhczzcsa1117gmfq3pc8w362g4mx84ik36srpr7cx2bg4"))
373 ("i686-linux"
374 (base32
375 "0s5b3jb315n13m1k8095l0a5hfrsz8g0fv1b6riyc5hnxqyphlak"))
376 ("armhf-linux"
377 (base32
378 "0gf0fn2kbpxkjixkmx5f4z6hv6qpmgixl69zgg74dbsfdfj8jdv5"))
379 ("aarch64-linux"
380 (base32
381 "18dfiq6c6xhsdpbidigw6480wh0vdgsxqq3xindq4lpdgqlccpfh"))
382 ("mips64el-linux"
383 (base32
384 "072y4wyfsj1bs80r6vbybbafy8ya4vfy7qj25dklwk97m6g71753"))))))
385 "fgrep" ; the program to test
386 "Bootstrap binaries of Coreutils, Awk, etc."
387 #:snippet
388 '(let ((path (list (string-append (getcwd) "/bin"))))
389 (chmod "bin" #o755)
390 (patch-shebang "bin/egrep" path)
391 (patch-shebang "bin/fgrep" path)
392 ;; Starting with grep@2.25 'egrep' and 'fgrep' are shell files
393 ;; that call 'grep'. If the bootstrap 'egrep' and 'fgrep'
394 ;; are not binaries then patch them to execute 'grep' via its
395 ;; absolute file name instead of searching for it in $PATH.
396 (if (not (elf-file? "bin/egrep"))
397 (substitute* '("bin/egrep" "bin/fgrep")
398 (("^exec grep") (string-append (getcwd) "/bin/grep"))))
399 (chmod "bin" #o555))))
400
401 (define-public %bootstrap-linux-libre-headers
402 (package-from-tarball
403 "linux-libre-headers-bootstrap"
404 (lambda (system)
405 (origin
406 (method url-fetch)
407 (uri (match system
408 ((or "i686-linux"
409 "x86_64-linux")
410 "http://lilypond.org/janneke/mes/linux-libre-headers-stripped-4.14.26-i686-linux.tar.xz")
411 (_ (error "linux-libre-headers-bootstrap: system not supported"))))
412 (sha256
413 (base32
414 "0nwspwydn089xbd28nnas762iwl6l9ymbcz170qvfi50ywgim1ma"))))
415 #f ; no program to test
416 "Bootstrap linux-libre-headers"))
417
418 (define %bootstrap-binutils
419 (package-from-tarball "binutils-bootstrap"
420 (lambda (system)
421 (origin
422 (method url-fetch)
423 (uri (map (cut string-append <> "/" system
424 (match system
425 ("armhf-linux"
426 "/20150101/binutils-2.25.tar.xz")
427 ("aarch64-linux"
428 "/20170217/binutils-2.27.tar.xz")
429 (_
430 "/20131110/binutils-2.23.2.tar.xz")))
431 %bootstrap-base-urls))
432 (sha256
433 (match system
434 ("x86_64-linux"
435 (base32
436 "1j5yivz7zkjqfsfmxzrrrffwyayjqyfxgpi89df0w4qziqs2dg20"))
437 ("i686-linux"
438 (base32
439 "14jgwf9gscd7l2pnz610b1zia06dvcm2qyzvni31b8zpgmcai2v9"))
440 ("armhf-linux"
441 (base32
442 "1v7dj6bzn6m36f20gw31l99xaabq4xrhrx3gwqkhhig0mdlmr69q"))
443 ("aarch64-linux"
444 (base32
445 "111s7ilfiby033rczc71797xrmaa3qlv179wdvsaq132pd51xv3n"))
446 ("mips64el-linux"
447 (base32
448 "1x8kkhcxmfyzg1ddpz2pxs6fbdl6412r7x0nzbmi5n7mj8zw2gy7"))))))
449 "ld" ; the program to test
450 "Bootstrap binaries of the GNU Binutils"))
451
452 (define %bootstrap-glibc
453 ;; The initial libc.
454 (package
455 (name "glibc-bootstrap")
456 (version "0")
457 (source #f)
458 (build-system trivial-build-system)
459 (arguments
460 `(#:guile ,%bootstrap-guile
461 #:modules ((guix build utils))
462 #:builder
463 (let ((out (assoc-ref %outputs "out"))
464 (tar (assoc-ref %build-inputs "tar"))
465 (xz (assoc-ref %build-inputs "xz"))
466 (tarball (assoc-ref %build-inputs "tarball")))
467 (use-modules (guix build utils))
468
469 (mkdir out)
470 (copy-file tarball "binaries.tar.xz")
471 (invoke xz "-d" "binaries.tar.xz")
472 (let ((builddir (getcwd)))
473 (with-directory-excursion out
474 (invoke tar "xvf"
475 (string-append builddir
476 "/binaries.tar"))
477 (chmod "lib" #o755)
478
479 ;; Patch libc.so so it refers to the right path.
480 (substitute* "lib/libc.so"
481 (("/[^ ]+/lib/(libc|ld)" _ prefix)
482 (string-append out "/lib/" prefix)))
483
484 #t)))))
485 (inputs
486 `(("tar" ,(search-bootstrap-binary "tar" (%current-system)))
487 ("xz" ,(search-bootstrap-binary "xz" (%current-system)))
488 ("tarball" ,(bootstrap-origin
489 (origin
490 (method url-fetch)
491 (uri (map (cut string-append <> "/" (%current-system)
492 (match (%current-system)
493 ("armhf-linux"
494 "/20150101/glibc-2.20.tar.xz")
495 ("aarch64-linux"
496 "/20170217/glibc-2.25.tar.xz")
497 (_
498 "/20131110/glibc-2.18.tar.xz")))
499 %bootstrap-base-urls))
500 (sha256
501 (match (%current-system)
502 ("x86_64-linux"
503 (base32
504 "0jlqrgavvnplj1b083s20jj9iddr4lzfvwybw5xrcis9spbfzk7v"))
505 ("i686-linux"
506 (base32
507 "1hgrccw1zqdc7lvgivwa54d9l3zsim5pqm0dykxg0z522h6gr05w"))
508 ("armhf-linux"
509 (base32
510 "18cmgvpllqfpn6khsmivqib7ys8ymnq0hdzi3qp24prik0ykz8gn"))
511 ("aarch64-linux"
512 (base32
513 "07nx3x8598i2924rjnlrncg6rm61c9bmcczbbcpbx0fb742nvv5c"))
514 ("mips64el-linux"
515 (base32
516 "0k97a3whzx3apsi9n2cbsrr79ad6lh00klxph9hw4fqyp1abkdsg")))))))))
517 (synopsis "Bootstrap binaries and headers of the GNU C Library")
518 (description synopsis)
519 (home-page #f)
520 (license lgpl2.1+)))
521
522 (define %bootstrap-gcc
523 ;; The initial GCC. Uses binaries from a tarball typically built by
524 ;; %GCC-BOOTSTRAP-TARBALL.
525 (package
526 (name "gcc-bootstrap")
527 (version "0")
528 (source #f)
529 (build-system trivial-build-system)
530 (arguments
531 `(#:guile ,%bootstrap-guile
532 #:modules ((guix build utils))
533 #:builder
534 (let ((out (assoc-ref %outputs "out"))
535 (tar (assoc-ref %build-inputs "tar"))
536 (xz (assoc-ref %build-inputs "xz"))
537 (bash (assoc-ref %build-inputs "bash"))
538 (libc (assoc-ref %build-inputs "libc"))
539 (tarball (assoc-ref %build-inputs "tarball")))
540 (use-modules (guix build utils)
541 (ice-9 popen))
542
543 (mkdir out)
544 (copy-file tarball "binaries.tar.xz")
545 (invoke xz "-d" "binaries.tar.xz")
546 (let ((builddir (getcwd))
547 (bindir (string-append out "/bin")))
548 (with-directory-excursion out
549 (invoke tar "xvf"
550 (string-append builddir "/binaries.tar")))
551
552 (with-directory-excursion bindir
553 (chmod "." #o755)
554 (rename-file "gcc" ".gcc-wrapped")
555 (call-with-output-file "gcc"
556 (lambda (p)
557 (format p "#!~a
558 exec ~a/bin/.gcc-wrapped -B~a/lib \
559 -Wl,-rpath -Wl,~a/lib \
560 -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
561 bash
562 out libc libc libc
563 ,(glibc-dynamic-linker))))
564
565 (chmod "gcc" #o555)
566 #t)))))
567 (inputs
568 `(("tar" ,(search-bootstrap-binary "tar" (%current-system)))
569 ("xz" ,(search-bootstrap-binary "xz" (%current-system)))
570 ("bash" ,(search-bootstrap-binary "bash" (%current-system)))
571 ("libc" ,%bootstrap-glibc)
572 ("tarball" ,(bootstrap-origin
573 (origin
574 (method url-fetch)
575 (uri (map (cut string-append <> "/" (%current-system)
576 (match (%current-system)
577 ("armhf-linux"
578 "/20150101/gcc-4.8.4.tar.xz")
579 ("aarch64-linux"
580 "/20170217/gcc-5.4.0.tar.xz")
581 (_
582 "/20131110/gcc-4.8.2.tar.xz")))
583 %bootstrap-base-urls))
584 (sha256
585 (match (%current-system)
586 ("x86_64-linux"
587 (base32
588 "17ga4m6195n4fnbzdkmik834znkhs53nkypp6557pl1ps7dgqbls"))
589 ("i686-linux"
590 (base32
591 "150c1arrf2k8vfy6dpxh59vcgs4p1bgiz2av5m19dynpks7rjnyw"))
592 ("armhf-linux"
593 (base32
594 "0ghz825yzp43fxw53kd6afm8nkz16f7dxi9xi40bfwc8x3nbbr8v"))
595 ("aarch64-linux"
596 (base32
597 "1ar3vdzyqbfm0z36kmvazvfswxhcihlacl2dzdjgiq25cqnq9ih1"))
598 ("mips64el-linux"
599 (base32
600 "1m5miqkyng45l745n0sfafdpjkqv9225xf44jqkygwsipj2cv9ks")))))))))
601 (native-search-paths
602 (list (search-path-specification
603 (variable "CPATH")
604 (files '("include")))
605 (search-path-specification
606 (variable "LIBRARY_PATH")
607 (files '("lib" "lib64")))))
608 (synopsis "Bootstrap binaries of the GNU Compiler Collection")
609 (description synopsis)
610 (home-page #f)
611 (license gpl3+)))
612
613 (define %mescc-tools-seed ; todo: add tarballs to alpha.gnu.org/pub/mes/bootstrap/
614 (let ((commit "dc4e20e74924a5c80a2b7a77b4d7b927234fa71c"))
615 (origin
616 (method url-fetch)
617 (uri (string-append "https://gitlab.com/janneke/mescc-tools-seed"
618 "/-/archive/" commit
619 "/mescc-tools-seed-" commit ".tar.gz"))
620 (sha256
621 (base32
622 "1lj7df73vxanmffmiwkhcn83r7yd9n8568nkki06bqq5zg526nyz")))))
623
624 (define %mes-seed
625 (let ((commit "057fd36735b5605fe582d6b3625f793a62922206"))
626 (origin
627 (method url-fetch)
628 (uri (string-append "https://gitlab.com/janneke/mes-seed"
629 "/-/archive/" commit
630 "/mes-seed-" commit ".tar.gz"))
631 (sha256
632 (base32
633 "0vdb4kc05a1kdpmsi8dg425d5f33kp28sgl2fi3s320pc0v4dv13")))))
634
635 (define %tinycc-seed
636 (let ((commit "843d47ca682617f21333b50c67851797b8c3fd04"))
637 (origin
638 (method url-fetch)
639 (uri (string-append "https://gitlab.com/janneke/tinycc-seed"
640 "/-/archive/" commit
641 "/tinycc-seed-" commit ".tar.gz"))
642 (sha256
643 (base32
644 "0599wwv30js03l1rpmvzfclq3jadzvq04pi29j45nf6fyfg5hhqb")))))
645
646 (define %srfi-43
647 (origin
648 (method url-fetch)
649 (uri "http://git.savannah.gnu.org/cgit/guile.git/plain/module/srfi/srfi-43.scm?h=stable-2.0")
650 (file-name "srfi-43.scm")
651 (sha256
652 (base32
653 "0rnkppwdkxbzkgp9s9ccmby9f7p3ijxjlmvj0pzqxwmrmpy7jwmb"))))
654
655 (define (%bootstrap-inputs)
656 ;; The initial, pre-built inputs. From now on, we can start building our
657 ;; own packages.
658 `(,@(match (%current-system)
659 ((or "i686-linux" "x86_64-linux")
660 `(("linux-libre-headers" ,%bootstrap-linux-libre-headers)
661 ("mescc-tools-seed" ,%mescc-tools-seed)
662 ("mes-seed" ,%mes-seed)
663 ("srfi-43" ,%srfi-43 )
664 ("tinycc-seed" ,%tinycc-seed)))
665 (_
666 `(("libc" ,%bootstrap-glibc)
667 ("gcc" ,%bootstrap-gcc)
668 ("binutils" ,%bootstrap-binutils))))
669 ("coreutils&co" ,%bootstrap-coreutils&co)
670
671 ;; In gnu-build-system.scm, we rely on the availability of Bash.
672 ("bash" ,%bootstrap-coreutils&co)))
673
674 ;;; bootstrap.scm ends here