download: Add 'url-fetch/executable'.
[jackhill/guix/guix.git] / gnu / packages / bootstrap.scm
index 82d2295..50786d9 100644 (file)
             %bootstrap-gcc
             %bootstrap-glibc
             %bootstrap-inputs
-            %mescc-tools-seed
-            %mes-seed
-            %srfi-43
-            %tinycc-seed))
+            %bootstrap-mescc-tools
+            %bootstrap-mes))
 
 ;;; Commentary:
 ;;;
@@ -115,23 +113,25 @@ or false to signal an error."
      `(#:guile ,%bootstrap-guile
        #:modules ((guix build utils))
        #:builder
-       (let ((out     (assoc-ref %outputs "out"))
-             (tar     (assoc-ref %build-inputs "tar"))
-             (xz      (assoc-ref %build-inputs "xz"))
-             (tarball (assoc-ref %build-inputs "tarball")))
+       (begin
          (use-modules (guix build utils))
 
-         (mkdir out)
-         (copy-file tarball "binaries.tar.xz")
-         (invoke xz "-d" "binaries.tar.xz")
-         (let ((builddir (getcwd)))
-           (with-directory-excursion out
-             (invoke tar "xvf"
-                     (string-append builddir "/binaries.tar"))
-             ,@(if snippet (list snippet) '())
-             (or (not ,program-to-test)
-                 (invoke (string-append "bin/" ,program-to-test)
-                         "--version")))))))
+         (let ((out     (assoc-ref %outputs "out"))
+              (tar     (assoc-ref %build-inputs "tar"))
+              (xz      (assoc-ref %build-inputs "xz"))
+              (tarball (assoc-ref %build-inputs "tarball")))
+
+          (mkdir out)
+          (copy-file tarball "binaries.tar.xz")
+          (invoke xz "-d" "binaries.tar.xz")
+          (let ((builddir (getcwd)))
+            (with-directory-excursion out
+              (invoke tar "xvf"
+                      (string-append builddir "/binaries.tar"))
+              ,@(if snippet (list snippet) '())
+              (or (not ,program-to-test)
+                  (invoke (string-append "bin/" ,program-to-test)
+                          "--version"))))))))
     (inputs
      `(("tar" ,(search-bootstrap-binary "tar" (%current-system)))
        ("xz"  ,(search-bootstrap-binary "xz" (%current-system)))
@@ -184,9 +184,11 @@ or false to signal an error."
         ((string=? system "powerpc64le-linux") "/lib/ld64.so.2")
         ((string=? system "alpha-linux") "/lib/ld-linux.so.2")
         ((string=? system "s390x-linux") "/lib/ld64.so.1")
+        ((string=? system "riscv64-linux") "/lib/ld-linux-riscv64-lp64d.so.1")
 
         ;; XXX: This one is used bare-bones, without a libc, so add a case
         ;; here just so we can keep going.
+        ((string=? system "arm-elf") "no-ld.so")
         ((string=? system "arm-eabi") "no-ld.so")
         ((string=? system "xtensa-elf") "no-ld.so")
         ((string=? system "avr") "no-ld.so")
@@ -404,14 +406,13 @@ $out/bin/guile --version~%"
    (lambda (system)
      (origin
        (method url-fetch)
-       (uri (match system
-              ((or "i686-linux"
-                   "x86_64-linux")
-               "http://lilypond.org/janneke/mes/linux-libre-headers-stripped-4.14.26-i686-linux.tar.xz")
-              (_ (error "linux-libre-headers-bootstrap: system not supported"))))
+       (uri (map (cute string-append <>
+                       "/i686-linux/20181020/"
+                       "linux-libre-headers-stripped-4.14.67-i686-linux.tar.xz")
+                 %bootstrap-base-urls))
        (sha256
         (base32
-         "0nwspwydn089xbd28nnas762iwl6l9ymbcz170qvfi50ywgim1ma"))))
+         "0sm2z9x4wk45bh6qfs94p0w1d6hsy6dqx9sw38qsqbvxwa1qzk8s"))))
    #f                                   ; no program to test
    "Bootstrap linux-libre-headers"))
 
