The first of these two patches adds support for optional "snippets" to 'package-from-tarball', which is used to unpack the bootstrap tarballs.
The second patch uses this new feature to patch the shebangs in 'egrep' and 'fgrep' immediately after unpacking the static-binaries bootstrap tarball. Obviously, this is for core-updates, the first 2 out of 6 remaining patches needed for ARM. It is a prerequisite for ARM support, because 'fgrep' is typically needed for ARM specific tests in configure scripts. What do you think? Mark
>From 00e491bc64f6aa1fcebd19d1aa7370d1708d9d3a Mon Sep 17 00:00:00 2001 From: Mark H Weaver <m...@netris.org> Date: Wed, 31 Dec 2014 03:38:26 -0500 Subject: [PATCH 1/2] gnu: bootstrap: Add support for snippets to 'package-from-tarball'. * gnu/packages/bootstrap.scm (package-from-tarball): Add new keyword argument #:snippet. --- gnu/packages/bootstrap.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index 5a19783..05444dd 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <l...@gnu.org> +;;; Copyright © 2014, 2015 Mark H Weaver <m...@netris.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -87,10 +88,13 @@ (patch patch)) (origin-patches source)))))) -(define (package-from-tarball name source program-to-test description) +(define* (package-from-tarball name source program-to-test description + #:key snippet) "Return a package that correspond to the extraction of SOURCE. PROGRAM-TO-TEST is a program to run after extraction of SOURCE, to -check whether everything is alright." +check whether everything is alright. If SNIPPET is provided, it is +evaluated after extracting SOURCE. SNIPPET should return true if +successful, or false to signal an error." (package (name name) (version "0") @@ -112,6 +116,7 @@ check whether everything is alright." (with-directory-excursion out (and (zero? (system* tar "xvf" (string-append builddir "/binaries.tar"))) + ,@(if snippet (list snippet) '()) (zero? (system* (string-append "bin/" ,program-to-test) "--version")))))))) (inputs -- 2.1.2
>From 34412a7202cabafd25daaa045f70aa567e867d3b Mon Sep 17 00:00:00 2001 From: Mark H Weaver <m...@netris.org> Date: Wed, 31 Dec 2014 03:41:50 -0500 Subject: [PATCH 2/2] gnu: bootstrap: Fix egrep and fgrep after unpacking bootstrap binaries. * gnu/packages/bootstrap.scm (%bootstrap-coreutils&co): Add #:snippet argument to 'package-from-tarball' that calls 'patch-shebang' on egrep and fgrep after unpacking. Test 'fgrep' instead of 'true'. --- gnu/packages/bootstrap.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index 05444dd..f1110d9 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -264,8 +264,15 @@ $out/bin/guile --version~%" ("mips64el-linux" (base32 "072y4wyfsj1bs80r6vbybbafy8ya4vfy7qj25dklwk97m6g71753")))))) - "true" ; the program to test - "Bootstrap binaries of Coreutils, Awk, etc.")) + "fgrep" ; the program to test + "Bootstrap binaries of Coreutils, Awk, etc." + #:snippet + '(let ((path (list (string-append (getcwd) "/bin")))) + (chmod "bin" #o755) + (patch-shebang "bin/egrep" path) + (patch-shebang "bin/fgrep" path) + (chmod "bin" #o555) + #t))) (define %bootstrap-binutils (package-from-tarball "binutils-bootstrap" -- 2.1.2