From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: [PATCHES] gnu: bootstrap: Fix egrep and fgrep in bootstrap binaries Date: Wed, 07 Jan 2015 09:02:00 -0500 Message-ID: <87387m3d0n.fsf@netris.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8rWO-00018E-Bx for guix-devel@gnu.org; Wed, 07 Jan 2015 09:23:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y8rWL-0006ue-3O for guix-devel@gnu.org; Wed, 07 Jan 2015 09:23:40 -0500 Received: from world.peace.net ([50.252.239.5]:43625) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8rBX-00028k-Dx for guix-devel@gnu.org; Wed, 07 Jan 2015 09:02:07 -0500 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-bootstrap-Add-support-for-snippets-to-package-fr.patch Content-Transfer-Encoding: quoted-printable Content-Description: [PATCH 1/2] gnu: bootstrap: Add support for snippets to 'package-from-tarball' >From 00e491bc64f6aa1fcebd19d1aa7370d1708d9d3a Mon Sep 17 00:00:00 2001 From: Mark H Weaver 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 =C2=A9 2012, 2013, 2014 Ludovic Court=C3=A8s +;;; Copyright =C2=A9 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -87,10 +88,13 @@ (patch patch)) (origin-patches source)))))) =20 -(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 --=20 2.1.2 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-gnu-bootstrap-Fix-egrep-and-fgrep-after-unpacking-bo.patch Content-Description: [PATCH 2/2] gnu: bootstrap: Fix egrep and fgrep after unpacking bootstrap binaries >From 34412a7202cabafd25daaa045f70aa567e867d3b Mon Sep 17 00:00:00 2001 From: Mark H Weaver 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 --=-=-=--