all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: guix-devel@gnu.org
Subject: [PATCHES] gnu: bootstrap: Fix egrep and fgrep in bootstrap binaries
Date: Wed, 07 Jan 2015 09:02:00 -0500	[thread overview]
Message-ID: <87387m3d0n.fsf@netris.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 542 bytes --]

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



[-- Attachment #2: [PATCH 1/2] gnu: bootstrap: Add support for snippets to 'package-from-tarball' --]
[-- Type: text/x-patch, Size: 2014 bytes --]

From 00e491bc64f6aa1fcebd19d1aa7370d1708d9d3a Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw@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 <ludo@gnu.org>
+;;; Copyright © 2014, 2015 Mark H Weaver <mhw@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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: [PATCH 2/2] gnu: bootstrap: Fix egrep and fgrep after unpacking bootstrap binaries --]
[-- Type: text/x-patch, Size: 1685 bytes --]

From 34412a7202cabafd25daaa045f70aa567e867d3b Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw@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


             reply	other threads:[~2015-01-07 14:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-07 14:02 Mark H Weaver [this message]
2015-01-07 17:20 ` [PATCHES] gnu: bootstrap: Fix egrep and fgrep in bootstrap binaries Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87387m3d0n.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.