summary refs log tree commit diff
diff options
context:
space:
mode:
authorSimon Tournier <zimon.toutoune@gmail.com>2024-07-23 19:59:18 +0200
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2024-09-14 21:59:47 +0900
commit4c99ef43f09d541890c5b6a7bd1e3207597bae75 (patch)
treeb2e81b572e6f1d51475a4f6720c5a67431a4aeb6
parent5fb5cbb8b4c8a87cdb49658ab86e2f4c8721c3d2 (diff)
downloadguix-4c99ef43f09d541890c5b6a7bd1e3207597bae75.tar.gz
gnu: patman: Wrap program with git.
* gnu/packages/bootloaders.scm (patman)
[arguments]: Add 'wrap-script' phase to ensure git is always available.
[inputs]: Add git, git:send-email and guile-3.0/pinned.

Change-Id: Id4ebadd518f271baa087161b10455ec03d6f959b
Co-authored-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
-rw-r--r--gnu/packages/bootloaders.scm34
1 files changed, 22 insertions, 12 deletions
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 353b2c2a16..fcc1088fd6 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -17,8 +17,9 @@
 ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
 ;;; Copyright © 2022, 2023 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
 ;;; Copyright © 2021 Stefan <stefan-guix@vodafonemail.de>
-;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2022, 2023, 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2023 Herman Rimm <herman@rimm.ee>
+;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.com>
 ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -52,6 +53,7 @@
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gettext)
+  #:use-module (gnu packages guile)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
@@ -71,6 +73,7 @@
   #:use-module (gnu packages serialization)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages valgrind)
+  #:use-module (gnu packages version-control)
   #:use-module (gnu packages virtualization)
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages python-web)
@@ -982,17 +985,24 @@ commands part of the U-Boot project, such as Patman.")))
           (add-after 'unpack 'chdir
             (lambda _
               (chdir "tools/patman")))
-          (add-after 'chdir 'patch-pyproject.toml
-            ;; There is no 'run_patman' procedure in the __main__.py script,
-            ;; which breaks execution
-            ;; Patch submitted upstream (see:
-            ;; https://patchwork.ozlabs.org/project/uboot/\
-            ;; patch/20230901050532.725-1-maxim.cournoyer@gmail.com/).
-            (lambda _
-              (substitute* "pyproject.toml"
-                (("patman.__main__:run_patman")
-                 "patman.__main__")))))))
-    (inputs (list python-pygit2 python-requests python-u-boot-pylib))
+          (add-after 'install 'wrap-script
+            (lambda* (#:key inputs #:allow-other-keys)
+              (wrap-script (string-append #$output "/bin/patman")
+                `("PATH" ":" prefix
+                  (,(string-append #$(this-package-input "git") "/bin")))
+                `("GIT_EXEC_PATH" ":" prefix
+                  (,(dirname (search-input-file
+                              inputs "libexec/git-core/git-commit"))
+                   ,(dirname (search-input-file
+                              inputs
+                              "libexec/git-core/git-send-email"))))))))))
+    (inputs
+     (list git
+           `(,git "send-email")
+           guile-3.0/pinned             ;for wrap-script
+           python-pygit2
+           python-requests
+           python-u-boot-pylib))
     (synopsis "Patch automation tool")
     (description "Patman is a patch automation script which:
 @itemize