1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 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>
7 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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-input derivation->output-path))
34 #:use-module ((guix utils) #:select (gnu-triplet->nix-system))
35 #:use-module (guix memoization)
36 #:use-module (guix i18n)
37 #:use-module (srfi srfi-1)
38 #:use-module (srfi srfi-26)
39 #:use-module (srfi srfi-34)
40 #:use-module (srfi srfi-35)
41 #:use-module (ice-9 match)
42 #:export (bootstrap-origin
43 package-with-bootstrap-guile
47 bootstrap-guile-origin
50 %bootstrap-coreutils&co
51 %bootstrap-linux-libre-headers
56 %bootstrap-mescc-tools
59 %bootstrap-inputs-for-tests))
63 ;;; Pre-built packages that are used to bootstrap the
64 ;;; distribution--i.e., to build all the core packages from scratch.
71 ;;; The bootstrap executables: 'bash', 'mkdir', 'tar', 'xz'. They allow us to
72 ;;; extract the very first tarball.
75 (define %bootstrap-executables
76 ;; List of bootstrap executables and their recursive hashes (as per 'guix
77 ;; hash -r'), taking their executable bit into account.
80 ,(base32 "13aqhqb8nydlwq1ah9974q0iadx1pb95v13wzzyf7vgv6nasrwzr"))
82 ,(base32 "1pxhdp7ldwavmm71xbh9wc197cb2nr66acjn26yjx3732cixh9ws"))
84 ,(base32 "1j51gv08sfg277yxj73xd564wjq3f8xwd6s9rbcg8v9gms47m4cx"))
86 ,(base32 "1d779rwsrasphg5g3r37qppcqy3p7ay1jb1y83w7x4i3qsc7zjy2")))
89 ,(base32 "0s6f1s26g4dsrrkl39zblvwpxmbzi6n9mgqf6vxsqz42gik6bgyn"))
91 ,(base32 "1r5rcp35niyxfkrdf00y2ba8ifrq9bi76cr63lwjf2l655j1i5p7"))
93 ,(base32 "0dksx5im3fv8ximz7368bsax9f26nn47ds74298flm5lnvpv9xly"))
95 ,(base32 "1cqqavghjfr0iwxqf61lrssv27wfigysgq2rs4rm1gkmn04yn1k3")))
98 ,(base32 "0rjaxyzjdllfkf1abczvgaf3cdcc7mmahyvdbkjmjzhgz92pv23g"))
100 ,(base32 "133ybmfpkmsnysrzbngwvbysqnsmfi8is8zifs7i7n6n600h4s1w"))
102 ,(base32 "07830bx29ad5i0l1ykj0g0b1jayjdblf01sr3ww9wbnwdbzinqms"))
104 ,(base32 "0i9kxdi17bm5gxfi2xzm0y73p3ii0cqxli1sbljm6rh2fjgyn90k")))
107 ,(base32 "1aw046dhda240k9pb9iaj5aqkm23gkvxa9j82n4k7fk87nbrixw6"))
109 ,(base32 "0c9j6qgyw84zxbry3ypifzll13gy8ax71w40kdk1h11jbgla3f5k"))
111 ,(base32 "06gmqdjq3rl8lr47b9fyx4ifnm5x56ymc8lyryp1ax1j2s4y5jb4"))
113 ,(base32 "09j1d69qr0hhhx4k4ih8wp00dfc9y4rp01hfg3vc15yxd0jxabh5")))))
115 (define (bootstrap-executable-url program system)
116 "Return the URL where PROGRAM can be found for SYSTEM."
118 "https://git.savannah.gnu.org/cgit/guix.git/plain/gnu/packages/bootstrap/"
120 "?id=44f07d1dc6806e97c4e9ee3e6be883cc59dc666e"))
122 (define bootstrap-executable
123 (mlambda (program system)
124 "Return an origin for PROGRAM, a statically-linked bootstrap executable
126 (let ((system (if (string=? system "x86_64-linux")
129 (match (assoc-ref (assoc-ref %bootstrap-executables system)
135 (format #f (G_ "could not find bootstrap binary '~a' \
140 (method url-fetch/executable)
141 (uri (bootstrap-executable-url program system))
143 (sha256 sha256)))))))
147 ;;; Helper procedures.
150 (define (bootstrap-origin source)
151 "Return a variant of SOURCE, an <origin> instance, whose method uses
152 %BOOTSTRAP-GUILE to do its job."
154 (lambda* (url hash-algo hash
155 #:optional name #:key system)
156 (fetch url hash-algo hash name
157 #:guile %bootstrap-guile
160 (define %bootstrap-patch-inputs
161 ;; Packages used when an <origin> has a non-empty 'patches' field.
162 `(("tar" ,%bootstrap-coreutils&co)
163 ("xz" ,%bootstrap-coreutils&co)
164 ("bzip2" ,%bootstrap-coreutils&co)
165 ("gzip" ,%bootstrap-coreutils&co)
166 ("patch" ,%bootstrap-coreutils&co)))
168 (let ((orig-method (origin-method source)))
169 (origin (inherit source)
170 (method (cond ((eq? orig-method url-fetch)
173 (patch-guile %bootstrap-guile)
174 (patch-inputs %bootstrap-patch-inputs)
176 ;; Patches can be origins as well, so process them.
177 (patches (map (match-lambda
179 (bootstrap-origin patch))
181 (origin-patches source))))))
183 (define* (package-from-tarball name source program-to-test description
185 "Return a package that correspond to the extraction of SOURCE.
186 PROGRAM-TO-TEST is #f or a string: the program to run after extraction of
187 SOURCE to check whether everything is alright. If SNIPPET is provided, it is
188 evaluated after extracting SOURCE. SNIPPET should return true if successful,
189 or false to signal an error."
193 (build-system trivial-build-system)
195 `(#:guile ,%bootstrap-guile
196 #:modules ((guix build utils))
199 (use-modules (guix build utils))
201 (let ((out (assoc-ref %outputs "out"))
202 (tar (assoc-ref %build-inputs "tar"))
203 (xz (assoc-ref %build-inputs "xz"))
204 (tarball (assoc-ref %build-inputs "tarball")))
207 (copy-file tarball "binaries.tar.xz")
208 (invoke xz "-d" "binaries.tar.xz")
209 (let ((builddir (getcwd)))
210 (with-directory-excursion out
212 (string-append builddir "/binaries.tar"))
213 ,@(if snippet (list snippet) '())
214 (or (not ,program-to-test)
215 (invoke (string-append "bin/" ,program-to-test)
218 `(("tar" ,(bootstrap-executable "tar" (%current-system)))
219 ("xz" ,(bootstrap-executable "xz" (%current-system)))
220 ("tarball" ,(bootstrap-origin (source (%current-system))))))
222 (synopsis description)
223 (description description)
227 (define package-with-bootstrap-guile
229 "Return a variant of P such that all its origins are fetched with
231 (define rewritten-input
233 ((name (? origin? o))
234 `(,name ,(bootstrap-origin o)))
235 ((name (? package? p) sub-drvs ...)
236 `(,name ,(package-with-bootstrap-guile p) ,@sub-drvs))
240 (source (match (package-source p)
241 ((? origin? o) (bootstrap-origin o))
243 (inputs (map rewritten-input
245 (native-inputs (map rewritten-input
246 (package-native-inputs p)))
247 (propagated-inputs (map rewritten-input
248 (package-propagated-inputs p)))
249 (replacement (and=> (package-replacement p)
250 package-with-bootstrap-guile)))))
252 (define* (glibc-dynamic-linker
253 #:optional (system (or (and=> (%current-target-system)
254 gnu-triplet->nix-system)
256 "Return the name of Glibc's dynamic linker for SYSTEM."
257 ;; See the 'SYSDEP_KNOWN_INTERPRETER_NAMES' cpp macro in libc.
258 (cond ((string=? system "x86_64-linux") "/lib/ld-linux-x86-64.so.2")
259 ((string=? system "i686-linux") "/lib/ld-linux.so.2")
260 ((string=? system "armhf-linux") "/lib/ld-linux-armhf.so.3")
261 ((string=? system "mips64el-linux") "/lib/ld.so.1")
262 ((string=? system "i586-gnu") "/lib/ld.so.1")
263 ((string=? system "i686-gnu") "/lib/ld.so.1")
264 ((string=? system "aarch64-linux") "/lib/ld-linux-aarch64.so.1")
265 ((string=? system "powerpc-linux") "/lib/ld.so.1")
266 ((string=? system "powerpc64le-linux") "/lib/ld64.so.2")
267 ((string=? system "alpha-linux") "/lib/ld-linux.so.2")
268 ((string=? system "s390x-linux") "/lib/ld64.so.1")
269 ((string=? system "riscv64-linux") "/lib/ld-linux-riscv64-lp64d.so.1")
271 ;; XXX: This one is used bare-bones, without a libc, so add a case
272 ;; here just so we can keep going.
273 ((string=? system "arm-elf") "no-ld.so")
274 ((string=? system "arm-eabi") "no-ld.so")
275 ((string=? system "xtensa-elf") "no-ld.so")
276 ((string=? system "avr") "no-ld.so")
277 ((string=? system "propeller-elf") "no-ld.so")
278 ((string=? system "i686-mingw") "no-ld.so")
279 ((string=? system "vc4-elf") "no-ld.so")
281 (else (error "dynamic linker name not known for this system"
286 ;;; Bootstrap packages.
289 (define %bootstrap-base-urls
290 ;; This is where the initial binaries come from.
291 '("https://alpha.gnu.org/gnu/guix/bootstrap"
292 "http://alpha.gnu.org/gnu/guix/bootstrap"
293 "ftp://alpha.gnu.org/gnu/guix/bootstrap"
294 "http://www.fdn.fr/~lcourtes/software/guix/packages"
295 "http://flashner.co.il/guix/bootstrap"))
297 (define (bootstrap-guile-url-path system)
298 "Return the URI for FILE."
299 (string-append "/" system
302 "/20170217/guile-2.0.14.tar.xz")
304 "/20150101/guile-2.0.11.tar.xz")
306 "/20131110/guile-2.0.9.tar.xz"))))
308 (define (bootstrap-guile-hash system)
309 "Return the SHA256 hash of the Guile bootstrap tarball for SYSTEM."
312 (base32 "1w2p5zyrglzzniqgvyn1b55vprfzhgk8vzbzkkbdgl5248si0yq3"))
314 (base32 "0im800m30abgh7msh331pcbjvb4n02smz5cfzf1srv0kpx3csmxp"))
316 (base32 "0fzp93lvi0hn54acc0fpvhc7bvl0yc853k62l958cihk03q80ilr"))
318 (base32 "1mi3brl7l58aww34rawhvja84xc7l1b4hmwdmc36fp9q9mfx0lg5"))
320 (base32 "1giy2aprjmn5fp9c4s9r125fljw4wv6ixy5739i5bffw4jgr0f9r"))))
322 (define (bootstrap-guile-origin system)
323 "Return an <origin> object for the Guile tarball of SYSTEM."
326 (uri (map (cute string-append <> (bootstrap-guile-url-path system))
327 %bootstrap-base-urls))
328 (sha256 (bootstrap-guile-hash system))))
330 (define (download-bootstrap-guile store system)
331 "Return a derivation that downloads the bootstrap Guile tarball for SYSTEM."
332 (let* ((path (bootstrap-guile-url-path system))
333 (base (basename path))
334 (urls (map (cut string-append <> path) %bootstrap-base-urls)))
335 (run-with-store store
336 (url-fetch urls 'sha256 (bootstrap-guile-hash system)
339 (define* (raw-build store name inputs
340 #:key outputs system search-paths
342 (define (->store file)
343 (run-with-store store
344 (origin->derivation (bootstrap-executable file system)
347 (let* ((tar (->store "tar"))
349 (mkdir (->store "mkdir"))
350 (bash (->store "bash"))
351 (guile (download-bootstrap-guile store system))
352 ;; The following code, run by the bootstrap guile after it is
353 ;; unpacked, creates a wrapper for itself to set its load path.
354 ;; This replaces the previous non-portable method based on
355 ;; reading the /proc/self/exe symlink.
358 (use-modules (ice-9 match))
359 (match (command-line)
361 (let ((bin-dir (string-append out "/bin"))
362 (guile (string-append out "/bin/guile"))
363 (guile-real (string-append out "/bin/.guile-real"))
364 ;; We must avoid using a bare dollar sign in this code,
365 ;; because it would be interpreted by the shell.
366 (dollar (string (integer->char 36))))
367 (chmod bin-dir #o755)
368 (rename-file guile guile-real)
369 (call-with-output-file guile
373 export GUILE_SYSTEM_PATH=~a/share/guile/2.0
374 export GUILE_SYSTEM_COMPILED_PATH=~a/lib/guile/2.0/ccache
375 exec -a \"~a0\" ~a \"~a@\"\n"
376 bash out out dollar guile-real dollar)))
378 (chmod bin-dir #o555))))))
380 (add-text-to-store store
381 "build-bootstrap-guile.sh"
383 echo \"unpacking bootstrap Guile to '$out'...\"
386 ~a -dc < $GUILE_TARBALL | ~a xv
388 # Use the bootstrap guile to create its own wrapper to set the load path.
389 GUILE_SYSTEM_PATH=$out/share/guile/2.0 \
390 GUILE_SYSTEM_COMPILED_PATH=$out/lib/guile/2.0/ccache \
391 $out/bin/guile -c ~s $out ~a
394 $out/bin/guile --version~%"
395 (derivation->output-path mkdir)
396 (derivation->output-path xz)
397 (derivation->output-path tar)
398 (format #f "~s" make-guile-wrapper)
399 (derivation->output-path bash)))))
400 (derivation store name
401 (derivation->output-path bash) `(,builder)
403 #:inputs (map derivation-input
404 (list bash mkdir tar xz guile))
405 #:sources (list builder)
406 #:env-vars `(("GUILE_TARBALL"
407 . ,(derivation->output-path guile))))))
409 (define* (make-raw-bag name
410 #:key source inputs native-inputs outputs
415 (build-inputs inputs)
418 (define %bootstrap-guile
419 ;; The Guile used to run the build scripts of the initial derivations.
420 ;; It is just unpacked from a tarball containing a pre-built binary.
421 ;; This is typically built using %GUILE-BOOTSTRAP-TARBALL below.
423 ;; XXX: Would need libc's `libnss_files2.so' for proper `getaddrinfo'
424 ;; support (for /etc/services).
425 (let ((raw (build-system
427 (description "Raw build system with direct store access")
428 (lower make-raw-bag))))
430 (name "guile-bootstrap")
434 (synopsis "Bootstrap Guile")
435 (description "Pre-built Guile for bootstrapping purposes.")
439 (define %bootstrap-coreutils&co
440 (package-from-tarball "bootstrap-binaries"
444 (uri (map (cut string-append <> "/" system
447 "/20150101/static-binaries.tar.xz")
449 "/20170217/static-binaries.tar.xz")
451 "/20131110/static-binaries.tar.xz")))
452 %bootstrap-base-urls))
457 "0c533p9dhczzcsa1117gmfq3pc8w362g4mx84ik36srpr7cx2bg4"))
460 "0s5b3jb315n13m1k8095l0a5hfrsz8g0fv1b6riyc5hnxqyphlak"))
463 "0gf0fn2kbpxkjixkmx5f4z6hv6qpmgixl69zgg74dbsfdfj8jdv5"))
466 "18dfiq6c6xhsdpbidigw6480wh0vdgsxqq3xindq4lpdgqlccpfh"))
469 "072y4wyfsj1bs80r6vbybbafy8ya4vfy7qj25dklwk97m6g71753"))))))
470 "fgrep" ; the program to test
471 "Bootstrap binaries of Coreutils, Awk, etc."
473 '(let ((path (list (string-append (getcwd) "/bin"))))
475 (patch-shebang "bin/egrep" path)
476 (patch-shebang "bin/fgrep" path)
477 ;; Starting with grep@2.25 'egrep' and 'fgrep' are shell files
478 ;; that call 'grep'. If the bootstrap 'egrep' and 'fgrep'
479 ;; are not binaries then patch them to execute 'grep' via its
480 ;; absolute file name instead of searching for it in $PATH.
481 (if (not (elf-file? "bin/egrep"))
482 (substitute* '("bin/egrep" "bin/fgrep")
483 (("^exec grep") (string-append (getcwd) "/bin/grep"))))
484 (chmod "bin" #o555))))
486 (define-public %bootstrap-linux-libre-headers
487 (package-from-tarball
488 "linux-libre-headers-bootstrap"
492 (uri (map (cute string-append <>
493 "/i686-linux/20181020/"
494 "linux-libre-headers-stripped-4.14.67-i686-linux.tar.xz")
495 %bootstrap-base-urls))
498 "0sm2z9x4wk45bh6qfs94p0w1d6hsy6dqx9sw38qsqbvxwa1qzk8s"))))
499 #f ; no program to test
500 "Bootstrap linux-libre-headers"))
502 (define %bootstrap-binutils
503 (package-from-tarball "binutils-bootstrap"
507 (uri (map (cut string-append <> "/" system
510 "/20150101/binutils-2.25.tar.xz")
512 "/20170217/binutils-2.27.tar.xz")
514 "/20131110/binutils-2.23.2.tar.xz")))
515 %bootstrap-base-urls))
520 "1j5yivz7zkjqfsfmxzrrrffwyayjqyfxgpi89df0w4qziqs2dg20"))
523 "14jgwf9gscd7l2pnz610b1zia06dvcm2qyzvni31b8zpgmcai2v9"))
526 "1v7dj6bzn6m36f20gw31l99xaabq4xrhrx3gwqkhhig0mdlmr69q"))
529 "111s7ilfiby033rczc71797xrmaa3qlv179wdvsaq132pd51xv3n"))
532 "1x8kkhcxmfyzg1ddpz2pxs6fbdl6412r7x0nzbmi5n7mj8zw2gy7"))))))
533 "ld" ; the program to test
534 "Bootstrap binaries of the GNU Binutils"))
536 (define %bootstrap-glibc
539 (name "glibc-bootstrap")
542 (build-system trivial-build-system)
544 `(#:guile ,%bootstrap-guile
545 #:modules ((guix build utils))
548 (use-modules (guix build utils))
550 (let ((out (assoc-ref %outputs "out"))
551 (tar (assoc-ref %build-inputs "tar"))
552 (xz (assoc-ref %build-inputs "xz"))
553 (tarball (assoc-ref %build-inputs "tarball")))
556 (copy-file tarball "binaries.tar.xz")
557 (invoke xz "-d" "binaries.tar.xz")
558 (let ((builddir (getcwd)))
559 (with-directory-excursion out
561 (string-append builddir
565 ;; Patch libc.so so it refers to the right path.
566 (substitute* "lib/libc.so"
567 (("/[^ ]+/lib/(libc|ld)" _ prefix)
568 (string-append out "/lib/" prefix)))
572 `(("tar" ,(bootstrap-executable "tar" (%current-system)))
573 ("xz" ,(bootstrap-executable "xz" (%current-system)))
574 ("tarball" ,(bootstrap-origin
577 (uri (map (cut string-append <> "/" (%current-system)
578 (match (%current-system)
580 "/20150101/glibc-2.20.tar.xz")
582 "/20170217/glibc-2.25.tar.xz")
584 "/20131110/glibc-2.18.tar.xz")))
585 %bootstrap-base-urls))
587 (match (%current-system)
590 "0jlqrgavvnplj1b083s20jj9iddr4lzfvwybw5xrcis9spbfzk7v"))
593 "1hgrccw1zqdc7lvgivwa54d9l3zsim5pqm0dykxg0z522h6gr05w"))
596 "18cmgvpllqfpn6khsmivqib7ys8ymnq0hdzi3qp24prik0ykz8gn"))
599 "07nx3x8598i2924rjnlrncg6rm61c9bmcczbbcpbx0fb742nvv5c"))
602 "0k97a3whzx3apsi9n2cbsrr79ad6lh00klxph9hw4fqyp1abkdsg")))))))))
603 (synopsis "Bootstrap binaries and headers of the GNU C Library")
604 (description synopsis)
608 (define %bootstrap-gcc
609 ;; The initial GCC. Uses binaries from a tarball typically built by
610 ;; %GCC-BOOTSTRAP-TARBALL.
612 (name "gcc-bootstrap")
615 (build-system trivial-build-system)
617 `(#:guile ,%bootstrap-guile
618 #:modules ((guix build utils))
621 (use-modules (guix build utils)
624 (let ((out (assoc-ref %outputs "out"))
625 (tar (assoc-ref %build-inputs "tar"))
626 (xz (assoc-ref %build-inputs "xz"))
627 (bash (assoc-ref %build-inputs "bash"))
628 (libc (assoc-ref %build-inputs "libc"))
629 (tarball (assoc-ref %build-inputs "tarball")))
632 (copy-file tarball "binaries.tar.xz")
633 (invoke xz "-d" "binaries.tar.xz")
634 (let ((builddir (getcwd))
635 (bindir (string-append out "/bin")))
636 (with-directory-excursion out
638 (string-append builddir "/binaries.tar")))
640 (with-directory-excursion bindir
642 (rename-file "gcc" ".gcc-wrapped")
643 (call-with-output-file "gcc"
646 exec ~a/bin/.gcc-wrapped -B~a/lib \
647 -Wl,-rpath -Wl,~a/lib \
648 -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
651 ,(glibc-dynamic-linker))))
656 `(("tar" ,(bootstrap-executable "tar" (%current-system)))
657 ("xz" ,(bootstrap-executable "xz" (%current-system)))
658 ("bash" ,(bootstrap-executable "bash" (%current-system)))
659 ("libc" ,%bootstrap-glibc)
660 ("tarball" ,(bootstrap-origin
663 (uri (map (cut string-append <> "/" (%current-system)
664 (match (%current-system)
666 "/20150101/gcc-4.8.4.tar.xz")
668 "/20170217/gcc-5.4.0.tar.xz")
670 "/20131110/gcc-4.8.2.tar.xz")))
671 %bootstrap-base-urls))
673 (match (%current-system)
676 "17ga4m6195n4fnbzdkmik834znkhs53nkypp6557pl1ps7dgqbls"))
679 "150c1arrf2k8vfy6dpxh59vcgs4p1bgiz2av5m19dynpks7rjnyw"))
682 "0ghz825yzp43fxw53kd6afm8nkz16f7dxi9xi40bfwc8x3nbbr8v"))
685 "1ar3vdzyqbfm0z36kmvazvfswxhcihlacl2dzdjgiq25cqnq9ih1"))
688 "1m5miqkyng45l745n0sfafdpjkqv9225xf44jqkygwsipj2cv9ks")))))))))
690 (list (search-path-specification
692 (files '("include")))
693 (search-path-specification
694 (variable "LIBRARY_PATH")
695 (files '("lib" "lib64")))))
696 (synopsis "Bootstrap binaries of the GNU Compiler Collection")
697 (description synopsis)
701 (define %bootstrap-mescc-tools
702 ;; The initial MesCC tools. Uses binaries from a tarball typically built by
703 ;; %MESCC-TOOLS-BOOTSTRAP-TARBALL.
705 (name "bootstrap-mescc-tools")
708 (build-system trivial-build-system)
710 `(#:guile ,%bootstrap-guile
711 #:modules ((guix build utils))
714 (use-modules (guix build utils)
716 (let ((out (assoc-ref %outputs "out"))
717 (tar (assoc-ref %build-inputs "tar"))
718 (xz (assoc-ref %build-inputs "xz"))
719 (tarball (assoc-ref %build-inputs "tarball")))
722 (copy-file tarball "binaries.tar.xz")
723 (invoke xz "-d" "binaries.tar.xz")
724 (let ((builddir (getcwd))
725 (bindir (string-append out "/bin")))
726 (with-directory-excursion out
728 (string-append builddir "/binaries.tar"))))))))
730 `(("tar" ,(bootstrap-executable "tar" (%current-system)))
731 ("xz" ,(bootstrap-executable "xz" (%current-system)))
737 (cute string-append <>
738 "/i686-linux/20181020/"
739 "mescc-tools-static-0.5.2-0.bb062b0-i686-linux.tar.xz")
740 %bootstrap-base-urls))
743 "11lniw0vg61kmyhvnwkmcnkci9ym6hbmiksiqggd0hkipbq7hvlz")))))))
744 (synopsis "Bootstrap binaries of MesCC Tools")
745 (description synopsis)
747 (supported-systems '("i686-linux" "x86_64-linux"))
750 (define %bootstrap-mes
751 ;; The initial Mes. Uses binaries from a tarball typically built by
752 ;; %MES-BOOTSTRAP-TARBALL.
754 (name "bootstrap-mes")
757 (build-system trivial-build-system)
759 `(#:guile ,%bootstrap-guile
760 #:modules ((guix build utils))
763 (use-modules (guix build utils)
765 (let ((out (assoc-ref %outputs "out"))
766 (tar (assoc-ref %build-inputs "tar"))
767 (xz (assoc-ref %build-inputs "xz"))
768 (tarball (assoc-ref %build-inputs "tarball")))
771 (copy-file tarball "binaries.tar.xz")
772 (invoke xz "-d" "binaries.tar.xz")
773 (let ((builddir (getcwd))
774 (bindir (string-append out "/bin")))
775 (with-directory-excursion out
777 (string-append builddir "/binaries.tar"))))))))
779 `(("tar" ,(bootstrap-executable "tar" (%current-system)))
780 ("xz" ,(bootstrap-executable "xz" (%current-system)))
786 (cute string-append <>
787 "/i686-linux/20181020/"
788 "mes-minimal-stripped-0.19-i686-linux.tar.xz")
789 %bootstrap-base-urls))
792 "0k7kkl68a6xaadv47ij0nr9jm5ca1ffj38n7f2lg80y72wdkwr9h")))))))
793 (supported-systems '("i686-linux" "x86_64-linux"))
794 (synopsis "Bootstrap binaries of Mes")
795 (description synopsis)
799 (define (%bootstrap-inputs)
800 ;; The initial, pre-built inputs. From now on, we can start building our
802 `(,@(match (%current-system)
803 ((or "i686-linux" "x86_64-linux")
804 `(("linux-libre-headers" ,%bootstrap-linux-libre-headers)
805 ("bootstrap-mescc-tools" ,%bootstrap-mescc-tools)
806 ("mes" ,%bootstrap-mes)))
808 `(("libc" ,%bootstrap-glibc)
809 ("gcc" ,%bootstrap-gcc)
810 ("binutils" ,%bootstrap-binutils))))
811 ("coreutils&co" ,%bootstrap-coreutils&co)
813 ;; In gnu-build-system.scm, we rely on the availability of Bash.
814 ("bash" ,%bootstrap-coreutils&co)))
816 (define %bootstrap-inputs-for-tests
817 ;; These are bootstrap inputs that are cheap to produce (no compilation
818 ;; needed) and that are meant to be used for testing. (These are those we
819 ;; used before the Mes-based reduced bootstrap.)
820 `(("libc" ,%bootstrap-glibc)
821 ("gcc" ,%bootstrap-gcc)
822 ("binutils" ,%bootstrap-binutils)
823 ("coreutils&co" ,%bootstrap-coreutils&co)
824 ("bash" ,%bootstrap-coreutils&co)))
826 ;;; bootstrap.scm ends here