From b7c5e34c0a2a298cb5f519249174d511f369a3c6 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 19 Nov 2017 22:55:41 +0100 Subject: [PATCH 3/3] gnu: Add mes-boot. * gnu/packages/mes.scm (mes-boot): New variable. --- gnu/packages/mes.scm | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/gnu/packages/mes.scm b/gnu/packages/mes.scm index ef4d4a486..8a33ce8a5 100644 --- a/gnu/packages/mes.scm +++ b/gnu/packages/mes.scm @@ -201,6 +201,83 @@ hex2 linker.") (home-page "https://github.com/oriansj/mescc-tools") (license gpl3+)))) +(define-public mes-boot + (let ((version "0.11") + (revision "0") + (commit "948dd793619ddd5d930deead082737d14db9674b")) + (package + (name "mes-boot") + (version (string-append version "-" revision "." (string-take commit 7))) + (synopsis "Scheme interpreter and C compiler for full source bootstrapping") + (source (origin + (method url-fetch) + (uri (string-append "https://gitlab.com/janneke/mes" + "/repository/archive.tar.gz?ref=" + commit)) + (file-name (string-append name "-" version ".tar.xz")) + (sha256 + (base32 + "1hcfaapq0lg9achkc4565glcy9i23ln7azashi7ncsdv9jy72hmr")))) + (build-system trivial-build-system) + (supported-systems '("i686-linux" "x86_64-linux")) + (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))) + ("mescc-tools" ,mescc-tools-boot) + ("nyacc-source" ,(package-source nyacc)) + ("mes-seed" + ,(origin + (method url-fetch) + (uri (string-append "https://gitlab.com/janneke/mes-seed" + "/repository/archive.tar.gz?ref=" + "d53d5998666873a79fbd9b4f6742d11affa34b44")) + (file-name (string-append "mes-seed-0.11" ".tar.xz")) + (sha256 + (base32 + "00zk4vfxqjyy3x4s5bdx59zicfqvxyvsbb9mfs4zkwyka64flk34")))))) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let* ((bash (assoc-ref %build-inputs "static-bash")) + (mescc-tools (assoc-ref %build-inputs "mescc-tools")) + (tar (assoc-ref %build-inputs "tar")) + (xz (assoc-ref %build-inputs "xz")) + (source (assoc-ref %build-inputs "source")) + (mes-seed (assoc-ref %build-inputs "mes-seed")) + (out (assoc-ref %outputs "out")) + (out/bin (string-append out "/bin"))) + (setenv "PATH" (string-append bash "/bin:" + mescc-tools "/bin:" + 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 "mes-seed") + (system* "tar" "--strip=1" "-C" "mes-seed" "-xvf" mes-seed) + (chdir "source") + (zero? (system (string-append +"set -ex;" +"mkdir -p " out/bin ";" +"M1 --LittleEndian --Architecture=1 -f stage0/x86.M1 -f ../mes-seed/crt1.M1 > crt1.hex2;" +"M1 --LittleEndian --Architecture=1 -f stage0/x86.M1 -f ../mes-seed/libc-mes.M1 > libc-mes.hex2;" +"M1 --LittleEndian --Architecture=1 -f stage0/x86.M1 -f ../mes-seed/mes.M1 > mes.hex2;" +"hex2 --LittleEndian --Architecture=1 --BaseAddress=0x1000000 -f stage0/elf32-header.hex2 -f crt1.hex2 -f libc-mes.hex2 -f mes.hex2 -f stage0/elf32-footer-single-main.hex2 > " out/bin "/mes;" +"chmod +x " out/bin "/mes;" +out/bin "/mes --version;"))))))) + (description + "Mes [Maxwell Equations of Software] aims to create full source +bootstrapping for GuixSD. It consists of a mutual self-hosting [close to +Guile-] Scheme interpreter prototype in C and a Nyacc-based C compiler in +[Guile] Scheme.") + (home-page "https://gitlab.com/janneke/mes") + (license gpl3+)))) + +;;; (define-public nyacc (package -- Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.com