guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 229ea2f9eaf56f56a8899129eb5e44899ecebb0f
Author: Maxim Cournoyer <maxim.courno...@gmail.com>
AuthorDate: Wed May 28 12:28:42 2025 +0900

    Revert "gnu: git-repo: Update to 2.54."
    
    This reverts commit 6c1cc9e36038c9a154501632a825acca6dfaf17a.  This doesn't
    install fully working repo, just the updater:
    
       $ repo --help
       [...]
       repo is not yet installed.  Use "repo init" to install it here.
    
    Change-Id: Ibe343789464828cbbd41380d5f0ae1ff71969bb3
---
 gnu/packages/android.scm | 116 ++++++++++++++++++++++++++++++++---------------
 1 file changed, 79 insertions(+), 37 deletions(-)

diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index eea3ba0a4f..9b2ec85de2 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -13,7 +13,6 @@
 ;;; Copyright © 2021 Guillaume Le Vaillant <g...@posteo.net>
 ;;; Copyright © 2021 Petr Hodina <phod...@protonmail.com>
 ;;; Copyright © 2023 Camilo Q.S. (Distopico) <distop...@riseup.net>
-;;; Copyright © 2025 Jakob Kirsch <jakob.kir...@web.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -46,7 +45,6 @@
   #:use-module (guix build-system trivial)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages)
-  #:use-module (gnu packages bash)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages docker)
@@ -926,7 +924,7 @@ The standard for the ETC1 texture format can be found at
 (define-public git-repo
   (package
     (name "git-repo")
-    (version "2.54")
+    (version "2.4.1")
     (source
      (origin
        (method git-fetch)
@@ -935,43 +933,87 @@ The standard for the ETC1 texture format can be found at
              (commit (string-append "v" version))))
        (file-name (string-append "git-repo-" version "-checkout"))
        (sha256
-        (base32 "0a1qa7gq3ink0cfgdxx3l3p26jm2w5vsifqs9xdvb98kkswak45d"))))
+        (base32 "0khg1731927gvin73dcbw1657kbfq4k7agla5rpzqcnwkk5agzg3"))))
     (build-system python-build-system)
     (arguments
-     (list
-      #:tests? #f ;tests consist of just formatting the code
-      #:phases
-      #~(modify-phases %standard-phases
-          (add-before 'build 'set-executable-paths
-            (lambda* (#:key inputs #:allow-other-keys)
-              (substitute* '("repo" "git_command.py")
-                (("^GIT = 'git'")
-                 (string-append "GIT = '"
-                                (search-input-file inputs "/bin/git"))))
-              (substitute* "git_config.py"
-                ((" command_base = \\['ssh',")
-                 (string-append " command_base = ['"
-                                (search-input-file inputs "/bin/ssh") ",")))))
-          (replace 'install
-            (lambda _
-              (let* ((bin-dir (string-append #$output "/bin"))
-                     (repo-dir (string-append #$output "/share/git-repo")))
-                (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"))
-                (wrap-program (string-append bin-dir "/repo")
-                  '("REPO_SKIP_SELF_UPDATE" =
-                    ("1"))
-                  '("REPO_TRACE" =
-                    ("0")))))))))
-    (inputs (list git openssh bash-minimal))
-    (home-page "https://gerrit.googlesource.com/git-repo/";)
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'set-executable-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (git (assoc-ref inputs "git"))
+                    (ssh (assoc-ref inputs "ssh")))
+               (substitute* '("repo" "git_command.py")
+                 (("^GIT = 'git'")
+                  (string-append "GIT = '" git "/bin/git'")))
+               (substitute* "git_config.py"
+                 ((" command_base = \\['ssh',")
+                  (string-append " command_base = ['" ssh "/bin/ssh',")))
+               #t)))
+         (add-before 'build 'do-not-self-update
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; Setting the REPO_MAIN variable to an absolute file name is
+             ;; enough to have _FindRepo return the store main.py file.  The
+             ;; self update mechanism is activated with the call to _Init() in
+             ;; main(), so we bypass it.
+
+             ;; Ticket requesting upstream to provide a mean to disable the
+             ;; self update mechanism:
+             ;; https://bugs.chromium.org/p/gerrit/issues/detail?id=12407.
+             (let* ((out (assoc-ref outputs "out"))
+                    (repo-main (string-append out "/share/git-repo/main.py")))
+               (substitute* "repo"
+                 (("^REPO_MAIN = .*")
+                  (format #f "REPO_MAIN = ~s~%" repo-main))
+                 ((" _Init\\(args, gitc_init=\\(cmd ==.*" all)
+                  (string-append "True #" all)))
+               ;; Prevent repo from trying to git describe its version from
+               ;; the (disabled) self updated copy.
+               (substitute* "git_command.py"
+                 (("ver = getattr\\(RepoSourceVersion.*")
+                  (format #f "ver = ~s~%" ,version)))
+               (substitute* "subcmds/version.py"
+                 (("rp_ver = .*")
+                  (format #f "rp_ver = ~s~%" ,version)))
+               ;; Prevent repo from adding its (disabled) self update copy to
+               ;; the list of projects to fetch when using 'repo sync'.
+               (substitute* "subcmds/sync.py"
+                 (("to_fetch\\.extend\\(all_projects\\).*" all)
+                  (string-append "#" all))
+                 (("self\\._Fetch\\(to_fetch")
+                  "self._Fetch(all_projects")
+                 (("_PostRepoFetch\\(rp, opt\\.repo_verify).*" all)
+                  (string-append "#" all))))))
+         (delete 'build) ; nothing to build
+         (add-before 'check 'configure-git
+           (lambda _
+             (setenv "HOME" (getcwd))
+             (invoke "git" "config" "--global" "user.email" "y...@example.com")
+             (invoke "git" "config" "--global" "user.name" "Your Name")))
+         (replace 'check
+           (lambda _
+             (invoke "./run_tests")))
+         (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"))
+               #t))))))
+    (inputs
+     ;; TODO: Add git-remote-persistent-https once it is available in guix
+     `(("git" ,git)
+       ("ssh" ,openssh)))
+    (native-inputs
+     `(("pytest" ,python-pytest)))
+    (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
+    (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

Reply via email to