diff mbox

gnu: python-git-review: Wrap it so 'git', 'ssh' and 'scp' are found.

Message ID 20160910211332.27106-1-clement@lassieur.org
State New
Headers show

Commit Message

Clément Lassieur Sept. 10, 2016, 9:13 p.m. UTC
* gnu/packages/openstack.scm (python-git-review)[arguments]: Add
'wrap-program' phase.
[inputs]: Add openssh.
---
 gnu/packages/openstack.scm | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

Comments

Efraim Flashner Sept. 11, 2016, 7:05 a.m. UTC | #1
On Sat, Sep 10, 2016 at 11:13:32PM +0200, Clément Lassieur wrote:
> * gnu/packages/openstack.scm (python-git-review)[arguments]: Add
> 'wrap-program' phase.
> [inputs]: Add openssh.
> ---
>  gnu/packages/openstack.scm | 19 +++++++++++++++++--
>  1 file changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/gnu/packages/openstack.scm b/gnu/packages/openstack.scm
> index 4cb38a9..62f1e84 100644
> --- a/gnu/packages/openstack.scm
> +++ b/gnu/packages/openstack.scm
> @@ -20,6 +20,7 @@
>  
>  (define-module (gnu packages openstack)
>    #:use-module (gnu packages python)
> +  #:use-module (gnu packages ssh)
>    #:use-module (gnu packages tls)
>    #:use-module (gnu packages version-control)
>    #:use-module (guix build-system python)
> @@ -796,12 +797,26 @@ permanence.")
>          (base32
>           "07d1jn9ryff5j5ic6qj5pbk10m1ccmpllj0wyalrcms1q9yhlzh8"))))
>      (build-system python-build-system)
> -    (arguments `(#:tests? #f)) ; tests require a running Gerrit server
> +    (arguments
> +     '(#:tests? #f ; tests require a running Gerrit server
> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-after 'install 'wrap-program
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (git (assoc-ref inputs "git"))
> +                    (openssh (assoc-ref inputs "openssh")))
> +               (wrap-program (string-append out "/bin/git-review")
> +                 `("PATH" ":" prefix
> +                   ,(map (lambda (dir)
> +                           (string-append dir "/bin"))
> +                         (list git openssh))))))))))
>      (native-inputs
>       `(("python-pbr" ,python-pbr)))
>      (inputs
>       `(("python-requests" ,python-requests)
> -       ("git" ,git)))
> +       ("git" ,git)
> +       ("openssh" ,openssh)))
>      (home-page "http://docs.openstack.org/infra/git-review/")
>      (synopsis "Command-line tool for Gerrit")
>      (description
> -- 
> 2.10.0
> 

$ guix gc --references /gnu/store/5nr0nxadwrjrwsl16zgv2adlglpjcffn-python-git-review-1.25.0/
/gnu/store/429j0rw9782lsnnj492sr51dynw1iljl-python-testrepository-0.0.20
/gnu/store/5nr0nxadwrjrwsl16zgv2adlglpjcffn-python-git-review-1.25.0
/gnu/store/h2yg74jqdm062aijw775ambram58xc4f-git-2.10.0
/gnu/store/kqyrncmqyppb8njh0mh5gmi9iwsszvp6-python-pbr-1.8.1
/gnu/store/l3dmdmchz4nc0kjp4rqag94nbchihmn8-python-testtools-1.0.0
/gnu/store/m1v516vzcxqfvwvr3vlqxm1dzsjrjz50-python-fixtures-0.3.16
/gnu/store/m4gc2wx4q9if1vrhgclpspdil7rqsn21-python-3.4.3
/gnu/store/s3hwh3ky7qa173sxq7kz43xknxnbl3db-openssh-7.3p1
/gnu/store/wa1yc835mb7pmmrj45xfgviqr5fbasqq-python-wrapper-3.4.3
/gnu/store/xg06wf5hx35pprifwjfmsshczqa2vj1c-python-mimeparse-0.1.4
/gnu/store/ykzwykkvr2c80rw4l1qh3mvfdkl7jibi-bash-4.3.42
/gnu/store/zdahv56anb0ni3kcvbr1c446xbxmlpvs-python-requests-2.9.1

Looks good, pushed.
diff mbox

Patch

diff --git a/gnu/packages/openstack.scm b/gnu/packages/openstack.scm
index 4cb38a9..62f1e84 100644
--- a/gnu/packages/openstack.scm
+++ b/gnu/packages/openstack.scm
@@ -20,6 +20,7 @@ 
 
 (define-module (gnu packages openstack)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages ssh)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages version-control)
   #:use-module (guix build-system python)
@@ -796,12 +797,26 @@  permanence.")
         (base32
          "07d1jn9ryff5j5ic6qj5pbk10m1ccmpllj0wyalrcms1q9yhlzh8"))))
     (build-system python-build-system)
-    (arguments `(#:tests? #f)) ; tests require a running Gerrit server
+    (arguments
+     '(#:tests? #f ; tests require a running Gerrit server
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'wrap-program
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (git (assoc-ref inputs "git"))
+                    (openssh (assoc-ref inputs "openssh")))
+               (wrap-program (string-append out "/bin/git-review")
+                 `("PATH" ":" prefix
+                   ,(map (lambda (dir)
+                           (string-append dir "/bin"))
+                         (list git openssh))))))))))
     (native-inputs
      `(("python-pbr" ,python-pbr)))
     (inputs
      `(("python-requests" ,python-requests)
-       ("git" ,git)))
+       ("git" ,git)
+       ("openssh" ,openssh)))
     (home-page "http://docs.openstack.org/infra/git-review/")
     (synopsis "Command-line tool for Gerrit")
     (description