unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: 26730@debbugs.gnu.org
Subject: bug#26730: [PATCH 2/2] gnu: bzip2: Patch bzip2 utilities.
Date: Mon,  1 May 2017 11:10:15 +0100	[thread overview]
Message-ID: <20170501101015.30567-2-mail@cbaines.net> (raw)
In-Reply-To: <20170501101015.30567-1-mail@cbaines.net>

* gnu/packages/compression.scm (bzip2)[inputs]: Add grep, less, diffutils, sed
  and coreutils.
  [arguments]: Add patch-script phase.
---
 gnu/packages/compression.scm | 44 +++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index 031ecaad4..fe32b95bd 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -46,6 +46,7 @@
   #:use-module (gnu packages backup)
   #:use-module (gnu packages base)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages less)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
@@ -218,6 +219,12 @@ file; as a result, it is often used in conjunction with \"tar\", resulting in
                (base32
                 "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152"))))
     (build-system gnu-build-system)
+    (inputs
+     `(("grep" ,grep)
+       ("less" ,less)
+       ("diff" ,diffutils)
+       ("sed" ,sed)
+       ("coreutils" ,coreutils)))
     (arguments
      `(#:modules ((guix build gnu-build-system)
                   (guix build utils)
@@ -252,7 +259,42 @@ file; as a result, it is often used in conjunction with \"tar\", resulting in
                                      base libdir)
                              (copy-file file
                                         (string-append libdir "/" base))))
-                         (find-files "." "^libbz2\\.so"))))))
+                         (find-files "." "^libbz2\\.so")))))
+         (add-after 'install-shared-lib 'patch-scripts
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (let* ((out       (assoc-ref outputs "out"))
+                    (grep      (assoc-ref inputs "grep"))
+                    (less      (assoc-ref inputs "less"))
+                    (diff      (assoc-ref inputs "diff"))
+                    (sed       (assoc-ref inputs "sed"))
+                    (coreutils (assoc-ref inputs "coreutils")))
+               (substitute* (string-append out "/bin/bzgrep")
+                 (("/usr/bin:\\$PATH")
+                  (string-join
+                   (list (string-append grep "/bin")
+                         (string-append out "/bin")
+                         (string-append sed "/bin"))
+                   ":")))
+               (substitute* (string-append out "/bin/bzmore")
+                 (("/usr/bin") ;; Don't remove $PATH, as if bzmore is to work,
+                               ;; more must be on the PATH in the
+                               ;; environment. util-linux, which contains more
+                               ;; is not included here as there is a potential
+                               ;; issues with circular dependencies.
+                  (string-join
+                   (list (string-append less "/bin")
+                         (string-append sed "/bin")
+                         (string-append out "/bin"))
+                   ":")))
+               (substitute* (string-append out "/bin/bzdiff")
+                 (("/usr/bin:/bin:\\$PATH")
+                  (string-join
+                   (list (string-append diff "/bin")
+                         (string-append coreutils "/bin")
+                         (string-append out "/bin")
+                         (string-append sed "/bin"))
+                   ":"))
+                 (("/bin/rm") "rm"))))))
 
        #:make-flags (list (string-append "PREFIX="
                                          (assoc-ref %outputs "out")))
-- 
2.12.2

  reply	other threads:[~2017-05-01 10:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-01  9:49 bug#26730: [PATCH] Fix bzip2 utilities Christopher Baines
2017-05-01 10:10 ` bug#26730: [PATCH 1/2] gnu: bzip2: Use 'modify-phases' syntax Christopher Baines
2017-05-01 10:10   ` Christopher Baines [this message]
2017-05-15 15:43   ` Marius Bakke
2017-05-06 15:38 ` bug#26730: [PATCH] Fix bzip2 utilities Marius Bakke
2017-05-09 10:18   ` Ludovic Courtès
2017-05-15  6:08     ` Christopher Baines
2017-05-15  6:04 ` bug#26730: [PATCH] gnu: bzip2: Patch " Christopher Baines
2017-05-15  6:07 ` Christopher Baines
2017-05-15 15:46   ` Marius Bakke
2017-05-16 20:41     ` Christopher Baines
2017-05-17 14:58       ` Marius Bakke
2017-05-18 18:46         ` Christopher Baines
2017-05-16 20:36 ` bug#26730: [PATCH 1/3] gnu: bzip2: Use 'modify-phases' syntax Christopher Baines
2017-05-16 20:36   ` bug#26730: [PATCH 2/3] gnu: bzip2: Add explicit return value for 2 phases Christopher Baines
2017-05-16 20:36   ` bug#26730: [PATCH 3/3] gnu: bzip2: Patch bzip2 utilities Christopher Baines

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=20170501101015.30567-2-mail@cbaines.net \
    --to=mail@cbaines.net \
    --cc=26730@debbugs.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).