[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
16/26: commencement: bash-mesboot0: Support ARM.
From: |
guix-commits |
Subject: |
16/26: commencement: bash-mesboot0: Support ARM. |
Date: |
Sat, 9 Jan 2021 13:30:50 -0500 (EST) |
janneke pushed a commit to branch wip-arm-bootstrap
in repository guix.
commit d8a57f791fe8a9e2a4dd40eba348ae2047155014
Author: Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
AuthorDate: Wed Dec 23 09:45:08 2020 +0100
commencement: bash-mesboot0: Support ARM.
* gnu/packages/commencement.scm (bash-mesboot0)[arguments]: Parameterize
configure-flags' --build,--host.
---
gnu/packages/commencement.scm | 197 ++++++++++++++++++++++--------------------
1 file changed, 102 insertions(+), 95 deletions(-)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 24b3fba..9b9d30f 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -734,87 +734,94 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\"
(define bash-mesboot0
;; The initial Bash
- (package
- (inherit static-bash)
- (name "bash-mesboot0")
- (version "2.05b")
- (source (origin
- (method url-fetch)
- (uri (string-append "mirror://gnu/bash/bash-"
- version ".tar.gz"))
- (sha256
- (base32
- "1r1z2qdw3rz668nxrzwa14vk2zcn00hw7mpjn384picck49d80xs"))))
- (inputs '())
- (propagated-inputs '())
- (native-inputs (%boot-tcc0-inputs))
- (outputs '("out"))
- (arguments
- `(#:implicit-inputs? #f
- #:guile ,%bootstrap-guile
- #:parallel-build? #f
- #:strip-binaries? #f ; no strip yet
- #:configure-flags
- (list "--build=i686-unknown-linux-gnu"
- "--host=i686-unknown-linux-gnu"
-
- "--without-bash-malloc"
- "--disable-readline"
- "--disable-history"
- "--disable-help-builtin"
- "--disable-progcomp"
- "--disable-net-redirections"
- "--disable-nls"
-
- ;; Pretend 'dlopen' is missing so we don't build loadable
- ;; modules and related code.
- "ac_cv_func_dlopen=no")
- #:make-flags '("bash")
- #:phases
- (modify-phases %standard-phases
- (add-before 'configure 'setenv
- (lambda _
- (let* ((gash (assoc-ref %build-inputs "bash"))
- (shell (string-append gash "/bin/gash")))
- (setenv "CONFIG_SHELL" shell)
- (setenv "SHELL" shell)
- (setenv "CC" "tcc")
- (setenv "LD" "tcc")
- (setenv "AR" "tcc -ar")
- (setenv "CFLAGS" "-D _POSIX_VERSION=1")
- #t)))
- (add-after 'unpack 'scripted-patch
- (lambda _
- (substitute* "Makefile.in"
- (("mksyntax\\.c\n") "mksyntax.c -lgetopt\n")
- (("buildversion[.]o\n") "buildversion.o -lgetopt\n")
- ;; No size in Gash
- (("\tsize ") "#\tsize"))
- (substitute* "lib/sh/oslib.c"
- (("int name, namelen;") "char *name; int namelen;"))
- (substitute* "lib/sh/snprintf.c"
- (("^#if (defined [(]HAVE_LOCALE_H[)])" all define)
(string-append "#if 0 //" define)))
- (substitute* "configure"
- ((" egrep") " grep"))
- #t))
- (replace 'configure
- (lambda* (#:key configure-flags #:allow-other-keys)
- (let ((configure-flags (filter (lambda (x)
- (and (not (string-prefix?
"CONFIG_SHELL=" x))
- (not (string-prefix?
"SHELL=" x))))
- configure-flags)))
- (format (current-error-port)
- "running ./configure ~a\n" (string-join
configure-flags)))
- (apply invoke (cons "./configure" configure-flags))))
- (add-after 'configure 'configure-fixups
- (lambda _
- (substitute* "config.h"
- (("#define GETCWD_BROKEN 1") "#undef GETCWD_BROKEN"))
- (let ((config.h (open-file "config.h" "a")))
- (display (string-append
- ;; XXX TODO: remove nested ,(string-append ...) and
- ;; store file name on next rebuild cycle
- ,(string-append "
+ (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 static-bash)
+ (name "bash-mesboot0")
+ (version "2.05b")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "mirror://gnu/bash/bash-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1r1z2qdw3rz668nxrzwa14vk2zcn00hw7mpjn384picck49d80xs"))))
+ (supported-systems '("armhf-linux" "aarch64-linux"
+ "i686-linux" "x86_64-linux"))
+ (inputs '())
+ (propagated-inputs '())
+ (native-inputs (%boot-tcc0-inputs))
+ (outputs '("out"))
+ (arguments
+ `(#:implicit-inputs? #f
+ #:guile ,%bootstrap-guile
+ #:parallel-build? #f
+ #:strip-binaries? #f ; no strip yet
+ #:configure-flags
+ (list (string-append "--build=" ,triplet)
+ (string-append "--host=" ,triplet)
+
+ "--without-bash-malloc"
+ "--disable-readline"
+ "--disable-history"
+ "--disable-help-builtin"
+ "--disable-progcomp"
+ "--disable-net-redirections"
+ "--disable-nls"
+
+ ;; Pretend 'dlopen' is missing so we don't build loadable
+ ;; modules and related code.
+ "ac_cv_func_dlopen=no")
+ #:make-flags '("bash")
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'setenv
+ (lambda _
+ (let* ((gash (assoc-ref %build-inputs "bash"))
+ (shell (string-append gash "/bin/gash")))
+ (setenv "CONFIG_SHELL" shell)
+ (setenv "SHELL" shell)
+ (setenv "CC" "tcc")
+ (setenv "LD" "tcc")
+ (setenv "AR" "tcc -ar")
+ (setenv "CFLAGS" "-g -D _POSIX_VERSION=1")
+ #t)))
+ (add-after 'unpack 'scripted-patch
+ (lambda _
+ (substitute* "Makefile.in"
+ (("mksyntax\\.c\n") "mksyntax.c -lgetopt\n")
+ (("buildversion[.]o\n") "buildversion.o -lgetopt\n")
+ ;; No size in Gash
+ (("\tsize ") "#\tsize"))
+ (substitute* "lib/sh/oslib.c"
+ (("int name, namelen;") "char *name; int namelen;"))
+ (substitute* "lib/sh/snprintf.c"
+ (("^#if (defined [(]HAVE_LOCALE_H[)])" all define)
(string-append "#if 0 //" define)))
+ (substitute* "configure"
+ ((" egrep") " grep"))
+ #t))
+ (replace 'configure
+ (lambda* (#:key configure-flags #:allow-other-keys)
+ (let ((configure-flags (filter (lambda (x)
+ (and (not (string-prefix?
"CONFIG_SHELL=" x))
+ (not (string-prefix?
"SHELL=" x))))
+ configure-flags)))
+ (format (current-error-port)
+ "running ./configure ~a\n" (string-join
configure-flags)))
+ (apply invoke (cons "./configure" configure-flags))))
+ (add-after 'configure 'configure-fixups
+ (lambda _
+ (substitute* "config.h"
+ (("#define GETCWD_BROKEN 1") "#undef GETCWD_BROKEN"))
+ (let ((config.h (open-file "config.h" "a")))
+ (display (string-append
+ ;; XXX TODO: remove nested ,(string-append ...) and
+ ;; store file name on next rebuild cycle
+ ,(string-append "
// tcc: error: undefined symbol 'enable_hostname_completion'
#define enable_hostname_completion(on_or_off) 0
@@ -822,20 +829,20 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\"
#define HAVE_POSIX_SIGNALS 1
#define endpwent(x) 0
"))
- config.h)
- (close config.h))
- #t))
- (replace 'check
- (lambda _
- (invoke "./bash" "--version")))
- (replace 'install
- (lambda _
- (let* ((out (assoc-ref %outputs "out"))
- (bin (string-append out "/bin")))
- (mkdir-p bin)
- (copy-file "bash" (string-append bin "/bash"))
- (copy-file "bash" (string-append bin "/sh"))
- #t))))))))
+ config.h)
+ (close config.h))
+ #t))
+ (replace 'check
+ (lambda _
+ (invoke "./bash" "--version")))
+ (replace 'install
+ (lambda _
+ (let* ((out (assoc-ref %outputs "out"))
+ (bin (string-append out "/bin")))
+ (mkdir-p bin)
+ (copy-file "bash" (string-append bin "/bash"))
+ (copy-file "bash" (string-append bin "/sh"))
+ #t)))))))))
(define tcc-boot
;; The final tcc.
- branch wip-arm-bootstrap created (now ac6ca06), guix-commits, 2021/01/09
- 02/26: gnu: Add nyacc-1.00.2., guix-commits, 2021/01/09
- 01/26: gnu: mescc-tools: Update to 0.7.0., guix-commits, 2021/01/09
- 03/26: gnu: mes: Update to nyacc-1.00.2., guix-commits, 2021/01/09
- 05/26: bootstrap: mescc-tools: Support ARM, update to 0.7.0., guix-commits, 2021/01/09
- 12/26: commencement: tcc-boot0: Support ARM, update to 0.9.26-1136-g0fbeb2dd., guix-commits, 2021/01/09
- 14/26: commencement: make-mesboot0: Support ARM., guix-commits, 2021/01/09
- 16/26: commencement: bash-mesboot0: Support ARM.,
guix-commits <=
- 19/26: commencement: patch-mesboot: Support ARM., guix-commits, 2021/01/09
- 17/26: commencement: tcc-boot: Support ARM., guix-commits, 2021/01/09
- 20/26: commencement: sed-mesboot0: Support ARM., guix-commits, 2021/01/09
- 04/26: DRAFT gnu: mes: Update to 0.22-123-g9cd754498., guix-commits, 2021/01/09
- 06/26: bootstrap: mes-minimal: Support ARM, update for mes-0.23., guix-commits, 2021/01/09
- 09/26: commencement: gash-boot: Build fix for ARM., guix-commits, 2021/01/09
- 07/26: DRAFT bootstrap: %bootstrap-mescc-tools: Support ARM., guix-commits, 2021/01/09
- 13/26: commencement: gzip-mesboot: Support ARM., guix-commits, 2021/01/09
- 15/26: commencement: bzip2-mesboot: Support ARM., guix-commits, 2021/01/09
- 18/26: commencement: diffutils-mesboot: Support ARM., guix-commits, 2021/01/09