unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 60145@debbugs.gnu.org
Cc: vagrant@debian.org, Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: [bug#60145] [PATCH 2/2] gnu: Add patman.
Date: Fri, 16 Dec 2022 23:35:49 -0500	[thread overview]
Message-ID: <20221217043549.23069-2-maxim.cournoyer@gmail.com> (raw)
In-Reply-To: <20221217043549.23069-1-maxim.cournoyer@gmail.com>

* gnu/packages/bootloaders.scm (patman): New variable.
* gnu/packages/patches/u-boot-patman-fix-help.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Register it.
---

 gnu/local.mk                                  |  1 +
 gnu/packages/bootloaders.scm                  | 34 +++++++++++++++-
 .../patches/u-boot-patman-fix-help.patch      | 40 +++++++++++++++++++
 3 files changed, 74 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/u-boot-patman-fix-help.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 8ae21641d7..456d955616 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1924,6 +1924,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/twinkle-bcg729.patch			\
   %D%/packages/patches/u-boot-allow-disabling-openssl.patch	\
   %D%/packages/patches/u-boot-infodocs-target.patch		\
+  %D%/packages/patches/u-boot-patman-fix-help.patch		\
   %D%/packages/patches/u-boot-nintendo-nes-serial.patch		\
   %D%/packages/patches/u-boot-rockchip-inno-usb.patch		\
   %D%/packages/patches/u-boot-sifive-prevent-reloc-initrd-fdt.patch	\
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index f52b2130ac..335b5a56d8 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -69,7 +69,10 @@ (define-module (gnu packages bootloaders)
   #:use-module (gnu packages valgrind)
   #:use-module (gnu packages virtualization)
   #:use-module (gnu packages xorg)
+  #:use-module (gnu packages python-web)
+  #:use-module (gnu packages python-xyz)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system pyproject)
   #:use-module (guix build-system trivial)
   #:use-module (guix download)
   #:use-module (guix gexp)
@@ -640,7 +643,8 @@ (define u-boot
                      %u-boot-allow-disabling-openssl-patch
                      %u-boot-sifive-prevent-relocating-initrd-fdt
                      %u-boot-rk3399-enable-emmc-phy-patch
-                     (search-patch "u-boot-infodocs-target.patch")))
+                     (search-patch "u-boot-infodocs-target.patch")
+                     (search-patch "u-boot-patman-fix-help.patch")))
               (method url-fetch)
               (uri (string-append
                     "https://ftp.denx.de/pub/u-boot/"
@@ -822,6 +826,34 @@ (define-public u-boot-tools
                   "  This package provides board-independent tools "
                   "of U-Boot."))))
 
+;;; This is packaged separately, as it can be used in other contexts than for
+;;; U-Boot development.
+(define-public patman
+  (package
+    (inherit u-boot)
+    (name "patman")
+    (build-system pyproject-build-system)
+    (arguments
+     ;; The test suite strongly relies on the git metadata being available (23
+     ;; failed, 14 passed).
+     (list
+      #:tests? #f
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'chdir
+            (lambda _
+              (chdir "tools/patman"))))))
+    (inputs (list python-pygit2 python-requests))
+    (synopsis "Patch automation tool")
+    (description "Patman is a patch automation script which:
+@itemize
+@item Creates patches directly from your branch
+@item Cleans them up by removing unwanted tags
+@item Inserts a cover letter with change lists
+@item Runs the patches through automated checks
+@item Optionally emails them out to selected people.
+@end itemize")))
+
 (define*-public (make-u-boot-package board triplet
                                      #:key
                                      defconfig
diff --git a/gnu/packages/patches/u-boot-patman-fix-help.patch b/gnu/packages/patches/u-boot-patman-fix-help.patch
new file mode 100644
index 0000000000..15b1aa3b55
--- /dev/null
+++ b/gnu/packages/patches/u-boot-patman-fix-help.patch
@@ -0,0 +1,40 @@
+Submitted upstream on Dec 16th, 2022.
+
+diff --git a/tools/patman/main.py b/tools/patman/main.py
+index 5a7756a221..bf300c6e64 100755
+--- a/tools/patman/main.py
++++ b/tools/patman/main.py
+@@ -7,6 +7,7 @@
+ """See README for more information"""
+ 
+ from argparse import ArgumentParser
++import importlib.resources
+ import os
+ import re
+ import shutil
+@@ -163,11 +164,8 @@ elif args.cmd == 'send':
+         fd.close()
+ 
+     elif args.full_help:
+-        tools.print_full_help(
+-            os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])),
+-                         'README.rst')
+-        )
+-
++        with importlib.resources.path('patman', 'README.rst') as readme:
++            tools.print_full_help(str(readme))
+     else:
+         # If we are not processing tags, no need to warning about bad ones
+         if not args.process_tags:
+diff --git a/tools/patman/setup.py b/tools/patman/setup.py
+index 43fdc00ce6..ce9bb4aa63 100644
+--- a/tools/patman/setup.py
++++ b/tools/patman/setup.py
+@@ -7,6 +7,6 @@ setup(name='patman',
+       scripts=['patman'],
+       packages=['patman'],
+       package_dir={'patman': ''},
+-      package_data={'patman': ['README']},
++      package_data={'patman': ['README.rst']},
+       classifiers=['Environment :: Console',
+                    'Topic :: Software Development'])
-- 
2.38.1





  reply	other threads:[~2022-12-17  4:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-17  4:15 [bug#60145] [PATCH 0/2] Add u-boot-documentation and patman Maxim Cournoyer
2022-12-17  4:35 ` [bug#60145] [PATCH 1/2] gnu: Add u-boot-documentation Maxim Cournoyer
2022-12-17  4:35   ` Maxim Cournoyer [this message]
2022-12-19 17:23 ` [bug#60145] [PATCH v4 " Maxim Cournoyer
2022-12-19 17:23   ` [bug#60145] [PATCH v4 2/2] gnu: Add patman Maxim Cournoyer
2022-12-19 22:42 ` [bug#60145] [PATCH v5 1/2] gnu: Add u-boot-documentation Maxim Cournoyer
2022-12-19 22:42   ` [bug#60145] [PATCH v5 2/2] gnu: Add patman Maxim Cournoyer
2022-12-20 13:21 ` [bug#60145] [PATCH v6 1/2] gnu: Add u-boot-documentation Maxim Cournoyer
2022-12-20 13:21   ` [bug#60145] [PATCH v6 2/2] gnu: Add patman Maxim Cournoyer
2022-12-28 21:06     ` bug#60145: " Maxim Cournoyer

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=20221217043549.23069-2-maxim.cournoyer@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=60145@debbugs.gnu.org \
    --cc=vagrant@debian.org \
    /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).