~ruther/guix-local

58da9c2f7ec7549befc4c4fe1b9f1b4910ae0afe — Cayetano Santos a month ago a1e5b01
gnu: parallel: Modernize.

* gnu/packages/parallel.scm (parallel)[arguments]: Use G-Expressions.

Closes guix/guix!5311

Change-Id: I5bd5613eb3fb8332cb14dccc46cda5bafc44195a
1 files changed, 32 insertions(+), 35 deletions(-)

M gnu/packages/parallel.scm
M gnu/packages/parallel.scm => gnu/packages/parallel.scm +32 -35
@@ 102,41 102,38 @@
                       "src/parallel_cheat_bw.pdf")))))
    (build-system gnu-build-system)
    (arguments
     `(#:configure-flags
       (list (string-append "--docdir=" (assoc-ref %outputs "doc")
                             "/share/doc/parallel"))
       #: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 line ending in:
                  ;; $Global::shell = $ENV{'PARALLEL_SHELL'} ||
                  ;;  parent_shell($$) || $ENV{'SHELL'} || "/bin/sh";
                  (("/bin/sh\\\";\n$") (string-append (which "sh") "\";\n"))))
              (list "src/parallel" "src/sem"))))
         (add-before 'install 'add-install-to-path
           (lambda* (#:key outputs #:allow-other-keys)
             (setenv "PATH" (string-append (getenv "PATH") ":"
                                           (assoc-ref outputs "out") "/bin"))))
         (add-after 'install 'wrap-program
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (let ((out (assoc-ref outputs "out")))
               (wrap-program (string-append out "/bin/parallel")
                 `("PATH" ":" prefix
                   ,(map (lambda (input)
                           (string-append (assoc-ref inputs input) "/bin"))
                         '("perl"
                           "procps")))))))
         (add-after 'wrap-program 'post-install-test
           (lambda* (#:key tests? outputs #:allow-other-keys)
             (when tests?
               (invoke (string-append
                        (assoc-ref outputs "out") "/bin/parallel")
                       "echo"
                       ":::" "1" "2" "3")))))))
     (list
      #:configure-flags
      #~(list (string-append "--docdir=" #$output:doc "/share/doc/parallel"))
      #: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 line ending in:
                   ;; $Global::shell = $ENV{'PARALLEL_SHELL'} ||
                   ;;  parent_shell($$) || $ENV{'SHELL'} || "/bin/sh";
                   (("/bin/sh\\\";\n$") (string-append (which "sh") "\";\n"))))
               (list "src/parallel" "src/sem"))))
          (add-before 'install 'add-install-to-path
            (lambda _
              (setenv "PATH"
                      (string-append (getenv "PATH") ":" #$output "/bin"))))
          (add-after 'install 'wrap-program
            (lambda* (#:key inputs #:allow-other-keys)
              (wrap-program (string-append #$output "/bin/parallel")
                `("PATH" ":" prefix
                  ,(map (lambda (input)
                          (string-append (assoc-ref inputs input) "/bin"))
                        '("perl" "procps"))))))
          (add-after 'wrap-program 'post-install-test
            (lambda* (#:key tests? #:allow-other-keys)
              (when tests?
                (invoke (string-append #$output "/bin/parallel")
                        "echo"
                        ":::" "1" "2" "3")))))))
    (native-inputs
     (list perl pod2pdf))
    (inputs