From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53552) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d58IN-000568-04 for guix-patches@gnu.org; Mon, 01 May 2017 06:11:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d58II-0000xj-4p for guix-patches@gnu.org; Mon, 01 May 2017 06:11:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:50334) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d58II-0000xb-0k for guix-patches@gnu.org; Mon, 01 May 2017 06:11:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d58IH-0006Hn-NG for guix-patches@gnu.org; Mon, 01 May 2017 06:11:01 -0400 Subject: bug#26730: [PATCH 2/2] gnu: bzip2: Patch bzip2 utilities. Resent-Message-ID: From: Christopher Baines Date: Mon, 1 May 2017 11:10:15 +0100 Message-Id: <20170501101015.30567-2-mail@cbaines.net> In-Reply-To: <20170501101015.30567-1-mail@cbaines.net> References: <20170501101015.30567-1-mail@cbaines.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 26730@debbugs.gnu.org * 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