Patchwork [01/22] gnu: parallel: Use full paths for executables.

login
register
mail settings
Submitter Ben Woodcroft
Date July 27, 2016, 12:54 p.m.
Message ID <d3453a89a3858e7455e46040f96146f52b9c24aa.1469622378.git.donttrustben@gmail.com>
Download mbox | patch
Permalink /patch/14028/
State New
Headers show

Comments

Ben Woodcroft - July 27, 2016, 12:54 p.m.
* gnu/packages/parallel.scm (parallel)[inputs]: Add procps.
[arguments]: New field.
---
 gnu/packages/parallel.scm | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)
Leo Famulari - July 28, 2016, 10:31 p.m.
On Wed, Jul 27, 2016 at 10:54:02PM +1000, Ben Woodcroft wrote:
> * gnu/packages/parallel.scm (parallel)[inputs]: Add procps.
> [arguments]: New field.

> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (add-after 'unpack 'patch-bin-sh
> +           (lambda _
> +             (for-each
> +              (lambda (file)
> +                (substitute* file
> +                  ;; Patch hard coded '/bin/sh' in the lin ending in:
> +                  ;; $Global::shell = $ENV{'PARALLEL_SHELL'} ||
> +                  ;;  parent_shell($$) || $ENV{'SHELL'} || "/bin/sh";
> +                  (("/bin/sh\\\";\n$") (string-append (which "sh") "\";\n"))
> +                  ;; Patch call to 'ps' and 'perl' commands.
> +                  ((" ps ") (string-append " " (which "ps") " "))
> +                  ((" perl -") (string-append " " (which "perl") " -"))))
> +              (list "src/parallel" "src/sem"))))
> +         (add-after 'install 'post-install-test
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (zero? (system* (string-append
> +                              (assoc-ref outputs "out") "/bin/parallel")
> +                             "echo"
> +                             ":::" "1" "2" "3")))))))

Do we need the 'post-install-test' phase, or was it left in by accident after
debugging?

Patch

diff --git a/gnu/packages/parallel.scm b/gnu/packages/parallel.scm
index 12f0028..3bb078e 100644
--- a/gnu/packages/parallel.scm
+++ b/gnu/packages/parallel.scm
@@ -5,6 +5,7 @@ 
 ;;; Copyright © 2016 Pjotr Prins <pjotr.guix@thebird.nl>
 ;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,7 +55,31 @@ 
        (base32
         "08gm0i9vj2nz8qgqi98z00myypgb3dni0s5yf3l17fp8h78fp4g3"))))
     (build-system gnu-build-system)
-    (inputs `(("perl" ,perl)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-bin-sh
+           (lambda _
+             (for-each
+              (lambda (file)
+                (substitute* file
+                  ;; Patch hard coded '/bin/sh' in the lin ending in:
+                  ;; $Global::shell = $ENV{'PARALLEL_SHELL'} ||
+                  ;;  parent_shell($$) || $ENV{'SHELL'} || "/bin/sh";
+                  (("/bin/sh\\\";\n$") (string-append (which "sh") "\";\n"))
+                  ;; Patch call to 'ps' and 'perl' commands.
+                  ((" ps ") (string-append " " (which "ps") " "))
+                  ((" perl -") (string-append " " (which "perl") " -"))))
+              (list "src/parallel" "src/sem"))))
+         (add-after 'install 'post-install-test
+           (lambda* (#:key outputs #:allow-other-keys)
+             (zero? (system* (string-append
+                              (assoc-ref outputs "out") "/bin/parallel")
+                             "echo"
+                             ":::" "1" "2" "3")))))))
+    (inputs
+     `(("perl" ,perl)
+       ("procps" ,procps)))
     (home-page "http://www.gnu.org/software/parallel/")
     (synopsis "Build and execute command lines in parallel")
     (description