diff options
Diffstat (limited to 'gnu/packages/commencement.scm')
-rw-r--r-- | gnu/packages/commencement.scm | 1421 |
1 files changed, 650 insertions, 771 deletions
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index e7bd6cf002..e570a95b04 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -1,15 +1,17 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <[email protected]> +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <[email protected]> ;;; Copyright © 2014 Andreas Enge <[email protected]> ;;; Copyright © 2012 Nikita Karetnikov <[email protected]> ;;; Copyright © 2014, 2015, 2017 Mark H Weaver <[email protected]> -;;; Copyright © 2017, 2018, 2019 Efraim Flashner <[email protected]> +;;; Copyright © 2017, 2018, 2019, 2021 Efraim Flashner <[email protected]> ;;; Copyright © 2018 Tobias Geerinckx-Rice <[email protected]> ;;; Copyright © 2018, 2019, 2020 Jan (janneke) Nieuwenhuizen <[email protected]> -;;; Copyright © 2019, 2020 Marius Bakke <[email protected]> +;;; Copyright © 2019, 2020, 2021 Marius Bakke <[email protected]> ;;; Copyright © 2020 Timothy Sample <[email protected]> ;;; Copyright © 2020 Guy Fleury Iteriteka <[email protected]> +;;; Copyright © 2021 Maxim Cournoyer <[email protected]> ;;; Copyright © 2021 Chris Marusich <[email protected]> +;;; Copyright © 2021 Julien Lepiller <[email protected]> ;;; ;;; This file is part of GNU Guix. ;;; @@ -49,12 +51,13 @@ #:use-module (gnu packages shells) #:use-module (gnu packages texinfo) #:use-module (gnu packages pkg-config) - #:use-module (gnu packages rsync) #:use-module (gnu packages xml) + #:use-module (guix gexp) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) + #:use-module (guix gexp) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix memoization) #:use-module (guix utils) @@ -116,8 +119,7 @@ (guile-dir (assoc-ref inputs "guile")) (guile (string-append guile-dir "/bin/guile"))) (invoke guile "--no-auto-compile" source) - (chdir "bootar") - #t))) + (chdir "bootar")))) (replace 'configure (bootstrap-configure ,version "." "scripts")) (replace 'build (bootstrap-build ".")) (replace 'install (bootstrap-install "." "scripts")))))) @@ -163,8 +165,7 @@ pure Scheme to Tar and decompression in one easy step.") (symlink (string-append out "/bin/gash") (string-append out "/bin/sh")) (symlink (string-append out "/bin/gash") - (string-append out "/bin/bash")) - #t))))))) + (string-append out "/bin/bash"))))))))) (inputs `(("guile" ,%bootstrap-guile))) (native-inputs `(("bootar" ,bootar))))) @@ -190,8 +191,7 @@ pure Scheme to Tar and decompression in one easy step.") (lambda* (#:key inputs #:allow-other-keys) (let ((gash (assoc-ref inputs "gash"))) (add-to-load-path (string-append gash "/share/guile/site/" - (effective-version)))) - #t)) + (effective-version)))))) (add-before 'configure 'pre-configure (lambda _ (format #t "Creating gash/commands/testb.scm~%") @@ -217,8 +217,7 @@ pure Scheme to Tar and decompression in one easy step.") (copy-file "scripts/template.in" "scripts/[.in") (substitute* "scripts/[.in" (("@UTILITY@") "testb")) - (delete-file "scripts/template.in") - #t)) + (delete-file "scripts/template.in"))) (replace 'configure (bootstrap-configure ,(package-version gash-utils) "gash" "scripts")) @@ -247,8 +246,7 @@ pure Scheme to Tar and decompression in one easy step.") (copy-file (string-append gash-godir "/gash/compat.go") (string-append godir "/gash/compat.go")) (copy-recursively (string-append gash-godir "/gash/compat") - (string-append godir "/gash/compat")) - #t))))))) + (string-append godir "/gash/compat"))))))))) (inputs `(("gash" ,gash-boot) ("guile" ,%bootstrap-guile))) (native-inputs `(("bootar" ,bootar))))) @@ -438,8 +436,7 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\" (string-suffix? ".s" name)))))) (for-each (lambda (x) (install-file x cache)) (append (objects-in-dir ".") - (objects-in-dir "mescc-lib")))) - #t))))) + (objects-in-dir "mescc-lib"))))))))) (native-search-paths (list (search-path-specification (variable "C_INCLUDE_PATH") @@ -573,8 +570,7 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\" (add-after 'unpack 'scripted-patch (lambda _ (substitute* "util.c" - (("^char [*]strlwr" all) (string-append all "_tcc_cannot_handle_dupe"))) - #t)) + (("^char [*]strlwr" all) (string-append all "_tcc_cannot_handle_dupe"))))) (replace 'build (lambda _ (let ((files '("bits" "crypt" "deflate" "getopt" "gzip" @@ -636,13 +632,11 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\" (lambda _ (substitute* "build.sh.in" (("@LIBOBJS@") "getloadavg.o") - (("@REMOTE@") "stub")) - #t)) + (("@REMOTE@") "stub")))) (add-after 'configure 'configure-fixup (lambda _ (substitute* "make.h" - (("^extern long int lseek.*" all) (string-append "// " all))) - #t)) + (("^extern long int lseek.*" all) (string-append "// " all))))) (replace 'build (lambda _ (invoke "sh" "./build.sh"))) @@ -694,16 +688,14 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\" (("uTimBuf[.]" all) (string-append "// " all)) (("retVal = utime [(] dstName, &uTimBuf [)];" all) - (string-append "retVal = 0; // " all))) - #t)) + (string-append "retVal = 0; // " all))))) (replace 'configure (lambda _ (with-output-to-file "utime.h" (lambda _ (display " #define fchown(filedes, owner, group) 0 #define fchmod(filedes, mode) 0 -"))) - #t)) +"))))) (replace 'check (lambda _ (invoke "./bzip2" "--help"))) @@ -759,8 +751,7 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\" (setenv "CC" "tcc") (setenv "LD" "tcc") (setenv "AR" "tcc -ar") - (setenv "CFLAGS" "-D _POSIX_VERSION=1") - #t))) + (setenv "CFLAGS" "-D _POSIX_VERSION=1")))) (add-after 'unpack 'scripted-patch (lambda _ (substitute* "Makefile.in" @@ -773,8 +764,7 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\" (substitute* "lib/sh/snprintf.c" (("^#if (defined [(]HAVE_LOCALE_H[)])" all define) (string-append "#if 0 //" define))) (substitute* "configure" - ((" egrep") " grep")) - #t)) + ((" egrep") " grep")))) (replace 'configure (lambda* (#:key configure-flags #:allow-other-keys) (let ((configure-flags (filter (lambda (x) @@ -789,20 +779,16 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\" (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 " + (display " // tcc: error: undefined symbol 'enable_hostname_completion' #define enable_hostname_completion(on_or_off) 0 -// /gnu/store/" "cq0cmv35s9dhilx14zaghlc08gpc0hwr-tcc-boot0-0.9.26-6.c004e9a/lib/libc.a: error: 'sigprocmask' defined twice +// /gnu/store/…-tcc-boot0-0.9.26-6.c004e9a/lib/libc.a: error: 'sigprocmask' defined twice #define HAVE_POSIX_SIGNALS 1 #define endpwent(x) 0 -")) +" config.h) - (close config.h)) - #t)) + (close config.h)))) (replace 'check (lambda _ (invoke "./bash" "--version"))) @@ -812,8 +798,7 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\" (bin (string-append out "/bin"))) (mkdir-p bin) (copy-file "bash" (string-append bin "/bash")) - (copy-file "bash" (string-append bin "/sh")) - #t)))))))) + (copy-file "bash" (string-append bin "/sh")))))))))) (define tcc-boot ;; The final tcc. @@ -821,16 +806,11 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\" (inherit tcc-boot0) (name "tcc-boot") (version "0.9.27") - (source (origin - (inherit (package-source tcc)) - ;; `patches' needs XZ - ;; (patches (search-patches "tcc-boot-0.9.27.patch")) - )) + (source (package-source tcc)) (build-system gnu-build-system) (inputs '()) (propagated-inputs '()) - (native-inputs `(;;("boot-patch" ,(search-patch "tcc-boot-0.9.27.patch")) - ("bzip2" ,bzip2-mesboot) + (native-inputs `(("bzip2" ,bzip2-mesboot) ,@(%boot-tcc0-inputs))) (arguments `(#:implicit-inputs? #f @@ -846,20 +826,13 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\" (copy-file source "tarball.tar.bz2") (invoke "bzip2" "-d" "tarball.tar.bz2") (invoke "tar" "xvf" "tarball.tar") - (chdir (string-append "tcc-" ,version)) - #t)) - ;; no patch yet - ;; (add-after 'unpack 'apply-boot-patch - ;; (lambda* (#:key inputs #:allow-other-keys) - ;; (let ((patch-file (assoc-ref inputs "boot-patch"))) - ;; (invoke "patch" "-p1" "-i" patch-file)))) + (chdir (string-append "tcc-" ,version)))) (add-after 'unpack 'scripted-patch (lambda* (#:key inputs #:allow-other-keys) (substitute* "libtcc.c" (("s->alacarte_link = 1;" all) (string-append all " - s->static_link = 1;"))) - #t)) + s->static_link = 1;"))))) (replace 'configure (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref %outputs "out")) @@ -919,57 +892,8 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\" (invoke "tcc" "-ar" "rc" "libtcc1.a" "libtcc1.o") (copy-file "libtcc1.a" (string-append out "/lib/libtcc1.a")) (delete-file (string-append out "/lib/tcc/libtcc1.a")) - (copy-file "libtcc1.a" (string-append out "/lib/tcc/libtcc1.a")) - #t))))))))) - -(define diffutils-mesboot - ;; The initial diffutils. - (package - (inherit diffutils) - (name "diffutils-mesboot") - (version "2.7") - (source (origin - (method url-fetch) - (uri (string-append "mirror://gnu/diffutils/diffutils-" - version ".tar.gz")) - (sha256 - (base32 - "1mirn5i825bn5w7rh6mgn0r8aj9xqanav95dwcl1b8sn82f4iwnm")))) - (supported-systems '("i686-linux" "x86_64-linux")) - (inputs '()) - (propagated-inputs '()) - (native-inputs (%boot-tcc0-inputs)) - (arguments - `(#:implicit-inputs? #f - #:guile ,%bootstrap-guile - #:parallel-build? #f - #:tests? #f ; check is naive, also checks non-built PROGRAMS - #:strip-binaries? #f ; no strip yet - #:phases - (modify-phases %standard-phases - (add-before 'configure 'remove-diff3-sdiff - (lambda* (#:key outputs #:allow-other-keys) - (substitute* "Makefile.in" - (("PROGRAMS = .*" all) "PROGRAMS = cmp diff")))) - (replace 'configure ; needs classic invocation of configure - (lambda* (#:key configure-flags #:allow-other-keys) - (let* ((out (assoc-ref %outputs "out")) - (bash (assoc-ref %build-inputs "bash")) - (shell (string-append bash "/bin/bash"))) - (setenv "CONFIG_SHELL" shell) - (setenv "CC" "tcc") - (setenv "LD" "tcc") - (format (current-error-port) - "running ./configure ~a\n" (string-join configure-flags)) - (apply invoke (cons "./configure" configure-flags))))) - (replace 'install - (lambda _ - (let* ((out (assoc-ref %outputs "out")) - (bin (string-append out "/bin"))) - (mkdir-p bin) - (install-file "cmp" bin) - (install-file "diff" bin) - #t)))))))) + (copy-file "libtcc1.a" + (string-append out "/lib/tcc/libtcc1.a"))))))))))) (define patch-mesboot ;; The initial patch. @@ -1002,8 +926,7 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\" ;; avoid another segfault (substitute* "pch.c" (("while [(]p_end >= 0[)]" all) - "p_end = -1;\nwhile (0)")) - #t)) + "p_end = -1;\nwhile (0)")))) ;; FIXME: no compressing gzip yet (delete 'compress-documentation)))))) @@ -1039,8 +962,7 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\" (bash (assoc-ref %build-inputs "bash")) (shell (string-append bash "/bin/bash"))) (substitute* "configure" - (("/bin/sh") shell)) - #t))) + (("/bin/sh") shell))))) (replace 'check (lambda _ (invoke "./sed" "--version"))) @@ -1048,16 +970,16 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\" (lambda _ (let* ((out (assoc-ref %outputs "out")) (bin (string-append out "/bin"))) - (install-file "sed" bin) - #t)))))))) + (install-file "sed" bin))))))))) (define (%boot-tcc-inputs) `(("bash" ,bash-mesboot0) ("bzip2" ,bzip2-mesboot) - ("diffutils" ,diffutils-mesboot) ("gzip" ,gzip-mesboot) ("patch" ,patch-mesboot) ("sed" ,sed-mesboot0) + ;; Place lower than sed so we don't override it. + ("gash-utils" ,gash-utils-boot) ("tcc" ,tcc-boot) ,@(alist-delete "tcc" (%boot-tcc0-inputs)))) @@ -1105,14 +1027,12 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\" (setenv "SHELL" shell) (setenv "AR" "tcc -ar") (setenv "RANLIB" "true") - (setenv "CC" "tcc -D __GLIBC_MINOR__=6") - #t))) + (setenv "CC" "tcc -D __GLIBC_MINOR__=6")))) (add-after 'unpack 'scripted-patch (lambda* (#:key inputs #:allow-other-keys) (substitute* "bfd/configure" (("^sed -e '/SRC-POTFILES.*" all) - "echo -e 'all:\\n\\ttrue\\n\\ninstall:\\n\\ttrue\\n' > po/Makefile\n")) - #t)) + "echo -e 'all:\\n\\ttrue\\n\\ninstall:\\n\\ttrue\\n' > po/Makefile\n")))) (replace 'configure ; needs classic invocation of configure (lambda* (#:key configure-flags #:allow-other-keys) (format (current-error-port) @@ -1145,96 +1065,95 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\" (supported-systems '("i686-linux" "x86_64-linux")) (inputs '()) (propagated-inputs '()) - (native-inputs `(("boot-patch" ,(search-patch "gcc-boot-2.95.3.patch")) - ("binutils" ,binutils-mesboot0) + (native-inputs `(("binutils" ,binutils-mesboot0) ,@(%boot-tcc-inputs))) (outputs '("out")) (arguments - `(#:implicit-inputs? #f - #:guile ,%bootstrap-guile - #:tests? #f - #:parallel-build? #f - #:strip-binaries? #f - #:configure-flags - (let ((out (assoc-ref %outputs "out"))) - `("--enable-static" - "--disable-shared" - "--disable-werror" - "--build=i686-unknown-linux-gnu" - "--host=i686-unknown-linux-gnu" - ,(string-append "--prefix=" out))) - #:make-flags - `("CC=tcc -static -D __GLIBC_MINOR__=6" - "OLDCC=tcc -static -D __GLIBC_MINOR__=6" - "CC_FOR_BUILD=tcc -static -D __GLIBC_MINOR__=6" - "AR=ar" - "RANLIB=ranlib" - ,(string-append "LIBGCC2_INCLUDES=-I " - (assoc-ref %build-inputs "tcc") - "/include") - "LANGUAGES=c" - ,(string-append "BOOT_LDFLAGS=" - " -B" (assoc-ref %build-inputs "tcc") - "/lib/")) - #:modules ((guix build gnu-build-system) - (guix build utils) - (srfi srfi-1)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'apply-boot-patch - (lambda* (#:key inputs #:allow-other-keys) - (let ((patch-file (assoc-ref inputs "boot-patch"))) - (system* "patch" "--force" "-p1" "-i" patch-file) - #t))) - (add-before 'configure 'setenv - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (bash (assoc-ref %build-inputs "bash")) - (shell (string-append bash "/bin/bash")) - (tcc (assoc-ref %build-inputs "tcc")) - (cppflags " -D __GLIBC_MINOR__=6")) - (setenv "CONFIG_SHELL" shell) - (setenv "CPPFLAGS" cppflags) - (setenv "CC" (string-append "tcc" cppflags)) - (setenv "CC_FOR_BUILD" (string-append "tcc" cppflags)) - (setenv "CPP" (string-append "tcc -E" cppflags)) - (with-output-to-file "config.cache" - (lambda _ - (display " + (list #:implicit-inputs? #f + #:guile %bootstrap-guile + #:tests? #f + #:parallel-build? #f + #:strip-binaries? #f + #:configure-flags + #~(let ((out (assoc-ref %outputs "out"))) + `("--enable-static" + "--disable-shared" + "--disable-werror" + "--build=i686-unknown-linux-gnu" + "--host=i686-unknown-linux-gnu" + ,(string-append "--prefix=" out))) + #:make-flags + #~`("CC=tcc -static -D __GLIBC_MINOR__=6" + "OLDCC=tcc -static -D __GLIBC_MINOR__=6" + "CC_FOR_BUILD=tcc -static -D __GLIBC_MINOR__=6" + "AR=ar" + "RANLIB=ranlib" + ,(string-append "LIBGCC2_INCLUDES=-I " + (assoc-ref %build-inputs "tcc") + "/include") + "LANGUAGES=c" + ,(string-append "BOOT_LDFLAGS=" + " -B" (assoc-ref %build-inputs "tcc") + "/lib/")) + #:modules '((guix build gnu-build-system) + (guix build utils) + (srfi srfi-1)) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'apply-boot-patch + (lambda* (#:key inputs #:allow-other-keys) + (let ((patch-file + #$(local-file + (search-patch "gcc-boot-2.95.3.patch")))) + (invoke "patch" "--force" "-p1" "-i" patch-file)))) + (add-before 'configure 'setenv + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bash (assoc-ref %build-inputs "bash")) + (shell (string-append bash "/bin/bash")) + (tcc (assoc-ref %build-inputs "tcc")) + (cppflags " -D __GLIBC_MINOR__=6")) + (setenv "CONFIG_SHELL" shell) + (setenv "CPPFLAGS" cppflags) + (setenv "CC" (string-append "tcc" cppflags)) + (setenv "CC_FOR_BUILD" (string-append "tcc" cppflags)) + (setenv "CPP" (string-append "tcc -E" cppflags)) + (with-output-to-file "config.cache" + (lambda _ + (display " ac_cv_c_float_format='IEEE (little-endian)' ")))))) - ;; gcc-2.95.3 - (replace 'configure ; needs classic invocation of configure - (lambda* (#:key configure-flags #:allow-other-keys) - (format (current-error-port) - "running ./configure ~a\n" (string-join configure-flags)) - (apply invoke "./configure" configure-flags))) - (add-after 'configure 'remove-info - (lambda _ - ;; no info at this stage - (delete-file-recursively "texinfo") - (invoke "touch" "gcc/cpp.info" "gcc/gcc.info"))) - (add-after 'install 'install2 - (lambda* (#:key outputs #:allow-other-keys) - (let* ((tcc (assoc-ref %build-inputs "tcc")) - (tcc-lib (string-append tcc "/lib/x86-mes-gcc")) - (out (assoc-ref outputs "out")) - (gcc-dir (string-append - out "/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3"))) - (mkdir-p "tmp") - (with-directory-excursion "tmp" - (invoke "ar" "x" (string-append "../gcc/libgcc2.a")) - (invoke "ar" "x" (string-append tcc "/lib/libtcc1.a")) - (apply invoke "ar" "r" (string-append gcc-dir "/libgcc.a") - (find-files "." "\\.o"))) - (copy-file "gcc/libgcc2.a" (string-append out "/lib/libgcc2.a")) - (copy-file (string-append tcc "/lib/libtcc1.a") - (string-append out "/lib/libtcc1.a")) - (invoke "ar" "x" (string-append tcc "/lib/libtcc1.a")) - (invoke "ar" "x" (string-append tcc "/lib/libc.a")) - (invoke "ar" "r" (string-append gcc-dir "/libc.a") - "libc.o" "libtcc1.o") - #t)))))) + ;; gcc-2.95.3 + (replace 'configure ; needs classic invocation of configure + (lambda* (#:key configure-flags #:allow-other-keys) + (format (current-error-port) + "running ./configure ~a\n" (string-join configure-flags)) + (apply invoke "./configure" configure-flags))) + (add-after 'configure 'remove-info + (lambda _ + ;; no info at this stage + (delete-file-recursively "texinfo") + (invoke "touch" "gcc/cpp.info" "gcc/gcc.info"))) + (add-after 'install 'install2 + (lambda* (#:key outputs #:allow-other-keys) + (let* ((tcc (assoc-ref %build-inputs "tcc")) + (tcc-lib (string-append tcc "/lib/x86-mes-gcc")) + (out (assoc-ref outputs "out")) + (gcc-dir (string-append + out "/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3"))) + (mkdir-p "tmp") + (with-directory-excursion "tmp" + (invoke "ar" "x" (string-append "../gcc/libgcc2.a")) + (invoke "ar" "x" (string-append tcc "/lib/libtcc1.a")) + (apply invoke "ar" "r" (string-append gcc-dir "/libgcc.a") + (find-files "." "\\.o"))) + (copy-file "gcc/libgcc2.a" (string-append out "/lib/libgcc2.a")) + (copy-file (string-append tcc "/lib/libtcc1.a") + (string-append out "/lib/libtcc1.a")) + (invoke "ar" "x" (string-append tcc "/lib/libtcc1.a")) + (invoke "ar" "x" (string-append tcc "/lib/libc.a")) + (invoke "ar" "r" (string-append gcc-dir "/libc.a") + "libc.o" "libtcc1.o"))))))) (native-search-paths (list (search-path-specification (variable "C_INCLUDE_PATH") @@ -1277,8 +1196,7 @@ ac_cv_c_float_format='IEEE (little-endian)' (headers (assoc-ref %build-inputs "kernel-headers"))) (mkdir-p include) (copy-recursively "include" out) - (copy-recursively headers out) - #t)))))))) + (copy-recursively headers out))))))))) (define gawk-mesboot0 ;; The initial Gawk. @@ -1329,8 +1247,7 @@ ac_cv_c_float_format='IEEE (little-endian)' (setenv "CPP" "tcc -E") (setenv "LD" "tcc") (setenv "ac_cv_func_getpgrp_void" "yes") - (setenv "ac_cv_func_tzset" "yes")) - #t)) + (setenv "ac_cv_func_tzset" "yes")))) (replace 'configure ; needs classic invocation of configure (lambda* (#:key configure-flags #:allow-other-keys) (let* ((out (assoc-ref %outputs "out")) @@ -1345,8 +1262,7 @@ ac_cv_c_float_format='IEEE (little-endian)' (let* ((out (assoc-ref outputs "out")) (bin (string-append out "/bin"))) (install-file "gawk" bin) - (symlink "gawk" (string-append bin "/awk")) - #t)))))))) + (symlink "gawk" (string-append bin "/awk")))))))))) (define glibc-mesboot0 ;; GNU C Library 2.2.5 is the most recent glibc that we managed to build @@ -1369,87 +1285,84 @@ ac_cv_c_float_format='IEEE (little-endian)' (supported-systems '("i686-linux" "x86_64-linux")) (inputs '()) (propagated-inputs '()) - (native-inputs `(("boot-patch" ,(search-patch "glibc-boot-2.2.5.patch")) - ("system-patch" ,(search-patch "glibc-bootstrap-system-2.2.5.patch")) - ("headers" ,mesboot-headers) + (native-inputs `(("headers" ,mesboot-headers) ,@(%boot-mesboot-core-inputs))) (outputs '("out")) (arguments - `(#:implicit-inputs? #f - #:guile ,%bootstrap-guile - #:tests? #f - #:strip-binaries? #f - #:validate-runpath? #f ; no dynamic executables - #:parallel-build? #f ; gcc-2.95.3 ICEs on massively parallel builds - #:make-flags (list (string-append - "SHELL=" - (assoc-ref %build-inputs "bash") - "/bin/sh")) - #:configure-flags - (let ((out (assoc-ref %outputs "out")) - (headers (assoc-ref %build-inputs "headers"))) - `("--disable-shared" - "--enable-static" - "--disable-sanity-checks" - "--build=i686-unknown-linux-gnu" - "--host=i686-unknown-linux-gnu" - ,(string-append "--with-headers=" headers "/include") - "--enable-static-nss" - "--without-__thread" - "--without-cvs" - "--without-gd" - "--without-tls" - ,(string-append "--prefix=" out))) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'apply-boot-patch - (lambda* (#:key inputs #:allow-other-keys) - (and (let ((patch (assoc-ref inputs "boot-patch"))) - (invoke "patch" "--force" "-p1" "-i" patch)) - (let ((patch (assoc-ref inputs "system-patch"))) - (invoke "patch" "--force" "-p1" "-i" patch))))) - (add-before 'configure 'setenv - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (bash (assoc-ref %build-inputs "bash")) - (shell (string-append bash "/bin/bash")) - (gcc (assoc-ref %build-inputs "gcc")) - (headers (assoc-ref %build-inputs "headers")) - (cppflags (string-append - ;;" -D __STDC__=1" - " -D MES_BOOTSTRAP=1" - " -D BOOTSTRAP_GLIBC=1")) - (cflags (string-append " -L " (getcwd)))) - (setenv "CONFIG_SHELL" shell) - (setenv "SHELL" shell) - (setenv "CPP" (string-append gcc "/bin/gcc -E " cppflags)) - (setenv "CC" (string-append gcc "/bin/gcc " cppflags cflags)) - #t))) - (replace 'configure ; needs classic invocation of configure - (lambda* (#:key configure-flags #:allow-other-keys) - (format (current-error-port) - "running ./configure ~a\n" (string-join configure-flags)) - (apply invoke "./configure" configure-flags))) - (add-after 'configure 'fixup-configure - (lambda _ - (let* ((out (assoc-ref %outputs "out")) - (bash (assoc-ref %build-inputs "bash")) - (shell (string-append bash "/bin/bash"))) - (substitute* "config.make" - (("INSTALL = scripts/") "INSTALL = $(..)./scripts/")) - (substitute* "config.make" - (("INSTALL = scripts/") "INSTALL = $(..)./scripts/") - (("BASH = ") (string-append - "SHELL = " shell " - BASH = "))) - #t)))))))) + (list #:implicit-inputs? #f + #:guile %bootstrap-guile + #:tests? #f + #:strip-binaries? #f + #:validate-runpath? #f ; no dynamic executables + #:parallel-build? #f ; gcc-2.95.3 ICEs on massively parallel builds + #:make-flags #~(list (string-append + "SHELL=" + (assoc-ref %build-inputs "bash") + "/bin/sh")) + #:configure-flags + #~(let ((out (assoc-ref %outputs "out")) + (headers (assoc-ref %build-inputs "headers"))) + `("--disable-shared" + "--enable-static" + "--disable-sanity-checks" + "--build=i686-unknown-linux-gnu" + "--host=i686-unknown-linux-gnu" + ,(string-append "--with-headers=" headers "/include") + "--enable-static-nss" + "--without-__thread" + "--without-cvs" + "--without-gd" + "--without-tls" + ,(string-append "--prefix=" out))) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'apply-boot-patch + (lambda* (#:key inputs #:allow-other-keys) + (invoke "patch" "--force" "-p1" "-i" + #$(local-file + (search-patch "glibc-boot-2.2.5.patch"))) + (invoke "patch" "--force" "-p1" "-i" + #$(local-file + (search-patch "glibc-bootstrap-system-2.2.5.patch"))))) + (add-before 'configure 'setenv + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bash (assoc-ref %build-inputs "bash")) + (shell (string-append bash "/bin/bash")) + (gcc (assoc-ref %build-inputs "gcc")) + (headers (assoc-ref %build-inputs "headers")) + (cppflags (string-append + ;;" -D __STDC__=1" + " -D MES_BOOTSTRAP=1" + " -D BOOTSTRAP_GLIBC=1")) + (cflags (string-append " -L " (getcwd)))) + (setenv "CONFIG_SHELL" shell) + (setenv "SHELL" shell) + (setenv "CPP" (string-append gcc "/bin/gcc -E " cppflags)) + (setenv "CC" (string-append gcc "/bin/gcc " cppflags cflags))))) + (replace 'configure ; needs classic invocation of configure + (lambda* (#:key configure-flags #:allow-other-keys) + (format (current-error-port) + "running ./configure ~a\n" (string-join configure-flags)) + (apply invoke "./configure" configure-flags))) + (add-after 'configure 'fixup-configure + (lambda _ + (let* ((out (assoc-ref %outputs "out")) + (bash (assoc-ref %build-inputs "bash")) + (shell (string-append bash "/bin/bash"))) + (substitute* "config.make" + (("INSTALL = scripts/") "INSTALL = $(..)./scripts/")) + (substitute* "config.make" + (("INSTALL = scripts/") "INSTALL = $(..)./scripts/") + (("BASH = ") (string-append + "SHELL = " shell " + BASH = "))))))))))) (define gcc-mesboot0 (package (inherit gcc-core-mesboot0) (name "gcc-mesboot0") - (native-inputs `(("boot-patch" ,(search-patch "gcc-boot-2.95.3.patch")) - ;; Packages are given in an order that's relevant for + (native-inputs `(;; Packages are given in an order that's relevant for ;; #include_next purposes. ("libc" ,glibc-mesboot0) ("kernel-headers" ,%bootstrap-linux-libre-headers) @@ -1457,38 +1370,37 @@ ac_cv_c_float_format='IEEE (little-endian)' (arguments (substitute-keyword-arguments (package-arguments gcc-core-mesboot0) ((#:phases phases) - `(modify-phases ,phases - (replace 'setenv - (lambda _ - (setenv "CONFIG_SHELL" (which "sh")) - (with-output-to-file "config.cache" - (lambda _ - (display " + #~(modify-phases #$phases + (replace 'setenv + (lambda _ + (setenv "CONFIG_SHELL" (which "sh")) + (with-output-to-file "config.cache" + (lambda _ + (display " ac_cv_c_float_format='IEEE (little-endian)' -"))) - #t)) - (replace 'install2 - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (gcc-dir (string-append - out "/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3"))) - (and - (mkdir-p "tmp") - (zero? (system (string-append "set -x; cd tmp && ar x ../gcc/libgcc2.a"))) - (zero? (system (string-append "set -x; cd tmp && ar r " gcc-dir "/libgcc.a *.o"))) - (copy-file "gcc/libgcc2.a" (string-append out "/lib/libgcc2.a")))))))) +"))))) + (replace 'install2 + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (gcc-dir (string-append + out "/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3"))) + (and + (mkdir-p "tmp") + (zero? (system (string-append "set -x; cd tmp && ar x ../gcc/libgcc2.a"))) + (zero? (system (string-append "set -x; cd tmp && ar r " gcc-dir "/libgcc.a *.o"))) + (copy-file "gcc/libgcc2.a" (string-append out "/lib/libgcc2.a")))))))) ((#:configure-flags configure-flags) - `(let ((out (assoc-ref %outputs "out"))) - `("--disable-shared" - "--disable-werror" - "--build=i686-unknown-linux-gnu" - "--host=i686-unknown-linux-gnu" - ,(string-append "--prefix=" out)))) + #~(let ((out (assoc-ref %outputs "out"))) + `("--disable-shared" + "--disable-werror" + "--build=i686-unknown-linux-gnu" + "--host=i686-unknown-linux-gnu" + ,(string-append "--prefix=" out)))) ((#:make-flags make-flags) - `(let ((gcc (assoc-ref %build-inputs "gcc"))) - `("RANLIB=true" - ,(string-append "LIBGCC2_INCLUDES=-I " gcc "/include") - "LANGUAGES=c"))))))) + #~(let ((gcc (assoc-ref %build-inputs "gcc"))) + `("RANLIB=true" + ,(string-append "LIBGCC2_INCLUDES=-I " gcc "/include") + "LANGUAGES=c"))))))) (define (%boot-mesboot0-inputs) `(("gcc" ,gcc-mesboot0) @@ -1543,14 +1455,12 @@ ac_cv_c_float_format='IEEE (little-endian)' (substitute* "configure" ((" /bin/sh") shell))) (substitute* "Makefile.in" - (("^SUBDIRS = doc") "SUBDIRS =")) - #t)) + (("^SUBDIRS = doc") "SUBDIRS =")))) (replace 'install (lambda _ (let* ((out (assoc-ref %outputs "out")) (bin (string-append out "/bin"))) - (install-file "src/tar" bin) - #t)))))))) + (install-file "src/tar" bin))))))))) (define grep-mesboot ;; The initial grep. @@ -1587,8 +1497,7 @@ ac_cv_c_float_format='IEEE (little-endian)' (bin (string-append out "/bin"))) (install-file "grep" bin) (symlink "grep" (string-append bin "/egrep")) - (symlink "grep" (string-append bin "/fgrep")) - #t)))))))) + (symlink "grep" (string-append bin "/fgrep")))))))))) (define binutils-mesboot1 (package @@ -1613,8 +1522,7 @@ ac_cv_c_float_format='IEEE (little-endian)' (let* ((out (assoc-ref %outputs "out")) (bash (assoc-ref %build-inputs "bash")) (shell (string-append bash "/bin/bash"))) - (setenv "CONFIG_SHELL" shell) - #t))))))))) + (setenv "CONFIG_SHELL" shell)))))))))) (define coreutils-mesboot0 (package @@ -1677,8 +1585,7 @@ ac_cv_c_float_format='IEEE (little-endian)' (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (bin (string-append out "/bin"))) - (install-file "make" bin) - #t)))))))) + (install-file "make" bin))))))))) (define gawk-mesboot (package @@ -1713,8 +1620,7 @@ ac_cv_c_float_format='IEEE (little-endian)' (let* ((out (assoc-ref outputs "out")) (bin (string-append out "/bin"))) (install-file "gawk" bin) - (symlink "gawk" (string-append bin "/awk")) - #t)))))))) + (symlink "gawk" (string-append bin "/awk")))))))))) (define sed-mesboot (package @@ -1745,8 +1651,7 @@ ac_cv_c_float_format='IEEE (little-endian)' (shell (string-append bash "/bin/bash"))) (substitute* "testsuite/Makefile.tests" (("^SHELL = /bin/sh") - (string-append "SHELL = " shell))) - #t)))))))) + (string-append "SHELL = " shell))))))))))) (define bash-mesboot (package @@ -1789,14 +1694,12 @@ ac_cv_c_float_format='IEEE (little-endian)' (add-after 'unpack 'scripted-patch (lambda _ (substitute* "shell.c" - ((";;") ";")) - #t)) + ((";;") ";")))) (add-before 'configure 'setenv (lambda _ (setenv "AWK" "gawk") (setenv "LIBS" "-lc -lnss_files -lnss_dns -lresolv") - (setenv "gl_cv_func_rename_dest_works" "yes") - #t)) + (setenv "gl_cv_func_rename_dest_works" "yes"))) (add-after 'configure 'configure-fixups (lambda _ (let ((config.h (open-file "config.h" "a"))) @@ -1804,8 +1707,7 @@ ac_cv_c_float_format='IEEE (little-endian)' #define enable_hostname_completion(on_or_off) 0 ") config.h) - (close config.h)) - #t)) + (close config.h)))) (replace 'check (lambda _ (invoke "./bash" "--version"))) @@ -1815,8 +1717,7 @@ ac_cv_c_float_format='IEEE (little-endian)' (bin (string-append out "/bin"))) (mkdir-p bin) (copy-file "bash" (string-append bin "/bash")) - (copy-file "bash" (string-append bin "/sh")) - #t)))))))) + (copy-file "bash" (string-append bin "/sh")))))))))) (define (%boot-mesboot1-inputs) `(("bash" ,bash-mesboot) @@ -1832,38 +1733,28 @@ ac_cv_c_float_format='IEEE (little-endian)' "gawk" "grep" "guile" "make" "sed" "tar")))) (define gmp-boot - (package - (inherit gmp) - (version "4.3.2") - (source (origin - (method url-fetch) - (uri (string-append "mirror://gnu/gmp/gmp-" version - ".tar.gz")) - (sha256 (base32 - "15rwq54fi3s11izas6g985y9jklm3xprfsmym3v1g6xr84bavqvv")))))) + (let ((version "4.3.2")) + (origin + (method url-fetch) + (uri (string-append "mirror://gnu/gmp/gmp-" version ".tar.gz")) + (sha256 + (base32 "15rwq54fi3s11izas6g985y9jklm3xprfsmym3v1g6xr84bavqvv"))))) (define mpfr-boot - (package - (inherit mpfr) - (version "2.4.2") - (source (origin - (method url-fetch) - (uri (string-append "mirror://gnu/mpfr/mpfr-" version - ".tar.gz")) - (sha256 (base32 - "0dxn4904dra50xa22hi047lj8kkpr41d6vb9sd4grca880c7wv94")))))) + (let ((version "2.4.2")) + (origin + (method url-fetch) + (uri (string-append "mirror://gnu/mpfr/mpfr-" version ".tar.gz")) + (sha256 + (base32 "0dxn4904dra50xa22hi047lj8kkpr41d6vb9sd4grca880c7wv94"))))) (define mpc-boot - (package - (inherit mpc) - (version "1.0.3") - (source (origin - (method url-fetch) - (uri (string-append - "mirror://gnu/mpc/mpc-" version ".tar.gz")) - (sha256 - (base32 - "1hzci2zrrd7v3g1jk35qindq05hbl0bhjcyyisq9z209xb3fqzb1")))))) + (let ((version "1.0.3")) + (origin + (method url-fetch) + (uri (string-append "mirror://gnu/mpc/mpc-" version ".tar.gz")) + (sha256 + (base32 "1hzci2zrrd7v3g1jk35qindq05hbl0bhjcyyisq9z209xb3fqzb1"))))) (define gcc-core-mesboot1 ;; GCC 4.6.4 is the latest modular distribution. This package is not @@ -1880,114 +1771,112 @@ ac_cv_c_float_format='IEEE (little-endian)' version "/gcc-core-" version ".tar.gz")) (sha256 (base32 - "173kdb188qg79pcz073cj9967rs2vzanyjdjyxy9v0xb0p5sad75")) - ;; Patch needs XZ - ;; (patches (search-patches "gcc-boot-4.6.4.patch")) - )) - (inputs `(("gmp-source" ,(package-source gmp-boot)) - ("mpfr-source" ,(package-source mpfr-boot)) - ("mpc-source" ,(package-source mpc-boot)))) - (native-inputs `(("boot-patch" ,(search-patch "gcc-boot-4.6.4.patch")) - ,@(%boot-mesboot1-inputs))) - (arguments - `(#:implicit-inputs? #f - #:guile ,%bootstrap-guile - #:tests? #f - #:modules ((guix build gnu-build-system) - (guix build utils) - (srfi srfi-1)) - #:parallel-build? #f ; for debugging - #:make-flags - (let* ((libc (assoc-ref %build-inputs "libc")) - (ldflags (string-append - "-B" libc "/lib " - "-Wl,-dynamic-linker " - "-Wl," libc - ,(glibc-dynamic-linker "i686-linux")))) - (list (string-append "LDFLAGS=" ldflags) - (string-append "LDFLAGS_FOR_TARGET=" ldflags))) - #:configure-flags - (let ((out (assoc-ref %outputs "out")) - (glibc (assoc-ref %build-inputs "libc"))) - (list (string-append "--prefix=" out) - "--build=i686-unknown-linux-gnu" - "--host=i686-unknown-linux-gnu" - (string-append "--with-native-system-header-dir=" glibc "/include") - (string-append "--with-build-sysroot=" glibc "/include") - "--disable-bootstrap" - "--disable-decimal-float" - "--disable-libatomic" - "--disable-libcilkrts" - "--disable-libgomp" - "--disable-libitm" - "--disable-libmudflap" - "--disable-libquadmath" - "--disable-libsanitizer" - "--disable-libssp" - "--disable-libvtv" - "--disable-lto" - "--disable-lto-plugin" - "--disable-multilib" - "--disable-plugin" - "--disable-threads" - "--enable-languages=c" - "--enable-static" - "--disable-shared" - "--enable-threads=single" - "--disable-libstdcxx-pch" - "--disable-build-with-cxx")) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'apply-boot-patch - (lambda* (#:key inputs #:allow-other-keys) - (let ((patch-file (assoc-ref inputs "boot-patch"))) - (format (current-error-port) "patch file=~s\n" patch-file) - (system* "patch" "--force" "-p1" "-i" patch-file)) - #t)) - ;; c&p from commencement.scm:gcc-boot0 - (add-after 'unpack 'unpack-gmp&co - (lambda* (#:key inputs #:allow-other-keys) - (let ((gmp (assoc-ref %build-inputs "gmp-source")) - (mpfr (assoc-ref %build-inputs "mpfr-source")) - (mpc (assoc-ref %build-inputs "mpc-source"))) - - ;; To reduce the set of pre-built bootstrap inputs, build - ;; GMP & co. from GCC. - (for-each (lambda (source) - (or (invoke "tar" "xvf" source) - (error "failed to unpack tarball" - source))) - (list gmp mpfr mpc)) - - ;; Create symlinks like `gmp' -> `gmp-x.y.z'. - ,@(map (lambda (lib) - ;; Drop trailing letters, as gmp-6.0.0a unpacks - ;; into gmp-6.0.0. - `(symlink ,(string-trim-right - (package-full-name lib "-") - char-set:letter) - ,(package-name lib))) - (list gmp-boot mpfr-boot mpc-boot)) - #t))) - (add-before 'configure 'setenv - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (binutils (assoc-ref %build-inputs "binutils")) - (bash (assoc-ref %build-inputs "bash")) - (gcc (assoc-ref %build-inputs "gcc")) - (glibc (assoc-ref %build-inputs "libc")) - (kernel-headers (assoc-ref %build-inputs "kernel-headers"))) - (setenv "CONFIG_SHELL" (string-append bash "/bin/sh")) - (setenv "C_INCLUDE_PATH" (string-append - gcc "/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include" - ":" kernel-headers "/include" - ":" glibc "/include" - ":" (getcwd) "/mpfr/src")) - (setenv "LIBRARY_PATH" (string-append glibc "/lib" - ":" gcc "/lib")) - (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH")) - (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv "LIBRARY_PATH")) - #t)))))))) + "173kdb188qg79pcz073cj9967rs2vzanyjdjyxy9v0xb0p5sad75")))) + (inputs `(("gmp-source" ,gmp-boot) + ("mpfr-source" ,mpfr-boot) + ("mpc-source" ,mpc-boot))) + (native-inputs (%boot-mesboot1-inputs)) + (arguments + (list #:implicit-inputs? #f + #:guile %bootstrap-guile + #:tests? #f + #:modules '((guix build gnu-build-system) + (guix build utils) + (srfi srfi-1)) + #:parallel-build? #f ; for debugging + #:make-flags + #~(let* ((libc (assoc-ref %build-inputs "libc")) + (ldflags (string-append + "-B" libc "/lib " + "-Wl,-dynamic-linker " + "-Wl," libc + #$(glibc-dynamic-linker "i686-linux")))) + (list (string-append "LDFLAGS=" ldflags) + (string-append "LDFLAGS_FOR_TARGET=" ldflags))) + #:configure-flags + #~(let ((out (assoc-ref %outputs "out")) + (glibc (assoc-ref %build-inputs "libc"))) + (list (string-append "--prefix=" out) + "--build=i686-unknown-linux-gnu" + "--host=i686-unknown-linux-gnu" + (string-append "--with-native-system-header-dir=" glibc "/include") + (string-append "--with-build-sysroot=" glibc "/include") + "--disable-bootstrap" + "--disable-decimal-float" + "--disable-libatomic" + "--disable-libcilkrts" + "--disable-libgomp" + "--disable-libitm" + "--disable-libmudflap" + "--disable-libquadmath" + "--disable-libsanitizer" + "--disable-libssp" + "--disable-libvtv" + "--disable-lto" + "--disable-lto-plugin" + "--disable-multilib" + "--disable-plugin" + "--disable-threads" + "--enable-languages=c" + "--enable-static" + "--disable-shared" + "--enable-threads=single" + "--disable-libstdcxx-pch" + "--disable-build-with-cxx")) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'apply-boot-patch + (lambda* (#:key inputs #:allow-other-keys) + (let ((patch-file + #$(local-file + (search-patch "gcc-boot-4.6.4.patch")))) + (invoke "patch" "--force" "-p1" "-i" patch-file)))) + ;; c&p from commencement.scm:gcc-boot0 + (add-after 'unpack 'unpack-gmp&co + (lambda* (#:key inputs #:allow-other-keys) + (let ((gmp (assoc-ref %build-inputs "gmp-source")) + (mpfr (assoc-ref %build-inputs "mpfr-source")) + (mpc (assoc-ref %build-inputs "mpc-source"))) + + ;; To reduce the set of pre-built bootstrap inputs, build + ;; GMP & co. from GCC. + (for-each (lambda (source) + (or (invoke "tar" "xvf" source) + (error "failed to unpack tarball" + source))) + (list gmp mpfr mpc)) + + ;; Create symlinks like `gmp' -> `gmp-x.y.z'. + #$@(map (lambda (lib package) + ;; Drop trailing letters, as gmp-6.0.0a unpacks + ;; into gmp-6.0.0. + #~(symlink #$(string-trim-right + (basename + (origin-actual-file-name lib) + ".tar.gz") + char-set:letter) + #$package)) + (list gmp-boot mpfr-boot mpc-boot) + '("gmp" "mpfr" "mpc"))))) + (add-before 'configure 'setenv + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (binutils (assoc-ref %build-inputs "binutils")) + (bash (assoc-ref %build-inputs "bash")) + (gcc (assoc-ref %build-inputs "gcc")) + (glibc (assoc-ref %build-inputs "libc")) + (kernel-headers (assoc-ref %build-inputs "kernel-headers"))) + (setenv "CONFIG_SHELL" (string-append bash "/bin/sh")) + (setenv "C_INCLUDE_PATH" (string-append + gcc "/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include" + ":" kernel-headers "/include" + ":" glibc "/include" + ":" (getcwd) "/mpfr/src")) + (setenv "LIBRARY_PATH" (string-append glibc "/lib" + ":" gcc "/lib")) + (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH")) + (format (current-error-port) "LIBRARY_PATH=~a\n" + (getenv "LIBRARY_PATH")))))))))) (define gcc-mesboot1 (package @@ -2007,31 +1896,29 @@ ac_cv_c_float_format='IEEE (little-endian)' (arguments (substitute-keyword-arguments (package-arguments gcc-core-mesboot1) ((#:configure-flags configure-flags) - `(let ((out (assoc-ref %outputs "out"))) - `("--enable-languages=c,c++" - ,@(filter - (negate (lambda (x) (string-prefix? "--enable-languages=" x))) - ,configure-flags)))) + #~(let ((out (assoc-ref %outputs "out"))) + `("--enable-languages=c,c++" + ,@(filter + (negate (lambda (x) (string-prefix? "--enable-languages=" x))) + #$configure-flags)))) ((#:phases phases) - `(modify-phases ,phases - (add-before 'unpack 'unpack-g++ - (lambda _ - (let ((source-g++ (assoc-ref %build-inputs "gcc-g++"))) - (invoke "tar" "xvf" source-g++)) - #t)) - (replace 'setenv - (lambda _ - (setenv "CONFIG_SHELL" (which "sh")) - - ;; Allow MPFR headers to be found. - (setenv "C_INCLUDE_PATH" - (string-append (getcwd) "/mpfr/src:" - (getenv "C_INCLUDE_PATH"))) - - ;; Set the C++ search path so that C headers can be found as - ;; libstdc++ is being compiled. - (setenv "CPLUS_INCLUDE_PATH" (getenv "C_INCLUDE_PATH")) - #t)))))))) + #~(modify-phases #$phases + (add-before 'unpack 'unpack-g++ + (lambda _ + (let ((source-g++ (assoc-ref %build-inputs "gcc-g++"))) + (invoke "tar" "xvf" source-g++)))) + (replace 'setenv + (lambda _ + (setenv "CONFIG_SHELL" (which "sh")) + + ;; Allow MPFR headers to be found. + (setenv "C_INCLUDE_PATH" + (string-append (getcwd) "/mpfr/src:" + (getenv "C_INCLUDE_PATH"))) + + ;; Set the C++ search path so that C headers can be found as + ;; libstdc++ is being compiled. + (setenv "CPLUS_INCLUDE_PATH" (getenv "C_INCLUDE_PATH")))))))))) (define (%boot-mesboot2-inputs) `(("gcc" ,gcc-mesboot1) @@ -2172,8 +2059,7 @@ ac_cv_c_float_format='IEEE (little-endian)' (substitute* "gprof/Makefile.in" (("^SUBDIRS = po") "SUBDIRS =")) (substitute* "ld/Makefile.in" - (("^SUBDIRS = po") "SUBDIRS =")) - #t))))))) + (("^SUBDIRS = po") "SUBDIRS ="))))))))) (define (%boot-mesboot3-inputs) `(("binutils" ,binutils-mesboot) @@ -2201,92 +2087,89 @@ ac_cv_c_float_format='IEEE (little-endian)' (arguments (substitute-keyword-arguments (package-arguments glibc-mesboot0) ((#:configure-flags configure-flags) - `(let ((out (assoc-ref %outputs "out")) - (headers (assoc-ref %build-inputs "headers"))) - (list - (string-append "--prefix=" out) - "--disable-obsolete-rpc" - "--host=i686-unknown-linux-gnu" - (string-append "--with-headers=" headers "/include") - "--enable-static-nss" - "--with-pthread" - "--without-cvs" - "--without-gd" - "--enable-add-ons=nptl" - ;; avoid: configure: error: confusing output from nm -u - "libc_cv_predef_stack_protector=no"))) + #~(let ((out (assoc-ref %outputs "out")) + (headers (assoc-ref %build-inputs "headers"))) + (list + (string-append "--prefix=" out) + "--disable-obsolete-rpc" + "--host=i686-unknown-linux-gnu" + (string-append "--with-headers=" headers "/include") + "--enable-static-nss" + "--with-pthread" + "--without-cvs" + "--without-gd" + "--enable-add-ons=nptl" + ;; avoid: configure: error: confusing output from nm -u + "libc_cv_predef_stack_protector=no"))) ((#:make-flags make-flags) - '(list "install-bootstrap-headers=yes" "install-headers")) + #~(list "install-bootstrap-headers=yes" "install-headers")) ((#:phases phases) - `(modify-phases ,phases - (delete 'apply-boot-patch) - (delete 'fixup-configure) - (delete 'set-path) - (replace 'unpack - (lambda* (#:key source #:allow-other-keys) - (invoke "tar" "xvf" source) - (chdir (string-append "glibc-" ,version)) - #t)) - (replace 'setenv - (lambda* (#:key inputs #:allow-other-keys) - (let* ((headers (assoc-ref inputs "headers")) - (libc (assoc-ref inputs "libc")) - (gcc (assoc-ref inputs "gcc")) - (cppflags (string-append - " -I " (getcwd) "/nptl/sysdeps/pthread/bits" - " -D BOOTSTRAP_GLIBC=1")) - (cflags (string-append " -L " (getcwd) - " -L " libc "/lib"))) - (setenv "libc_cv_friendly_stddef" "yes") - (setenv "CONFIG_SHELL" (which "sh")) - (setenv "SHELL" (which "sh")) - - (setenv "CPP" (string-append gcc "/bin/gcc -E " cppflags)) - (setenv "CC" (string-append gcc "/bin/gcc " cppflags cflags)) - (setenv "LD" "gcc") - - ;; avoid -fstack-protector - (setenv "libc_cv_ssp" "false") - (substitute* "configure" - (("/bin/pwd") "pwd")) - #t))) - (replace 'install - (lambda* (#:key outputs make-flags #:allow-other-keys) - (let ((kernel-headers (assoc-ref %build-inputs "kernel-headers")) - (out (assoc-ref outputs "out"))) - (and (apply invoke "make" make-flags) - (copy-recursively kernel-headers out) - #t)))) - (replace 'configure - (lambda* (#:key configure-flags #:allow-other-keys) - (format (current-error-port) "running ../configure ~a\n" (string-join configure-flags)) - (mkdir-p "build") - (chdir "build") - (apply invoke "../configure" configure-flags))) - (add-after 'configure 'remove-sunrpc - (lambda _ - (let* ((out (assoc-ref %outputs "out")) - (bash (assoc-ref %build-inputs "bash")) - (shell (string-append bash "/bin/bash"))) - - (let ((Makefile (open-file "Makefile" "a"))) - (display (string-append " + #~(modify-phases #$phases + (delete 'apply-boot-patch) + (delete 'fixup-configure) + (delete 'set-path) + (replace 'unpack + (lambda* (#:key source #:allow-other-keys) + (invoke "tar" "xvf" source) + (chdir (string-append "glibc-" #$version)))) + (replace 'setenv + (lambda* (#:key inputs #:allow-other-keys) + (let* ((headers (assoc-ref inputs "headers")) + (libc (assoc-ref inputs "libc")) + (gcc (assoc-ref inputs "gcc")) + (cppflags (string-append + " -I " (getcwd) "/nptl/sysdeps/pthread/bits" + " -D BOOTSTRAP_GLIBC=1")) + (cflags (string-append " -L " (getcwd) + " -L " libc "/lib"))) + (setenv "libc_cv_friendly_stddef" "yes") + (setenv "CONFIG_SHELL" (which "sh")) + (setenv "SHELL" (which "sh")) + + (setenv "CPP" (string-append gcc "/bin/gcc -E " cppflags)) + (setenv "CC" (string-append gcc "/bin/gcc " cppflags cflags)) + (setenv "LD" "gcc") + + ;; avoid -fstack-protector + (setenv "libc_cv_ssp" "false") + (substitute* "configure" + (("/bin/pwd") "pwd"))))) + (replace 'install + (lambda* (#:key outputs make-flags #:allow-other-keys) + (let ((kernel-headers (assoc-ref %build-inputs "kernel-headers")) + (out (assoc-ref outputs "out"))) + (apply invoke "make" make-flags) + (copy-recursively kernel-headers out)))) + (replace 'configure + (lambda* (#:key configure-flags #:allow-other-keys) + (format (current-error-port) "running ../configure ~a\n" + (string-join configure-flags)) + (mkdir-p "build") + (chdir "build") + (apply invoke "../configure" configure-flags))) + (add-after 'configure 'remove-sunrpc + (lambda _ + (let* ((out (assoc-ref %outputs "out")) + (bash (assoc-ref %build-inputs "bash")) + (shell (string-append bash "/bin/bash"))) + + (let ((Makefile (open-file "Makefile" "a"))) + (display (string-append " SHELL := " shell " ") - Makefile) - (close Makefile)) - (substitute* "../Makefile" - (("^SHELL := /bin/sh") (string-append "SHELL := " shell))) - (substitute* "../Makeconfig" - (("^SHELL := /bin/sh") (string-append "SHELL := " shell))) - (substitute* "../elf/Makefile" - (("^SHELL := /bin/sh") (string-append "SHELL := " shell))) - (invoke "make" (string-append (getcwd) "/sysd-sorted" )) - (substitute* "sysd-sorted" - ((" sunrpc") " ") - ((" nis") " ")) - #t))))))))) + Makefile) + (close Makefile)) + (substitute* "../Makefile" + (("^SHELL := /bin/sh") (string-append "SHELL := " shell))) + (substitute* "../Makeconfig" + (("^SHELL := /bin/sh") (string-append "SHELL := " shell))) + (substitute* "../elf/Makefile" + (("^SHELL := /bin/sh") (string-append "SHELL := " shell))) + (invoke "make" (string-append (getcwd) "/sysd-sorted" )) + (substitute* "sysd-sorted" + ((" sunrpc") " ") + ((" nis") " "))))))))))) (define glibc-mesboot (package @@ -2298,18 +2181,17 @@ SHELL := " shell " `(#:validate-runpath? #f ; fails when using --enable-shared ,@(substitute-keyword-arguments (package-arguments glibc-headers-mesboot) ((#:make-flags make-flags) - `(let ((bash (assoc-ref %build-inputs "bash"))) - (list (string-append "SHELL=" bash "/bin/sh")))) + #~(let ((bash (assoc-ref %build-inputs "bash"))) + (list (string-append "SHELL=" bash "/bin/sh")))) ((#:phases phases) - `(modify-phases ,phases - (replace 'install - (lambda* (#:key outputs make-flags #:allow-other-keys) - (let* ((kernel-headers (assoc-ref %build-inputs "kernel-headers")) - (out (assoc-ref outputs "out")) - (install-flags (cons "install" make-flags))) - (and (apply invoke "make" install-flags) - (copy-recursively kernel-headers out) - #t))))))))))) + #~(modify-phases #$phases + (replace 'install + (lambda* (#:key outputs make-flags #:allow-other-keys) + (let* ((kernel-headers (assoc-ref %build-inputs "kernel-headers")) + (out (assoc-ref outputs "out")) + (install-flags (cons "install" make-flags))) + (apply invoke "make" install-flags) + (copy-recursively kernel-headers out))))))))))) (define (%boot-mesboot4-inputs) `(("libc" ,glibc-mesboot) @@ -2364,8 +2246,7 @@ exec " gcc "/bin/" program "g++" "i686-unknown-linux-gnu-cpp" "i686-unknown-linux-gnu-gcc" - "i686-unknown-linux-gnu-g++")) - #t))) + "i686-unknown-linux-gnu-g++"))))) (replace 'check (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) @@ -2380,81 +2261,80 @@ exec " gcc "/bin/" program (version (package-version gcc-4.9)) (source (bootstrap-origin (package-source gcc-4.9))) (native-inputs `(("gcc-wrapper" ,gcc-mesboot1-wrapper) - ("gcc" ,gcc-mesboot1) ("headers" ,glibc-headers-mesboot) ,@(%boot-mesboot4-inputs))) (arguments `(#:validate-runpath? #f ,@(substitute-keyword-arguments (package-arguments gcc-mesboot1) ((#:configure-flags configure-flags) - `(let ((out (assoc-ref %outputs "out")) - (glibc (assoc-ref %build-inputs "libc"))) - (list (string-append "--prefix=" out) - "--build=i686-unknown-linux-gnu" - "--host=i686-unknown-linux-gnu" - - "--with-host-libstdcxx=-lsupc++" - - (string-append "--with-native-system-header-dir=" glibc "/include") - (string-append "--with-build-sysroot=" glibc "/include") - - "--disable-bootstrap" - "--disable-decimal-float" - "--disable-libatomic" - "--disable-libcilkrts" - "--disable-libgomp" - "--disable-libitm" - "--disable-libmudflap" - "--disable-libquadmath" - "--disable-libsanitizer" - "--disable-libssp" - "--disable-libvtv" - "--disable-lto" - "--disable-lto-plugin" - "--disable-multilib" - "--disable-plugin" - "--disable-threads" - "--enable-languages=c,c++" - - "--enable-static" - "--enable-shared" - "--enable-threads=single" - - ;; No pre-compiled libstdc++ headers, to save space. - "--disable-libstdcxx-pch" - - ;; for libcpp ... - "--disable-build-with-cxx"))) + #~(let ((out (assoc-ref %outputs "out")) + (glibc (assoc-ref %build-inputs "libc"))) + (list (string-append "--prefix=" out) + "--build=i686-unknown-linux-gnu" + "--host=i686-unknown-linux-gnu" + + "--with-host-libstdcxx=-lsupc++" + + (string-append "--with-native-system-header-dir=" glibc "/include") + (string-append "--with-build-sysroot=" glibc "/include") + + "--disable-bootstrap" + "--disable-decimal-float" + "--disable-libatomic" + "--disable-libcilkrts" + "--disable-libgomp" + "--disable-libitm" + "--disable-libmudflap" + "--disable-libquadmath" + "--disable-libsanitizer" + "--disable-libssp" + "--disable-libvtv" + "--disable-lto" + "--disable-lto-plugin" + "--disable-multilib" + "--disable-plugin" + "--disable-threads" + "--enable-languages=c,c++" + + "--enable-static" + "--enable-shared" + "--enable-threads=single" + + ;; No pre-compiled libstdc++ headers, to save space. + "--disable-libstdcxx-pch" + + ;; for libcpp ... + "--disable-build-with-cxx"))) ((#:phases phases) - `(modify-phases ,phases - (delete 'apply-boot-patch) - (delete 'unpack-g++) ; sadly, gcc-4.9.4 does not provide - ; modular core/language downloads - (replace 'setenv - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (binutils (assoc-ref %build-inputs "binutils")) - (bash (assoc-ref %build-inputs "bash")) - (gcc (assoc-ref %build-inputs "gcc")) - (glibc (assoc-ref %build-inputs "libc")) - (kernel-headers (assoc-ref %build-inputs "kernel-headers"))) - (setenv "CONFIG_SHELL" (string-append bash "/bin/sh")) - (setenv "C_INCLUDE_PATH" (string-append - gcc "/lib/gcc-lib/i686-unknown-linux-gnu/4.6.4/include" - ":" kernel-headers "/include" - ":" glibc "/include" - ":" (getcwd) "/mpfr/src")) - (setenv "CPLUS_INCLUDE_PATH" (string-append - gcc "/lib/gcc-lib/i686-unknown-linux-gnu/4.6.4/include" - ":" kernel-headers "/include" - ":" glibc "/include" - ":" (getcwd) "/mpfr/src")) - (setenv "LIBRARY_PATH" (string-append glibc "/lib" - ":" gcc "/lib")) - (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH")) - (format (current-error-port) "CPLUS_INCLUDE_PATH=~a\n" (getenv "CPLUS_INCLUDE_PATH")) - (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv "LIBRARY_PATH")) - #t)))))))))) + #~(modify-phases #$phases + (delete 'apply-boot-patch) + (delete 'unpack-g++) ; sadly, gcc-4.9.4 does not provide + ; modular core/language downloads + (replace 'setenv + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (binutils (assoc-ref %build-inputs "binutils")) + (bash (assoc-ref %build-inputs "bash")) + (gcc (assoc-ref %build-inputs "gcc")) + (glibc (assoc-ref %build-inputs "libc")) + (kernel-headers (assoc-ref %build-inputs "kernel-headers"))) + (setenv "CONFIG_SHELL" (string-append bash "/bin/sh")) + (setenv "C_INCLUDE_PATH" (string-append + gcc "/lib/gcc-lib/i686-unknown-linux-gnu/4.6.4/include" + ":" kernel-headers "/include" + ":" glibc "/include" + ":" (getcwd) "/mpfr/src")) + (setenv "CPLUS_INCLUDE_PATH" (string-append + gcc "/lib/gcc-lib/i686-unknown-linux-gnu/4.6.4/include" + ":" kernel-headers "/include" + ":" glibc "/include" + ":" (getcwd) "/mpfr/src")) + (setenv "LIBRARY_PATH" (string-append glibc "/lib" + ":" gcc "/lib")) + (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH")) + (format (current-error-port) "CPLUS_INCLUDE_PATH=~a\n" (getenv "CPLUS_INCLUDE_PATH")) + (format (current-error-port) "LIBRARY_PATH=~a\n" + (getenv "LIBRARY_PATH")))))))))))) (define gcc-mesboot-wrapper ;; We need this so gcc-mesboot can be used to create shared binaries that @@ -2506,6 +2386,7 @@ exec " gcc "/bin/" program (define gnu-make-boot0 (package (inherit gnu-make) + (outputs (delete "debug" (package-outputs gnu-make))) (source (bootstrap-origin (package-source gnu-make))) (name "make-boot0") (arguments @@ -2517,7 +2398,16 @@ exec " gcc "/bin/" program ;; The generated config.status has some problems due to the ;; bootstrap environment. Disable dependency tracking to work ;; around it. - `(cons "--disable-dependency-tracking" ,flags)) + `(cons "--disable-dependency-tracking" + + ;; 'glibc-bootstrap' on non-x86 platforms has a buggy + ;; 'posix_spawn'. Thus, disable it. See + ;; <https://bugs.gnu.org/49367>. + ,(match (%current-system) + ((or "i686-linux" "x86_64-linux") + flags) + (_ + `(cons "--disable-posix-spawn" ,flags))))) ((#:phases phases) `(modify-phases ,phases (replace 'build @@ -2527,8 +2417,7 @@ exec " gcc "/bin/" program (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (bin (string-append out "/bin"))) - (install-file "make" bin) - #t)))))))) + (install-file "make" bin))))))))) (native-inputs '()) ; no need for 'pkg-config' (inputs (%bootstrap-inputs+toolchain)))) @@ -2549,6 +2438,7 @@ exec " gcc "/bin/" program (define coreutils-boot0 (package (inherit coreutils) + (outputs (delete "debug" (package-outputs coreutils))) (source (bootstrap-origin (package-source coreutils))) (name "coreutils-boot0") (native-inputs `()) @@ -2565,6 +2455,9 @@ exec " gcc "/bin/" program (package (inherit diffutils) (name "diffutils-boot0") + (source (origin + (inherit (package-source diffutils)) + (patches '()))) ;patches for tests unneeded here (native-inputs `()) (inputs `(("make" ,gnu-make-boot0) @@ -2594,6 +2487,8 @@ exec " gcc "/bin/" program ,@(%bootstrap-inputs+toolchain))) (arguments `(#:implicit-inputs? #f + ;; Ignore test failure in gnulib for armhf/aarch64. + #:tests? ,(not (target-arm?)) #:guile ,%bootstrap-guile ;; The build system assumes we have done a mistake when time_t is 32-bit @@ -2608,7 +2503,20 @@ exec " gcc "/bin/" program ((or "arm-linux" "aarch64-linux") ''("--disable-dependency-tracking")) (_ ''())) - ,flags))))))) + ,flags)) + ((#:phases phases '%standard-phases) + `(modify-phases ,phases + ;; 'test-fnmatch' fails when using [email protected], due + ;; to incorrect handling of the [:alpha:] regexp character + ;; class. Ignore it. + ,@(if (member (%current-system) + '("x86_64-linux" "i686-linux")) + '((add-before 'check 'skip-fnmatch-test + (lambda _ + (substitute* "gnulib-tests/Makefile" + (("^XFAIL_TESTS =") + "XFAIL_TESTS = test-fnmatch "))))) + '())))))))) (define file (package @@ -2640,7 +2548,7 @@ exec " gcc "/bin/" program (define gawk-boot0 (package - (inherit patch) + (inherit gawk) (source (bootstrap-origin (package-source gawk))) (name "gawk-boot0") (native-inputs '()) @@ -2753,8 +2661,7 @@ exec " gcc "/bin/" program (with-directory-excursion (string-append out "/bin") (for-each (lambda (name) (symlink name (remove-triplet-prefix name))) - (scandir "." has-triplet-prefix?))) - #t)))) + (scandir "." has-triplet-prefix?))))))) ,@(substitute-keyword-arguments (package-arguments binutils) ((#:configure-flags cf) @@ -2789,8 +2696,7 @@ exec " gcc "/bin/" program ;; fail, which in turn confuses the configure script. (lambda _ (substitute* "libstdc++-v3/configure" - (("g\\+\\+ -v") "true")) - #t)))))) + (("g\\+\\+ -v") "true")))))))) (_ (package-arguments lib))))) (inputs (%boot0-inputs)) (native-inputs '())))) @@ -2799,6 +2705,7 @@ exec " gcc "/bin/" program (package (inherit gcc) (name "gcc-cross-boot0") + (outputs (delete "debug" (package-outputs gcc))) (source (bootstrap-origin (package-source gcc))) (arguments `(#:guile ,%bootstrap-guile @@ -2819,13 +2726,6 @@ exec " gcc "/bin/" program "--disable-shared" "--enable-languages=c,c++" - ;; boot-triplet inserts "guix" in the triplet. - ,@(if (equal? "powerpc64le-guix-linux-gnu" (boot-triplet)) - ;; On POWER9 (little endian) glibc needs the - ;; 128-bit long double type. - '("--with-long-double-128") - '()) - ;; libstdc++ cannot be built at this stage ;; ("Link tests are not allowed after ;; GCC_NO_EXECUTABLES."). @@ -2879,8 +2779,7 @@ exec " gcc "/bin/" program (package-full-name lib "-") char-set:letter) ,(package-name lib))) - (list gmp-6.0 mpfr mpc)) - #t))) + (list gmp-6.0 mpfr mpc))))) ,(match (%current-system) ((or "i686-linux" "x86_64-linux") '(add-before 'configure 'fix-libcc1 @@ -2893,8 +2792,7 @@ exec " gcc "/bin/" program (assoc-ref inputs "gcc") "/lib"))) ;; XXX: "g++ -v" is broken (see also libstdc++ above). (substitute* "libcc1/configure" - (("g\\+\\+ -v") "true")) - #t))) + (("g\\+\\+ -v") "true"))))) (_ '(add-before 'configure 'return-true (lambda _ #t)))) (add-after 'install 'symlink-libgcc_eh @@ -2906,8 +2804,7 @@ exec " gcc "/bin/" program (string-append out "/lib/gcc/" ,(boot-triplet) "/" ,(package-version gcc)) - (symlink "libgcc.a" "libgcc_eh.a")) - #t)))))))) + (symlink "libgcc.a" "libgcc_eh.a")))))))))) (inputs `(("gmp-source" ,(bootstrap-origin (package-source gmp-6.0))) ("mpfr-source" ,(bootstrap-origin (package-source mpfr))) @@ -2948,8 +2845,7 @@ exec " gcc "/bin/" program (lambda _ (substitute* "Configure" (("^libswanted=(.*)pthread" _ before) - (string-append "libswanted=" before))) - #t)))) + (string-append "libswanted=" before))))))) ;; Do not configure with '-Dusethreads' since pthread ;; support is missing. ((#:configure-flags configure-flags) @@ -2992,6 +2888,15 @@ exec " gcc "/bin/" program "RANLIB=ranlib -D")) "V=1") + ;; 'glibc-bootstrap' on non-x86 platforms has a buggy 'posix_spawn'. + ;; Thus, use the Gnulib replacement instead. See + ;; <https://bugs.gnu.org/49367>. + ,@(match (%current-system) + ((or "i686-linux" "x86_64-linux") + '()) + (_ + '(#:configure-flags '("gl_cv_func_posix_spawn_works=no")))) + ,@(package-arguments bison))))) (define flex-boot0 @@ -3006,15 +2911,6 @@ exec " gcc "/bin/" program #:guile ,%bootstrap-guile #:tests? #f)))) -(define rsync-boot0 - (package - (inherit rsync) - (native-inputs `(("perl" ,perl-boot0))) - (inputs (%boot0-inputs)) - (arguments - `(#:implicit-inputs? #f - #:guile ,%bootstrap-guile)))) - (define-syntax define/system-dependent (lambda (s) "Bind IDENTIFIER to EXP, where the value of EXP is known to depend on @@ -3050,9 +2946,6 @@ memoized as a function of '%current-system'." ;; Flex and Bison are required since version 4.16. ("flex" ,flex-boot0) ("bison" ,bison-boot0) - - ;; Rsync is required since version 5.3. - ("rsync" ,rsync-boot0) ,@(%boot0-inputs))))) (define with-boot0 @@ -3155,6 +3048,7 @@ memoized as a function of '%current-system'." (package (inherit expat) (inputs (%boot0-inputs)) + (outputs '("out")) (arguments ;; XXX: Linking 'runtestscpp' fails with things like: ;; @@ -3169,6 +3063,7 @@ memoized as a function of '%current-system'." ;; Since we're not passing the right -Wl,-rpath flags, build the ;; static library to avoid RUNPATH validation failure. `(cons "--disable-shared" ,flags)) + ((#:phases phases) '%standard-phases) ((#:tests? _ #f) #f)))))) (define python-boot0 @@ -3195,54 +3090,54 @@ memoized as a function of '%current-system'." (substitute* "Modules/Setup.dist" ;; Link Expat instead of embedding the bundled one. (("^#pyexpat.*") "pyexpat pyexpat.c -lexpat\n")) - #t))))) + ;; Delete windows binaries + (for-each delete-file + (find-files "Lib/distutils/command" ".*.exe$")) + (for-each delete-file + (find-files "Lib/ensurepip" ".*.whl$"))))))) (inputs `(,@(%boot0-inputs) ("expat" ,expat-sans-tests))) ;remove OpenSSL, zlib, etc. - (native-inputs '()) ;and pkg-config + (native-inputs ;and pkg-config + `(("sitecustomize.py" ,(local-file (search-auxiliary-file + "python/sitecustomize.py"))))) (arguments `(#:implicit-inputs? #f #:guile ,%bootstrap-guile - - ,@(substitute-keyword-arguments (package-arguments python-minimal) - ;; Disable features that cannot be built at this stage. - ((#:configure-flags _ ''()) - `(list "--without-ensurepip" - "--without-threads")) - ;; Clear #:make-flags, such that changes to the regular - ;; Python package won't interfere with this one. - ((#:make-flags _ ''()) ''()) - ((#:phases phases) - ;; Remove the 'apply-alignment-patch' phase if present to avoid - ;; rebuilding this package. TODO: for the next rebuild cycle, - ;; consider inlining all the arguments instead of inheriting to - ;; make it easier to patch Python without risking a full rebuild. - ;; Or better yet, change to 'python-on-guile'. - `(modify-phases ,@(list (match phases - (('modify-phases original-phases - changes ... - ('add-after unpack apply-alignment-patch _)) - `(modify-phases ,original-phases ,@changes)) - (_ phases))) - (add-before 'configure 'disable-modules - (lambda _ - (substitute* "setup.py" - ;; Disable ctypes, since it requires libffi. - (("extensions\\.append\\(ctypes\\)") "") - ;; Prevent the 'ossaudiodev' extension from being - ;; built, since it requires Linux headers. - (("'linux', ") "")) - #t)) - (delete 'set-TZDIR) - ,@(if (hurd-system?) - `((add-before 'build 'fix-regen - (lambda* (#:key inputs #:allow-other-keys) - (let ((libc (assoc-ref inputs "libc"))) - (substitute* "Lib/plat-generic/regen" - (("/usr/include/") (string-append libc "/include/"))) - #t)))) - '()))) - ((#:tests? _ #f) #f)))))) + ;; Running the tests won't work because we lack several required + ;; modules (OpenSSL, etc). + #:tests? #f + ;; Disable features that cannot be built at this stage. + #:configure-flags '("--without-ensurepip" "--without-threads") + #:phases + (modify-phases %standard-phases + (add-before 'configure 'patch-lib-shells + (lambda _ + (substitute* '("Lib/subprocess.py" + "Lib/distutils/tests/test_spawn.py" + "Lib/test/support/__init__.py" + "Lib/test/test_subprocess.py") + (("/bin/sh") (which "sh"))))) + (add-before 'configure 'disable-modules + (lambda _ + (substitute* "setup.py" + ;; Disable ctypes, since it requires libffi. + (("extensions\\.append\\(ctypes\\)") "") + ;; Prevent the 'ossaudiodev' extension from being + ;; built, since it requires Linux headers. + (("'linux', ") "")))) + ,@(if (hurd-system?) + `((add-before 'build 'fix-regen + (lambda* (#:key inputs #:allow-other-keys) + (let ((libc (assoc-ref inputs "libc"))) + (substitute* "Lib/plat-generic/regen" + (("/usr/include/") + (string-append libc "/include/"))))))) + '()) + (add-after 'install 'install-sitecustomize.py + ,(customize-site version))))) + (native-search-paths + (list (guix-pythonpath-search-path version))))) (define/system-dependent ld-wrapper-boot0 ;; The first 'ld' wrapper, defined with 'define/system-dependent' because @@ -3272,6 +3167,7 @@ memoized as a function of '%current-system'." (package (inherit glibc) (name "glibc-intermediate") + (outputs (delete "debug" (package-outputs glibc))) (source (bootstrap-origin (package-source glibc))) (arguments `(#:guile ,%bootstrap-guile @@ -3289,9 +3185,9 @@ memoized as a function of '%current-system'." `(modify-phases ,phases (add-before 'configure 'pre-configure (lambda* (#:key inputs #:allow-other-keys) - ;; Don't clobber CPATH with the bootstrap libc. - (setenv "NATIVE_CPATH" (getenv "CPATH")) - (unsetenv "CPATH") + ;; Don't clobber include paths with the bootstrap libc. + (unsetenv "C_INCLUDE_PATH") + (unsetenv "CPLUS_INCLUDE_PATH") ;; Tell 'libpthread' where to find 'libihash' on Hurd systems. ,@(if (hurd-system?) @@ -3301,25 +3197,13 @@ memoized as a function of '%current-system'." (string-append "LDLIBS-pthread.so = " (assoc-ref %build-inputs "kernel-headers") "/lib/libihash.a\n")))) - '()) - - ;; 'rpcgen' needs native libc headers to be built. - (substitute* "sunrpc/Makefile" - (("sunrpc-CPPFLAGS =.*" all) - (string-append "CPATH = $(NATIVE_CPATH)\n" - "export CPATH\n" - all "\n"))) - #t))))))) + '())))))))) (propagated-inputs `(("kernel-headers" ,(kernel-headers-boot0)))) (native-inputs `(("bison" ,bison-boot0) ("texinfo" ,texinfo-boot0) ("perl" ,perl-boot0) - ("python" ,python-boot0) - ,@(if (target-powerpc?) - `(("powerpc64le-patch" ,@(search-patches - "glibc-ldd-powerpc.patch"))) - '()))) + ("python" ,python-boot0))) (inputs `( ;; The boot inputs. That includes the bootstrap libc. We don't want ;; it in $CPATH, hence the 'pre-configure' phase above. @@ -3330,9 +3214,6 @@ memoized as a function of '%current-system'." `(("mig" ,mig-boot0)) '()) - ;; A native GCC is needed to build `cross-rpcgen'. - ("native-gcc" ,@(assoc-ref (%boot0-inputs) "gcc")) - ;; Here, we use the bootstrap Bash, which is not satisfactory ;; because we don't want to depend on bootstrap tools. ("static-bash" ,@(assoc-ref (%boot0-inputs) "bash")))))) @@ -3380,9 +3261,7 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" triplet "-" tool) tool)) '("ar" "ranlib")) - (for-each wrap-program '("gcc" "g++"))) - - #t)))) + (for-each wrap-program '("gcc" "g++"))))))) (native-inputs `(("binutils" ,binutils) ("gcc" ,gcc) @@ -3445,16 +3324,14 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" ;; Build only the tools. (add-after 'unpack 'chdir (lambda _ - (chdir "gettext-tools") - #t)) + (chdir "gettext-tools"))) ;; Some test programs require pthreads, which we don't have. (add-before 'configure 'no-test-programs (lambda _ (substitute* "tests/Makefile.in" (("^PROGRAMS =.*$") - "PROGRAMS =\n")) - #t))))))) + "PROGRAMS =\n"))))))))) (define glibc-final ;; The final glibc, which embeds the statically-linked Bash built above. @@ -3470,10 +3347,6 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" ;; This time we need 'msgfmt' to install all the libc.mo files. (native-inputs `(,@(package-native-inputs glibc-final-with-bootstrap-bash) - ,@(if (target-powerpc?) - `(("powerpc64le-patch" ,@(search-patches - "glibc-ldd-powerpc.patch"))) - '()) ("gettext" ,gettext-boot0))) (propagated-inputs @@ -3484,7 +3357,7 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" ;; if 'allowed-references' were per-output. (arguments `(#:allowed-references - ((,gcc-boot0 "lib") + (,(gexp-input gcc-boot0 "lib") ,(kernel-headers-boot0) ,static-bash-for-glibc ,@(if (hurd-system?) @@ -3635,8 +3508,7 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" (package-full-name lib "-") char-set:letter) ,(package-name lib))) - (list gmp-6.0 mpfr mpc)) - #t)))))))) + (list gmp-6.0 mpfr mpc)))))))))) ;; This time we want Texinfo, so we get the manual. Add ;; STATIC-BASH-FOR-GLIBC so that it's used in the final shebangs of @@ -3712,6 +3584,13 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" #:guile guile-final #:bash bash-final)) +(define-public ld-gold-wrapper + (make-ld-wrapper "ld-gold-wrapper" + #:binutils binutils-gold + #:linker "ld.gold" + #:guile guile-final + #:bash bash-final)) + (define (%boot5-inputs) ;; Now with UTF-8 locales. Remember that the bootstrap binaries were built ;; with an older libc, which cannot load the new locale format. See @@ -3925,7 +3804,7 @@ is the GNU Compiler Collection.") (make-gcc-toolchain gcc-6)) (define-public gcc-toolchain-7 - gcc-toolchain) + (make-gcc-toolchain gcc-7)) (define-public gcc-toolchain-8 (make-gcc-toolchain gcc-8)) @@ -3934,7 +3813,7 @@ is the GNU Compiler Collection.") (make-gcc-toolchain gcc-9)) (define-public gcc-toolchain-10 - (make-gcc-toolchain gcc-10)) + gcc-toolchain) (define-public gcc-toolchain-11 (make-gcc-toolchain gcc-11)) |