From c64a0af956754a22a7900a96260b7615c62c14b1 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 19 Nov 2017 10:03:43 +0100 Subject: [PATCH 1/3] 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 dfa421177..1e3631a1e 100644 --- a/gnu/packages/mes.scm +++ b/gnu/packages/mes.scm @@ -19,6 +19,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) @@ -26,11 +27,85 @@ #:use-module (gnu packages package-management) #:use-module (gnu packages perl) #: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") -- Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.com