guix-commits
[Top][All Lists]
Advanced

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

134/176: gnu: mescc-tools-boot: Use gnu-build-system.


From: Jan Nieuwenhuizen
Subject: 134/176: gnu: mescc-tools-boot: Use gnu-build-system.
Date: Fri, 31 Aug 2018 11:20:28 -0400 (EDT)

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

commit ceef3a8075292a55f5d2d6b113253558c8ec3ffd
Author: Jan Nieuwenhuizen <address@hidden>
Date:   Thu Aug 23 17:33:33 2018 +0200

    gnu: mescc-tools-boot: Use gnu-build-system.
    
    * gnu/packages/mes.scm (mescc-tools-boot): Use gnu-build-system.
---
 gnu/packages/mes.scm | 78 +++++++++++++++++++++++++++++++---------------------
 1 file changed, 46 insertions(+), 32 deletions(-)

diff --git a/gnu/packages/mes.scm b/gnu/packages/mes.scm
index 62857cb..f467667 100644
--- a/gnu/packages/mes.scm
+++ b/gnu/packages/mes.scm
@@ -118,7 +118,7 @@ with a Knight VM that runs Forth and Lisp.")
       (license gpl3+))))
 
 (define-public mescc-tools-boot
- (let ((version "0.4")
+  (let ((version "0.4")
         (revision "1")
         (commit "f02b8f4fda8d0c5c11a1d63a02b2bfdfab55abc5"))
     (package-with-bootstrap-guile
@@ -141,38 +141,52 @@ with a Knight VM that runs Forth and Lisp.")
           ("mes-source" ,(package-source mes-boot))
           ("mes-seed" ,%mes-seed)))
        (supported-systems '("i686-linux" "x86_64-linux"))
-       (build-system trivial-build-system)
+       (build-system gnu-build-system)
        (arguments
-        `(#:modules ((guix build utils))
-          #:builder
-          (begin
-            (use-modules (guix build utils))
-            (let* ((coreutils (assoc-ref %build-inputs "coreutils"))
-                   (source (assoc-ref %build-inputs "source"))
-                   (mescc-tools-seed (assoc-ref %build-inputs 
"mescc-tools-seed"))
-                   (mes-seed (assoc-ref %build-inputs "mes-seed"))
-                   (mes-source (assoc-ref %build-inputs "mes-source"))
-                   (out (assoc-ref %outputs "out"))
-                   (out/bin (string-append out "/bin")))
-              (setenv "PATH" (string-append coreutils "/bin"
-                                            ":" "../mescc-tools-seed"))
-              (format (current-error-port) "PATH=~s\n" (getenv "PATH"))
-              (mkdir-p "source")
-              (system* "tar" "--strip=1" "-C" "source" "-xvf" source)
-              (mkdir-p "mescc-tools-seed")
-              (system* "tar" "--strip=1" "-C" "mescc-tools-seed" "-xvf" 
mescc-tools-seed)
-              (mkdir-p "mes-source")
-              (system* "tar" "--strip=1" "-C" "mes-source" "-xvf" mes-source)
-              (mkdir-p "mes-seed")
-              (system* "tar" "--strip=1" "-C" "mes-seed" "-xvf" mes-seed)
-              (chdir "source")
-              (setenv "PREFIX" out)
-              (setenv "MES_PREFIX" "../mes-source")
-              (setenv "MESCC_TOOLS_SEED" "../mescc-tools-seed")
-              (setenv "MES_SEED" "../mes-seed")
-              (and (zero? (system* "sh" "build.sh"))
-                   (zero? (system* "sh" "check.sh"))
-                   (zero? (system* "sh" "install.sh")))))))
+        `(#:strip-binaries? #f ; binutil's strip b0rkes MesCC/M1/hex2 binaries
+          #:phases
+          (modify-phases %standard-phases
+            (add-after 'unpack 'unpack-seeds
+              (lambda* (#:key outputs #:allow-other-keys)
+                (let* ((coreutils (assoc-ref %build-inputs "coreutils"))
+                       (mescc-tools-seed (assoc-ref %build-inputs 
"mescc-tools-seed"))
+                       (mes-seed (assoc-ref %build-inputs "mes-seed"))
+                       (mes-source (assoc-ref %build-inputs "mes-source"))
+                       (out (assoc-ref %outputs "out")))
+                  (setenv "PATH" (string-append coreutils "/bin"))
+                  (format (current-error-port) "PATH=~s\n" (getenv "PATH"))
+                  (with-directory-excursion ".."
+                    (and
+                     (mkdir-p "mescc-tools-seed")
+                     (zero? (system* "tar" "--strip=1" "-C" "mescc-tools-seed"
+                                     "-xvf" mescc-tools-seed))
+                     (mkdir-p "mes-source")
+                     (zero? (system* "tar" "--strip=1" "-C" "mes-source"
+                                     "-xvf" mes-source))
+                     (mkdir-p "mes-seed")
+                     (zero? (system* "tar" "--strip=1" "-C" "mes-seed"
+                                     "-xvf" mes-seed)))))))
+            (replace 'configure
+              (lambda* (#:key outputs #:allow-other-keys)
+                ;;(use-modules (guix build utils))
+                (let ((coreutils (assoc-ref %build-inputs "coreutils"))
+                      (out (assoc-ref %outputs "out")))
+                  (setenv "PATH" (string-append coreutils "/bin"
+                                                ":" "../mescc-tools-seed"))
+                  (format (current-error-port) "PATH=~s\n" (getenv "PATH"))
+                  (setenv "PREFIX" out)
+                  (setenv "MES_PREFIX" "../mes-source")
+                  (setenv "MESCC_TOOLS_SEED" "../mescc-tools-seed")
+                  (setenv "MES_SEED" "../mes-seed"))))
+            (replace 'build
+              (lambda* (#:key outputs #:allow-other-keys)
+                (zero? (system* "sh" "build.sh"))))
+            (replace 'check
+              (lambda* (#:key outputs #:allow-other-keys)
+                (zero? (system* "sh" "check.sh"))))
+            (replace 'install
+              (lambda* (#:key outputs #:allow-other-keys)
+                (zero? (system* "sh" "install.sh")))))))
        (description
         "Mescc-tools is a collection of tools for use in a full source
 bootstrapping process.  Currently consists of the M1 macro assembler and the



reply via email to

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