guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/163: gnu: Add stage0-boot.


From: Jan Nieuwenhuizen
Subject: 01/163: gnu: Add stage0-boot.
Date: Thu, 30 Aug 2018 01:03:12 -0400 (EDT)

janneke pushed a commit to branch wip-bootstrap
in repository guix.

commit 37639f2040201fb07f9236b3e6c8a673905d8fae
Author: Jan Nieuwenhuizen <address@hidden>
Date:   Sun Nov 19 10:03:43 2017 +0100

    gnu: Add stage0-boot.
    
    * gnu/packages/mes.scm (stag0-boot): New variable.
---
 gnu/packages/mes.scm | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)

diff --git a/gnu/packages/mes.scm b/gnu/packages/mes.scm
index 81d4145..6036666 100644
--- a/gnu/packages/mes.scm
+++ b/gnu/packages/mes.scm
@@ -21,6 +21,7 @@
 (define-module (gnu packages mes)
   #:use-module (gnu packages)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages bootstrap)
   #:use-module (gnu packages commencement)
   #:use-module (gnu packages cross-base)
   #:use-module (gnu packages gcc)
@@ -31,11 +32,85 @@
   #:use-module (gnu packages perl)
   #:use-module (gnu packages texinfo)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system trivial)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix licenses)
   #:use-module (guix packages))
 
+(define-public stage0-boot
+ (let ((version "0.0.8")
+        (revision "0")
+        (commit "14843efa5ed13372b1ec32a76d19f27b3febab91"))
+  (package
+    (name "stage0-boot")
+    (version (string-append version "-" revision "." (string-take commit 7)))
+    (synopsis "Manually created initial hex programs for full source 
bootstrapping")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://gitlab.com/janneke/stage0";
+                                  "/repository/archive.tar.gz?ref="
+                                  commit))
+              (file-name (string-append name "-" version ".tar.xz"))
+              (sha256
+               (base32
+                "0ws5g4r1rnyfaxrnyqzh4qr3w2a3i3wljcc095rk897wi1xz23jz"))))
+    (native-inputs
+     `(("static-bash" ,@(assoc-ref %bootstrap-inputs "bash"))
+       ("bash" ,(search-bootstrap-binary "bash" (%current-system)))
+       ("tar" ,(search-bootstrap-binary "tar" (%current-system)))
+       ("xz"  ,(search-bootstrap-binary "xz" (%current-system)))
+       ("stage0-seed"
+        ,(origin
+           (method url-fetch)
+           (uri (string-append "https://gitlab.com/janneke/stage0-seed";
+                               "/repository/archive.tar.gz?ref="
+                               "87039121e9ab4d48e9bade513c6f328cc9968583"))
+           (file-name (string-append name "-seed" "-" version ".tar.xz"))
+           (sha256
+            (base32
+             "0m18mv825nykj738gg9il60xb8xxc4015ypxgimhygdqxx0n66bp"))))))
+    (supported-systems '("i686-linux" "x86_64-linux"))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils))
+         (let* ((bash (assoc-ref %build-inputs "static-bash"))
+                (tar (assoc-ref %build-inputs "tar"))
+                (xz (assoc-ref %build-inputs "xz"))
+                (source (assoc-ref %build-inputs "source"))
+                (stage0-seed (assoc-ref %build-inputs "stage0-seed"))
+                (out (assoc-ref %outputs "out"))
+                (out/bin (string-append out "/bin")))
+           (setenv "PATH" (string-append bash "/bin:"
+                                         "../stage0-seed:"
+                                         tar "/bin:"
+                                         xz "/bin"))
+           (format (current-error-port) "PATH=~s\n" (getenv "PATH"))
+           (mkdir-p "source")
+           (system* "tar" "--strip=1" "-C" "source" "-xvf" source)
+           (mkdir-p "stage0-seed")
+           (system* "tar" "--strip=1" "-C" "stage0-seed" "-xvf" stage0-seed)
+           (chdir "source")
+           (zero? (system (string-append
+"set -ex;"
+"mkdir -p " out/bin ";"
+"hex Linux\\ Bootstrap/hex.hex > " out/bin "/hex;"
+;; FIXME: exec-enable?
+;;"hex Linux\\ Bootstrap/exec_enable.hex > " out/bin "/exec_enable;"
+;;"exec_enable " out/bin "/hex"
+;;"exec_enable " out/bin "/exec_enable"
+"chmod +x " out/bin "/hex"
+)))))))
+    (description
+     "Stage0 is the initial stage of a full source bootstrapping process.  It
+contains hex0, the initial 400 byte self hosting hex assembler.  It also comes
+with a Knight VM that runs Forth and Lisp.")
+    (home-page "https://savannah.nongnu.org/projects/stage0/";)
+    (license gpl3+))))
+
 (define-public nyacc
   (package
     (name "nyacc")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]