From 9d1d434cd07d8a0372b113c2c0efacd2eb6e258a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 13 Dec 2012 23:38:32 +0100 Subject: build-system/gnu: Avoid using /bin/sh. * guix/build/gnu-build-system.scm (configure): Add `inputs' keyword parameter. Take Bash from there, falling back to /bin/sh. Set `CONFIG_SHELL' and `SHELL' to that Bash. Run "bash ./configure" instead of just "./configure". * distro/packages/bootstrap.scm (%bootstrap-inputs): Add "bash". * distro/packages/base.scm (gcc-boot0-wrapped): Use "bash" from %BOOT1-INPUTS instead of /bin/sh. --- distro/packages/base.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'distro/packages/base.scm') diff --git a/distro/packages/base.scm b/distro/packages/base.scm index ea6297107f..30bd804b56 100644 --- a/distro/packages/base.scm +++ b/distro/packages/base.scm @@ -774,6 +774,7 @@ identifier SYSTEM." (let* ((binutils (assoc-ref %build-inputs "binutils")) (gcc (assoc-ref %build-inputs "gcc")) (libc (assoc-ref %build-inputs "libc")) + (bash (assoc-ref %build-inputs "bash")) (out (assoc-ref %outputs "out")) (bindir (string-append out "/bin")) (triplet ,(boot-triplet system))) @@ -790,8 +791,9 @@ identifier SYSTEM." ;; the dynamic linker. (call-with-output-file "gcc" (lambda (p) - (format p "#!/bin/sh + (format p "#!~a/bin/bash exec ~a/bin/~a-gcc -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" + bash gcc triplet libc libc ,(glibc-dynamic-linker system)))) @@ -800,7 +802,8 @@ exec ~a/bin/~a-gcc -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" (native-inputs `(("binutils" ,binutils-boot0) ("gcc" ,gcc-boot0) - ("libc" ,glibc-final))) + ("libc" ,glibc-final) + ("bash" ,(assoc-ref %boot1-inputs "bash")))) (inputs '()))) (define %boot2-inputs -- cgit v1.2.3 From 7f131cf3681afe62c84db66e48430de9e54e7d7d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 14 Dec 2012 18:04:27 +0100 Subject: distro: Fix incorrect "bash" input for gcc-boot0-wrapped. * distro/packages/base.scm (gcc-boot0-wrapped): Fix incorrect "bash" input. --- distro/packages/base.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'distro/packages/base.scm') diff --git a/distro/packages/base.scm b/distro/packages/base.scm index 30bd804b56..f782d78895 100644 --- a/distro/packages/base.scm +++ b/distro/packages/base.scm @@ -803,7 +803,7 @@ exec ~a/bin/~a-gcc -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" `(("binutils" ,binutils-boot0) ("gcc" ,gcc-boot0) ("libc" ,glibc-final) - ("bash" ,(assoc-ref %boot1-inputs "bash")))) + ,(assoc "bash" %boot1-inputs))) (inputs '()))) (define %boot2-inputs -- cgit v1.2.3 From ea8fbbf2f2d8beccad1c7a98077c0a31fb40e578 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 19 Dec 2012 12:34:53 +0100 Subject: distro: make: Change default shell from /bin/sh to the actual shell. * distro/packages/base.scm (gnu-make): Add `set-default-shell' phase. (gnu-make-boot0): Adjust phases accordingly. --- distro/packages/base.scm | 46 +++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 17 deletions(-) (limited to 'distro/packages/base.scm') diff --git a/distro/packages/base.scm b/distro/packages/base.scm index f0dd150e12..4bd8070827 100644 --- a/distro/packages/base.scm +++ b/distro/packages/base.scm @@ -289,8 +289,18 @@ are expected to exist on every operating system.") (build-system gnu-build-system) (native-inputs `(("patch/impure-dirs" ,(search-patch "make-impure-dirs.patch")))) - (arguments `(#:patches (list (assoc-ref %build-inputs - "patch/impure-dirs")))) + (arguments + '(#:patches (list (assoc-ref %build-inputs "patch/impure-dirs")) + #:phases (alist-cons-before + 'build 'set-default-shell + (lambda* (#:key inputs #:allow-other-keys) + ;; Change the default shell from /bin/sh. + (let ((bash (assoc-ref inputs "bash"))) + (substitute* "job.c" + (("default_shell\\[\\] =.*$") + (format #f "default_shell[] = \"~a/bin/bash\";\n" + bash))))) + %standard-phases))) (synopsis "GNU Make, a program controlling the generation of non-source files from sources") (description @@ -534,21 +544,23 @@ with the Linux kernel.") (package (inherit gnu-make) (name "make-boot0") (location (source-properties->location (current-source-location))) - (arguments `(#:guile ,%bootstrap-guile - #:implicit-inputs? #f - #:tests? #f ; cannot run "make check" - #:phases - (alist-replace - 'build (lambda _ - (zero? (system* "./build.sh"))) - (alist-replace - 'install (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin"))) - (mkdir-p bin) - (copy-file "make" - (string-append bin "/make")))) - %standard-phases)))) + (arguments + `(#:guile ,%bootstrap-guile + #:implicit-inputs? #f + #:tests? #f ; cannot run "make check" + ,@(substitute-keyword-arguments (package-arguments gnu-make) + ((#:phases phases) + `(alist-replace + 'build (lambda _ + (zero? (system* "./build.sh"))) + (alist-replace + 'install (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) + (mkdir-p bin) + (copy-file "make" + (string-append bin "/make")))) + ,phases)))))) (inputs %bootstrap-inputs)))) (define diffutils-boot0 -- cgit v1.2.3 From dfb53ee2324689f5f7843b87c7dfd6cdd4eb49bc Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 19 Dec 2012 23:49:31 +0100 Subject: distro: ld-wrapper: Use the current Bash instead of /bin/sh. * distro/packages/ld-wrapper.scm: Use @BASH@ in shebang. Change module name to (gnu build-support ld-wrapper). * distro/packages/base.scm (ld-wrapper-boot3): Substitute @BASH@. (ld-wrapper): Use BASH-FINAL. --- distro/packages/base.scm | 14 ++++++++++---- distro/packages/ld-wrapper.scm | 6 +++--- 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'distro/packages/base.scm') diff --git a/distro/packages/base.scm b/distro/packages/base.scm index 4bd8070827..5e7380581d 100644 --- a/distro/packages/base.scm +++ b/distro/packages/base.scm @@ -872,9 +872,10 @@ exec ~a/bin/~a-gcc -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" (source #f) (build-system trivial-build-system) (inputs `(("binutils" ,binutils-final) - ("guile" ,%bootstrap-guile) - ("wrapper" ,(search-path %load-path - "distro/packages/ld-wrapper.scm")))) + ("guile" ,%bootstrap-guile) + ("bash" ,@(assoc-ref %boot2-inputs "bash")) + ("wrapper" ,(search-path %load-path + "distro/packages/ld-wrapper.scm")))) (arguments `(#:guile ,%bootstrap-guile #:modules ((guix build utils)) @@ -898,6 +899,9 @@ exec ~a/bin/~a-gcc -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" (("@GUILE@") (string-append (assoc-ref %build-inputs "guile") "/bin/guile")) + (("@BASH@") + (string-append (assoc-ref %build-inputs "bash") + "/bin/bash")) (("@LD@") (string-append (assoc-ref %build-inputs "binutils") "/bin/ld"))) @@ -946,7 +950,9 @@ store.") (package (inherit ld-wrapper-boot3) (name "ld-wrapper") (inputs `(("guile" ,guile-final) - ,@(alist-delete "guile" (package-inputs ld-wrapper-boot3)))))) + ("bash" ,bash-final) + ,@(fold alist-delete (package-inputs ld-wrapper-boot3) + '("guile" "bash")))))) (define-public %final-inputs ;; Final derivations used as implicit inputs by `gnu-build-system'. diff --git a/distro/packages/ld-wrapper.scm b/distro/packages/ld-wrapper.scm index 9b8a09f067..5c98375814 100644 --- a/distro/packages/ld-wrapper.scm +++ b/distro/packages/ld-wrapper.scm @@ -1,4 +1,4 @@ -#!/bin/sh +#!@BASH@ # -*- mode: scheme; coding: utf-8; -*- # XXX: We have to go through Bash because there's no command-line switch to @@ -7,7 +7,7 @@ # Use `load-compiled' because `load' (and `-l') doesn't otherwise load our # .go file (see ). -main="(@ (distro packages ld-wrapper) ld-wrapper)" +main="(@ (gnu build-support ld-wrapper) ld-wrapper)" exec @GUILE@ -c "(load-compiled \"$0.go\") (apply $main (cdr (command-line)))" "$@" !# ;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*- @@ -28,7 +28,7 @@ exec @GUILE@ -c "(load-compiled \"$0.go\") (apply $main (cdr (command-line)))" " ;;; You should have received a copy of the GNU General Public License ;;; along with Guix. If not, see . -(define-module (distro packages ld-wrapper) +(define-module (gnu build-support ld-wrapper) #:use-module (srfi srfi-1) #:export (ld-wrapper)) -- cgit v1.2.3 From d6f80f187c4bc109dd4d8fc839cc376e7b11e593 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 19 Dec 2012 23:24:13 +0100 Subject: distro: gcc: Patch to allow builds without /bin/sh. * distro/packages/base.scm (gcc-4.7): In `pre-configure' phase, patch shebang in `gcc/exec-tool.in'. --- distro/packages/base.scm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'distro/packages/base.scm') diff --git a/distro/packages/base.scm b/distro/packages/base.scm index 5e7380581d..58c39ce7cd 100644 --- a/distro/packages/base.scm +++ b/distro/packages/base.scm @@ -428,6 +428,9 @@ BFD (Binary File Descriptor) library, `gprof', `nm', `strip', etc.") ~a~%" libc line)))) + ;; Adjust hard-coded #!/bin/sh. + (patch-shebang "gcc/exec-tool.in") + ;; Don't retain a dependency on the build-time sed. (substitute* "fixincludes/fixincl.x" (("static char const sed_cmd_z\\[\\] =.*;") -- cgit v1.2.3 From 6e32f6c019c35a8092f1285be67aaa7dd04c0f59 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 20 Dec 2012 00:49:06 +0100 Subject: distro: glibc: Add a statically-linked Bash to $out/bin. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * distro/packages/base.scm (glibc): Pass `ac_cv_path_BASH_SHELL' in the configure flags. During the `pre-configure' phase, copy the "static-bash" input to $out/bin, and change `system' and `popen' to use it instead of /bin/sh. Add the "static-bash" input. Suggested by Shea Levy and Lluís Batlle i Rossell . --- distro/packages/base.scm | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'distro/packages/base.scm') diff --git a/distro/packages/base.scm b/distro/packages/base.scm index 58c39ce7cd..7cb2dc116e 100644 --- a/distro/packages/base.scm +++ b/distro/packages/base.scm @@ -499,12 +499,19 @@ used in the GNU system including the GNU/Linux variant.") "--enable-kernel=2.6.30" ;; XXX: Work around "undefined reference to `__stack_chk_guard'". - "libc_cv_ssp=no") + "libc_cv_ssp=no" + + ;; Use our Bash instead of /bin/sh. + (string-append "ac_cv_path_BASH_SHELL=" + (assoc-ref %build-inputs "bash") + "/bin/bash")) + #:tests? #f ; XXX #:phases (alist-cons-before 'configure 'pre-configure - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) ;; Use `pwd', not `/bin/pwd'. (substitute* "configure" (("/bin/pwd") "pwd")) @@ -522,10 +529,28 @@ used in the GNU system including the GNU/Linux variant.") ;; , ;; linking against libgcc_s is not needed with GCC ;; 4.7.1. - ((" -lgcc_s") "")))) + ((" -lgcc_s") "")) + + ;; Copy a statically-linked Bash in the output. + (mkdir-p bin) + (copy-file (assoc-ref inputs "static-bash") + (string-append bin "/bash")) + (chmod (string-append bin "/bash") #o555) + + ;; Have `system' use that Bash. + (substitute* "sysdeps/posix/system.c" + (("#define[[:blank:]]+SHELL_PATH.*$") + (format #f "#define SHELL_PATH \"~a/bin/bash\"\n" + out))) + + ;; Same for `popen'. + (substitute* "libio/iopopen.c" + (("/bin/sh") + (string-append out "/bin/bash"))))) %standard-phases))) (inputs `(("patch/ld.so.cache" - ,(search-patch "glibc-no-ld-so-cache.patch")))) + ,(search-patch "glibc-no-ld-so-cache.patch")) + ("static-bash" ,(cut search-bootstrap-binary "bash" <>)))) (synopsis "The GNU C Library") (description "Any Unix-like operating system needs a C library: the library which -- cgit v1.2.3 From 8ccdbaa827c0be5a8c785f17d1eb5de165190ecd Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 20 Dec 2012 01:37:50 +0100 Subject: distro: Update `guile-final' to not fail during `patch-source-shebangs' phase. * distro/packages/base.scm (guile-final): Add workaround on top of GUILE-2.0/FIXED to avoid `patch-source-shebangs' failure on one of the source files. --- distro/packages/base.scm | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'distro/packages/base.scm') diff --git a/distro/packages/base.scm b/distro/packages/base.scm index 7cb2dc116e..dacf8e46aa 100644 --- a/distro/packages/base.scm +++ b/distro/packages/base.scm @@ -967,11 +967,27 @@ store.") ;; FIXME: The Libtool used here, specifically its `bin/libtool' script, ;; holds a dependency on the bootstrap Binutils. Use multiple outputs for ;; Libtool, so that that dependency is isolated in the "bin" output. - (package-with-bootstrap-guile - (package-with-explicit-inputs guile-2.0/fixed - %boot4-inputs - (current-source-location) - #:guile %bootstrap-guile))) + (let ((guile (package (inherit guile-2.0/fixed) + (arguments + `(#:phases + (alist-cons-before + 'patch-source-shebangs 'delete-encoded-test + (lambda* (#:key inputs #:allow-other-keys) + ;; %BOOTSTRAP-GUILE doesn't know about encodings other + ;; than UTF-8. That test declares an ISO-8859-1 + ;; encoding, which prevents `patch-shebang' from + ;; working, so skip it. + (call-with-output-file + "test-suite/standalone/test-command-line-encoding2" + (lambda (p) + (format p "#!~a/bin/bash\nexit 77" + (assoc-ref inputs "bash"))))) + %standard-phases)))))) + (package-with-bootstrap-guile + (package-with-explicit-inputs guile + %boot4-inputs + (current-source-location) + #:guile %bootstrap-guile)))) (define-public ld-wrapper ;; The final `ld' wrapper, which uses the final Guile. -- cgit v1.2.3 From 8ffaa93bffdb08dfe175854863462211d61261be Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 20 Dec 2012 23:07:46 +0100 Subject: distro: guile: Patch (ice-9 popen) to use the right shell. * distro/packages/guile.scm (guile-2.0): Add `pre-configure'. * distro/packages/base.scm (guile-final): Adjust to preserve the `pre-configure' phase. --- distro/packages/base.scm | 30 ++++++++++++++++-------------- distro/packages/guile.scm | 10 ++++++++++ 2 files changed, 26 insertions(+), 14 deletions(-) (limited to 'distro/packages/base.scm') diff --git a/distro/packages/base.scm b/distro/packages/base.scm index dacf8e46aa..971190ed6a 100644 --- a/distro/packages/base.scm +++ b/distro/packages/base.scm @@ -969,20 +969,22 @@ store.") ;; Libtool, so that that dependency is isolated in the "bin" output. (let ((guile (package (inherit guile-2.0/fixed) (arguments - `(#:phases - (alist-cons-before - 'patch-source-shebangs 'delete-encoded-test - (lambda* (#:key inputs #:allow-other-keys) - ;; %BOOTSTRAP-GUILE doesn't know about encodings other - ;; than UTF-8. That test declares an ISO-8859-1 - ;; encoding, which prevents `patch-shebang' from - ;; working, so skip it. - (call-with-output-file - "test-suite/standalone/test-command-line-encoding2" - (lambda (p) - (format p "#!~a/bin/bash\nexit 77" - (assoc-ref inputs "bash"))))) - %standard-phases)))))) + (substitute-keyword-arguments + (package-arguments guile-2.0/fixed) + ((#:phases phases) + `(alist-cons-before + 'patch-source-shebangs 'delete-encoded-test + (lambda* (#:key inputs #:allow-other-keys) + ;; %BOOTSTRAP-GUILE doesn't know about encodings other + ;; than UTF-8. That test declares an ISO-8859-1 + ;; encoding, which prevents `patch-shebang' from + ;; working, so skip it. + (call-with-output-file + "test-suite/standalone/test-command-line-encoding2" + (lambda (p) + (format p "#!~a/bin/bash\nexit 77" + (assoc-ref inputs "bash"))))) + ,phases))))))) (package-with-bootstrap-guile (package-with-explicit-inputs guile %boot4-inputs diff --git a/distro/packages/guile.scm b/distro/packages/guile.scm index a5d37eb40b..68c2fcc2ef 100644 --- a/distro/packages/guile.scm +++ b/distro/packages/guile.scm @@ -120,6 +120,16 @@ extensible. It supports many SRFIs.") (self-native-input? #t) + (arguments + '(#:phases (alist-cons-before + 'configure 'pre-configure + (lambda* (#:key inputs #:allow-other-keys) + (let ((bash (assoc-ref inputs "bash"))) + (substitute* "module/ice-9/popen.scm" + (("/bin/sh") + (string-append bash "/bin/bash"))))) + %standard-phases))) + (synopsis "GNU Guile 2.0, an embeddable Scheme implementation") (description "GNU Guile is an implementation of the Scheme programming language, with -- cgit v1.2.3 From 8722e80e82f6b2ca326b20a4b3179ed25115ce4f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 21 Dec 2012 17:59:23 +0100 Subject: distro: coreutils: Update to 8.20. * distro/packages/base.scm (coreutils): Update to 8.20. --- distro/packages/base.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'distro/packages/base.scm') diff --git a/distro/packages/base.scm b/distro/packages/base.scm index 971190ed6a..0a937486a4 100644 --- a/distro/packages/base.scm +++ b/distro/packages/base.scm @@ -252,14 +252,14 @@ The tools supplied with this package are: (define-public coreutils (package (name "coreutils") - (version "8.19") + (version "8.20") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/coreutils/coreutils-" version ".tar.xz")) (sha256 (base32 - "1rx9x3fp848w4nny7irdkcpkan9fcx24d99v5dkwgkyq7wc76f5d")))) + "1cly97xdy3v4nbbx631k43smqw0nnpn651kkprs0yyl2cj3pkjyv")))) (build-system gnu-build-system) (inputs `()) ; TODO: optional deps: SELinux, ACL, GMP (arguments -- cgit v1.2.3 From c089511288820cfb3efc5295e572be24aa83f068 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 21 Dec 2012 22:31:25 +0100 Subject: build-system/gnu: Patch shebangs in all the source; patch SHELL in makefiles. * guix/build/utils.scm (call-with-ascii-input-file): New procedure. (patch-shebang): Use it. (patch-makefile-SHELL): New procedure. * guix/build/gnu-build-system.scm (patch-source-shebangs): Patch all the files, not just executables; remove `po/Makefile.in.in' patching. (patch-generated-files): Rename to... (patch-generated-file-shebangs): ... this. Patch executables and makefiles. (%standard-phases): Adjust accordingly. * distro/packages/autotools.scm (libtool): Remove call to `patch-shebang'. * distro/packages/base.scm (gcc-4.7): Likewise. (guile-final): Remove hack to skip `test-command-line-encoding2'. * distro/packages/bash.scm (bash): Remove `pre-configure-phase'. * distro/packages/readline.scm (readline): Likewise. * distro/packages/ncurses.scm (ncurses): Remove `pre-install-phase'. --- distro/packages/autotools.scm | 1 - distro/packages/base.scm | 31 +++----------- distro/packages/bash.scm | 16 ++------ distro/packages/ncurses.scm | 8 +--- distro/packages/readline.scm | 14 +------ guix/build/gnu-build-system.scm | 28 +++++++------ guix/build/utils.scm | 90 ++++++++++++++++++++++++++++++----------- 7 files changed, 92 insertions(+), 96 deletions(-) (limited to 'distro/packages/base.scm') diff --git a/distro/packages/autotools.scm b/distro/packages/autotools.scm index 1c01b3d3db..171855b937 100644 --- a/distro/packages/autotools.scm +++ b/distro/packages/autotools.scm @@ -118,7 +118,6 @@ Standards. Automake requires the use of Autoconf.") (string-append "-j" ncores))) ;; Path references to /bin/sh. - (patch-shebang "libtoolize") (let ((bash (assoc-ref inputs "bash"))) (substitute* "tests/testsuite" (("/bin/sh") diff --git a/distro/packages/base.scm b/distro/packages/base.scm index 0a937486a4..0289b6c688 100644 --- a/distro/packages/base.scm +++ b/distro/packages/base.scm @@ -428,9 +428,6 @@ BFD (Binary File Descriptor) library, `gprof', `nm', `strip', etc.") ~a~%" libc line)))) - ;; Adjust hard-coded #!/bin/sh. - (patch-shebang "gcc/exec-tool.in") - ;; Don't retain a dependency on the build-time sed. (substitute* "fixincludes/fixincl.x" (("static char const sed_cmd_z\\[\\] =.*;") @@ -967,29 +964,11 @@ store.") ;; FIXME: The Libtool used here, specifically its `bin/libtool' script, ;; holds a dependency on the bootstrap Binutils. Use multiple outputs for ;; Libtool, so that that dependency is isolated in the "bin" output. - (let ((guile (package (inherit guile-2.0/fixed) - (arguments - (substitute-keyword-arguments - (package-arguments guile-2.0/fixed) - ((#:phases phases) - `(alist-cons-before - 'patch-source-shebangs 'delete-encoded-test - (lambda* (#:key inputs #:allow-other-keys) - ;; %BOOTSTRAP-GUILE doesn't know about encodings other - ;; than UTF-8. That test declares an ISO-8859-1 - ;; encoding, which prevents `patch-shebang' from - ;; working, so skip it. - (call-with-output-file - "test-suite/standalone/test-command-line-encoding2" - (lambda (p) - (format p "#!~a/bin/bash\nexit 77" - (assoc-ref inputs "bash"))))) - ,phases))))))) - (package-with-bootstrap-guile - (package-with-explicit-inputs guile - %boot4-inputs - (current-source-location) - #:guile %bootstrap-guile)))) + (package-with-bootstrap-guile + (package-with-explicit-inputs guile-2.0/fixed + %boot4-inputs + (current-source-location) + #:guile %bootstrap-guile))) (define-public ld-wrapper ;; The final `ld' wrapper, which uses the final Guile. diff --git a/distro/packages/bash.scm b/distro/packages/bash.scm index c2022fcf95..f32293d82f 100644 --- a/distro/packages/bash.scm +++ b/distro/packages/bash.scm @@ -33,13 +33,6 @@ "-DNON_INTERACTIVE_LOGIN_SHELLS" "-DSSH_SOURCE_BASHRC") " ")) - (pre-configure-phase - '(lambda* (#:key inputs #:allow-other-keys) - ;; Use the right shell for makefiles. - (let ((bash (assoc-ref inputs "bash"))) - (substitute* "configure" - (("MAKE_SHELL=[^ ]+") - (format #f "MAKE_SHELL=~a/bin/bash" bash)))))) (post-install-phase '(lambda* (#:key outputs #:allow-other-keys) ;; Add a `bash' -> `sh' link. @@ -80,12 +73,9 @@ ;; for now. #:tests? #f - #:phases (alist-cons-before - 'configure 'pre-configure - ,pre-configure-phase - (alist-cons-after 'install 'post-install - ,post-install-phase - %standard-phases)))) + #:phases (alist-cons-after 'install 'post-install + ,post-install-phase + %standard-phases))) (synopsis "GNU Bourne-Again Shell") (description "Bash is the shell, or command language interpreter, that will appear in diff --git a/distro/packages/ncurses.scm b/distro/packages/ncurses.scm index 868222ef83..8bde3c1989 100644 --- a/distro/packages/ncurses.scm +++ b/distro/packages/ncurses.scm @@ -28,9 +28,6 @@ '(lambda _ (substitute* (find-files "." "Makefile.in") (("^SHELL[[:blank:]]*=.*$") "")))) - (pre-install-phase - '(lambda _ - (for-each patch-shebang (find-files "." "\\.sh$")))) (post-install-phase '(lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) @@ -93,10 +90,7 @@ (alist-cons-before 'configure 'patch-makefile-SHELL ,patch-makefile-phase - (alist-cons-before - 'install 'pre-install-phase - ,pre-install-phase - %standard-phases))) + %standard-phases)) ;; The `ncursesw5-config' has a #!/bin/sh that we don't want to ;; patch, to avoid retaining a reference to the build-time Bash. diff --git a/distro/packages/readline.scm b/distro/packages/readline.scm index bf542e90b5..8e2a4cbb5d 100644 --- a/distro/packages/readline.scm +++ b/distro/packages/readline.scm @@ -36,14 +36,7 @@ (for-each (lambda (f) (chmod f #o755)) (find-files lib "\\.so")) (for-each (lambda (f) (chmod f #o644)) - (find-files lib "\\.a"))))) - (pre-configure-phase - '(lambda* (#:key inputs #:allow-other-keys) - ;; Use the right shell for makefiles. - (let ((bash (assoc-ref inputs "bash"))) - (substitute* "configure" - (("^MAKE_SHELL=.*") - (format #f "MAKE_SHELL=~a/bin/bash" bash))))))) + (find-files lib "\\.a")))))) (package (name "readline") (version "6.2") @@ -69,10 +62,7 @@ #:phases (alist-cons-after 'install 'post-install ,post-install-phase - (alist-cons-before - 'configure 'pre-configure - ,pre-configure-phase - %standard-phases)))) + %standard-phases))) (synopsis "GNU Readline, a library for interactive line editing") (description "The GNU Readline library provides a set of functions for use by diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 18c66e5256..b5eaa26bf5 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -84,24 +84,26 @@ (chdir (first-subdirectory ".")))) (define* (patch-source-shebangs #:key source #:allow-other-keys) - ;; Patch shebangs in executable source files. Most scripts honor - ;; $SHELL and $CONFIG_SHELL, but some don't, such as `mkinstalldirs' - ;; or Automake's `missing' script. + "Patch shebangs in all source files; this includes non-executable +files such as `.in' templates. Most scripts honor $SHELL and +$CONFIG_SHELL, but some don't, such as `mkinstalldirs' or Automake's +`missing' script." + (for-each patch-shebang + (remove file-is-directory? (find-files "." ".*")))) + +(define (patch-generated-file-shebangs . rest) + "Patch shebangs in generated files, including `SHELL' variables in +makefiles." + ;; Patch executable files, some of which might have been generated by + ;; `configure'. (for-each patch-shebang (filter (lambda (file) (and (executable-file? file) (not (file-is-directory? file)))) (find-files "." ".*"))) - ;; Gettext-generated po/Makefile.in.in does not honor $SHELL. - (let ((bash (search-path (search-path-as-string->list (getenv "PATH")) - "bash"))) - (when (file-exists? "po/Makefile.in.in") - (substitute* "po/Makefile.in.in" - (("^SHELL[[:blank:]]*=.*$") - (string-append "SHELL = " bash "\n")))))) - -(define patch-generated-files patch-source-shebangs) + ;; Patch `SHELL' in generated makefiles. + (for-each patch-makefile-SHELL (find-files "." "^(GNU)?[mM]akefile$"))) (define* (patch #:key (patches '()) (patch-flags '("--batch" "-p1")) #:allow-other-keys) @@ -253,7 +255,7 @@ (let-syntax ((phases (syntax-rules () ((_ p ...) `((p . ,p) ...))))) (phases set-paths unpack patch - patch-source-shebangs configure patch-generated-files + patch-source-shebangs configure patch-generated-file-shebangs build check install patch-shebangs strip))) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 0de7392620..c54c83883b 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -27,6 +27,7 @@ #:use-module (rnrs io ports) #:export (directory-exists? executable-file? + call-with-ascii-input-file with-directory-excursion mkdir-p copy-recursively @@ -43,6 +44,7 @@ substitute* dump-port patch-shebang + patch-makefile-SHELL fold-port-matches remove-store-references)) @@ -63,6 +65,21 @@ (and s (not (zero? (logand (stat:mode s) #o100)))))) +(define (call-with-ascii-input-file file proc) + "Open FILE as an ASCII or binary file, and pass the resulting port to +PROC. FILE is closed when PROC's dynamic extent is left. Return the +return values of applying PROC to the port." + (let ((port (with-fluids ((%default-port-encoding #f)) + ;; Use "b" so that `open-file' ignores `coding:' cookies. + (open-file file "rb")))) + (dynamic-wind + (lambda () + #t) + (lambda () + (proc port)) + (lambda () + (close-input-port port))))) + (define-syntax-rule (with-directory-excursion dir body ...) "Run BODY with DIR as the process's current directory." (let ((init (getcwd))) @@ -418,30 +435,55 @@ patched, #f otherwise." (false-if-exception (delete-file template)) #f)))) - (with-fluids ((%default-port-encoding #f)) ; ASCII - (call-with-input-file file - (lambda (p) - (and (eq? #\# (read-char p)) - (eq? #\! (read-char p)) - (let ((line (false-if-exception (read-line p)))) - (and=> (and line (regexp-exec shebang-rx line)) - (lambda (m) - (let* ((cmd (match:substring m 1)) - (bin (search-path path - (basename cmd)))) - (if bin - (if (string=? bin cmd) - #f ; nothing to do - (begin - (format (current-error-port) - "patch-shebang: ~a: changing `~a' to `~a'~%" - file cmd bin) - (patch p bin (match:substring m 2)))) - (begin - (format (current-error-port) - "patch-shebang: ~a: warning: no binary for interpreter `~a' found in $PATH~%" - file (basename cmd)) - #f))))))))))))) + (call-with-ascii-input-file file + (lambda (p) + (and (eq? #\# (read-char p)) + (eq? #\! (read-char p)) + (let ((line (false-if-exception (read-line p)))) + (and=> (and line (regexp-exec shebang-rx line)) + (lambda (m) + (let* ((cmd (match:substring m 1)) + (bin (search-path path (basename cmd)))) + (if bin + (if (string=? bin cmd) + #f ; nothing to do + (begin + (format (current-error-port) + "patch-shebang: ~a: changing `~a' to `~a'~%" + file cmd bin) + (patch p bin (match:substring m 2)))) + (begin + (format (current-error-port) + "patch-shebang: ~a: warning: no binary for interpreter `~a' found in $PATH~%" + file (basename cmd)) + #f)))))))))))) + +(define (patch-makefile-SHELL file) + "Patch the `SHELL' variable in FILE, which is supposedly a makefile." + + ;; For instance, Gettext-generated po/Makefile.in.in do not honor $SHELL. + + ;; XXX: Unlike with `patch-shebang', FILE is always touched. + + (define (find-shell name) + (let ((shell + (search-path (search-path-as-string->list (getenv "PATH")) + name))) + (unless shell + (format (current-error-port) + "patch-makefile-SHELL: warning: no binary for shell `~a' found in $PATH~%" + name)) + shell)) + + (substitute* file + (("^ *SHELL[[:blank:]]*=[[:blank:]]*([[:graph:]]*/)([[:graph:]]+)[[:blank:]]*" _ dir shell) + (let* ((old (string-append dir shell)) + (new (or (find-shell shell) old))) + (unless (string=? new old) + (format (current-error-port) + "patch-makefile-SHELL: ~a: changing `SHELL' from `~a' to `~a'~%" + file old new)) + (string-append "SHELL = " new "\n"))))) (define* (fold-port-matches proc init pattern port #:optional (unmatched (lambda (_ r) r))) -- cgit v1.2.3 From 98ea038b474def9b24fd2ba1c893e9c723e9f205 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 31 Dec 2012 01:12:09 +0100 Subject: distro: libc: Update to 2.17. * distro/packages/base.scm (glibc): Update to 2.17. --- distro/packages/base.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'distro/packages/base.scm') diff --git a/distro/packages/base.scm b/distro/packages/base.scm index 0289b6c688..6b4ee19a25 100644 --- a/distro/packages/base.scm +++ b/distro/packages/base.scm @@ -465,14 +465,14 @@ used in the GNU system including the GNU/Linux variant.") (define-public glibc (package (name "glibc") - (version "2.16.0") + (version "2.17") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/glibc/glibc-" version ".tar.xz")) (sha256 (base32 - "092rdm49zh6l1pqkxbcpcaawgsgzxhpf1s7wf5wi5dvc5am3dp0y")))) + "0gmjnn4kma9vgizccw1jv979xw55a8n1nkk94gg0l3hy80vy6539")))) (build-system gnu-build-system) ;; Glibc's refers to , for instance, so glibc -- cgit v1.2.3 From 8cd8e97cb5e4a32c20cbab6c048f5213509c4ac9 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 1 Jan 2013 23:50:52 +0100 Subject: distro: glibc: Fix contradicting settings of `BASH_SHELL'. * distro/packages/base.scm (glibc-final): Remove `ac_cv_path_BASH_SHELL' setting. (glibc): Set `BASH_SHELL' instead of `ac_cv_path_BASH_SHELL'. --- distro/packages/base.scm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'distro/packages/base.scm') diff --git a/distro/packages/base.scm b/distro/packages/base.scm index 6b4ee19a25..4acf4c1538 100644 --- a/distro/packages/base.scm +++ b/distro/packages/base.scm @@ -495,13 +495,13 @@ used in the GNU system including the GNU/Linux variant.") ;; GNU libc for details. "--enable-kernel=2.6.30" - ;; XXX: Work around "undefined reference to `__stack_chk_guard'". - "libc_cv_ssp=no" - ;; Use our Bash instead of /bin/sh. - (string-append "ac_cv_path_BASH_SHELL=" + (string-append "BASH_SHELL=" (assoc-ref %build-inputs "bash") - "/bin/bash")) + "/bin/bash") + + ;; XXX: Work around "undefined reference to `__stack_chk_guard'". + "libc_cv_ssp=no") #:tests? #f ; XXX #:phases (alist-cons-before @@ -783,7 +783,6 @@ identifier SYSTEM." `(append (list ,(string-append "--host=" (boot-triplet system)) ,(string-append "--build=" (nix-system->gnu-triplet system)) - "BASH_SHELL=/bin/sh" ;; Build Sun/ONC RPC support. In particular, ;; install rpc/*.h. -- cgit v1.2.3 From 46866fadee576d3c1dfa4b3d3ab819bfae3fdf8b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 1 Jan 2013 23:55:40 +0100 Subject: distro: glibc: Build the statically-linked Bash embedded in glibc. * distro/packages/base.scm (glibc): Expect "static-bash" to be a directory, not a single file. Call `remove-store-references' on the "bash" binary that is copied. Add an `sh' -> `bash' symlink. Change the "static-bash" input to (static-package bash-light). (glibc-final): Rename to... (glibc-final-with-bootstrap-bash): ... this. Change `name' to "glibc-intermediate". Remove #:patch-shebangs? setting. (cross-gcc-wrapper): New procedure, with code formerly in GCC-BOOT0-WRAPPED. (gcc-boot0-wrapped): Use it. (static-bash-for-glibc): New variable. (glibc-final): Inherit from GLIBC-FINAL-WITH-BOOTSTRAP-BASH, and use STATIC-BASH-FOR-GLIBC as the "static-bash" input. --- distro/packages/base.scm | 152 +++++++++++++++++++++++++++++++---------------- 1 file changed, 100 insertions(+), 52 deletions(-) (limited to 'distro/packages/base.scm') diff --git a/distro/packages/base.scm b/distro/packages/base.scm index 4acf4c1538..158a7d2f73 100644 --- a/distro/packages/base.scm +++ b/distro/packages/base.scm @@ -1,5 +1,5 @@ ;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*- -;;; Copyright (C) 2012 Ludovic Courtès +;;; Copyright (C) 2012, 2013 Ludovic Courtès ;;; Copyright (C) 2012 Nikita Karetnikov ;;; ;;; This file is part of Guix. @@ -528,12 +528,19 @@ used in the GNU system including the GNU/Linux variant.") ;; 4.7.1. ((" -lgcc_s") "")) - ;; Copy a statically-linked Bash in the output. + ;; Copy a statically-linked Bash in the output, with + ;; no references to other store paths. (mkdir-p bin) - (copy-file (assoc-ref inputs "static-bash") + (copy-file (string-append (assoc-ref inputs "static-bash") + "/bin/bash") (string-append bin "/bash")) + (remove-store-references (string-append bin "/bash")) (chmod (string-append bin "/bash") #o555) + ;; Keep a symlink, for `patch-shebang' resolution. + (with-directory-excursion bin + (symlink "bash" "sh")) + ;; Have `system' use that Bash. (substitute* "sysdeps/posix/system.c" (("#define[[:blank:]]+SHELL_PATH.*$") @@ -547,7 +554,7 @@ used in the GNU system including the GNU/Linux variant.") %standard-phases))) (inputs `(("patch/ld.so.cache" ,(search-patch "glibc-no-ld-so-cache.patch")) - ("static-bash" ,(cut search-bootstrap-binary "bash" <>)))) + ("static-bash" ,(static-package bash-light)))) (synopsis "The GNU C Library") (description "Any Unix-like operating system needs a C library: the library which @@ -765,19 +772,19 @@ identifier SYSTEM." ;; cross-`as'. ,@%boot0-inputs)) -(define-public glibc-final +(define glibc-final-with-bootstrap-bash ;; The final libc, "cross-built". If everything went well, the resulting - ;; store path has no dependencies. + ;; store path has no dependencies. Actually, the really-final libc is + ;; built just below; the only difference is that this one uses the + ;; bootstrap Bash. (package-with-bootstrap-guile (package (inherit glibc) + (name "glibc-intermediate") (arguments (lambda (system) `(#:guile ,%bootstrap-guile #:implicit-inputs? #f - ;; Leave /bin/sh as the interpreter for `ldd', `sotruss', etc. to - ;; avoid keeping a reference to the bootstrap Bash. - #:patch-shebangs? #f ,@(substitute-keyword-arguments (package-arguments glibc) ((#:configure-flags flags) `(append (list ,(string-append "--host=" (boot-triplet system)) @@ -789,60 +796,101 @@ identifier SYSTEM." "--enable-obsolete-rpc") ,flags)))))) (propagated-inputs `(("linux-headers" ,linux-libre-headers-boot0))) - (inputs `( ;; A native GCC is needed to build `cross-rpcgen'. - ("native-gcc" ,@(assoc-ref %boot0-inputs "gcc")) - ,@%boot1-inputs - ,@(package-inputs glibc)))))) ; patches + (inputs + `( ;; A native GCC is needed to build `cross-rpcgen'. + ("native-gcc" ,@(assoc-ref %boot0-inputs "gcc")) -(define gcc-boot0-wrapped - ;; Make the cross-tools GCC-BOOT0 and BINUTILS-BOOT0 available under the - ;; non-cross names. + ;; 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")) + + ,@%boot1-inputs + ,@(alist-delete "static-bash" + (package-inputs glibc))))))) ; patches + +(define (cross-gcc-wrapper gcc binutils glibc bash) + "Return a wrapper for the pseudo-cross toolchain GCC/BINUTILS/GLIBC +that makes it available under the native tool names." (package (inherit gcc-4.7) - (name (string-append (package-name gcc-boot0) "-wrapped")) + (name (string-append (package-name gcc) "-wrapped")) (source #f) (build-system trivial-build-system) (arguments (lambda (system) - `(#:guile ,%bootstrap-guile - #:modules ((guix build utils)) - #:builder (begin - (use-modules (guix build utils)) - - (let* ((binutils (assoc-ref %build-inputs "binutils")) - (gcc (assoc-ref %build-inputs "gcc")) - (libc (assoc-ref %build-inputs "libc")) - (bash (assoc-ref %build-inputs "bash")) - (out (assoc-ref %outputs "out")) - (bindir (string-append out "/bin")) - (triplet ,(boot-triplet system))) - (mkdir-p bindir) - (with-directory-excursion bindir - (for-each (lambda (tool) - (symlink (string-append binutils "/bin/" - triplet "-" tool) - tool)) - '("ar" "ranlib")) - - ;; GCC-BOOT0 is a libc-less cross-compiler, so it - ;; needs to be told where to find the crt files and - ;; the dynamic linker. - (call-with-output-file "gcc" - (lambda (p) - (format p "#!~a/bin/bash + `(#:guile ,%bootstrap-guile + #:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils)) + + (let* ((binutils (assoc-ref %build-inputs "binutils")) + (gcc (assoc-ref %build-inputs "gcc")) + (libc (assoc-ref %build-inputs "libc")) + (bash (assoc-ref %build-inputs "bash")) + (out (assoc-ref %outputs "out")) + (bindir (string-append out "/bin")) + (triplet ,(boot-triplet system))) + (mkdir-p bindir) + (with-directory-excursion bindir + (for-each (lambda (tool) + (symlink (string-append binutils "/bin/" + triplet "-" tool) + tool)) + '("ar" "ranlib")) + + ;; GCC-BOOT0 is a libc-less cross-compiler, so it + ;; needs to be told where to find the crt files and + ;; the dynamic linker. + (call-with-output-file "gcc" + (lambda (p) + (format p "#!~a/bin/bash exec ~a/bin/~a-gcc -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" - bash - gcc triplet - libc libc - ,(glibc-dynamic-linker system)))) + bash + gcc triplet + libc libc + ,(glibc-dynamic-linker system)))) - (chmod "gcc" #o555))))))) + (chmod "gcc" #o555))))))) (native-inputs - `(("binutils" ,binutils-boot0) - ("gcc" ,gcc-boot0) - ("libc" ,glibc-final) - ,(assoc "bash" %boot1-inputs))) + `(("binutils" ,binutils) + ("gcc" ,gcc) + ("libc" ,glibc) + ("bash" ,bash))) (inputs '()))) +(define static-bash-for-glibc + ;; A statically-linked Bash to be embedded in GLIBC-FINAL, for use by + ;; system(3) & co. + (let* ((gcc (cross-gcc-wrapper gcc-boot0 binutils-boot0 + glibc-final-with-bootstrap-bash + (car (assoc-ref %boot1-inputs "bash")))) + (bash (package (inherit bash-light) + (arguments + (lambda (system) + `(#:guile ,%bootstrap-guile + ,@(package-arguments bash-light))))))) + (package-with-bootstrap-guile + (package-with-explicit-inputs (static-package bash) + `(("gcc" ,gcc) + ("libc" ,glibc-final-with-bootstrap-bash) + ,@(fold alist-delete %boot1-inputs + '("gcc" "libc"))) + (current-source-location))))) + +(define-public glibc-final + ;; The final glibc, which embeds the statically-linked Bash built above. + (package (inherit glibc-final-with-bootstrap-bash) + (name "glibc") + (inputs `(("static-bash" ,static-bash-for-glibc) + ,@(alist-delete + "static-bash" + (package-inputs glibc-final-with-bootstrap-bash)))))) + +(define gcc-boot0-wrapped + ;; Make the cross-tools GCC-BOOT0 and BINUTILS-BOOT0 available under the + ;; non-cross names. + (cross-gcc-wrapper gcc-boot0 binutils-boot0 glibc-final + (car (assoc-ref %boot1-inputs "bash")))) + (define %boot2-inputs ;; 3rd stage inputs. `(("libc" ,glibc-final) -- cgit v1.2.3 From 52b8e5fc30f42914c1dadeca4243a5b55467be48 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 2 Jan 2013 01:01:58 +0100 Subject: distro: sed: Patch references to /bin/sh in the test suite. * distro/packages/base.scm (sed): Add `patch-test-suite' phase. --- distro/packages/base.scm | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'distro/packages/base.scm') diff --git a/distro/packages/base.scm b/distro/packages/base.scm index 158a7d2f73..ad9561b5f4 100644 --- a/distro/packages/base.scm +++ b/distro/packages/base.scm @@ -97,6 +97,17 @@ lines.") "13wlsb4sf5d5a82xjhxqmdvrrn36rmw5f0pl9qyb9zkvldnb7hra")))) (build-system gnu-build-system) (synopsis "GNU sed, a batch stream editor") + (arguments + `(#:phases (alist-cons-before + 'patch-source-shebangs 'patch-test-suite + (lambda* (#:key inputs #:allow-other-keys) + (let ((bash (assoc-ref inputs "bash"))) + (patch-makefile-SHELL "testsuite/Makefile.tests") + (substitute* '("testsuite/bsd.sh" + "testsuite/bug-regex9.c") + (("/bin/sh") + (string-append bash "/bin/bash"))))) + %standard-phases))) (description "Sed (stream editor) isn't really a true text editor or text processor. Instead, it is used to filter text, i.e., it takes text input and performs -- cgit v1.2.3 From 8ba8aeb74d3f45fb46a69d2278086e3a44845b4a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 2 Jan 2013 22:44:58 +0100 Subject: distro: coreutils: Enable tests; add dependency on ACL and GMP. * distro/packages/base.scm (coreutils): Set #:parallel-build? #f. Add `patch-shell-references' phase. Add 'acl', 'gmp', and 'perl' as inputs, as suggested by Nikita Karetnikov. --- distro/packages/base.scm | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'distro/packages/base.scm') diff --git a/distro/packages/base.scm b/distro/packages/base.scm index ad9561b5f4..2190fc528c 100644 --- a/distro/packages/base.scm +++ b/distro/packages/base.scm @@ -20,6 +20,7 @@ (define-module (distro packages base) #:use-module (guix licenses) #:use-module (distro) + #:use-module (distro packages acl) #:use-module (distro packages bash) #:use-module (distro packages bootstrap) #:use-module (distro packages compression) @@ -272,10 +273,24 @@ The tools supplied with this package are: (base32 "1cly97xdy3v4nbbx631k43smqw0nnpn651kkprs0yyl2cj3pkjyv")))) (build-system gnu-build-system) - (inputs `()) ; TODO: optional deps: SELinux, ACL, GMP + (inputs `(("acl" ,acl) + ("gmp" ,gmp) + ("perl" ,perl))) ; TODO: add SELinux (arguments - '(;; Perl is missing, and some tests are failing. - #:tests? #f)) + `(#:parallel-build? #f ; help2man may be called too early + #:phases (alist-cons-before + 'build 'patch-shell-references + (lambda* (#:key inputs #:allow-other-keys) + (let ((bash (assoc-ref inputs "bash"))) + (substitute* (cons "src/split.c" + (find-files "gnulib-tests" + "\\.c$")) + (("/bin/sh") + (format #f "~a/bin/sh" bash))) + (substitute* (find-files "tests" "\\.sh$") + (("#!/bin/sh") + (format #f "#!~a/bin/bash" bash))))) + %standard-phases))) (synopsis "The basic file, shell and text manipulation utilities of the GNU operating system") -- cgit v1.2.3 From 2f8a123ed32eba2d63822327f86eadfba2c12143 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 2 Jan 2013 23:40:56 +0100 Subject: distro: libtool: Add a "bin" output. * distro/packages/autotools.scm (libtool): Add a "bin" output. * distro/packages/base.scm (guile-final): Remove comment about retained dependency. --- distro/packages/autotools.scm | 9 ++++++++- distro/packages/base.scm | 3 --- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'distro/packages/base.scm') diff --git a/distro/packages/autotools.scm b/distro/packages/autotools.scm index 171855b937..32e50a5b12 100644 --- a/distro/packages/autotools.scm +++ b/distro/packages/autotools.scm @@ -1,6 +1,6 @@ ;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*- ;;; Copyright (C) 2012 Nikita Karetnikov -;;; Copyright (C) 2012 Ludovic Courtès +;;; Copyright (C) 2012, 2013 Ludovic Courtès ;;; ;;; This file is part of Guix. ;;; @@ -99,6 +99,13 @@ Standards. Automake requires the use of Autoconf.") (build-system gnu-build-system) (native-inputs `(("m4" ,m4) ("perl" ,perl))) + + ;; Separate binaries from the rest. During bootstrap, only ltdl is + ;; used; not depending on the binaries allows us to avoid retaining + ;; a reference to the bootstrap bash. + (outputs '("bin" ; libtoolize, libtool, etc. + "out")) ; libltdl.so, ltdl.h, etc. + (arguments `(#:patches (list (assoc-ref %build-inputs "patch/skip-tests")) #:phases (alist-cons-before diff --git a/distro/packages/base.scm b/distro/packages/base.scm index 2190fc528c..63eea603ef 100644 --- a/distro/packages/base.scm +++ b/distro/packages/base.scm @@ -1034,9 +1034,6 @@ store.") ,@(alist-delete "bash" %boot3-inputs))) (define-public guile-final - ;; FIXME: The Libtool used here, specifically its `bin/libtool' script, - ;; holds a dependency on the bootstrap Binutils. Use multiple outputs for - ;; Libtool, so that that dependency is isolated in the "bin" output. (package-with-bootstrap-guile (package-with-explicit-inputs guile-2.0/fixed %boot4-inputs -- cgit v1.2.3 From 4873f8ed9f79f8e20c8304f8ea1b4664df36fa3e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 10 Jan 2013 00:09:25 +0100 Subject: distro: binutils: Add a "lib" output. * distro/packages/base.scm (binutils): Add `outputs' field. --- distro/packages/base.scm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'distro/packages/base.scm') diff --git a/distro/packages/base.scm b/distro/packages/base.scm index cb0cb0fd79..bc705f16e7 100644 --- a/distro/packages/base.scm +++ b/distro/packages/base.scm @@ -353,6 +353,11 @@ that it is possible to use Make to build and install the program.") "1a9w66v5dwvbnawshjwqcgz7km6kw6ihkzp6sswv9ycc3knzhykc")))) (build-system gnu-build-system) + ;; Split Binutils in several outputs, mostly to avoid collisions in + ;; user profiles with GCC---e.g., libiberty.a. + (outputs '("out" ; ar, ld, binutils.info, etc. + "lib")) ; libbfd.a, bfd.h, etc. + ;; TODO: Add dependency on zlib + those for Gold. (native-inputs `(("patch/new-dtags" ,(search-patch "binutils-ld-new-dtags.patch")))) -- cgit v1.2.3