guix-commits
[Top][All Lists]
Advanced

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

24/26: commencement: gawk-mesboot: Support ARM.


From: guix-commits
Subject: 24/26: commencement: gawk-mesboot: Support ARM.
Date: Tue, 12 Jan 2021 13:49:18 -0500 (EST)

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

commit 4763433955c779ac4b168cd9d1a8763adbdc730d
Author: Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
AuthorDate: Mon Dec 28 15:50:12 2020 +0100

    commencement: gawk-mesboot: Support ARM.
    
    * gnu/packages/commencement.scm (gawk-mesboot0)[supported-systems]: Add
    armhf-linux, aarch64-linux.
    [arguments]: Cater for armhf-linux, aarch64-linux.
---
 gnu/packages/commencement.scm | 140 ++++++++++++++++++++++--------------------
 1 file changed, 75 insertions(+), 65 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 06450d1..09c3bd1 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -1409,71 +1409,81 @@ ac_cv_c_float_format='IEEE (little-endian)'
 
 (define gawk-mesboot0
   ;; The initial Gawk.
-  (package
-    (inherit gawk)
-    (name "gawk-mesboot0")
-    (version "3.0.0")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append "mirror://gnu/gawk/gawk-"
-                                  version ".tar.gz"))
-              (sha256
-               (base32
-                "087s7vpc8zawn3l7bwv9f44bf59rc398hvaiid63klw6fkbvabr3"))))
-    (supported-systems '("i686-linux" "x86_64-linux"))
-    (inputs '())
-    (propagated-inputs '())
-    (native-inputs (%boot-tcc-inputs))
-    (arguments
-     `(#:implicit-inputs? #f
-       #:guile ,%bootstrap-guile
-       #:configure-flags '("--build=i686-unknown-linux-gnu"
-                           "--host=i686-unknown-linux-gnu"
-                           "--disable-nls")
-       #:make-flags '("gawk")
-       #:parallel-build? #f
-       #:parallel-tests? #f
-       #:strip-binaries? #f             ; no strip yet
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'scripted-patch
-           (lambda _
-             (substitute* "Makefile.in"
-               (("date ") "echo today ")
-               ((" autoheader") "true")
-               ((" -lm ") " "))
-             (substitute* "test/Makefile.in"
-               (("^bigtest:.*") "bigtest: basic\n")
-               (("( |\t)(childin|convfmt|fflush|longwrds|math|negexp)" all 
sep) sep))))
-         (add-before 'configure 'setenv
-           (lambda _
-             (let* ((out (assoc-ref %outputs "out"))
-                    (bash (assoc-ref %build-inputs "bash"))
-                    (shell (string-append bash "/bin/bash")))
-               (setenv "CONFIG_SHELL" shell)
-               (setenv "SHELL" shell)
-               (setenv "CC" "tcc")
-               (setenv "CPP" "tcc -E")
-               (setenv "LD" "tcc")
-               (setenv "ac_cv_func_getpgrp_void" "yes")
-               (setenv "ac_cv_func_tzset" "yes"))
-             #t))
-         (replace 'configure           ; needs classic invocation of configure
-           (lambda* (#:key configure-flags #:allow-other-keys)
-             (let* ((out (assoc-ref %outputs "out"))
-                    (configure-flags
-                     `(,@configure-flags
-                       ,(string-append "--prefix=" out))))
-               (format (current-error-port) "running ./configure ~a\n" 
(string-join configure-flags))
-               (system* "touch" "configure") ; aclocal.m4 is newer than 
configure
-               (apply invoke (cons "./configure" configure-flags)))))
-         (replace 'install
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (bin (string-append out "/bin")))
-               (install-file "gawk" bin)
-               (symlink "gawk" (string-append bin "/awk"))
-               #t))))))))
+  (let ((triplet (match (%current-system)
+                   ((or "armhf-linux" "aarch64-linux")
+                    "arm-unknown-linux-gnu")
+                   ((or "i686-linux" "x86_64-linux")
+                    "i686-unknown-linux-gnu"))))
+    (package
+      (inherit gawk)
+      (name "gawk-mesboot0")
+      (version "3.0.0")
+      (source (origin
+                (method url-fetch)
+                (uri (string-append "mirror://gnu/gawk/gawk-"
+                                    version ".tar.gz"))
+                (sha256
+                 (base32
+                  "087s7vpc8zawn3l7bwv9f44bf59rc398hvaiid63klw6fkbvabr3"))))
+      (supported-systems '("armhf-linux" "aarch64-linux"
+                           "i686-linux" "x86_64-linux"))
+      (inputs '())
+      (propagated-inputs '())
+      (native-inputs (%boot-tcc-inputs))
+      (arguments
+       `(#:implicit-inputs? #f
+         #:guile ,%bootstrap-guile
+         #:configure-flags (list (string-append "--build=" ,triplet)
+                                 (string-append "--host=" ,triplet)
+                                 (string-append "--target=" ,triplet)
+                                 "--disable-nls")
+         #:make-flags '("gawk")
+         #:parallel-build? #f
+         #:parallel-tests? #f
+         #:strip-binaries? #f           ; no strip yet
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'scripted-patch
+             (lambda _
+               (substitute* "Makefile.in"
+                 (("date ") "echo today ")
+                 ((" autoheader") "true")
+                 ((" -lm ") " "))
+               (substitute* "test/Makefile.in"
+                 (("^bigtest:.*") "bigtest: basic\n")
+                 (("( |\t)(childin|convfmt|fflush|longwrds|math|negexp)" all 
sep) sep))
+               (substitute* "io.c"
+                 (("char rs;") "int rs;"))
+               #t))
+           (add-before 'configure 'setenv
+             (lambda _
+               (let* ((out (assoc-ref %outputs "out"))
+                      (bash (assoc-ref %build-inputs "bash"))
+                      (shell (string-append bash "/bin/bash")))
+                 (setenv "CONFIG_SHELL" shell)
+                 (setenv "SHELL" shell)
+                 (setenv "CC" "tcc")
+                 (setenv "CPP" "tcc -E")
+                 (setenv "LD" "tcc")
+                 (setenv "ac_cv_func_getpgrp_void" "yes")
+                 (setenv "ac_cv_func_tzset" "yes"))
+               #t))
+           (replace 'configure         ; needs classic invocation of configure
+             (lambda* (#:key configure-flags #:allow-other-keys)
+               (let* ((out (assoc-ref %outputs "out"))
+                      (configure-flags
+                       `(,@configure-flags
+                         ,(string-append "--prefix=" out))))
+                 (format (current-error-port) "running ./configure ~a\n" 
(string-join configure-flags))
+                 (system* "touch" "configure") ; aclocal.m4 is newer than 
configure
+                 (apply invoke (cons "./configure" configure-flags)))))
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (bin (string-append out "/bin")))
+                 (install-file "gawk" bin)
+                 (symlink "gawk" (string-append bin "/awk"))
+                 #t)))))))))
 
 (define glibc-mesboot0
   ;; GNU C Library 2.2.5 is the most recent glibc that we managed to build



reply via email to

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