Subject: [bug#66704] [PATCH 1/1] gnu: patman: Wrap program with git.

From: Simon Tournier <[email-masked]>
Date: Mon, 23 Oct 2023 18:26:00 +0200

* gnu/packages/bootloaders.scm (patman): Replace by 'package/inherit'.
[arguments]: Add 'wrap-program' that uses git-minimal dependency.
[inputs]: Add git-minimal.

Change-Id: Id4ebadd518f271baa087161b10455ec03d6f959b
---
 gnu/packages/bootloaders.scm | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index fb20ba0efa..cdc26a0c9e 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -18,6 +18,7 @@
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <[email-masked]>
 ;;; Copyright © 2021 Stefan <[email-masked]>
 ;;; Copyright © 2022, 2023 Maxim Cournoyer <[email-masked]>
+;;; Copyright © 2023 Simon Tournier <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -65,6 +66,7 @@ (define-module (gnu packages bootloaders)
   #: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)
@@ -864,8 +866,7 @@ (define-public python-u-boot-pylib
 ;;; This is packaged separately, as it can be used in other contexts than for
 ;;; U-Boot development.
 (define-public patman
-  (package
-    (inherit u-boot)
+  (package/inherit u-boot
     (name "patman")
     (build-system pyproject-build-system)
     (arguments
@@ -890,8 +891,17 @@ (define-public patman
             (lambda _
               (substitute* "pyproject.toml"
                 (("patman.__main__:run_patman")
-                 "patman.__main__")))))))
-    (inputs (list python-pygit2 python-requests python-u-boot-pylib))
+                 "patman.__main__"))))
+          (add-after 'install 'wrap-program
+            (lambda _
+              (wrap-program (string-append #$output "/bin/patman")
+                `("PATH" ":" suffix
+                  (,(string-append
+                     #$(this-package-input "git-minimal") "/bin")))))))))
+    (inputs (list git-minimal
+                  python-pygit2
+                  python-requests
+                  python-u-boot-pylib))
     (synopsis "Patch automation tool")
     (description "Patman is a patch automation script which:
 @itemize
-- 
2.38.1