unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Marius Bakke <mbakke@fastmail.com>
To: Hartmut Goebel <h.goebel@crazy-compilers.com>, 26822@debbugs.gnu.org
Subject: bug#26822: [PATCH] gnu: Add git-repo.
Date: Mon, 08 May 2017 09:57:31 +0200	[thread overview]
Message-ID: <87mvanye50.fsf@fastmail.com> (raw)
In-Reply-To: <1494193267-26385-1-git-send-email-h.goebel@crazy-compilers.com>

[-- Attachment #1: Type: text/plain, Size: 4313 bytes --]

Hartmut Goebel <h.goebel@crazy-compilers.com> writes:

> * gnu/packages/android.scm (git-repo): New variable.
> ---
>  gnu/packages/android.scm | 58 ++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 58 insertions(+)
>
> diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
> index e23d0fd..23ffa2b 100644
> --- a/gnu/packages/android.scm
> +++ b/gnu/packages/android.scm
> @@ -3,6 +3,7 @@
>  ;;; Copyright © 2015 Kai-Chung Yan <seamlikok@gmail.com>
>  ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
>  ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
> +;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -23,8 +24,11 @@
>    #:use-module (guix packages)
>    #:use-module (guix git-download)
>    #:use-module (guix build-system gnu)
> +  #:use-module (guix build-system python)
>    #:use-module ((guix licenses) #:prefix license:)
>    #:use-module (gnu packages)
> +  #:use-module (gnu packages python)
> +  #:use-module (gnu packages version-control)
>    #:use-module (gnu packages tls))
>  
>  ;; The Makefiles that we add are largely based on the Debian
> @@ -298,3 +302,57 @@ with an emulator instance or connected Android device.  It facilitates a variety
>  of device actions, such as installing and debugging apps, and it provides access
>  to a Unix shell that can run commands on the connected device or emulator.")
>      (license license:asl2.0)))
> +
> +(define-public git-repo
> +  (package
> +    (name "git-repo")
> +    (version "1.12.37")
> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "https://gerrit.googlesource.com/git-repo")
> +             (commit (string-append "v" version))))
> +       (file-name (string-append "git-repo-" version "-checkout"))
> +    (sha256
> +     (base32 "0qp7jqhblv7xblfgpcq4n18dyjdv8shz7r60c3vnjxx2fngkj2jd"))))

The indentation of (sha256.. should align with file-name.

> +    (build-system python-build-system)
> +    (arguments
> +     `(#:python ,python-2
> +       #:phases
> +       (modify-phases %standard-phases
> +         (replace 'build
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (repo-dir (string-append out "/share/" ,name)))
> +               (substitute* "repo"
> +                 (("^repodir = '\\.repo'")
> +                  (string-append "repodir = '" repo-dir "'"))
> +                 (("^S_repo = 'repo'") "S_repo = '.'"))
> +               #t
> +               )))

These parens want to stay closer to the #t.

> +         (replace 'check
> +           (lambda _
> +             (zero? (system* "python" "-m" "nose"))))
> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (bin-dir (string-append out "/bin"))
> +                    (repo-dir (string-append out "/share/" ,name)))
> +               (mkdir-p bin-dir)
> +               (mkdir-p repo-dir)
> +               (copy-recursively "." repo-dir)
> +               (delete-file-recursively (string-append repo-dir "/tests"))
> +               (symlink (string-append repo-dir "/repo")
> +                        (string-append bin-dir "/repo"))))))))

(symlink* ..) has an unspecified return value, so please return #t here.

Otherwise looks good. Would it make sense to have it in
version-control.scm, or is this tool mostly for doing Android
development?

> +    (native-inputs
> +     `(("nose" ,python2-nose)
> +       ("git" ,git)))
> +    (home-page "https://code.google.com/p/git-repo/")
> +    (synopsis "Helps to manage many Git repositories.")
> +    (description "Repo is a tool built on top of Git.  Repo helps manage many
> +Git repositories, does the uploads to revision control systems, and automates
> +parts of the development workflow.  Repo is not meant to replace Git, only to
> +make it easier to work with Git.  The repo command is an executable Python
> +script that you can put anywhere in your path.")
> +    (license license:asl2.0)))
> -- 
> 2.7.4

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

  parent reply	other threads:[~2017-05-08  7:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-07 21:41 bug#26822: [PATCH] gnu: Add git-repo Hartmut Goebel
2017-05-07 23:46 ` Leo Famulari
2017-05-08  7:57 ` Marius Bakke [this message]
2017-05-08  8:03   ` Hartmut Goebel
2017-05-08  9:02     ` Clément Lassieur
2017-05-12 11:56 ` Hartmut Goebel
2017-06-02 16:20   ` Ludovic Courtès
2017-05-12 12:02 ` Hartmut Goebel
2017-06-04  9:45 ` bug#26822: merged Hartmut Goebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mvanye50.fsf@fastmail.com \
    --to=mbakke@fastmail.com \
    --cc=26822@debbugs.gnu.org \
    --cc=h.goebel@crazy-compilers.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).