From patchwork Mon May 2 18:24:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janneke Nieuwenhuizen X-Patchwork-Id: 39068 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9115B27BBE9; Mon, 2 May 2022 19:25:23 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id BFDDB27BBEB for ; Mon, 2 May 2022 19:25:22 +0100 (BST) Received: from localhost ([::1]:46832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nlajZ-00054T-Tl for patchwork@mira.cbaines.net; Mon, 02 May 2022 14:25:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlajJ-00051H-9H for guix-patches@gnu.org; Mon, 02 May 2022 14:25:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44092) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nlajG-00011S-MW for guix-patches@gnu.org; Mon, 02 May 2022 14:25:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nlajG-0003FV-JU for guix-patches@gnu.org; Mon, 02 May 2022 14:25:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55227] [PATCH core-updates 2/8] commencement: Add stage0-posix. Resent-From: "Jan (janneke) Nieuwenhuizen" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 02 May 2022 18:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55227 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55227@debbugs.gnu.org Received: via spool by 55227-submit@debbugs.gnu.org id=B55227.165151589012404 (code B ref 55227); Mon, 02 May 2022 18:25:02 +0000 Received: (at 55227) by debbugs.gnu.org; 2 May 2022 18:24:50 +0000 Received: from localhost ([127.0.0.1]:37976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlaj2-0003DZ-V0 for submit@debbugs.gnu.org; Mon, 02 May 2022 14:24:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlaiv-0003Cs-NV for 55227@debbugs.gnu.org; Mon, 02 May 2022 14:24:42 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33880) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlaiq-0000sV-Ff; Mon, 02 May 2022 14:24:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=L8JCq6pen70E+Gihv/t6OrCxwyT1UqFj7/AEOfH+k7g=; b=NCsinWmwopLfbATL165E Z9Iksc5ejPRL2q8zH70gk1SwurMpUYMrL4my7SPnL5eaUUAlQgy4oLRKblhm7PY2LBcpmhDhCOfJl EkPX9R7935QyrJnPVNrLsfKGfDJsjsCCuu11ZropIH3Xj24OHqppsv4XNGOI1Wr/y7+VyjfH/YFyR Zf/RrJtLi5e1sPbJXopJiUtwIpTMNnbrZ2YE1V9AlZIAjxMryaRtM22h3cGssLnd+Mp6nglOgyHeD G+4maBjuGWXicPDkJMHATZ4WrvgFcRLq2SzJKmk3lAu0mpnRtKiohsdWFslyLk89HBw/EXd1b+/bC XkQgVPtEASObaw==; Received: from 2a02-a462-da03-1-fa3e-1174-c33f-9485.fixed6.kpn.net ([2a02:a462:da03:1:fa3e:1174:c33f:9485]:48262 helo=drakenbij.fritz.box) by fencepost.gnu.org with esmtpa (Exim 4.90_1) (envelope-from ) id 1nlaiq-0006Dq-3n; Mon, 02 May 2022 14:24:36 -0400 From: "Jan (janneke) Nieuwenhuizen" Date: Mon, 2 May 2022 20:24:28 +0200 Message-Id: <20220502182434.32130-2-janneke@gnu.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220502182434.32130-1-janneke@gnu.org> References: <20220502182434.32130-1-janneke@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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 | 109 ++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 663ffacd56..24e1e6ec8c 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -306,6 +306,115 @@ (define bootstrap-seeds 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")) + (package + (name "stage0-posix") + (version "1.4") + (source (bootstrap-origin + (origin + (method url-fetch) + (uri (string-append + "https://lilypond.org/janneke/guix/20220502/" + "stage0-posix-" version ".tar.gz")) + (sha256 + (base32 + "1ammifkj33205qrpfm84yb1c99lwgbn4jsl1hd08aab8c9ffz6p4"))))) + (native-inputs + `(("bootstrap-seeds" ,bootstrap-seeds) + ("mescc-tools" + ,(bootstrap-origin + (origin + (method url-fetch) + (uri (string-append + "https://lilypond.org/janneke/guix/20220502/" + "mescc-tools-" mescc-tools-version ".tar.gz")) + (sha256 + (base32 + "1xi6f48pf5bhajhfis189gpizxij7nbp1vzvsb1aafhz4skkiqvg"))))) + ("m2-planet" + ,(bootstrap-origin + (origin + (method url-fetch) + (uri (string-append + "https://lilypond.org/janneke/guix/20220502/" + "M2-Planet-" m2-planet-version ".tar.gz")) + (sha256 + (base32 + "1xrn69sc5nz4hwaishqyrcidp1ncxwib9zswl45x378ddz3mmk7g"))))) + ,@(%boot-gash-inputs))) + (build-system trivial-build-system) + (arguments + `(#:guile ,%bootstrap-guile + #:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let* ((bootstrap-seeds (assoc-ref %build-inputs "bootstrap-seeds")) + (mescc-tools (assoc-ref %build-inputs "mescc-tools")) + (m2-planet (assoc-ref %build-inputs "m2-planet")) + (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 (string-prefix? "x86_64-linux" target) + (string-prefix? "i686-linux" target)) + "x86") + ((or (string-prefix? "aarch64-linux" target) + (string-prefix? "armhf-linux" target)) + "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 an 357-byte hex0 provided by the bootstrap-seeds, +stage0-posix builds hex0, kaem, hex1, catm, hex2, M0, cc_x86, M1, +M2, get_machine, (mescc-tools), and M2-Planet.") + (license license:gpl3+)))) + (define %bootstrap-mes-rewired (package (inherit mes)