@@ -460,28 +461,30 @@ $out/bin/guile --version~%"
      `(#:guile ,%bootstrap-guile
        #:modules ((guix build utils))
        #:builder
-       (let ((out     (assoc-ref %outputs "out"))
-             (tar     (assoc-ref %build-inputs "tar"))
-             (xz      (assoc-ref %build-inputs "xz"))
-             (tarball (assoc-ref %build-inputs "tarball")))
+       (begin
          (use-modules (guix build utils))
 
-         (mkdir out)
-         (copy-file tarball "binaries.tar.xz")
-         (invoke xz "-d" "binaries.tar.xz")
-         (let ((builddir (getcwd)))
-           (with-directory-excursion out
-             (invoke tar "xvf"
-                     (string-append builddir
-                                    "/binaries.tar"))
-             (chmod "lib" #o755)
-
-             ;; Patch libc.so so it refers to the right path.
-             (substitute* "lib/libc.so"
-               (("/[^ ]+/lib/(libc|ld)" _ prefix)
-                (string-append out "/lib/" prefix)))
-
-             #t)))))
+         (let ((out     (assoc-ref %outputs "out"))
+              (tar     (assoc-ref %build-inputs "tar"))
+              (xz      (assoc-ref %build-inputs "xz"))
+              (tarball (assoc-ref %build-inputs "tarball")))
+
+          (mkdir out)
+          (copy-file tarball "binaries.tar.xz")
+          (invoke xz "-d" "binaries.tar.xz")
+          (let ((builddir (getcwd)))
+            (with-directory-excursion out
+              (invoke tar "xvf"
+                      (string-append builddir
+                                     "/binaries.tar"))
+              (chmod "lib" #o755)
+
+              ;; Patch libc.so so it refers to the right path.
+              (substitute* "lib/libc.so"
+                (("/[^ ]+/lib/(libc|ld)" _ prefix)
+                 (string-append out "/lib/" prefix)))
+
+              #t))))))
     (inputs
      `(("tar" ,(search-bootstrap-binary "tar" (%current-system)))
        ("xz"  ,(search-bootstrap-binary "xz" (%current-system)))
@@ -531,39 +534,41 @@ $out/bin/guile --version~%"
      `(#:guile ,%bootstrap-guile
        #:modules ((guix build utils))
        #:builder
-       (let ((out     (assoc-ref %outputs "out"))
-             (tar     (assoc-ref %build-inputs "tar"))
-             (xz      (assoc-ref %build-inputs "xz"))
-             (bash    (assoc-ref %build-inputs "bash"))
-             (libc    (assoc-ref %build-inputs "libc"))
-             (tarball (assoc-ref %build-inputs "tarball")))
+       (begin
          (use-modules (guix build utils)
                       (ice-9 popen))
 
-         (mkdir out)
-         (copy-file tarball "binaries.tar.xz")
-         (invoke xz "-d" "binaries.tar.xz")
-         (let ((builddir (getcwd))
-               (bindir   (string-append out "/bin")))
-           (with-directory-excursion out
-             (invoke tar "xvf"
-                     (string-append builddir "/binaries.tar")))
-
-           (with-directory-excursion bindir
-             (chmod "." #o755)
-             (rename-file "gcc" ".gcc-wrapped")
-             (call-with-output-file "gcc"
-               (lambda (p)
-                 (format p "#!~a
+         (let ((out     (assoc-ref %outputs "out"))
+               (tar     (assoc-ref %build-inputs "tar"))
+               (xz      (assoc-ref %build-inputs "xz"))
+               (bash    (assoc-ref %build-inputs "bash"))
+               (libc    (assoc-ref %build-inputs "libc"))
+               (tarball (assoc-ref %build-inputs "tarball")))
+
+           (mkdir out)
+           (copy-file tarball "binaries.tar.xz")
+           (invoke xz "-d" "binaries.tar.xz")
+           (let ((builddir (getcwd))
+                 (bindir   (string-append out "/bin")))
+             (with-directory-excursion out
+               (invoke tar "xvf"
+                       (string-append builddir "/binaries.tar")))
+
+             (with-directory-excursion bindir
+               (chmod "." #o755)
+               (rename-file "gcc" ".gcc-wrapped")
+               (call-with-output-file "gcc"
+                 (lambda (p)
+                   (format p "#!~a
 exec ~a/bin/.gcc-wrapped -B~a/lib \
      -Wl,-rpath -Wl,~a/lib \
      -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
-                         bash
-                         out libc libc libc
-                         ,(glibc-dynamic-linker))))
+                           bash
+                           out libc libc libc
+                           ,(glibc-dynamic-linker))))
 
-             (chmod "gcc" #o555)
-             #t)))))
+               (chmod "gcc" #o555)
+               #t))))))
     (inputs
      `(("tar" ,(search-bootstrap-binary "tar" (%current-system)))
        ("xz"  ,(search-bootstrap-binary "xz" (%current-system)))
@@ -571,33 +576,33 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \
        ("libc" ,%bootstrap-glibc)
        ("tarball" ,(bootstrap-origin
                     (origin
-                     (method url-fetch)
-                     (uri (map (cut string-append <> "/" (%current-system)
-                                    (match (%current-system)
-                                      ("armhf-linux"
-                                       "/20150101/gcc-4.8.4.tar.xz")
-                                      ("aarch64-linux"
-                                       "/20170217/gcc-5.4.0.tar.xz")
-                                      (_
-                                       "/20131110/gcc-4.8.2.tar.xz")))
-                               %bootstrap-base-urls))
-                     (sha256
-                      (match (%current-system)
-                        ("x86_64-linux"
-                         (base32
-                          "17ga4m6195n4fnbzdkmik834znkhs53nkypp6557pl1ps7dgqbls"))
-                        ("i686-linux"
-                         (base32
-                          "150c1arrf2k8vfy6dpxh59vcgs4p1bgiz2av5m19dynpks7rjnyw"))
-                        ("armhf-linux"
-                         (base32
-                          "0ghz825yzp43fxw53kd6afm8nkz16f7dxi9xi40bfwc8x3nbbr8v"))
-                        ("aarch64-linux"
-                         (base32
-                          "1ar3vdzyqbfm0z36kmvazvfswxhcihlacl2dzdjgiq25cqnq9ih1"))
-                        ("mips64el-linux"
-                         (base32
-                          "1m5miqkyng45l745n0sfafdpjkqv9225xf44jqkygwsipj2cv9ks")))))))))
+                      (method url-fetch)
+                      (uri (map (cut string-append <> "/" (%current-system)
+                                     (match (%current-system)
+                                       ("armhf-linux"
+                                        "/20150101/gcc-4.8.4.tar.xz")
+                                       ("aarch64-linux"
+                                        "/20170217/gcc-5.4.0.tar.xz")
+                                       (_
+                                        "/20131110/gcc-4.8.2.tar.xz")))
+                                %bootstrap-base-urls))
+                      (sha256
+                       (match (%current-system)
+                         ("x86_64-linux"
+                          (base32
+                           "17ga4m6195n4fnbzdkmik834znkhs53nkypp6557pl1ps7dgqbls"))
+                         ("i686-linux"
+                          (base32
+                           "150c1arrf2k8vfy6dpxh59vcgs4p1bgiz2av5m19dynpks7rjnyw"))
+                         ("armhf-linux"
+                          (base32
+                           "0ghz825yzp43fxw53kd6afm8nkz16f7dxi9xi40bfwc8x3nbbr8v"))
+                         ("aarch64-linux"
+                          (base32
+                           "1ar3vdzyqbfm0z36kmvazvfswxhcihlacl2dzdjgiq25cqnq9ih1"))
+                         ("mips64el-linux"
+                          (base32
+                           "1m5miqkyng45l745n0sfafdpjkqv9225xf44jqkygwsipj2cv9ks")))))))))
     (native-search-paths
      (list (search-path-specification
             (variable "CPATH")
@@ -610,47 +615,103 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \
     (home-page #f)
     (license gpl3+)))
 
-(define %mescc-tools-seed ; todo: add tarballs to alpha.gnu.org/pub/mes/bootstrap/
-  (let ((commit "dc4e20e74924a5c80a2b7a77b4d7b927234fa71c"))
-    (origin
-      (method url-fetch)
-      (uri (string-append "https://gitlab.com/janneke/mescc-tools-seed"
-                          "/-/archive/" commit
-                          "/mescc-tools-seed-" commit ".tar.gz"))
-      (sha256
-       (base32
-        "1lj7df73vxanmffmiwkhcn83r7yd9n8568nkki06bqq5zg526nyz")))))
-
-(define %mes-seed
-  (let ((commit "057fd36735b5605fe582d6b3625f793a62922206"))
-    (origin
-      (method url-fetch)
-      (uri (string-append "https://gitlab.com/janneke/mes-seed"
-                          "/-/archive/" commit
-                          "/mes-seed-" commit ".tar.gz"))
-      (sha256
-       (base32
-        "0vdb4kc05a1kdpmsi8dg425d5f33kp28sgl2fi3s320pc0v4dv13")))))
-
-(define %tinycc-seed
-  (let ((commit "843d47ca682617f21333b50c67851797b8c3fd04"))
-    (origin
-      (method url-fetch)
-      (uri (string-append "https://gitlab.com/janneke/tinycc-seed"
-                          "/-/archive/" commit
-                          "/tinycc-seed-" commit ".tar.gz"))
-      (sha256
-       (base32
-        "0599wwv30js03l1rpmvzfclq3jadzvq04pi29j45nf6fyfg5hhqb")))))
-
-(define %srfi-43
-  (origin
-    (method url-fetch)
-    (uri "http://git.savannah.gnu.org/cgit/guile.git/plain/module/srfi/srfi-43.scm?h=stable-2.0")
-    (file-name "srfi-43.scm")
-    (sha256
-     (base32
-      "0rnkppwdkxbzkgp9s9ccmby9f7p3ijxjlmvj0pzqxwmrmpy7jwmb"))))
+(define %bootstrap-mescc-tools
+  ;; The initial MesCC tools.  Uses binaries from a tarball typically built by
+  ;; %MESCC-TOOLS-BOOTSTRAP-TARBALL.
+  (package
+    (name "bootstrap-mescc-tools")
+    (version "0.5.2")
+    (source #f)
+    (build-system trivial-build-system)
+    (arguments
+     `(#:guile ,%bootstrap-guile
+       #:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils)
+                      (ice-9 popen))
+         (let ((out     (assoc-ref %outputs "out"))
+               (tar     (assoc-ref %build-inputs "tar"))
+               (xz      (assoc-ref %build-inputs "xz"))
+               (tarball (assoc-ref %build-inputs "tarball")))
+
+           (mkdir out)
+           (copy-file tarball "binaries.tar.xz")
+           (invoke xz "-d" "binaries.tar.xz")
+           (let ((builddir (getcwd))
+                 (bindir   (string-append out "/bin")))
+             (with-directory-excursion out
+               (invoke tar "xvf"
+                       (string-append builddir "/binaries.tar"))))))))
+    (inputs
+     `(("tar" ,(search-bootstrap-binary "tar" (%current-system)))
+       ("xz"  ,(search-bootstrap-binary "xz" (%current-system)))
+       ("tarball"
+        ,(bootstrap-origin
+          (origin
+            (method url-fetch)
+            (uri (map
+                  (cute string-append <>
+                        "/i686-linux/20181020/"
+                        "mescc-tools-static-0.5.2-0.bb062b0-i686-linux.tar.xz")
+                  %bootstrap-base-urls))
+            (sha256
+             (base32
+              "11lniw0vg61kmyhvnwkmcnkci9ym6hbmiksiqggd0hkipbq7hvlz")))))))
+    (synopsis "Bootstrap binaries of MesCC Tools")
+    (description synopsis)
+    (home-page #f)
+    (supported-systems '("i686-linux" "x86_64-linux"))
+    (license gpl3+)))
+
+(define %bootstrap-mes
+  ;; The initial Mes.  Uses binaries from a tarball typically built by
+  ;; %MES-BOOTSTRAP-TARBALL.
+  (package
+    (name "bootstrap-mes")
+    (version "0")
+    (source #f)
+    (build-system trivial-build-system)
+    (arguments
+     `(#:guile ,%bootstrap-guile
+       #:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils)
+                      (ice-9 popen))
+         (let ((out     (assoc-ref %outputs "out"))
+               (tar     (assoc-ref %build-inputs "tar"))
+               (xz      (assoc-ref %build-inputs "xz"))
+               (tarball (assoc-ref %build-inputs "tarball")))
+
+           (mkdir out)
+           (copy-file tarball "binaries.tar.xz")
+           (invoke xz "-d" "binaries.tar.xz")
+           (let ((builddir (getcwd))
+                 (bindir   (string-append out "/bin")))
+             (with-directory-excursion out
+               (invoke tar "xvf"
+                       (string-append builddir "/binaries.tar"))))))))
+    (inputs
+     `(("tar" ,(search-bootstrap-binary "tar" (%current-system)))
+       ("xz"  ,(search-bootstrap-binary "xz" (%current-system)))
+       ("tarball"
+        ,(bootstrap-origin
+          (origin
+            (method url-fetch)
+            (uri (map
+                  (cute string-append <>
+                        "/i686-linux/20181020/"
+                        "mes-minimal-stripped-0.19-i686-linux.tar.xz")
+                  %bootstrap-base-urls))
+            (sha256
+             (base32
+              "0k7kkl68a6xaadv47ij0nr9jm5ca1ffj38n7f2lg80y72wdkwr9h")))))))
+    (supported-systems '("i686-linux" "x86_64-linux"))
+    (synopsis "Bootstrap binaries of Mes")
+    (description synopsis)
+    (home-page #f)
+    (license gpl3+)))
 
 (define (%bootstrap-inputs)
   ;; The initial, pre-built inputs.  From now on, we can start building our
@@ -658,10 +719,8 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \
   `(,@(match (%current-system)
         ((or "i686-linux" "x86_64-linux")
          `(("linux-libre-headers" ,%bootstrap-linux-libre-headers)
-           ("mescc-tools-seed" ,%mescc-tools-seed)
-           ("mes-seed" ,%mes-seed)
-           ("srfi-43" ,%srfi-43 )
-           ("tinycc-seed" ,%tinycc-seed)))
+           ("bootstrap-mescc-tools" ,%bootstrap-mescc-tools)
+           ("mes" ,%bootstrap-mes)))
         (_
          `(("libc" ,%bootstrap-glibc)
            ("gcc" ,%bootstrap-gcc)