From a4169c369d850da7859e94152f96dc71acb42e4f Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Thu, 8 Sep 2016 21:31:32 +0300 Subject: [PATCH] gnu: python-git-review: Find outside commands. * gnu/packages/openstack.scm (python-git-review)[arguments]: Hardcode the location of `git', `ssh' and `scp' so that `git-review' can find it natively. [inputs]: Add openssh. --- gnu/packages/openstack.scm | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/gnu/packages/openstack.scm b/gnu/packages/openstack.scm index 4cb38a9..65bc296 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,11 +797,33 @@ 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 'unpack 'hardcode-outside-programs + (lambda _ + (let* ((git (string-append + (assoc-ref %build-inputs "git") "/bin/git")) + (base (assoc-ref %build-inputs "openssh")) + (ssh (string-append base "/bin/ssh")) + (scp (string-append base "/bin/scp"))) + (substitute* '("git_review/cmd.py" "git_review/tests/test_git_review.py" + "git_review/tests/test_unit.py" "git_review/tests/utils.py") + (("\"git ") (string-append "\"" git " ")) + (("\"git\"") (string-append "\"" git "\"")) + (("'git'") (string-append "'" git "'"))) + (substitute* "git_review/cmd.py" + (("\"ssh\"") (string-append "\"" ssh "\"")) + (("'ssh'") (string-append "'" ssh "'")) + (("\"scp\"") (string-append "\"" scp "\"")) + (("'scp") (string-append "'" scp))) + #t)))))) (native-inputs `(("python-pbr" ,python-pbr))) (inputs `(("python-requests" ,python-requests) + ("openssh" ,openssh) ("git" ,git))) (home-page "http://docs.openstack.org/infra/git-review/") (synopsis "Command-line tool for Gerrit") -- 2.10.0