unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
To: 55227@debbugs.gnu.org
Subject: [bug#55227] [PATCH core-updates v3 2/8] gnu: commencement: Add stage0-posix.
Date: Fri, 13 May 2022 17:36:25 +0200	[thread overview]
Message-ID: <20220513153631.13052-2-janneke@gnu.org> (raw)
In-Reply-To: <20220513153631.13052-1-janneke@gnu.org>

Stage0-posix is a skeleton for bootstrapping all of Stage0 for POSIX systems.
On x86-linux, from the 357-byte hex0-seed binary from the bootstrap-seeds, it
builds hex0, kaem, hex1, catm, hex2, M0, cc_x86, M1, M2,
get_machine, (mescc-tools), and M2-Planet.

* gnu/packages/commencement.scm (stage0-posix): New variable.
---
 gnu/packages/commencement.scm | 117 ++++++++++++++++++++++++++++++++++
 1 file changed, 117 insertions(+)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index ebb4ea98f1..cf3b356543 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -306,6 +306,123 @@ (define bootstrap-seeds
 hex1, hex2, M1, and M2-Planet.")
     (license license:gpl3+)))
 
+(define stage0-posix
+  ;; The initial bootstrap package: no binary inputs except those from
+  ;; `bootstrap-seeds, for x86 a 357 byte binary seed: `x86/hex0-seed'.
+  (let* ((mescc-tools-version "1.4.0")
+         (m2-planet-version "1.9.0")
+         (mescc-tools
+          (origin
+            (method url-fetch)
+            (uri (list
+                  (string-append
+                   "mirror://gnu/guix/mirror/"
+                   "mescc-tools-" mescc-tools-version ".tar.gz")
+                  (string-append
+                   "https://lilypond.org/janneke/guix/20220502/"
+                   "mescc-tools-" mescc-tools-version ".tar.gz")))
+            (sha256
+             (base32
+              "1xi6f48pf5bhajhfis189gpizxij7nbp1vzvsb1aafhz4skkiqvg"))))
+         (m2-planet
+          (origin
+            (method url-fetch)
+            (uri (list
+                  (string-append
+                   "mirror://gnu/guix/mirror/"
+                   "M2-Planet-" m2-planet-version ".tar.gz")
+                  (string-append
+                   "https://lilypond.org/janneke/guix/20220502/"
+                   "M2-Planet-" m2-planet-version ".tar.gz")))
+            (sha256
+             (base32
+              "1xrn69sc5nz4hwaishqyrcidp1ncxwib9zswl45x378ddz3mmk7g")))))
+    (package
+      (name "stage0-posix")
+      (version "1.4")
+      (source (origin
+                (method url-fetch)
+                (uri (list
+                      (string-append "mirror://gnu/guix/mirror/"
+                                     "stage0-posix-" version ".tar.gz")
+                      (string-append
+                       "https://lilypond.org/janneke/guix/20220502/"
+                       "stage0-posix-" version ".tar.gz")))
+                (sha256
+                 (base32
+                  "1ammifkj33205qrpfm84yb1c99lwgbn4jsl1hd08aab8c9ffz6p4"))))
+      (supported-systems '("i686-linux" "x86_64-linux"
+                           "armhf-linux" "aarch64-linux"
+                           "riscv64-linux"))
+      (native-inputs
+       `(("bootstrap-seeds" ,bootstrap-seeds)
+         ,@(%boot-gash-inputs)))
+      (build-system trivial-build-system)
+      (arguments
+       (list
+        #:guile %bootstrap-guile
+        #:modules '((guix build utils))
+        #:builder
+        #~(begin
+            (use-modules (guix build utils))
+            (let* ((bootstrap-seeds (assoc-ref %build-inputs "bootstrap-seeds"))
+                   (source (assoc-ref %build-inputs "source"))
+                   (tar (assoc-ref %build-inputs "bootar"))
+                   (bash (assoc-ref %build-inputs "bash"))
+                   (coreutils (assoc-ref %build-inputs "coreutils"))
+                   (guile (assoc-ref %build-inputs "guile"))
+                   (out (assoc-ref %outputs "out"))
+                   (bindir (string-append out "/bin"))
+                   (target (or #$(%current-target-system)
+                               #$(%current-system)))
+                   (stage0-cpu
+                    (cond
+                     ((or #$(target-x86-64?) #$(target-x86-32?))
+                      "x86")
+                     (#$(target-arm?)
+                      "armv7l")
+                     (else
+                      (error "stage0-posix: system not supported" target))))
+                   (kaem (string-append "../bootstrap-seeds/POSIX/"
+                                        stage0-cpu "/kaem-optional-seed")))
+              (setenv "PATH" (string-append tar "/bin:"
+                                            coreutils "/bin:"
+                                            bash "/bin"))
+              (invoke "tar" "xvf" source)
+              (chdir (string-append "stage0-posix-" #$version))
+              (copy-recursively bootstrap-seeds "bootstrap-seeds")
+              (invoke "tar" "xvf" #$mescc-tools)
+              (rmdir "mescc-tools")
+              (symlink (string-append "mescc-tools-" #$mescc-tools-version)
+                       "mescc-tools")
+              (invoke "tar" "xvf" #$m2-planet)
+              (rmdir "M2-Planet")
+              (symlink (string-append "M2-Planet-" #$m2-planet-version)
+                       "M2-Planet")
+              (rmdir "M2libc")
+              (symlink "M2-Planet/M2libc" "M2libc")
+              (mkdir-p bindir)
+              (with-directory-excursion stage0-cpu
+                (with-output-to-file "mes-m2.kaem"
+                  (lambda _ (display "")))
+                (with-output-to-file "mescc-tools-extra.kaem"
+                  (lambda _ (display "")))
+                (invoke kaem "kaem.run"))
+              (with-directory-excursion "bin"
+                (install-file "hex2" bindir)
+                (install-file "M1" bindir)
+                (install-file "blood-elf" bindir)
+                (install-file "kaem" bindir)
+                (install-file "get_machine" bindir)
+                (install-file "M2-Planet" bindir))))))
+      (home-page "https://github.com/oriansj/stage0-posix/")
+      (synopsis "The initial bootstrap package, builds stage0 up to M2-Planet")
+      (description "Starting from the 357-byte hex0-seed binary provided by
+the bootstrap-seeds, the stage0-posix package first builds hex0 and then all
+the way up: hex1, catm, hex2, M0, cc_x86, M1, M2, get_machine (that's all of
+MesCC-Tools), and finally M2-Planet.")
+      (license license:gpl3+))))
+
 (define %bootstrap-mes-rewired
   (package
     (inherit mes)
-- 
2.35.1





  reply	other threads:[~2022-05-13 15:41 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-02 18:21 [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Jan (janneke) Nieuwenhuizen
2022-05-02 18:24 ` [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 2/8] commencement: Add stage0-posix Jan (janneke) Nieuwenhuizen
2022-05-09  3:49     ` Thiago Jung Bauermann via Guix-patches via
2022-05-09  8:14       ` Jan Nieuwenhuizen
2022-05-12 10:45         ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 3/8] commencement: mes-boot: Update to 0.24, build with M2-Planet Jan (janneke) Nieuwenhuizen
2022-05-12 10:46     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 4/8] commencement: tcc-boot0: Use NYACC-1.00.2 Jan (janneke) Nieuwenhuizen
2022-05-12 10:47     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 5/8] commencement: tcc-boot0: Update to 0.9.26-1136-g0fbeb2dd Jan (janneke) Nieuwenhuizen
2022-05-12 10:50     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 6/8] bootstrap: Remove %bootstrap-mescc-tools, %bootstrap-mes Jan (janneke) Nieuwenhuizen
2022-05-12 10:50     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 7/8] commencement: Remove %bootstrap-mes-rewired Jan (janneke) Nieuwenhuizen
2022-05-12 10:50     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
2022-05-02 18:24   ` [bug#55227] [PATCH core-updates 8/8] doc: Add the "Full Source Bootstrap" Jan (janneke) Nieuwenhuizen
2022-05-12 11:03     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
2022-05-12 10:38   ` Ludovic Courtès
2022-05-13  8:08     ` Jan Nieuwenhuizen
2022-05-22  4:42   ` [bug#55227] [PATCH core-updates 1/8] commencement: Add bootstrap-seeds Maxim Cournoyer
2022-05-22  6:05     ` Jan Nieuwenhuizen
2022-05-12 11:09 ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
2022-05-13  8:07   ` Jan Nieuwenhuizen
2022-05-13  8:09 ` Jan Nieuwenhuizen
2022-05-13  8:09 ` Jan Nieuwenhuizen
2022-05-13  8:09 ` Jan Nieuwenhuizen
2022-05-13  8:09 ` Jan Nieuwenhuizen
2022-05-13 13:56   ` Ludovic Courtès
2022-05-13 15:39     ` Jan Nieuwenhuizen
2022-05-13  8:10 ` Jan Nieuwenhuizen
2022-05-13 15:36 ` [bug#55227] [PATCH core-updates v3 1/8] gnu: commencement: Add bootstrap-seeds Jan (janneke) Nieuwenhuizen
2022-05-13 15:36   ` Jan (janneke) Nieuwenhuizen [this message]
2022-05-14 14:09     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
2022-05-15  6:31       ` Jan Nieuwenhuizen
2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 3/8] gnu: commencement: mes-boot: Update to 0.24, build with M2-Planet Jan (janneke) Nieuwenhuizen
2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 4/8] gnu: commencement: tcc-boot0: Use nyacc-1.00.2 Jan (janneke) Nieuwenhuizen
2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 5/8] gnu: commencement: tcc-boot0: Update to 0.9.26-1136-g0fbeb2dd Jan (janneke) Nieuwenhuizen
2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 6/8] gnu: bootstrap: Remove %bootstrap-mescc-tools, %bootstrap-mes Jan (janneke) Nieuwenhuizen
2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 7/8] gnu: commencement: Remove %bootstrap-mes-rewired Jan (janneke) Nieuwenhuizen
2022-05-13 15:36   ` [bug#55227] [PATCH core-updates v3 8/8] doc: Add the "Full-source Bootstrap" Jan (janneke) Nieuwenhuizen
2022-05-14 14:10     ` [bug#55227] [PATCH core-updates 0/8] The Full Source Bootstrap Ludovic Courtès
2022-05-14 20:36       ` Jan Nieuwenhuizen
2022-05-14 14:11   ` Ludovic Courtès
2022-05-14 20:38     ` Jan Nieuwenhuizen
2022-05-16  4:58 ` Maxim Cournoyer
2022-05-16  5:17   ` Jan Nieuwenhuizen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220513153631.13052-2-janneke@gnu.org \
    --to=janneke@gnu.org \
    --cc=55227@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).