From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 16 23:16:06 2022 Received: (at submit) by debbugs.gnu.org; 17 Dec 2022 04:16:06 +0000 Received: from localhost ([127.0.0.1]:53551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6OcI-0001Yz-6v for submit@debbugs.gnu.org; Fri, 16 Dec 2022 23:16:06 -0500 Received: from lists.gnu.org ([209.51.188.17]:40764) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6OcE-0001Yl-H0 for submit@debbugs.gnu.org; Fri, 16 Dec 2022 23:16:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6OcE-0001OH-Au for guix-patches@gnu.org; Fri, 16 Dec 2022 23:16:02 -0500 Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6OcB-0002ij-NH for guix-patches@gnu.org; Fri, 16 Dec 2022 23:16:01 -0500 Received: by mail-qt1-x830.google.com with SMTP id fu10so4388446qtb.0 for ; Fri, 16 Dec 2022 20:15:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GVknBcjVe50xJJjPBuRduV0k13armE6dlaZOadexHug=; b=i6hjQlA0xgS2dQLMZTyBUKXT9eb5FVc+PMe6yZ2+qCjJYJ3/mEbovl0tWunEFVQKql Pm0jJ3ym8HoxnnNi9LUz7U+Wf/0Sfp54Rey/AeWRAinfHtTG9OVrRXj9OWiOMPNb+4ID /v0h8mkW++0N3HzIqDCNv05IVzx/B+L90o8I1TEb2vF0rt2tN4/KPUpOI/hRfXWgrUlW MbVdvVZpykzNtatTojaisfgqCoyfzkDGuwyMDZu5rpC8LPw3GJQfaLhLqY5siYRpgrmi TKen2v+YZMzJGKT2011CQFT+IWEtgjhgzyC1t9MnGTMqcEUyyXc1ZEQtXPyjMVbYgXbd og5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GVknBcjVe50xJJjPBuRduV0k13armE6dlaZOadexHug=; b=LVkYOYZIBxmfTHmyaOJVWDCO0sr49ZlN/Z5nS8ygyYam/00qOx0m4RlSbeOrnSmiSg 4ovjsZUypyRFtikd1itXwPHTI0kYYqy/A+EfBK5X6o2pkpmf/bPfMOrw91IchbuYi0+P aTRkcVGDTW7jPIW4hyk8CPHI5JPmEg0ttIK0AnMhAhZHHnPC3NMX55wZwPSuxiZkrQy6 9KlIcbAETfM5kALScJXB23G8LDG2x8h5UyA+rpNBqqHknyzvlpGLBLUP/yU1tabzEtES A8LKOOcOHgnCBPF+k9Kter9TwdeJBenMOYLWH3GkNXVscg6GQplPVyy/HFknrmYIXujd vHug== X-Gm-Message-State: AFqh2kp1C57oaE7fs1w/PKxjrgkZ4WjFdk5sHczn22XJwgr6sK5FIcCR Sjok+WSUPc1DFJIkJ5RUx/jxxtrOpbXq/dqG X-Google-Smtp-Source: AMrXdXuMdGJghNNGlUeOA6qL7U6hGDUmGfXJQYJqk9u/eQPHOm9LFTymfDqd0g9a+VJknlzFUVuPHQ== X-Received: by 2002:ac8:7cbc:0:b0:39c:da20:609 with SMTP id z28-20020ac87cbc000000b0039cda200609mr2107544qtv.19.1671250558527; Fri, 16 Dec 2022 20:15:58 -0800 (PST) Received: from localhost.localdomain (dsl-159-157.b2b2c.ca. [66.158.159.157]) by smtp.gmail.com with ESMTPSA id u5-20020a05620a430500b006ff8ac9acfdsm2967954qko.49.2022.12.16.20.15.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 20:15:58 -0800 (PST) From: Maxim Cournoyer To: guix-patches@gnu.org Subject: [PATCH 0/2] Add u-boot-documentation and patman Date: Fri, 16 Dec 2022 23:15:41 -0500 Message-Id: <20221217041541.20193-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::830; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x830.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This adds the u-boot documentation as an info manual and package a tool it used in the U-Boot community to work with patch. I'm testing it, perhaps it could be used in Guix, if it's modular enough to be plugged with etc/teams.scm and guix lint :-). Thanks, Maxim Cournoyer (2): gnu: Add u-boot-documentation. gnu: Add patman. gnu/local.mk | 2 + gnu/packages/bootloaders.scm | 79 ++++++++++++++++++- .../patches/u-boot-infodocs-target.patch | 61 ++++++++++++++ .../patches/u-boot-patman-fix-help.patch | 40 ++++++++++ 4 files changed, 181 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/u-boot-infodocs-target.patch create mode 100644 gnu/packages/patches/u-boot-patman-fix-help.patch base-commit: 90a2b8c64a0155a1cd663ee5408dc6bb09d64123 -- 2.38.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 16 23:36:20 2022 Received: (at 60145) by debbugs.gnu.org; 17 Dec 2022 04:36:20 +0000 Received: from localhost ([127.0.0.1]:53632 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6Ovs-0001kg-4r for submit@debbugs.gnu.org; Fri, 16 Dec 2022 23:36:20 -0500 Received: from mail-qt1-f174.google.com ([209.85.160.174]:34512) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6Ovo-0001kY-69 for 60145@debbugs.gnu.org; Fri, 16 Dec 2022 23:36:18 -0500 Received: by mail-qt1-f174.google.com with SMTP id g7so4368705qts.1 for <60145@debbugs.gnu.org>; Fri, 16 Dec 2022 20:36:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=sQfUFiYc7JfRWZyGeg0Wb/7u7kJuEqYrdejJac8yiQg=; b=dU9sk41KnbrRyy2Mv6YbUWhs0qAPXH4lAdX0uBMb0nc5GGV0gjnuKXwOHeLEzGQGhe hfGoz5GtBtnUIqczPElctsof3C+0hG7mYAZih75zSUeFXE1pkctRRhRa8m2I/G2nhP4x EUKMQBdfozCwzIqxGFE1X2BCrjWfboJEWEaun02kyvQsygXos+MZrm7Vd4fcdMlZe90q SZaswXl1FOkd9OdQ44qFGSI12i1YgfC8unPG/xVJJ29V6NZ3jVkG9YuTDauIovRshLkT PImFntYamA/h8+vmqD01SMrCmWOFo16s6xDprXs8QZr7PRbldQkbfRsH7iv/ZGepE5lV cFGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sQfUFiYc7JfRWZyGeg0Wb/7u7kJuEqYrdejJac8yiQg=; b=Uvprjha/80gidFd7j/WIyIu7AGbLpB1y1GDxZOXXxD+mOdYZCTWTCcv+vsCWSka24N P4L8+/nD2zn9mGtZ6cuPo38uaQy701TwI2v/WvpzHrbFrKWFymQRJZZBqXFbE20Ec094 QYbz6//LSGRVMYIcv5SiQ0Cf+4azZO4CCFXNXiy8LI2FL/ejJ9TZiUSxLjnZPAPuRKZB 7FvBvQ7JhsOVkO0H4tPe1bNAcPhgYAOQGO38IFzhBfh7vmvVFIHoJR1iwRN4UeZaWE4y JLQLgp4ncBoL3tDjMOZzH8wk9wXeLK4kCB0APD/c7XjckdarXQx5dPPEss8cA0VWY+he 8jgA== X-Gm-Message-State: ANoB5pmWPn3EQhchbVGzJV35R7abu0FZHlMj5knc/Enl8MTm+AvNxmph OGeWWnlFFU2HIZLZz6g1lbnUqj0jqDTvc0+o X-Google-Smtp-Source: AA0mqf6rsb0MpHSVNNEsfnWMItBYcLh9TYlpwDNUGkwbxOmXzmqgOiFaKchpvTec9p2pi+4mP7gyDw== X-Received: by 2002:a05:622a:2586:b0:3a7:fdfa:7ee with SMTP id cj6-20020a05622a258600b003a7fdfa07eemr47765892qtb.43.1671251770235; Fri, 16 Dec 2022 20:36:10 -0800 (PST) Received: from localhost.localdomain (dsl-159-157.b2b2c.ca. [66.158.159.157]) by smtp.gmail.com with ESMTPSA id ci27-20020a05622a261b00b003a580cd979asm2479291qtb.58.2022.12.16.20.36.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 20:36:09 -0800 (PST) From: Maxim Cournoyer To: 60145@debbugs.gnu.org Subject: [PATCH 1/2] gnu: Add u-boot-documentation. Date: Fri, 16 Dec 2022 23:35:48 -0500 Message-Id: <20221217043549.23069-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 60145 Cc: vagrant@debian.org, Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/patches/u-boot-infodocs-target.patch: New patch. * gnu/local.mk: (dist_patch_DATA): Register it. * gnu/packages/bootloaders.scm (u-boot): Apply it. (u-boot-documentation): New variable. --- gnu/local.mk | 1 + gnu/packages/bootloaders.scm | 47 +++++++++++++- .../patches/u-boot-infodocs-target.patch | 61 +++++++++++++++++++ 3 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/u-boot-infodocs-target.patch diff --git a/gnu/local.mk b/gnu/local.mk index 5b8944f568..8ae21641d7 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1923,6 +1923,7 @@ dist_patch_DATA = \ %D%/packages/patches/tuxpaint-stamps-path.patch \ %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-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 3c96453e5c..f52b2130ac 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -17,6 +17,7 @@ ;;; Copyright © 2021 Brice Waegeneire ;;; Copyright © 2022 Denis 'GNUtoo' Carikli ;;; Copyright © 2021 Stefan +;;; Copyright © 2022 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -62,6 +63,7 @@ (define-module (gnu packages bootloaders) #:use-module (gnu packages texinfo) #:use-module (gnu packages tls) #:use-module (gnu packages sdl) + #:use-module (gnu packages sphinx) #:use-module (gnu packages serialization) #:use-module (gnu packages swig) #:use-module (gnu packages valgrind) @@ -637,7 +639,8 @@ (define u-boot (list %u-boot-rockchip-inno-usb-patch %u-boot-allow-disabling-openssl-patch %u-boot-sifive-prevent-relocating-initrd-fdt - %u-boot-rk3399-enable-emmc-phy-patch)) + %u-boot-rk3399-enable-emmc-phy-patch + (search-patch "u-boot-infodocs-target.patch"))) (method url-fetch) (uri (string-append "https://ftp.denx.de/pub/u-boot/" @@ -667,6 +670,48 @@ (define u-boot also initializes the boards (RAM etc).") (license license:gpl2+))) +;;; This is very similar to the linux-libre-documentation package, since it +;;; reuses the same Makefile-based build system. +(define-public u-boot-documentation + (package + (inherit u-boot) + (name "u-boot-documentation") + (arguments + (list + #:make-flags #~(list "HOSTCC=gcc" + ;; Avoid treating Sphinx warnings as errors. + "SPHINXOPTS=") + #:tests? #f + #:phases #~(modify-phases %standard-phases + (delete 'configure) + (replace 'build + (lambda* (#:key make-flags #:allow-other-keys) + (substitute* "doc/Makefile" + ;; Remove problematic environment check script. + ((".*scripts/sphinx-pre-install.*") "")) + (apply invoke "make" "infodocs" make-flags))) + (replace 'install + (lambda* (#:key make-flags #:allow-other-keys) + (let* ((info-dir (string-append #$output "/share/info")) + (info (string-append info-dir + "/DasUBoot.info.gz"))) + (with-directory-excursion "doc/output" + (apply invoke "make" "-C" "texinfo" "install-info" + (string-append "infodir=" info-dir) + make-flags)) + ;; Create a symlink, for convenience. + (symlink info (string-append info-dir + "/uboot.info.gz")))))))) + (native-inputs + (modify-inputs (package-native-inputs u-boot) + (append fontconfig + python-sphinx + texinfo + which))) + (synopsis "U-Boot documentation") + (description "This package provides the documentation for U-Boot, as an +Info manual."))) + (define-public u-boot-tools (package (inherit u-boot) diff --git a/gnu/packages/patches/u-boot-infodocs-target.patch b/gnu/packages/patches/u-boot-infodocs-target.patch new file mode 100644 index 0000000000..ba32f1913a --- /dev/null +++ b/gnu/packages/patches/u-boot-infodocs-target.patch @@ -0,0 +1,61 @@ +Submitted upstream on Dec 16th, 2022. + +diff --git a/Makefile b/Makefile +index de5746399a..597a8886c3 100644 +--- a/Makefile ++++ b/Makefile +@@ -2372,7 +2372,7 @@ tcheck: + # Documentation targets + # --------------------------------------------------------------------------- + DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs \ +- linkcheckdocs dochelp refcheckdocs ++ linkcheckdocs dochelp refcheckdocs texinfodocs infodocs + PHONY += $(DOC_TARGETS) + $(DOC_TARGETS): scripts_basic FORCE + $(Q)$(MAKE) $(build)=doc $@ +diff --git a/doc/Makefile b/doc/Makefile +index f5de65e927..62effd0fec 100644 +--- a/doc/Makefile ++++ b/doc/Makefile +@@ -69,6 +69,15 @@ quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4) + htmldocs: + @+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var))) + ++texinfodocs: ++ @$(srctree)/scripts/sphinx-pre-install --version-check ++ @+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,texinfo,$(var),texinfo,$(var))) ++ ++# Note: the 'info' Make target is generated by sphinx itself when ++# running the texinfodocs target defined above. ++infodocs: texinfodocs ++ $(MAKE) -C $(BUILDDIR)/texinfo info ++ + linkcheckdocs: + @$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,linkcheck,$(var),,$(var))) + +@@ -109,6 +118,8 @@ cleandocs: + dochelp: + @echo ' U-Boot documentation in different formats from ReST:' + @echo ' htmldocs - HTML' ++ @echo ' texinfodocs - Texinfo' ++ @echo ' infodocs - Info' + @echo ' latexdocs - LaTeX' + @echo ' pdfdocs - PDF' + @echo ' epubdocs - EPUB' +diff --git a/doc/media/Makefile b/doc/media/Makefile +index b9b43a34c3..9b32258696 100644 +--- a/doc/media/Makefile ++++ b/doc/media/Makefile +@@ -22,10 +22,11 @@ $(BUILDDIR)/linker_lists.h.rst: ${API}/linker_lists.h ${PARSER} $(SRC_DIR)/linke + + # Media build rules + +-.PHONY: all html epub xml latex ++.PHONY: all html texinfo epub xml latex + + all: $(IMGDOT) $(BUILDDIR) ${TARGETS} + html: all ++texinfo: all + epub: all + xml: all + latex: $(IMGPDF) all base-commit: 90a2b8c64a0155a1cd663ee5408dc6bb09d64123 -- 2.38.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 16 23:36:27 2022 Received: (at 60145) by debbugs.gnu.org; 17 Dec 2022 04:36:27 +0000 Received: from localhost ([127.0.0.1]:53635 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6Ovy-0001ks-Pf for submit@debbugs.gnu.org; Fri, 16 Dec 2022 23:36:27 -0500 Received: from mail-qt1-f171.google.com ([209.85.160.171]:35787) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6Ovx-0001kf-8F for 60145@debbugs.gnu.org; Fri, 16 Dec 2022 23:36:25 -0500 Received: by mail-qt1-f171.google.com with SMTP id h26so509427qtu.2 for <60145@debbugs.gnu.org>; Fri, 16 Dec 2022 20:36:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hJgIMz5b1IirLsFOY2+I3tLAc1RqR/4ktOZMSNsmh04=; b=MAOe6Xn1hW+bTsYefN+tMmeFVQlR1/PsXr1xjRoA7cRbQsz80lMf8uz4oo1xQaeDpr IDtdLUCdOGGjfPR67VHTgecwNRfHp0n2oVVWOtVEb8HRlyB+6bE/RQvv3tHYZFD3XQzz nvA5uIDV8amzwVbemYtHN4yNSRR+hM08itCSSH89NIohyg9TXH4Jiw2OPNsZ6DTfVd6r CLK7MOcXKRhlkKvgQ+gVbtuP/tt3HhcCUYXPxQgnZiHiGoOqgvZzpv9wb2+Nf2Nt7rI9 dR8JU5SJGGnLdPNU5HTfNg8mvTfBUpGvjXmCFK57h2HbCjnFskQ9514qo60Cdj37dIga cfWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hJgIMz5b1IirLsFOY2+I3tLAc1RqR/4ktOZMSNsmh04=; b=fRNULO6TDecDVbWcEVzcymPZXBN0wHoSHZcU72eb9EN6qPL4jz6pVvz47Aq9ww9suD UDaiTNyBKA+JJLu7FwPg/VA9Did2tbqGsW/1+xsbY6FptmkshcvLpEYEN4uflpLpskQp gUS/Hvnkji2whkEooIYgaUsWS9h7hW1XFj80Xjti0FFeipvBTifp6siEzAG4siZmjsYY hjFaIRFvie588y8I3A2OhTmN+RgYF8JKqIIiBzEgf1OzFA9uDRiEgqjPO7Qu5XaaVUNn AZZVSaGrB5GM1lsCcsneBJh1qxcBWc5UU3w8hWwgS3tXJKkUT3Oh57H3wGNADKtTbiSf Sc+Q== X-Gm-Message-State: ANoB5pn2n+hY1oLdlH1zUKjRKeDKfHLcqMo8JzOtTOzPnjUVRIc4D7FA 2j1tfIZsWyTdt7g9JDB5n3JcAjiocZuJu3w5 X-Google-Smtp-Source: AA0mqf5Y0Kw+egyyaD+j0prhYRB7vqev6ZfrRn4y7DaAHqzYO7554XCb4GHsqOV3GRifdvSFjN9krw== X-Received: by 2002:ac8:6b4e:0:b0:3a8:2a89:d57d with SMTP id x14-20020ac86b4e000000b003a82a89d57dmr19256185qts.67.1671251779480; Fri, 16 Dec 2022 20:36:19 -0800 (PST) Received: from localhost.localdomain (dsl-159-157.b2b2c.ca. [66.158.159.157]) by smtp.gmail.com with ESMTPSA id ci27-20020a05622a261b00b003a580cd979asm2479291qtb.58.2022.12.16.20.36.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 20:36:19 -0800 (PST) From: Maxim Cournoyer To: 60145@debbugs.gnu.org Subject: [PATCH 2/2] gnu: Add patman. Date: Fri, 16 Dec 2022 23:35:49 -0500 Message-Id: <20221217043549.23069-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221217043549.23069-1-maxim.cournoyer@gmail.com> References: <20221217043549.23069-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60145 Cc: vagrant@debian.org, Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * 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 From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 19 12:23:49 2022 Received: (at 60145) by debbugs.gnu.org; 19 Dec 2022 17:23:49 +0000 Received: from localhost ([127.0.0.1]:39324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7Jrg-00059s-EA for submit@debbugs.gnu.org; Mon, 19 Dec 2022 12:23:49 -0500 Received: from mail-qt1-f175.google.com ([209.85.160.175]:44827) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7Jre-00059k-BF for 60145@debbugs.gnu.org; Mon, 19 Dec 2022 12:23:47 -0500 Received: by mail-qt1-f175.google.com with SMTP id c11so920106qtn.11 for <60145@debbugs.gnu.org>; Mon, 19 Dec 2022 09:23:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=E2V6LCv39ppz9qK3UN+24rSN6oe0xbGIo5sHBGt8DnE=; b=UVRDyC6YIq21tq9JqYjhxwPQI29xEupaFRTEiU9ceU/qXlWjXCtaDsVCORaJ5xhkA9 dEf0E8Ev3AXxaDsnCHn0WywqtAjC5kXP+1hSIQ7BM8aVr8zF1KYh5JGhnU/48YqzdjS0 Vp1d8a388f14ZBnsPUdqAHP0gGTQSitmQAcTb7p/cLEjXWgacWr4+nFmDk5B0rPaAuZL 3zTaQaQQIwZApZMCdkWm6WujP5Q0AkEqYwkhTlxYBzmAmuVffiH6sUoHxEW0HYplL8kD MdNCMqSj8SvcIHnORiTF1JCdBNr3XdEPNRUq53jEzLGJfbPfQGDo+7Yrco9qRRKNuM5o 0dwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=E2V6LCv39ppz9qK3UN+24rSN6oe0xbGIo5sHBGt8DnE=; b=WdW2FjcxgTQ2mDTz5+Fhc7M3LXjE5qHz7+9ppeojgmNR9nSkHhoa3Rl5/DARgSbPxV PtO6MNLL7f6U/DF0POa6O2mdkuAuTcDNWgeruGOOWpaso9omF/vsmKoRnDNgsWIOjNub gtFNj3pv1SiGEOsxLmkEl60ebgo8v0P70qTNL80KdzJyMTBRySL6x/Mn5h51vcZiIEm3 dhgC5UaMXy+zdIQhPlraI6O8utvRadQ8gvENNlWlbTjtDhyroxWyN1wX44Zn9/1DfQL1 B3VNQVDo/PYIOoYBHxt/NE/6y0Y3xBDmVFG2goaQPZVRDA4mi8pISFtWNm8O8384XAJZ ASiQ== X-Gm-Message-State: AFqh2kqr0QzJiFTUPqDbRRbkSScVTKbG0ldUIHdVHuOlz7KN0v2nktI0 lmJratdnascv+0c4HqoltvbZo1fmeMq3Aw== X-Google-Smtp-Source: AMrXdXtEmXrlo3kpKSl8Hts2z65RZPhJfHy+JTBO+ibBRzryDlNDHHs0O0VgjXKOeM3DsC0IMg1uzQ== X-Received: by 2002:a05:622a:2488:b0:3a9:8610:f9af with SMTP id cn8-20020a05622a248800b003a98610f9afmr8439000qtb.14.1671470620491; Mon, 19 Dec 2022 09:23:40 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id l6-20020a05620a28c600b00702311aea78sm5083298qkp.82.2022.12.19.09.23.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 09:23:40 -0800 (PST) From: Maxim Cournoyer To: 60145@debbugs.gnu.org Subject: [PATCH v4 1/2] gnu: Add u-boot-documentation. Date: Mon, 19 Dec 2022 12:23:31 -0500 Message-Id: <20221219172332.31222-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60145 Cc: vagrant@debian.org, Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/patches/u-boot-infodocs-target.patch: New patch. * gnu/local.mk: (dist_patch_DATA): Register it. * gnu/packages/bootloaders.scm (u-boot): Apply it. (u-boot-documentation): New variable. --- (no changes since v3) Changes in v3: - Update U-Boot documentation patch - Remove now extraneous convenience symlink Changes in v2: - Update U-Boot documentation patch gnu/local.mk | 1 + gnu/packages/bootloaders.scm | 41 ++++++++- .../patches/u-boot-infodocs-target.patch | 84 +++++++++++++++++++ 3 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/u-boot-infodocs-target.patch diff --git a/gnu/local.mk b/gnu/local.mk index 56634e090c..01fcc9d7d3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1924,6 +1924,7 @@ dist_patch_DATA = \ %D%/packages/patches/tuxpaint-stamps-path.patch \ %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-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 3c96453e5c..32970f86f1 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -17,6 +17,7 @@ ;;; Copyright © 2021 Brice Waegeneire ;;; Copyright © 2022 Denis 'GNUtoo' Carikli ;;; Copyright © 2021 Stefan +;;; Copyright © 2022 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -62,6 +63,7 @@ (define-module (gnu packages bootloaders) #:use-module (gnu packages texinfo) #:use-module (gnu packages tls) #:use-module (gnu packages sdl) + #:use-module (gnu packages sphinx) #:use-module (gnu packages serialization) #:use-module (gnu packages swig) #:use-module (gnu packages valgrind) @@ -637,7 +639,8 @@ (define u-boot (list %u-boot-rockchip-inno-usb-patch %u-boot-allow-disabling-openssl-patch %u-boot-sifive-prevent-relocating-initrd-fdt - %u-boot-rk3399-enable-emmc-phy-patch)) + %u-boot-rk3399-enable-emmc-phy-patch + (search-patch "u-boot-infodocs-target.patch"))) (method url-fetch) (uri (string-append "https://ftp.denx.de/pub/u-boot/" @@ -667,6 +670,42 @@ (define u-boot also initializes the boards (RAM etc).") (license license:gpl2+))) +;;; This is very similar to the linux-libre-documentation package, since it +;;; reuses the same Makefile-based build system. +(define-public u-boot-documentation + (package + (inherit u-boot) + (name "u-boot-documentation") + (arguments + (list + #:make-flags #~(list "HOSTCC=gcc" + ;; Avoid treating Sphinx warnings as errors. + "SPHINXOPTS=") + #:tests? #f + #:phases #~(modify-phases %standard-phases + (delete 'configure) + (replace 'build + (lambda* (#:key make-flags #:allow-other-keys) + (apply invoke "make" "infodocs" make-flags))) + (replace 'install + (lambda* (#:key make-flags #:allow-other-keys) + (let* ((info-dir (string-append #$output "/share/info")) + (info (string-append info-dir + "/DasUBoot.info.gz"))) + (with-directory-excursion "doc/output" + (apply invoke "make" "-C" "texinfo" "install-info" + (string-append "infodir=" info-dir) + make-flags)))))))) + (native-inputs + (modify-inputs (package-native-inputs u-boot) + (append fontconfig + python-sphinx + texinfo + which))) + (synopsis "U-Boot documentation") + (description "This package provides the documentation for U-Boot, as an +Info manual."))) + (define-public u-boot-tools (package (inherit u-boot) diff --git a/gnu/packages/patches/u-boot-infodocs-target.patch b/gnu/packages/patches/u-boot-infodocs-target.patch new file mode 100644 index 0000000000..2c81807f39 --- /dev/null +++ b/gnu/packages/patches/u-boot-infodocs-target.patch @@ -0,0 +1,84 @@ +Upstream status: https://patchwork.ozlabs.org/project/uboot/patch/20221217025137.2514-1-maxim.cournoyer@savoirfairelinux.com/ + +diff --git a/Makefile b/Makefile +index de5746399a..597a8886c3 100644 +--- a/Makefile ++++ b/Makefile +@@ -2372,7 +2372,7 @@ tcheck: + # Documentation targets + # --------------------------------------------------------------------------- + DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs \ +- linkcheckdocs dochelp refcheckdocs ++ linkcheckdocs dochelp refcheckdocs texinfodocs infodocs + PHONY += $(DOC_TARGETS) + $(DOC_TARGETS): scripts_basic FORCE + $(Q)$(MAKE) $(build)=doc $@ +diff --git a/doc/Makefile b/doc/Makefile +index f5de65e927..d0904a9f99 100644 +--- a/doc/Makefile ++++ b/doc/Makefile +@@ -69,6 +69,14 @@ quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4) + htmldocs: + @+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var))) + ++texinfodocs: ++ @+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,texinfo,$(var),texinfo,$(var))) ++ ++# Note: the 'info' Make target is generated by sphinx itself when ++# running the texinfodocs target defined above. ++infodocs: texinfodocs ++ $(MAKE) -C $(BUILDDIR)/texinfo info ++ + linkcheckdocs: + @$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,linkcheck,$(var),,$(var))) + +@@ -109,6 +117,8 @@ cleandocs: + dochelp: + @echo ' U-Boot documentation in different formats from ReST:' + @echo ' htmldocs - HTML' ++ @echo ' texinfodocs - Texinfo' ++ @echo ' infodocs - Info' + @echo ' latexdocs - LaTeX' + @echo ' pdfdocs - PDF' + @echo ' epubdocs - EPUB' +diff --git a/doc/conf.py b/doc/conf.py +index 62c8d31270..3db70f80c1 100644 +--- a/doc/conf.py ++++ b/doc/conf.py +@@ -449,7 +449,7 @@ for fn in os.listdir('.'): + # One entry per manual page. List of tuples + # (source start file, name, description, authors, manual section). + man_pages = [ +- (master_doc, 'dasuboot', 'The U-Boot Documentation', ++ (master_doc, 'u-boot', 'The U-Boot Documentation', + [author], 1) + ] + +@@ -463,8 +463,8 @@ man_pages = [ + # (source start file, target name, title, author, + # dir menu entry, description, category) + texinfo_documents = [ +- (master_doc, 'DasUBoot', 'The U-Boot Documentation', +- author, 'DasUBoot', 'One line description of project.', ++ (master_doc, 'u-boot', 'The U-Boot Documentation', ++ author, 'U-Boot', 'Boot loader for embedded systems', + 'Miscellaneous'), + ] + +diff --git a/doc/media/Makefile b/doc/media/Makefile +index b9b43a34c3..9b32258696 100644 +--- a/doc/media/Makefile ++++ b/doc/media/Makefile +@@ -22,10 +22,11 @@ $(BUILDDIR)/linker_lists.h.rst: ${API}/linker_lists.h ${PARSER} $(SRC_DIR)/linke + + # Media build rules + +-.PHONY: all html epub xml latex ++.PHONY: all html texinfo epub xml latex + + all: $(IMGDOT) $(BUILDDIR) ${TARGETS} + html: all ++texinfo: all + epub: all + xml: all + latex: $(IMGPDF) all base-commit: f28ca2447c5e2eef1ba6a3a11587380a665b0e26 -- 2.38.1 From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 19 12:24:29 2022 Received: (at 60145) by debbugs.gnu.org; 19 Dec 2022 17:24:29 +0000 Received: from localhost ([127.0.0.1]:39331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7JsK-0005Ak-9K for submit@debbugs.gnu.org; Mon, 19 Dec 2022 12:24:29 -0500 Received: from mail-vs1-f43.google.com ([209.85.217.43]:42988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7JsH-0005AZ-5I for 60145@debbugs.gnu.org; Mon, 19 Dec 2022 12:24:26 -0500 Received: by mail-vs1-f43.google.com with SMTP id m2so9371605vsv.9 for <60145@debbugs.gnu.org>; Mon, 19 Dec 2022 09:24:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=P/Y+E8j9zurJFwH/G96UgQFVcoOFwJxG8YKqYS17RBs=; b=kDo65n/63mMOmPxrOidrB1OfWUwzYmDLEmNESpLvhOJvDu53yJmRhsrfYbtV6Acdul CCIjhxsxBk3gBBJ1Ot6fa7lxpvTNFuOZFFAIiucAjB3x5BlYpAjixVCAcms0Bziz7NzX XRk/HniRAOJVa5sgdwoFutYh0Io6tNGjSh+FywB0hYVpmQHR4u94HOJhd76TxBqYNJ70 NREUH1/Yl1dWogK4QRfQiGT8J9Cdq/Nbbyn8GGbd/qfmD9OeiDTsP3JeKd/yN/kiQ1Ir UBPEsFIAfwIS4/1C+Av6P6ybc5hKpHy4bVnIIiIfDL6QTXCHQiwxZdjFBEm2ldAjxeWn UeeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P/Y+E8j9zurJFwH/G96UgQFVcoOFwJxG8YKqYS17RBs=; b=PaLlgqZ3/2DjnGXUbrFE9A1LMIC46aWQzHRbWLOQ3jd0njE+ZDH6ftGRxzBIrHclRw lHFM5h7NMZvPFAIIC5hrOQ5/d2aevD+GjmYWvsKAwhQfi3sQOVNyYSRd8qPQoITQBS3D 18+7hYPrnFdIF44xKAs2X+hhSN9QcryKpqAqNpPjCrO+bHAJxBb51DIrBHYQBknrexBl PV/ZWP5TbUGN/5hyNQ8CczdMeRgBsZonlWTw/Rh8aOXCY7Df1LHNQU0w3pBzdEm5YRah JVx1ummgM00XicZOHb34naZcrOUi9ENC+p4Ua7zrKBhZyZJHsGZ/ShkYu5IL32vsypXq 2Y1A== X-Gm-Message-State: AFqh2koEtW6KGhrGVIuVjJPRQFrKGd5CK9ruaUz5a/G9JXeK+G8wj5DS ZrkulIo3+DfovvQg7JvNwUxw5p2hoWmjLQ== X-Google-Smtp-Source: AMrXdXtQqi5EDeevCcM437yCnSMXXTLBU8xNG4byY6KupESh9HGrkSyhgLZposFGZkN7BI6YIPImDQ== X-Received: by 2002:a05:6102:34f7:b0:3b0:7212:f98e with SMTP id bi23-20020a05610234f700b003b07212f98emr3191681vsb.27.1671470659200; Mon, 19 Dec 2022 09:24:19 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id l6-20020a05620a28c600b00702311aea78sm5083298qkp.82.2022.12.19.09.24.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 09:24:18 -0800 (PST) From: Maxim Cournoyer To: 60145@debbugs.gnu.org Subject: [PATCH v4 2/2] gnu: Add patman. Date: Mon, 19 Dec 2022 12:23:32 -0500 Message-Id: <20221219172332.31222-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219172332.31222-1-maxim.cournoyer@gmail.com> References: <20221219172332.31222-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60145 Cc: vagrant@debian.org, Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/bootloaders.scm (patman): New variable. * gnu/packages/patches/u-boot-patman-fix-help.patch: New patch. * gnu/packages/patches/u-boot-patman-local-conf.patch: Likewise. * gnu/local.mk (dist_patch_DATA): Register them. --- Changes in v4: - Use the series URL for the patches upstream submission status - Add new u-boot-patman-local-conf.patch gnu/local.mk | 2 + gnu/packages/bootloaders.scm | 35 +++- .../patches/u-boot-patman-fix-help.patch | 40 ++++ .../patches/u-boot-patman-local-conf.patch | 176 ++++++++++++++++++ 4 files changed, 252 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/u-boot-patman-fix-help.patch create mode 100644 gnu/packages/patches/u-boot-patman-local-conf.patch diff --git a/gnu/local.mk b/gnu/local.mk index 01fcc9d7d3..48de38e770 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1925,6 +1925,8 @@ 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-patman-local-conf.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 32970f86f1..db7505df4f 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,9 @@ (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") + (search-patch "u-boot-patman-local-conf.patch"))) (method url-fetch) (uri (string-append "https://ftp.denx.de/pub/u-boot/" @@ -816,6 +821,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..89bac06c2f --- /dev/null +++ b/gnu/packages/patches/u-boot-patman-fix-help.patch @@ -0,0 +1,40 @@ +Upstream status: https://patchwork.ozlabs.org/project/uboot/list/?series=333156 + +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']) diff --git a/gnu/packages/patches/u-boot-patman-local-conf.patch b/gnu/packages/patches/u-boot-patman-local-conf.patch new file mode 100644 index 0000000000..3400982356 --- /dev/null +++ b/gnu/packages/patches/u-boot-patman-local-conf.patch @@ -0,0 +1,176 @@ +Upstream status: https://patchwork.ozlabs.org/project/uboot/list/?series=333354 + +diff --git a/tools/patman/main.py b/tools/patman/main.py +index bf300c6e64..3616b28f27 100755 +--- a/tools/patman/main.py ++++ b/tools/patman/main.py +@@ -116,7 +116,7 @@ status.add_argument('-f', '--force', action='store_true', + argv = sys.argv[1:] + args, rest = parser.parse_known_args(argv) + if hasattr(args, 'project'): +- settings.Setup(gitutil, parser, args.project, '') ++ settings.Setup(parser, args.project) + args, rest = parser.parse_known_args(argv) + + # If we have a command, it is safe to parse all arguments +diff --git a/tools/patman/patman.rst b/tools/patman/patman.rst +index 8c5c9cc2cc..7828899879 100644 +--- a/tools/patman/patman.rst ++++ b/tools/patman/patman.rst +@@ -74,7 +74,7 @@ out where to send patches pretty well. + During the first run patman creates a config file for you by taking the default + user name and email address from the global .gitconfig file. + +-To add your own, create a file ~/.patman like this:: ++To add your own, create a file `~/.patman` like this:: + + # patman alias file + +@@ -85,6 +85,12 @@ To add your own, create a file ~/.patman like this:: + wolfgang: Wolfgang Denk + others: Mike Frysinger , Fred Bloggs + ++Patman will also look for a `.patman` configuration file at the root ++of the current project git repository, which makes it possible to ++override the `project` settings variable or anything else in a ++project-specific way. The values of this "local" configuration file ++take precedence over those of the "global" one. ++ + Aliases are recursive. + + The checkpatch.pl in the U-Boot tools/ subdirectory will be located and +diff --git a/tools/patman/settings.py b/tools/patman/settings.py +index 903d6fcb0b..e8e2908f1f 100644 +--- a/tools/patman/settings.py ++++ b/tools/patman/settings.py +@@ -1,5 +1,6 @@ + # SPDX-License-Identifier: GPL-2.0+ + # Copyright (c) 2011 The Chromium OS Authors. ++# Copyright (c) 2022 Maxim Cournoyer + # + + try: +@@ -11,8 +12,7 @@ import argparse + import os + import re + +-from patman import command +-from patman import tools ++from patman import gitutil + + """Default settings per-project. + +@@ -190,7 +190,8 @@ def ReadGitAliases(fname): + + fd.close() + +-def CreatePatmanConfigFile(gitutil, config_fname): ++ ++def CreatePatmanConfigFile(config_fname): + """Creates a config file under $(HOME)/.patman if it can't find one. + + Args: +@@ -328,26 +329,46 @@ def GetItems(config, section): + except: + raise + +-def Setup(gitutil, parser, project_name, config_fname=''): ++def Setup(parser, project_name, config_fname=None): + """Set up the settings module by reading config files. + ++ Unless `config_fname` is specified, a `.patman` config file local ++ to the git repository is consulted, followed by the global ++ `$HOME/.patman`. If none exists, the later is created. Values ++ defined in the local config file take precedence over those ++ defined in the global one. ++ + Args: +- parser: The parser to update ++ parser: The parser to update. + project_name: Name of project that we're working on; we'll look + for sections named "project_section" as well. +- config_fname: Config filename to read ('' for default) ++ config_fname: Config filename to read. An error is raised if it ++ does not exist. + """ + # First read the git alias file if available + _ReadAliasFile('doc/git-mailrc') + config = _ProjectConfigParser(project_name) +- if config_fname == '': ++ ++ if config_fname and not os.path.exists(config_fname): ++ raise Exception(f'provided {config_fname} does not exist') ++ ++ if not config_fname: + config_fname = '%s/.patman' % os.getenv('HOME') ++ has_config = os.path.exists(config_fname) ++ ++ git_local_config_fname = os.path.join(gitutil.get_top_level(), '.patman') ++ has_git_local_config = os.path.exists(git_local_config_fname) + +- if not os.path.exists(config_fname): +- print("No config file found ~/.patman\nCreating one...\n") +- CreatePatmanConfigFile(gitutil, config_fname) ++ # Read the git local config last, so that its values override ++ # those of the global config, if any. ++ if has_config: ++ config.read(config_fname) ++ if has_git_local_config: ++ config.read(git_local_config_fname) + +- config.read(config_fname) ++ if not (has_config or has_git_local_config): ++ print("No config file found.\nCreating ~/.patman...\n") ++ CreatePatmanConfigFile(config_fname) + + for name, value in GetItems(config, 'alias'): + alias[name] = value.split(',') +diff --git a/tools/patman/test_settings.py b/tools/patman/test_settings.py +new file mode 100644 +index 0000000000..9c14b4aaa3 +--- /dev/null ++++ b/tools/patman/test_settings.py +@@ -0,0 +1,43 @@ ++# SPDX-License-Identifier: GPL-2.0+ ++# ++# Copyright (c) 2022 Maxim Cournoyer ++# ++ ++import argparse ++import contextlib ++import os ++import subprocess ++import tempfile ++ ++from patman import settings ++ ++ ++@contextlib.contextmanager ++def empty_git_repository(): ++ with tempfile.TemporaryDirectory() as tmpdir: ++ os.chdir(tmpdir) ++ subprocess.check_call(['git', 'init']) ++ yield tmpdir ++ ++ ++def test_git_local_config(): ++ with empty_git_repository(): ++ with tempfile.NamedTemporaryFile() as global_config: ++ global_config.write(b'[settings]\n' ++ b'project=u-boot\n') ++ global_config.flush() ++ parser = argparse.ArgumentParser() ++ parser.add_argument('-p', '--project', default='unknown') ++ ++ # Test "global" config is used. ++ settings.Setup(parser, 'unknown', global_config.name) ++ args, _ = parser.parse_known_args() ++ assert args.project == 'u-boot' ++ ++ # Test local config can shadow it. ++ with open('.patman', 'w', buffering=1) as f: ++ f.write('[settings]\n' ++ 'project=guix-patches\n') ++ settings.Setup(parser, 'unknown', global_config.name) ++ args, _ = parser.parse_known_args([]) ++ assert args.project == 'guix-patches' -- 2.38.1 From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 19 17:42:42 2022 Received: (at 60145) by debbugs.gnu.org; 19 Dec 2022 22:42:42 +0000 Received: from localhost ([127.0.0.1]:40795 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7OqI-0008Qc-3o for submit@debbugs.gnu.org; Mon, 19 Dec 2022 17:42:42 -0500 Received: from mail-qv1-f51.google.com ([209.85.219.51]:46651) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7OqF-0008QV-DK for 60145@debbugs.gnu.org; Mon, 19 Dec 2022 17:42:41 -0500 Received: by mail-qv1-f51.google.com with SMTP id mn15so7186212qvb.13 for <60145@debbugs.gnu.org>; Mon, 19 Dec 2022 14:42:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=uscX7WMLExdGQ5gp3nKv9DL7fL7jd3wQNvvJDm15Z1E=; b=QfORZjwEInlnqs5j++Xwg5cLiv7zkF2y22YqJ8fGpRzwAySLfNYcIBp4Q9b5pE/EUc NaY/kVBQkwAnLL7u9KXZsWq7LipgLMsFj2A1C5smzBcmkPczq5Y5GCzLH7GmESPT0/dM a46naa5KMRh316ugtf9Z/SrpTKFctZ39S0lm1K4+Q3Cjr8CkaJ7bictb5T8cTpFVy9mq CjjMdoDe2K0i/vZTX3SZdTVZqFHSD97f1jleWjigPFU0KRScqfnstSpTdHH5yNfncJ/u TAQPJ/JLC0SVOnJK+pAh6t2gUS2gjdm3OqezwpsCT5tjUtRlpX+DVLsohSc0QbOU74Hz 5o1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uscX7WMLExdGQ5gp3nKv9DL7fL7jd3wQNvvJDm15Z1E=; b=0zGKw1D6NnHpkevrN5ef1HNd3nXGtzjXNRTP/N0O0Wh4Aeq1D8OBBmRIixZ8jKFYGs DKWRTMC0dKOmzISnwBa+gJ8dO7ES4uJ5zSW2OvbNRNK+TXhnYygVGN1V64fnuMnrgqo/ 3h8J/IfyOOjSX4ykn91S0wFslCWKuhpekUZ0cUvIwNWgNc4gNBr4IzbrHZB6UMrT+r1x 9Hw04dEJiWhVpgTE0I4iHaMNrD9XYiGLUE0cwqPHutvaXcQt1SQeR5kZ2sX1cXzUiXDx W0Wef+3w0XEJtN2Z2njklNkxg999FmawhFVNXQmxjdVBDV1gzTDQC2tcPrM4Z703RRaZ YPTw== X-Gm-Message-State: ANoB5pkGtyFApIzbRL+8VmH7VBa5RiRdjWmEMomHMvYW8WMFkf2bUJMM eNpd3CgLXQBZVZaK+XOk97KYTCasNbbO/tC9 X-Google-Smtp-Source: AA0mqf4CRUew5eUkdILK3+fwIFaQnxQmygLfpgsy/w8p243+F7VZzsDzmxD/FuqgL1dFvzfCzBQWLw== X-Received: by 2002:a0c:fc0f:0:b0:4c7:1d69:5533 with SMTP id z15-20020a0cfc0f000000b004c71d695533mr49630975qvo.34.1671489753490; Mon, 19 Dec 2022 14:42:33 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id f19-20020a05620a15b300b006ce9e880c6fsm7616995qkk.111.2022.12.19.14.42.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 14:42:33 -0800 (PST) From: Maxim Cournoyer To: 60145@debbugs.gnu.org Subject: [PATCH v5 1/2] gnu: Add u-boot-documentation. Date: Mon, 19 Dec 2022 17:42:26 -0500 Message-Id: <20221219224227.17684-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60145 Cc: vagrant@debian.org, Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/patches/u-boot-infodocs-target.patch: New patch. * gnu/local.mk: (dist_patch_DATA): Register it. * gnu/packages/bootloaders.scm (u-boot): Apply it. (u-boot-documentation): New variable. --- Changes in v5: - Update URL in patch Changes in v3: - Update U-Boot documentation patch - Remove now extraneous convenience symlink Changes in v2: - Update U-Boot documentation patch gnu/local.mk | 1 + gnu/packages/bootloaders.scm | 41 ++++++++- .../patches/u-boot-infodocs-target.patch | 84 +++++++++++++++++++ 3 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/u-boot-infodocs-target.patch diff --git a/gnu/local.mk b/gnu/local.mk index 56634e090c..01fcc9d7d3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1924,6 +1924,7 @@ dist_patch_DATA = \ %D%/packages/patches/tuxpaint-stamps-path.patch \ %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-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 3c96453e5c..32970f86f1 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -17,6 +17,7 @@ ;;; Copyright © 2021 Brice Waegeneire ;;; Copyright © 2022 Denis 'GNUtoo' Carikli ;;; Copyright © 2021 Stefan +;;; Copyright © 2022 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -62,6 +63,7 @@ (define-module (gnu packages bootloaders) #:use-module (gnu packages texinfo) #:use-module (gnu packages tls) #:use-module (gnu packages sdl) + #:use-module (gnu packages sphinx) #:use-module (gnu packages serialization) #:use-module (gnu packages swig) #:use-module (gnu packages valgrind) @@ -637,7 +639,8 @@ (define u-boot (list %u-boot-rockchip-inno-usb-patch %u-boot-allow-disabling-openssl-patch %u-boot-sifive-prevent-relocating-initrd-fdt - %u-boot-rk3399-enable-emmc-phy-patch)) + %u-boot-rk3399-enable-emmc-phy-patch + (search-patch "u-boot-infodocs-target.patch"))) (method url-fetch) (uri (string-append "https://ftp.denx.de/pub/u-boot/" @@ -667,6 +670,42 @@ (define u-boot also initializes the boards (RAM etc).") (license license:gpl2+))) +;;; This is very similar to the linux-libre-documentation package, since it +;;; reuses the same Makefile-based build system. +(define-public u-boot-documentation + (package + (inherit u-boot) + (name "u-boot-documentation") + (arguments + (list + #:make-flags #~(list "HOSTCC=gcc" + ;; Avoid treating Sphinx warnings as errors. + "SPHINXOPTS=") + #:tests? #f + #:phases #~(modify-phases %standard-phases + (delete 'configure) + (replace 'build + (lambda* (#:key make-flags #:allow-other-keys) + (apply invoke "make" "infodocs" make-flags))) + (replace 'install + (lambda* (#:key make-flags #:allow-other-keys) + (let* ((info-dir (string-append #$output "/share/info")) + (info (string-append info-dir + "/DasUBoot.info.gz"))) + (with-directory-excursion "doc/output" + (apply invoke "make" "-C" "texinfo" "install-info" + (string-append "infodir=" info-dir) + make-flags)))))))) + (native-inputs + (modify-inputs (package-native-inputs u-boot) + (append fontconfig + python-sphinx + texinfo + which))) + (synopsis "U-Boot documentation") + (description "This package provides the documentation for U-Boot, as an +Info manual."))) + (define-public u-boot-tools (package (inherit u-boot) diff --git a/gnu/packages/patches/u-boot-infodocs-target.patch b/gnu/packages/patches/u-boot-infodocs-target.patch new file mode 100644 index 0000000000..5b21a99de3 --- /dev/null +++ b/gnu/packages/patches/u-boot-infodocs-target.patch @@ -0,0 +1,84 @@ +Upstream status: https://patchwork.ozlabs.org/project/uboot/list/?series=333259 + +diff --git a/Makefile b/Makefile +index de5746399a..597a8886c3 100644 +--- a/Makefile ++++ b/Makefile +@@ -2372,7 +2372,7 @@ tcheck: + # Documentation targets + # --------------------------------------------------------------------------- + DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs \ +- linkcheckdocs dochelp refcheckdocs ++ linkcheckdocs dochelp refcheckdocs texinfodocs infodocs + PHONY += $(DOC_TARGETS) + $(DOC_TARGETS): scripts_basic FORCE + $(Q)$(MAKE) $(build)=doc $@ +diff --git a/doc/Makefile b/doc/Makefile +index f5de65e927..d0904a9f99 100644 +--- a/doc/Makefile ++++ b/doc/Makefile +@@ -69,6 +69,14 @@ quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4) + htmldocs: + @+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var))) + ++texinfodocs: ++ @+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,texinfo,$(var),texinfo,$(var))) ++ ++# Note: the 'info' Make target is generated by sphinx itself when ++# running the texinfodocs target defined above. ++infodocs: texinfodocs ++ $(MAKE) -C $(BUILDDIR)/texinfo info ++ + linkcheckdocs: + @$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,linkcheck,$(var),,$(var))) + +@@ -109,6 +117,8 @@ cleandocs: + dochelp: + @echo ' U-Boot documentation in different formats from ReST:' + @echo ' htmldocs - HTML' ++ @echo ' texinfodocs - Texinfo' ++ @echo ' infodocs - Info' + @echo ' latexdocs - LaTeX' + @echo ' pdfdocs - PDF' + @echo ' epubdocs - EPUB' +diff --git a/doc/conf.py b/doc/conf.py +index 62c8d31270..3db70f80c1 100644 +--- a/doc/conf.py ++++ b/doc/conf.py +@@ -449,7 +449,7 @@ for fn in os.listdir('.'): + # One entry per manual page. List of tuples + # (source start file, name, description, authors, manual section). + man_pages = [ +- (master_doc, 'dasuboot', 'The U-Boot Documentation', ++ (master_doc, 'u-boot', 'The U-Boot Documentation', + [author], 1) + ] + +@@ -463,8 +463,8 @@ man_pages = [ + # (source start file, target name, title, author, + # dir menu entry, description, category) + texinfo_documents = [ +- (master_doc, 'DasUBoot', 'The U-Boot Documentation', +- author, 'DasUBoot', 'One line description of project.', ++ (master_doc, 'u-boot', 'The U-Boot Documentation', ++ author, 'U-Boot', 'Boot loader for embedded systems', + 'Miscellaneous'), + ] + +diff --git a/doc/media/Makefile b/doc/media/Makefile +index b9b43a34c3..9b32258696 100644 +--- a/doc/media/Makefile ++++ b/doc/media/Makefile +@@ -22,10 +22,11 @@ $(BUILDDIR)/linker_lists.h.rst: ${API}/linker_lists.h ${PARSER} $(SRC_DIR)/linke + + # Media build rules + +-.PHONY: all html epub xml latex ++.PHONY: all html texinfo epub xml latex + + all: $(IMGDOT) $(BUILDDIR) ${TARGETS} + html: all ++texinfo: all + epub: all + xml: all + latex: $(IMGPDF) all base-commit: f28ca2447c5e2eef1ba6a3a11587380a665b0e26 -- 2.38.1 From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 19 17:42:47 2022 Received: (at 60145) by debbugs.gnu.org; 19 Dec 2022 22:42:47 +0000 Received: from localhost ([127.0.0.1]:40797 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7OqL-0008Qo-PZ for submit@debbugs.gnu.org; Mon, 19 Dec 2022 17:42:47 -0500 Received: from mail-qv1-f41.google.com ([209.85.219.41]:36822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7OqH-0008QW-9q for 60145@debbugs.gnu.org; Mon, 19 Dec 2022 17:42:42 -0500 Received: by mail-qv1-f41.google.com with SMTP id o12so7216486qvn.3 for <60145@debbugs.gnu.org>; Mon, 19 Dec 2022 14:42:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=y+TCMq2myzU+ll/fkvbE+/EJpOlX5dkgGylUI/mVlWQ=; b=IqT3cKZia3aqQIWdiREpjogZtKbvXnlGdOZMYqId1JoviUdTtS1A50I4+aHgd5pf3o PpS6r8JZlGuekDW6vuj2w/e5H9sIJTq2j4t4S0HZs2E/fCWnAwUCDwmWA1vp7VkjyD31 Q5Krt9wnycpg7cca5MiFDzhrbNSnzaD0PQgYAEwv+XpeOd6PTi7iSB8Hxu1YULrTJtpF WBVkZKdL9g/x8gcvrCrrdAudqd835bggnRCOMJRy3ywpXz+UuZl3VG52jJIclQTFd/WO 75yJJbQssWh5xog94pybKe6t97eYHZG2uZ/Il4Yct9bOBuj+/Qs4l41HYDB8HIZb6fc6 SoXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y+TCMq2myzU+ll/fkvbE+/EJpOlX5dkgGylUI/mVlWQ=; b=4iMm62SSmeKbGZA0CkkkHlVtPFdcGRr1IMv0hZCVBF4LvJtifLm7NoVZz+Rb6rSHhP GXxBM65zwNyERq+KwZ4NOWwx+vMy778M4sST8YRcnnXCU93u9cqqN72fWi7f6IER/lcP Vt/IdgEPyCu6cd4ZUZY1dSvBJUijjX/7ty9C6X5h5yfQFxUM/yXj7P7wlIlP8spNLAXK EM6bxT2+jIY9dwlvQ3z1Wqvk5/a93MtFzMURkm1Xy+D4ICh4sQmQojURWvkRCoov8s+r P1I6bhKGmUUZZeH9lruKwwpcSJmTzEneLFWMyttK2/LOy7aN3sNSVEOmfH8+H7vwCe29 eCeA== X-Gm-Message-State: ANoB5pm35sp5zjFd938IBeFh0FGc/7rQ2WvRJHeGJhkxXfRdPZ1ySHZs o7sS44ZZRpYaHYVh9mP7mqG/JxYRxwjZmWnh X-Google-Smtp-Source: AA0mqf4kKS5iRNIawapK6CMX661kRq9yhP7wKrGAJT8sLGuRVzrafbKnok49wed/9ajVshbqhDcYVg== X-Received: by 2002:ad4:45a2:0:b0:4c7:797e:7788 with SMTP id y2-20020ad445a2000000b004c7797e7788mr59826163qvu.20.1671489755234; Mon, 19 Dec 2022 14:42:35 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-202.b2b2c.ca. [72.10.133.202]) by smtp.gmail.com with ESMTPSA id f19-20020a05620a15b300b006ce9e880c6fsm7616995qkk.111.2022.12.19.14.42.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 14:42:34 -0800 (PST) From: Maxim Cournoyer To: 60145@debbugs.gnu.org Subject: [PATCH v5 2/2] gnu: Add patman. Date: Mon, 19 Dec 2022 17:42:27 -0500 Message-Id: <20221219224227.17684-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219224227.17684-1-maxim.cournoyer@gmail.com> References: <20221219224227.17684-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60145 Cc: vagrant@debian.org, Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/bootloaders.scm (patman): New variable. * gnu/packages/patches/u-boot-patman-fix-help.patch: New patch. * gnu/packages/patches/u-boot-patman-get-maintainer.patch: Likewise. * gnu/packages/patches/u-boot-patman-local-conf.patch: Likewise. * gnu/local.mk (dist_patch_DATA): Register them. --- Changes in v5: - Add new u-boot-patman-get-maintainer.patch. Changes in v4: - Use the series URL for the patches upstream submission status - Add new u-boot-patman-local-conf.patch gnu/local.mk | 3 + gnu/packages/bootloaders.scm | 36 ++- .../patches/u-boot-patman-fix-help.patch | 40 +++ .../u-boot-patman-get-maintainer.patch | 285 ++++++++++++++++++ .../patches/u-boot-patman-local-conf.patch | 176 +++++++++++ 5 files changed, 539 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/u-boot-patman-fix-help.patch create mode 100644 gnu/packages/patches/u-boot-patman-get-maintainer.patch create mode 100644 gnu/packages/patches/u-boot-patman-local-conf.patch diff --git a/gnu/local.mk b/gnu/local.mk index 01fcc9d7d3..a704cf6002 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1925,6 +1925,9 @@ 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-patman-get-maintainer.patch \ + %D%/packages/patches/u-boot-patman-local-conf.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 32970f86f1..4cfb16860e 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,10 @@ (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") + (search-patch "u-boot-patman-local-conf.patch") + (search-patch "u-boot-patman-get-maintainer.patch"))) (method url-fetch) (uri (string-append "https://ftp.denx.de/pub/u-boot/" @@ -816,6 +822,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..89bac06c2f --- /dev/null +++ b/gnu/packages/patches/u-boot-patman-fix-help.patch @@ -0,0 +1,40 @@ +Upstream status: https://patchwork.ozlabs.org/project/uboot/list/?series=333156 + +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']) diff --git a/gnu/packages/patches/u-boot-patman-get-maintainer.patch b/gnu/packages/patches/u-boot-patman-get-maintainer.patch new file mode 100644 index 0000000000..1ff03efea3 --- /dev/null +++ b/gnu/packages/patches/u-boot-patman-get-maintainer.patch @@ -0,0 +1,285 @@ +Upstream status: https://patchwork.ozlabs.org/project/uboot/list/?series=333427 + +diff --git a/tools/patman/control.py b/tools/patman/control.py +index bf426cf7bc..38e98dab84 100644 +--- a/tools/patman/control.py ++++ b/tools/patman/control.py +@@ -94,8 +94,8 @@ def check_patches(series, patch_files, run_checkpatch, verbose, use_tree): + + + def email_patches(col, series, cover_fname, patch_files, process_tags, its_a_go, +- ignore_bad_tags, add_maintainers, limit, dry_run, in_reply_to, +- thread, smtp_server): ++ ignore_bad_tags, add_maintainers, get_maintainer_script, limit, ++ dry_run, in_reply_to, thread, smtp_server): + """Email patches to the recipients + + This emails out the patches and cover letter using 'git send-email'. Each +@@ -123,6 +123,8 @@ def email_patches(col, series, cover_fname, patch_files, process_tags, its_a_go, + ignore_bad_tags (bool): True to just print a warning for unknown tags, + False to halt with an error + add_maintainers (bool): Run the get_maintainer.pl script for each patch ++ get_maintainer_script (str): The script used to retrieve which ++ maintainers to cc + limit (int): Limit on the number of people that can be cc'd on a single + patch or the cover letter (None if no limit) + dry_run (bool): Don't actually email the patches, just print out what +@@ -134,7 +136,7 @@ def email_patches(col, series, cover_fname, patch_files, process_tags, its_a_go, + smtp_server (str): SMTP server to use to send patches (None for default) + """ + cc_file = series.MakeCcFile(process_tags, cover_fname, not ignore_bad_tags, +- add_maintainers, limit) ++ add_maintainers, limit, get_maintainer_script) + + # Email the patches out (giving the user time to check / cancel) + cmd = '' +@@ -174,8 +176,8 @@ def send(args): + email_patches( + col, series, cover_fname, patch_files, args.process_tags, + its_a_go, args.ignore_bad_tags, args.add_maintainers, +- args.limit, args.dry_run, args.in_reply_to, args.thread, +- args.smtp_server) ++ args.get_maintainer_script, args.limit, args.dry_run, ++ args.in_reply_to, args.thread, args.smtp_server) + + def patchwork_status(branch, count, start, end, dest_branch, force, + show_comments, url): +diff --git a/tools/patman/func_test.py b/tools/patman/func_test.py +index 7b92bc67be..6fa6e6a75e 100644 +--- a/tools/patman/func_test.py ++++ b/tools/patman/func_test.py +@@ -200,6 +200,8 @@ class TestFunctional(unittest.TestCase): + text = self._get_text('test01.txt') + series = patchstream.get_metadata_for_test(text) + cover_fname, args = self._create_patches_for_test(series) ++ get_maintainer_script = (pathlib.Path(__file__).parent.parent.parent ++ / 'get_maintainer.pl') + ' --norolestats' + with capture_sys_output() as out: + patchstream.fix_patches(series, args) + if cover_fname and series.get('cover'): +@@ -207,7 +209,7 @@ class TestFunctional(unittest.TestCase): + series.DoChecks() + cc_file = series.MakeCcFile(process_tags, cover_fname, + not ignore_bad_tags, add_maintainers, +- None) ++ None, get_maintainer_script) + cmd = gitutil.email_patches( + series, cover_fname, args, dry_run, not ignore_bad_tags, + cc_file, in_reply_to=in_reply_to, thread=None) +diff --git a/tools/patman/get_maintainer.py b/tools/patman/get_maintainer.py +index e1d15ff6ab..eb06423c19 100644 +--- a/tools/patman/get_maintainer.py ++++ b/tools/patman/get_maintainer.py +@@ -1,48 +1,61 @@ + # SPDX-License-Identifier: GPL-2.0+ + # Copyright (c) 2012 The Chromium OS Authors. ++# Copyright (c) 2022 Maxim Cournoyer + # + + import os ++import shlex ++import shutil + + from patman import command ++from patman import gitutil + +-def find_get_maintainer(try_list): +- """Look for the get_maintainer.pl script. + +- Args: +- try_list: List of directories to try for the get_maintainer.pl script ++def find_get_maintainer(script_file_name): ++ """Try to find where `script_file_name` is. + +- Returns: +- If the script is found we'll return a path to it; else None. ++ It searches in PATH and falls back to a path relative to the top ++ of the current git repository. + """ +- # Look in the list +- for path in try_list: +- fname = os.path.join(path, 'get_maintainer.pl') +- if os.path.isfile(fname): +- return fname ++ get_maintainer = shutil.which(script_file_name) ++ if get_maintainer: ++ return get_maintainer ++ ++ git_relative_script = os.path.join(gitutil.get_top_level(), ++ script_file_name) ++ if os.path.exist(git_relative_script): ++ return git_relative_script + +- return None + +-def get_maintainer(dir_list, fname, verbose=False): +- """Run get_maintainer.pl on a file if we find it. ++def get_maintainer(script_file_name, fname, verbose=False): ++ """Run `script_file_name` on a file. + +- We look for get_maintainer.pl in the 'scripts' directory at the top of +- git. If we find it we'll run it. If we don't find get_maintainer.pl +- then we fail silently. ++ `script_file_name` should be a get_maintainer.pl-like script that ++ takes a patch file name as an input and return the email addresses ++ of the associated maintainers to standard output, one per line. ++ ++ If `script_file_name` does not exist we fail silently. + + Args: +- dir_list: List of directories to try for the get_maintainer.pl script +- fname: Path to the patch file to run get_maintainer.pl on. ++ script_file_name: The file name of the get_maintainer.pl script ++ (or compatible). ++ fname: File name of the patch to process with get_maintainer.pl. + + Returns: + A list of email addresses to CC to. + """ +- get_maintainer = find_get_maintainer(dir_list) ++ # Expand `script_file_name` into a file name and its arguments, if ++ # any. ++ cmd_args = shlex.split(script_file_name) ++ file_name = cmd_args[0] ++ arguments = cmd_args[1:] ++ ++ get_maintainer = find_get_maintainer(file_name) + if not get_maintainer: + if verbose: + print("WARNING: Couldn't find get_maintainer.pl") + return [] + +- stdout = command.output(get_maintainer, '--norolestats', fname) ++ stdout = command.output(get_maintainer, *arguments, fname) + lines = stdout.splitlines() +- return [ x.replace('"', '') for x in lines ] ++ return [x.replace('"', '') for x in lines] +diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py +index ceaf2ce150..a72ba4f42d 100644 +--- a/tools/patman/gitutil.py ++++ b/tools/patman/gitutil.py +@@ -417,8 +417,8 @@ def check_suppress_cc_config(): + return True + + def email_patches(series, cover_fname, args, dry_run, warn_on_error, cc_fname, +- self_only=False, alias=None, in_reply_to=None, thread=False, +- smtp_server=None): ++ self_only=False, alias=None, in_reply_to=None, thread=False, ++ smtp_server=None, get_maintainer_script=None): + """Email a patch series. + + Args: +@@ -435,6 +435,7 @@ def email_patches(series, cover_fname, args, dry_run, warn_on_error, cc_fname, + thread: True to add --thread to git send-email (make + all patches reply to cover-letter or first patch in series) + smtp_server: SMTP server to use to send patches ++ get_maintainer_script: File name of script to get maintainers emails + + Returns: + Git command that was/would be run +diff --git a/tools/patman/main.py b/tools/patman/main.py +index fb5ad60b20..c39c0424f9 100755 +--- a/tools/patman/main.py ++++ b/tools/patman/main.py +@@ -64,6 +64,12 @@ send.add_argument('-l', '--limit-cc', dest='limit', type=int, default=None, + send.add_argument('-m', '--no-maintainers', action='store_false', + dest='add_maintainers', default=True, + help="Don't cc the file maintainers automatically") ++send.add_argument( ++ '--get-maintainer-script', dest='get_maintainer_script', type=str, ++ action='store', ++ default=os.path.join(gitutil.get_top_level(), 'scripts', ++ 'get_maintainer.pl') + ' --norolestats', ++ help='File name of the get_maintainer.pl (or compatible) script.') + send.add_argument('-n', '--dry-run', action='store_true', dest='dry_run', + default=False, help="Do a dry run (create but don't email patches)") + send.add_argument('-r', '--in-reply-to', type=str, action='store', +diff --git a/tools/patman/patman.rst b/tools/patman/patman.rst +index 7828899879..5a3554f961 100644 +--- a/tools/patman/patman.rst ++++ b/tools/patman/patman.rst +@@ -1,6 +1,7 @@ + .. SPDX-License-Identifier: GPL-2.0+ + .. Copyright (c) 2011 The Chromium OS Authors + .. Simon Glass ++.. Maxim Cournoyer + .. v1, v2, 19-Oct-11 + .. revised v3 24-Nov-11 + .. revised v4 Independence Day 2020, with Patchwork integration +@@ -68,8 +69,23 @@ this once:: + + git config sendemail.aliasesfile doc/git-mailrc + +-For both Linux and U-Boot the 'scripts/get_maintainer.pl' handles figuring +-out where to send patches pretty well. ++For both Linux and U-Boot the 'scripts/get_maintainer.pl' handles ++figuring out where to send patches pretty well. For other projects, ++you may want to specify a different script to be run, for example via ++a project-specific `.patman` file:: ++ ++ # .patman configuration file at the root of some project ++ ++ [settings] ++ get_maintainer_script: etc/teams.scm get-maintainer ++ ++The `get_maintainer_script` option corresponds to the ++`--get-maintainer-script` argument of the `send` command. It is ++looked relatively to the root of the current git repository, as well ++as on PATH. It can also be provided arguments, as shown above. The ++contract is that the script should accept a patch file name and return ++a list of email addresses, one per line, like `get_maintainer.pl` ++does. + + During the first run patman creates a config file for you by taking the default + user name and email address from the global .gitconfig file. +@@ -85,11 +101,11 @@ To add your own, create a file `~/.patman` like this:: + wolfgang: Wolfgang Denk + others: Mike Frysinger , Fred Bloggs + +-Patman will also look for a `.patman` configuration file at the root +-of the current project git repository, which makes it possible to +-override the `project` settings variable or anything else in a +-project-specific way. The values of this "local" configuration file +-take precedence over those of the "global" one. ++As hinted above, Patman will also look for a `.patman` configuration ++file at the root of the current project git repository, which makes it ++possible to override the `project` settings variable or anything else ++in a project-specific way. The values of this "local" configuration ++file take precedence over those of the "global" one. + + Aliases are recursive. + +diff --git a/tools/patman/series.py b/tools/patman/series.py +index 3075378ac1..2eeeef71dc 100644 +--- a/tools/patman/series.py ++++ b/tools/patman/series.py +@@ -235,7 +235,7 @@ class Series(dict): + print(col.build(col.RED, str)) + + def MakeCcFile(self, process_tags, cover_fname, warn_on_error, +- add_maintainers, limit): ++ add_maintainers, limit, get_maintainer_script): + """Make a cc file for us to use for per-commit Cc automation + + Also stores in self._generated_cc to make ShowActions() faster. +@@ -249,6 +249,8 @@ class Series(dict): + True/False to call the get_maintainers to CC maintainers + List of maintainers to include (for testing) + limit: Limit the length of the Cc list (None if no limit) ++ get_maintainer_script: The file name of the get_maintainer.pl ++ script (or compatible). + Return: + Filename of temp file created + """ +@@ -267,8 +269,9 @@ class Series(dict): + if type(add_maintainers) == type(cc): + cc += add_maintainers + elif add_maintainers: +- dir_list = [os.path.join(gitutil.get_top_level(), 'scripts')] +- cc += get_maintainer.get_maintainer(dir_list, commit.patch) ++ ++ cc += get_maintainer.get_maintainer(get_maintainer_script, ++ commit.patch) + for x in set(cc) & set(settings.bounces): + print(col.build(col.YELLOW, 'Skipping "%s"' % x)) + cc = list(set(cc) - set(settings.bounces)) diff --git a/gnu/packages/patches/u-boot-patman-local-conf.patch b/gnu/packages/patches/u-boot-patman-local-conf.patch new file mode 100644 index 0000000000..3400982356 --- /dev/null +++ b/gnu/packages/patches/u-boot-patman-local-conf.patch @@ -0,0 +1,176 @@ +Upstream status: https://patchwork.ozlabs.org/project/uboot/list/?series=333354 + +diff --git a/tools/patman/main.py b/tools/patman/main.py +index bf300c6e64..3616b28f27 100755 +--- a/tools/patman/main.py ++++ b/tools/patman/main.py +@@ -116,7 +116,7 @@ status.add_argument('-f', '--force', action='store_true', + argv = sys.argv[1:] + args, rest = parser.parse_known_args(argv) + if hasattr(args, 'project'): +- settings.Setup(gitutil, parser, args.project, '') ++ settings.Setup(parser, args.project) + args, rest = parser.parse_known_args(argv) + + # If we have a command, it is safe to parse all arguments +diff --git a/tools/patman/patman.rst b/tools/patman/patman.rst +index 8c5c9cc2cc..7828899879 100644 +--- a/tools/patman/patman.rst ++++ b/tools/patman/patman.rst +@@ -74,7 +74,7 @@ out where to send patches pretty well. + During the first run patman creates a config file for you by taking the default + user name and email address from the global .gitconfig file. + +-To add your own, create a file ~/.patman like this:: ++To add your own, create a file `~/.patman` like this:: + + # patman alias file + +@@ -85,6 +85,12 @@ To add your own, create a file ~/.patman like this:: + wolfgang: Wolfgang Denk + others: Mike Frysinger , Fred Bloggs + ++Patman will also look for a `.patman` configuration file at the root ++of the current project git repository, which makes it possible to ++override the `project` settings variable or anything else in a ++project-specific way. The values of this "local" configuration file ++take precedence over those of the "global" one. ++ + Aliases are recursive. + + The checkpatch.pl in the U-Boot tools/ subdirectory will be located and +diff --git a/tools/patman/settings.py b/tools/patman/settings.py +index 903d6fcb0b..e8e2908f1f 100644 +--- a/tools/patman/settings.py ++++ b/tools/patman/settings.py +@@ -1,5 +1,6 @@ + # SPDX-License-Identifier: GPL-2.0+ + # Copyright (c) 2011 The Chromium OS Authors. ++# Copyright (c) 2022 Maxim Cournoyer + # + + try: +@@ -11,8 +12,7 @@ import argparse + import os + import re + +-from patman import command +-from patman import tools ++from patman import gitutil + + """Default settings per-project. + +@@ -190,7 +190,8 @@ def ReadGitAliases(fname): + + fd.close() + +-def CreatePatmanConfigFile(gitutil, config_fname): ++ ++def CreatePatmanConfigFile(config_fname): + """Creates a config file under $(HOME)/.patman if it can't find one. + + Args: +@@ -328,26 +329,46 @@ def GetItems(config, section): + except: + raise + +-def Setup(gitutil, parser, project_name, config_fname=''): ++def Setup(parser, project_name, config_fname=None): + """Set up the settings module by reading config files. + ++ Unless `config_fname` is specified, a `.patman` config file local ++ to the git repository is consulted, followed by the global ++ `$HOME/.patman`. If none exists, the later is created. Values ++ defined in the local config file take precedence over those ++ defined in the global one. ++ + Args: +- parser: The parser to update ++ parser: The parser to update. + project_name: Name of project that we're working on; we'll look + for sections named "project_section" as well. +- config_fname: Config filename to read ('' for default) ++ config_fname: Config filename to read. An error is raised if it ++ does not exist. + """ + # First read the git alias file if available + _ReadAliasFile('doc/git-mailrc') + config = _ProjectConfigParser(project_name) +- if config_fname == '': ++ ++ if config_fname and not os.path.exists(config_fname): ++ raise Exception(f'provided {config_fname} does not exist') ++ ++ if not config_fname: + config_fname = '%s/.patman' % os.getenv('HOME') ++ has_config = os.path.exists(config_fname) ++ ++ git_local_config_fname = os.path.join(gitutil.get_top_level(), '.patman') ++ has_git_local_config = os.path.exists(git_local_config_fname) + +- if not os.path.exists(config_fname): +- print("No config file found ~/.patman\nCreating one...\n") +- CreatePatmanConfigFile(gitutil, config_fname) ++ # Read the git local config last, so that its values override ++ # those of the global config, if any. ++ if has_config: ++ config.read(config_fname) ++ if has_git_local_config: ++ config.read(git_local_config_fname) + +- config.read(config_fname) ++ if not (has_config or has_git_local_config): ++ print("No config file found.\nCreating ~/.patman...\n") ++ CreatePatmanConfigFile(config_fname) + + for name, value in GetItems(config, 'alias'): + alias[name] = value.split(',') +diff --git a/tools/patman/test_settings.py b/tools/patman/test_settings.py +new file mode 100644 +index 0000000000..9c14b4aaa3 +--- /dev/null ++++ b/tools/patman/test_settings.py +@@ -0,0 +1,43 @@ ++# SPDX-License-Identifier: GPL-2.0+ ++# ++# Copyright (c) 2022 Maxim Cournoyer ++# ++ ++import argparse ++import contextlib ++import os ++import subprocess ++import tempfile ++ ++from patman import settings ++ ++ ++@contextlib.contextmanager ++def empty_git_repository(): ++ with tempfile.TemporaryDirectory() as tmpdir: ++ os.chdir(tmpdir) ++ subprocess.check_call(['git', 'init']) ++ yield tmpdir ++ ++ ++def test_git_local_config(): ++ with empty_git_repository(): ++ with tempfile.NamedTemporaryFile() as global_config: ++ global_config.write(b'[settings]\n' ++ b'project=u-boot\n') ++ global_config.flush() ++ parser = argparse.ArgumentParser() ++ parser.add_argument('-p', '--project', default='unknown') ++ ++ # Test "global" config is used. ++ settings.Setup(parser, 'unknown', global_config.name) ++ args, _ = parser.parse_known_args() ++ assert args.project == 'u-boot' ++ ++ # Test local config can shadow it. ++ with open('.patman', 'w', buffering=1) as f: ++ f.write('[settings]\n' ++ 'project=guix-patches\n') ++ settings.Setup(parser, 'unknown', global_config.name) ++ args, _ = parser.parse_known_args([]) ++ assert args.project == 'guix-patches' -- 2.38.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 20 08:21:22 2022 Received: (at 60145) by debbugs.gnu.org; 20 Dec 2022 13:21:22 +0000 Received: from localhost ([127.0.0.1]:44848 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7cYb-0002C9-3L for submit@debbugs.gnu.org; Tue, 20 Dec 2022 08:21:21 -0500 Received: from mail-qt1-f179.google.com ([209.85.160.179]:38796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7cYY-0002C1-Gi for 60145@debbugs.gnu.org; Tue, 20 Dec 2022 08:21:19 -0500 Received: by mail-qt1-f179.google.com with SMTP id z12so10864371qtv.5 for <60145@debbugs.gnu.org>; Tue, 20 Dec 2022 05:21:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=XmGIC7nPHNp+TzX1//jy/0TopQ6sVtrS8TVEsbNfaJA=; b=V5/FsQNnLAefuBNqvcCGlGBIAEiOqlCfSNw4nM+dV3uyD2vSTH5mKI6WvhBO/7oqeB 2xliP7+mMdrUtPD9sVrrGDR+zhAPl5yX8Vpm9SfP4ahu+85mNxkArnA1QiSG8HUlv9oT hSI3ihDPbvMOToD24SnVlUdayAk7KRPBmCV3tXkdWnAZhgiVMXG1yvHlWNvVKEdaVmzC l8tI87aoS7CeXvSGLNgqauDSkfGcTYOUeNGtsYlhstM2xWuZWh3bQP1t0j0H6CaDm/x7 FYBxkih02XxPAIYsI+RQzIfTaAEGhGeaNSXJXLVef0G+stbi1sj6VS5cyMC9i1IlhiX2 xfSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XmGIC7nPHNp+TzX1//jy/0TopQ6sVtrS8TVEsbNfaJA=; b=uhEyDVHhfp/sj548x7l11v0fjnP7HolEIHcAtF6inps4sNmsycER3jYM96NF/dnEEL YOnNzH0GRQ/grFtgd8v0UHrqrJKvQqw5ueUd7wYvZHBDLkW4SCVe7YX6RlD+Eh2+TJCI CMhYS9m5XQGBr18z3DT4G9WxOCAAG/EZKXuviTHEt52siR1FIjDxYHqMidc/4p6GmwP6 fvaIjIWESsP8AM6F+En+vH8JUn6/NwVF4BVVtOAbm96OzEx6lmLNEIxYLPCj98GcvJbg dbitC78DBnPo5tvl0W0tWrWJH+9iAiNKt48Fu7QyAvtQ2DJ45jdbLel8vn37+0R3ToOf n9oA== X-Gm-Message-State: ANoB5pm7n0rDHNPQkxDze5KBiL1arJiWmDnwrHYyH24k4I63JPr5LR4i wyEgOH2Flkh6qUIOyLGvnPGPkfvIjHIzfg== X-Google-Smtp-Source: AA0mqf7zayui3JdE5qYbZUIi8r9AsdMiMmvpS7jJw+VyzYdXNY3+ZslVJM+4kh04yLy+byyEaq8VRA== X-Received: by 2002:ac8:4e19:0:b0:3a7:efe3:47c8 with SMTP id c25-20020ac84e19000000b003a7efe347c8mr53688473qtw.6.1671542472464; Tue, 20 Dec 2022 05:21:12 -0800 (PST) Received: from localhost.localdomain ([2607:fad8:4:3::1002]) by smtp.gmail.com with ESMTPSA id o11-20020ac872cb000000b003a4f435e381sm7550703qtp.18.2022.12.20.05.21.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 05:21:11 -0800 (PST) From: Maxim Cournoyer To: 60145@debbugs.gnu.org Subject: [PATCH v6 1/2] gnu: Add u-boot-documentation. Date: Tue, 20 Dec 2022 08:21:06 -0500 Message-Id: <20221220132107.25988-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 60145 Cc: vagrant@debian.org, Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/patches/u-boot-infodocs-target.patch: New patch. * gnu/local.mk: (dist_patch_DATA): Register it. * gnu/packages/bootloaders.scm (u-boot): Apply it. (u-boot-documentation): New variable. --- (no changes since v5) Changes in v5: - Update URL in patch Changes in v3: - Update U-Boot documentation patch - Remove now extraneous convenience symlink Changes in v2: - Update U-Boot documentation patch gnu/local.mk | 1 + gnu/packages/bootloaders.scm | 41 ++++++++- .../patches/u-boot-infodocs-target.patch | 84 +++++++++++++++++++ 3 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/u-boot-infodocs-target.patch diff --git a/gnu/local.mk b/gnu/local.mk index 56634e090c..01fcc9d7d3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1924,6 +1924,7 @@ dist_patch_DATA = \ %D%/packages/patches/tuxpaint-stamps-path.patch \ %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-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 3c96453e5c..32970f86f1 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -17,6 +17,7 @@ ;;; Copyright © 2021 Brice Waegeneire ;;; Copyright © 2022 Denis 'GNUtoo' Carikli ;;; Copyright © 2021 Stefan +;;; Copyright © 2022 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -62,6 +63,7 @@ (define-module (gnu packages bootloaders) #:use-module (gnu packages texinfo) #:use-module (gnu packages tls) #:use-module (gnu packages sdl) + #:use-module (gnu packages sphinx) #:use-module (gnu packages serialization) #:use-module (gnu packages swig) #:use-module (gnu packages valgrind) @@ -637,7 +639,8 @@ (define u-boot (list %u-boot-rockchip-inno-usb-patch %u-boot-allow-disabling-openssl-patch %u-boot-sifive-prevent-relocating-initrd-fdt - %u-boot-rk3399-enable-emmc-phy-patch)) + %u-boot-rk3399-enable-emmc-phy-patch + (search-patch "u-boot-infodocs-target.patch"))) (method url-fetch) (uri (string-append "https://ftp.denx.de/pub/u-boot/" @@ -667,6 +670,42 @@ (define u-boot also initializes the boards (RAM etc).") (license license:gpl2+))) +;;; This is very similar to the linux-libre-documentation package, since it +;;; reuses the same Makefile-based build system. +(define-public u-boot-documentation + (package + (inherit u-boot) + (name "u-boot-documentation") + (arguments + (list + #:make-flags #~(list "HOSTCC=gcc" + ;; Avoid treating Sphinx warnings as errors. + "SPHINXOPTS=") + #:tests? #f + #:phases #~(modify-phases %standard-phases + (delete 'configure) + (replace 'build + (lambda* (#:key make-flags #:allow-other-keys) + (apply invoke "make" "infodocs" make-flags))) + (replace 'install + (lambda* (#:key make-flags #:allow-other-keys) + (let* ((info-dir (string-append #$output "/share/info")) + (info (string-append info-dir + "/DasUBoot.info.gz"))) + (with-directory-excursion "doc/output" + (apply invoke "make" "-C" "texinfo" "install-info" + (string-append "infodir=" info-dir) + make-flags)))))))) + (native-inputs + (modify-inputs (package-native-inputs u-boot) + (append fontconfig + python-sphinx + texinfo + which))) + (synopsis "U-Boot documentation") + (description "This package provides the documentation for U-Boot, as an +Info manual."))) + (define-public u-boot-tools (package (inherit u-boot) diff --git a/gnu/packages/patches/u-boot-infodocs-target.patch b/gnu/packages/patches/u-boot-infodocs-target.patch new file mode 100644 index 0000000000..5b21a99de3 --- /dev/null +++ b/gnu/packages/patches/u-boot-infodocs-target.patch @@ -0,0 +1,84 @@ +Upstream status: https://patchwork.ozlabs.org/project/uboot/list/?series=333259 + +diff --git a/Makefile b/Makefile +index de5746399a..597a8886c3 100644 +--- a/Makefile ++++ b/Makefile +@@ -2372,7 +2372,7 @@ tcheck: + # Documentation targets + # --------------------------------------------------------------------------- + DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs \ +- linkcheckdocs dochelp refcheckdocs ++ linkcheckdocs dochelp refcheckdocs texinfodocs infodocs + PHONY += $(DOC_TARGETS) + $(DOC_TARGETS): scripts_basic FORCE + $(Q)$(MAKE) $(build)=doc $@ +diff --git a/doc/Makefile b/doc/Makefile +index f5de65e927..d0904a9f99 100644 +--- a/doc/Makefile ++++ b/doc/Makefile +@@ -69,6 +69,14 @@ quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4) + htmldocs: + @+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var))) + ++texinfodocs: ++ @+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,texinfo,$(var),texinfo,$(var))) ++ ++# Note: the 'info' Make target is generated by sphinx itself when ++# running the texinfodocs target defined above. ++infodocs: texinfodocs ++ $(MAKE) -C $(BUILDDIR)/texinfo info ++ + linkcheckdocs: + @$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,linkcheck,$(var),,$(var))) + +@@ -109,6 +117,8 @@ cleandocs: + dochelp: + @echo ' U-Boot documentation in different formats from ReST:' + @echo ' htmldocs - HTML' ++ @echo ' texinfodocs - Texinfo' ++ @echo ' infodocs - Info' + @echo ' latexdocs - LaTeX' + @echo ' pdfdocs - PDF' + @echo ' epubdocs - EPUB' +diff --git a/doc/conf.py b/doc/conf.py +index 62c8d31270..3db70f80c1 100644 +--- a/doc/conf.py ++++ b/doc/conf.py +@@ -449,7 +449,7 @@ for fn in os.listdir('.'): + # One entry per manual page. List of tuples + # (source start file, name, description, authors, manual section). + man_pages = [ +- (master_doc, 'dasuboot', 'The U-Boot Documentation', ++ (master_doc, 'u-boot', 'The U-Boot Documentation', + [author], 1) + ] + +@@ -463,8 +463,8 @@ man_pages = [ + # (source start file, target name, title, author, + # dir menu entry, description, category) + texinfo_documents = [ +- (master_doc, 'DasUBoot', 'The U-Boot Documentation', +- author, 'DasUBoot', 'One line description of project.', ++ (master_doc, 'u-boot', 'The U-Boot Documentation', ++ author, 'U-Boot', 'Boot loader for embedded systems', + 'Miscellaneous'), + ] + +diff --git a/doc/media/Makefile b/doc/media/Makefile +index b9b43a34c3..9b32258696 100644 +--- a/doc/media/Makefile ++++ b/doc/media/Makefile +@@ -22,10 +22,11 @@ $(BUILDDIR)/linker_lists.h.rst: ${API}/linker_lists.h ${PARSER} $(SRC_DIR)/linke + + # Media build rules + +-.PHONY: all html epub xml latex ++.PHONY: all html texinfo epub xml latex + + all: $(IMGDOT) $(BUILDDIR) ${TARGETS} + html: all ++texinfo: all + epub: all + xml: all + latex: $(IMGPDF) all base-commit: f28ca2447c5e2eef1ba6a3a11587380a665b0e26 -- 2.38.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 20 08:21:26 2022 Received: (at 60145) by debbugs.gnu.org; 20 Dec 2022 13:21:26 +0000 Received: from localhost ([127.0.0.1]:44850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7cYf-0002CL-1P for submit@debbugs.gnu.org; Tue, 20 Dec 2022 08:21:26 -0500 Received: from mail-qt1-f173.google.com ([209.85.160.173]:40834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7cYa-0002C2-GQ for 60145@debbugs.gnu.org; Tue, 20 Dec 2022 08:21:21 -0500 Received: by mail-qt1-f173.google.com with SMTP id jr11so10846544qtb.7 for <60145@debbugs.gnu.org>; Tue, 20 Dec 2022 05:21:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2axDCYbQmH5W5TTdoMwQ9ZXF4nXKzlvPJiZJ4Qj+yD4=; b=n53tv38C54xy6tSbsMGJw87II2sYJ2wmcFnvqKyuutCA6COvQJOjtPJRVv/2V2tEXQ XEE0LsmfdVgJbf4GcRvOuDxvZtckxZIpRjzw8dfG7bImxVdNfk+PN+MoxQMRySLuhkS1 P3XA8nPguUtAqmBWL/j2vnoJ7YkKvBiEB9jgtIs8DmNhVBF0L3Zer8vHoaU4t9yC+ya1 u3NBD0YKz4zhoaVXCuNGHKCV1zIY3oQn8aQyG7OIGSxQ2bHxk/TgQ2I5oLnNM7lZMKWE VqpqDUJjTbPKQM3a4Gd/RNixA+MNlSDJRIbXDMHvD5xBthKYoGQufkfbDn8oj4i2LO5S LluA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2axDCYbQmH5W5TTdoMwQ9ZXF4nXKzlvPJiZJ4Qj+yD4=; b=GvSnWHOqYRxM4pD1WXVMK1vxSZ0Mv8fZzELIm/vnRQndAeSS5WfQOUv/pdgTXtbaBI 6SIb9TwpjrAmGYH3uZGbvqR+/ksw3SyZCGeCJh7kCuEk9UOeI9uvCj9XCldF5YTDhLcl KzyuveA3AWFGM3++SPZTYbh6Ewld4Oz91Syic6DN0UAAKLXsj/02Cse9fnipC0VaZ1tu 8K0H0bHtPI3jTdIt7qy2FkFKhPLq0E9h6k2riU5By24ouIsaAeJdQQWmNwWO7k/ycCK1 F6r/RSyw+6h47OTsOw2P9gYEbvs7Htf8V8UGXg/UAvZ/gri6C+rXuF20UR3SoHCl8nH1 O+Fg== X-Gm-Message-State: AFqh2ko92UkuWt/5OAX0icvz/aad210FloStnp0jjXHZmrWzzc0aMerW TmA5ebxhkv0SWDGYQGHa8r5p1rsGJIyFXw== X-Google-Smtp-Source: AMrXdXsH7wZ3B2InThA6W0AgWkcC9rIWduXTkWaGpa2RpXyiPnERpq1YSlps+g/w/YT7jGOzTbfzjQ== X-Received: by 2002:ac8:7382:0:b0:3a9:6cff:e1a6 with SMTP id t2-20020ac87382000000b003a96cffe1a6mr26541506qtp.0.1671542474724; Tue, 20 Dec 2022 05:21:14 -0800 (PST) Received: from localhost.localdomain ([2607:fad8:4:3::1002]) by smtp.gmail.com with ESMTPSA id o11-20020ac872cb000000b003a4f435e381sm7550703qtp.18.2022.12.20.05.21.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 05:21:14 -0800 (PST) From: Maxim Cournoyer To: 60145@debbugs.gnu.org Subject: [PATCH v6 2/2] gnu: Add patman. Date: Tue, 20 Dec 2022 08:21:07 -0500 Message-Id: <20221220132107.25988-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221220132107.25988-1-maxim.cournoyer@gmail.com> References: <20221220132107.25988-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 60145 Cc: vagrant@debian.org, Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/bootloaders.scm (patman): New variable. * gnu/packages/patches/u-boot-patman-fix-help.patch: New patch. * gnu/packages/patches/u-boot-patman-get-maintainer.patch: Likewise. * gnu/packages/patches/u-boot-patman-local-conf.patch: Likewise. * gnu/local.mk (dist_patch_DATA): Register them. --- Changes in v6: - Update u-boot-patman-get-maintainer.patch. Changes in v5: - Add new u-boot-patman-get-maintainer.patch. Changes in v4: - Use the series URL for the patches upstream submission status - Add new u-boot-patman-local-conf.patch gnu/local.mk | 3 + gnu/packages/bootloaders.scm | 36 +++- .../patches/u-boot-patman-fix-help.patch | 40 ++++ .../u-boot-patman-get-maintainer.patch | 104 +++++++++++ .../patches/u-boot-patman-local-conf.patch | 176 ++++++++++++++++++ 5 files changed, 358 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/u-boot-patman-fix-help.patch create mode 100644 gnu/packages/patches/u-boot-patman-get-maintainer.patch create mode 100644 gnu/packages/patches/u-boot-patman-local-conf.patch diff --git a/gnu/local.mk b/gnu/local.mk index 01fcc9d7d3..a704cf6002 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1925,6 +1925,9 @@ 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-patman-get-maintainer.patch \ + %D%/packages/patches/u-boot-patman-local-conf.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 32970f86f1..4cfb16860e 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,10 @@ (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") + (search-patch "u-boot-patman-local-conf.patch") + (search-patch "u-boot-patman-get-maintainer.patch"))) (method url-fetch) (uri (string-append "https://ftp.denx.de/pub/u-boot/" @@ -816,6 +822,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..89bac06c2f --- /dev/null +++ b/gnu/packages/patches/u-boot-patman-fix-help.patch @@ -0,0 +1,40 @@ +Upstream status: https://patchwork.ozlabs.org/project/uboot/list/?series=333156 + +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']) diff --git a/gnu/packages/patches/u-boot-patman-get-maintainer.patch b/gnu/packages/patches/u-boot-patman-get-maintainer.patch new file mode 100644 index 0000000000..4377f8394e --- /dev/null +++ b/gnu/packages/patches/u-boot-patman-get-maintainer.patch @@ -0,0 +1,104 @@ +Upstream status: https://patchwork.ozlabs.org/project/uboot/list/?series=333427 + +diff --git a/tools/patman/patman.rst b/tools/patman/patman.rst +index 7828899879..95b6c9c3f0 100644 +--- a/tools/patman/patman.rst ++++ b/tools/patman/patman.rst +@@ -88,7 +88,7 @@ To add your own, create a file `~/.patman` like this:: + Patman will also look for a `.patman` configuration file at the root + of the current project git repository, which makes it possible to + override the `project` settings variable or anything else in a +-project-specific way. The values of this "local" configuration file ++project-specific way. The values of this "local" configuration file + take precedence over those of the "global" one. + + Aliases are recursive. +diff --git a/tools/patman/test_settings.py b/tools/patman/test_settings.py +index 9c14b4aaa3..c768a2fc64 100644 +--- a/tools/patman/test_settings.py ++++ b/tools/patman/test_settings.py +@@ -6,38 +6,62 @@ + import argparse + import contextlib + import os +-import subprocess ++import sys + import tempfile + + from patman import settings ++from patman import tools + + + @contextlib.contextmanager + def empty_git_repository(): + with tempfile.TemporaryDirectory() as tmpdir: + os.chdir(tmpdir) +- subprocess.check_call(['git', 'init']) ++ tools.run('git', 'init', raise_on_error=True) + yield tmpdir + + ++@contextlib.contextmanager ++def cleared_command_line_args(): ++ old_value = sys.argv[:] ++ sys.argv = [sys.argv[0]] ++ try: ++ yield ++ finally: ++ sys.argv = old_value ++ ++ + def test_git_local_config(): +- with empty_git_repository(): +- with tempfile.NamedTemporaryFile() as global_config: +- global_config.write(b'[settings]\n' +- b'project=u-boot\n') +- global_config.flush() +- parser = argparse.ArgumentParser() +- parser.add_argument('-p', '--project', default='unknown') +- +- # Test "global" config is used. +- settings.Setup(parser, 'unknown', global_config.name) +- args, _ = parser.parse_known_args() +- assert args.project == 'u-boot' +- +- # Test local config can shadow it. +- with open('.patman', 'w', buffering=1) as f: +- f.write('[settings]\n' +- 'project=guix-patches\n') +- settings.Setup(parser, 'unknown', global_config.name) +- args, _ = parser.parse_known_args([]) +- assert args.project == 'guix-patches' ++ # Clearing the command line arguments is required, otherwise ++ # arguments passed to the test running such as in 'pytest -k ++ # filter' would be processed by _UpdateDefaults and fail. ++ with cleared_command_line_args(): ++ with empty_git_repository(): ++ with tempfile.NamedTemporaryFile() as global_config: ++ global_config.write(b'[settings]\n' ++ b'project=u-boot\n') ++ global_config.flush() ++ parser = argparse.ArgumentParser() ++ parser.add_argument('-p', '--project', default='unknown') ++ subparsers = parser.add_subparsers(dest='cmd') ++ send = subparsers.add_parser('send') ++ send.add_argument('--no-check', action='store_false', ++ dest='check_patch', default=True) ++ ++ # Test "global" config is used. ++ settings.Setup(parser, 'unknown', global_config.name) ++ args, _ = parser.parse_known_args([]) ++ assert args.project == 'u-boot' ++ send_args, _ = send.parse_known_args([]) ++ assert send_args.check_patch ++ ++ # Test local config can shadow it. ++ with open('.patman', 'w', buffering=1) as f: ++ f.write('[settings]\n' ++ 'project: guix-patches\n' ++ 'check_patch: False\n') ++ settings.Setup(parser, 'unknown', global_config.name) ++ args, _ = parser.parse_known_args([]) ++ assert args.project == 'guix-patches' ++ send_args, _ = send.parse_known_args([]) ++ assert not send_args.check_patch diff --git a/gnu/packages/patches/u-boot-patman-local-conf.patch b/gnu/packages/patches/u-boot-patman-local-conf.patch new file mode 100644 index 0000000000..3400982356 --- /dev/null +++ b/gnu/packages/patches/u-boot-patman-local-conf.patch @@ -0,0 +1,176 @@ +Upstream status: https://patchwork.ozlabs.org/project/uboot/list/?series=333354 + +diff --git a/tools/patman/main.py b/tools/patman/main.py +index bf300c6e64..3616b28f27 100755 +--- a/tools/patman/main.py ++++ b/tools/patman/main.py +@@ -116,7 +116,7 @@ status.add_argument('-f', '--force', action='store_true', + argv = sys.argv[1:] + args, rest = parser.parse_known_args(argv) + if hasattr(args, 'project'): +- settings.Setup(gitutil, parser, args.project, '') ++ settings.Setup(parser, args.project) + args, rest = parser.parse_known_args(argv) + + # If we have a command, it is safe to parse all arguments +diff --git a/tools/patman/patman.rst b/tools/patman/patman.rst +index 8c5c9cc2cc..7828899879 100644 +--- a/tools/patman/patman.rst ++++ b/tools/patman/patman.rst +@@ -74,7 +74,7 @@ out where to send patches pretty well. + During the first run patman creates a config file for you by taking the default + user name and email address from the global .gitconfig file. + +-To add your own, create a file ~/.patman like this:: ++To add your own, create a file `~/.patman` like this:: + + # patman alias file + +@@ -85,6 +85,12 @@ To add your own, create a file ~/.patman like this:: + wolfgang: Wolfgang Denk + others: Mike Frysinger , Fred Bloggs + ++Patman will also look for a `.patman` configuration file at the root ++of the current project git repository, which makes it possible to ++override the `project` settings variable or anything else in a ++project-specific way. The values of this "local" configuration file ++take precedence over those of the "global" one. ++ + Aliases are recursive. + + The checkpatch.pl in the U-Boot tools/ subdirectory will be located and +diff --git a/tools/patman/settings.py b/tools/patman/settings.py +index 903d6fcb0b..e8e2908f1f 100644 +--- a/tools/patman/settings.py ++++ b/tools/patman/settings.py +@@ -1,5 +1,6 @@ + # SPDX-License-Identifier: GPL-2.0+ + # Copyright (c) 2011 The Chromium OS Authors. ++# Copyright (c) 2022 Maxim Cournoyer + # + + try: +@@ -11,8 +12,7 @@ import argparse + import os + import re + +-from patman import command +-from patman import tools ++from patman import gitutil + + """Default settings per-project. + +@@ -190,7 +190,8 @@ def ReadGitAliases(fname): + + fd.close() + +-def CreatePatmanConfigFile(gitutil, config_fname): ++ ++def CreatePatmanConfigFile(config_fname): + """Creates a config file under $(HOME)/.patman if it can't find one. + + Args: +@@ -328,26 +329,46 @@ def GetItems(config, section): + except: + raise + +-def Setup(gitutil, parser, project_name, config_fname=''): ++def Setup(parser, project_name, config_fname=None): + """Set up the settings module by reading config files. + ++ Unless `config_fname` is specified, a `.patman` config file local ++ to the git repository is consulted, followed by the global ++ `$HOME/.patman`. If none exists, the later is created. Values ++ defined in the local config file take precedence over those ++ defined in the global one. ++ + Args: +- parser: The parser to update ++ parser: The parser to update. + project_name: Name of project that we're working on; we'll look + for sections named "project_section" as well. +- config_fname: Config filename to read ('' for default) ++ config_fname: Config filename to read. An error is raised if it ++ does not exist. + """ + # First read the git alias file if available + _ReadAliasFile('doc/git-mailrc') + config = _ProjectConfigParser(project_name) +- if config_fname == '': ++ ++ if config_fname and not os.path.exists(config_fname): ++ raise Exception(f'provided {config_fname} does not exist') ++ ++ if not config_fname: + config_fname = '%s/.patman' % os.getenv('HOME') ++ has_config = os.path.exists(config_fname) ++ ++ git_local_config_fname = os.path.join(gitutil.get_top_level(), '.patman') ++ has_git_local_config = os.path.exists(git_local_config_fname) + +- if not os.path.exists(config_fname): +- print("No config file found ~/.patman\nCreating one...\n") +- CreatePatmanConfigFile(gitutil, config_fname) ++ # Read the git local config last, so that its values override ++ # those of the global config, if any. ++ if has_config: ++ config.read(config_fname) ++ if has_git_local_config: ++ config.read(git_local_config_fname) + +- config.read(config_fname) ++ if not (has_config or has_git_local_config): ++ print("No config file found.\nCreating ~/.patman...\n") ++ CreatePatmanConfigFile(config_fname) + + for name, value in GetItems(config, 'alias'): + alias[name] = value.split(',') +diff --git a/tools/patman/test_settings.py b/tools/patman/test_settings.py +new file mode 100644 +index 0000000000..9c14b4aaa3 +--- /dev/null ++++ b/tools/patman/test_settings.py +@@ -0,0 +1,43 @@ ++# SPDX-License-Identifier: GPL-2.0+ ++# ++# Copyright (c) 2022 Maxim Cournoyer ++# ++ ++import argparse ++import contextlib ++import os ++import subprocess ++import tempfile ++ ++from patman import settings ++ ++ ++@contextlib.contextmanager ++def empty_git_repository(): ++ with tempfile.TemporaryDirectory() as tmpdir: ++ os.chdir(tmpdir) ++ subprocess.check_call(['git', 'init']) ++ yield tmpdir ++ ++ ++def test_git_local_config(): ++ with empty_git_repository(): ++ with tempfile.NamedTemporaryFile() as global_config: ++ global_config.write(b'[settings]\n' ++ b'project=u-boot\n') ++ global_config.flush() ++ parser = argparse.ArgumentParser() ++ parser.add_argument('-p', '--project', default='unknown') ++ ++ # Test "global" config is used. ++ settings.Setup(parser, 'unknown', global_config.name) ++ args, _ = parser.parse_known_args() ++ assert args.project == 'u-boot' ++ ++ # Test local config can shadow it. ++ with open('.patman', 'w', buffering=1) as f: ++ f.write('[settings]\n' ++ 'project=guix-patches\n') ++ settings.Setup(parser, 'unknown', global_config.name) ++ args, _ = parser.parse_known_args([]) ++ assert args.project == 'guix-patches' -- 2.38.1 From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 28 16:06:52 2022 Received: (at 60145-done) by debbugs.gnu.org; 28 Dec 2022 21:06:52 +0000 Received: from localhost ([127.0.0.1]:58808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAddU-00066e-0j for submit@debbugs.gnu.org; Wed, 28 Dec 2022 16:06:52 -0500 Received: from mail-qt1-f180.google.com ([209.85.160.180]:36517) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAddS-00066O-5U for 60145-done@debbugs.gnu.org; Wed, 28 Dec 2022 16:06:50 -0500 Received: by mail-qt1-f180.google.com with SMTP id v14so10847231qtq.3 for <60145-done@debbugs.gnu.org>; Wed, 28 Dec 2022 13:06:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=USsVnup6KcqKW8CLwmsbarYndy/22/5Gx8Pg/18R4Rg=; b=PktXdwktQjSfdKQC5S77xCOY4Nrrb4nHqPeXbwduYud1nZycttk1Xpq08w+4kOsJZ5 2btyA5nCV+cLHzTVsN4USozXzdkqVK0Ogs55hGaYRZwVuEHNdu22RXfpf2lxTNuYTvZ9 BlgaUqymKUf5ec+kOYZrcQoVIplCXGfGtG3CdEwA0Fo+C3+CKrZuuFDkbFsVVzaYnhpf bWj3YBOxjE0JrnjMMurp0F+mJ80UIwSLZN86FUnL73kPHQidgoM9Bz1W8x/aFqZfgY9+ ik+5b3n+EYqWqQ0q0mDWXcEmGqufudxc01ySLhxre2CHJQPJBSm3s27koQt511g8LCIg 429g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=USsVnup6KcqKW8CLwmsbarYndy/22/5Gx8Pg/18R4Rg=; b=7YkneJTh7Na27SZqNtMxIRi2qQxMTzOrVgAI7QzgcJ/DbEQ1c/C2dRsjppQSX3q9/d ZIHYmphD7pCTeWiSx8cJbhN/+jpCJGMaUUTiYMzzNSmjTThFKQ6UzR2zwrDy3wOX6grL T3IsU2GVO70oXJs03Bqk2i4l9FOMssKylV9pQPSbzzovON/0sfuaQm76eSrdCNillvCf Q8TDEXLkggVmKdOv4TZ5NPWqUSoGfJu62OQQnJ6p5+E3YaPW6RSql18H4TrnAPPE0oBO gKH2jsOzomGDAyddLSGUKXWBdUxB7BIBox1uc7XJN38qwJSxbQ/mv8/ys0fIO3HPr3OM PNCQ== X-Gm-Message-State: AFqh2kpYJgq/KzzARlnPTLdkLQFqN8H5vkB51TlVoPYRofy9uH2gjTrz 3qT0RHUsREBioP0Yu12Sjj/NVmD9uPrFoe3W X-Google-Smtp-Source: AMrXdXvIl/rF/BRxV2aHiNuySI65IfVNGyCLzqYpiIGx8k8BiVPoXQRoBET1ewGHhdtoycjlBBd6UA== X-Received: by 2002:a05:622a:4807:b0:3a8:efd:2ef0 with SMTP id fb7-20020a05622a480700b003a80efd2ef0mr35257991qtb.60.1672261604610; Wed, 28 Dec 2022 13:06:44 -0800 (PST) Received: from hurd (dsl-153-10.b2b2c.ca. [66.158.153.10]) by smtp.gmail.com with ESMTPSA id x3-20020ac87303000000b003a97a71c906sm10293386qto.78.2022.12.28.13.06.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Dec 2022 13:06:44 -0800 (PST) From: Maxim Cournoyer To: 60145-done@debbugs.gnu.org Subject: Re: [PATCH v6 2/2] gnu: Add patman. References: <20221220132107.25988-1-maxim.cournoyer@gmail.com> <20221220132107.25988-2-maxim.cournoyer@gmail.com> Date: Wed, 28 Dec 2022 16:06:43 -0500 In-Reply-To: <20221220132107.25988-2-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Tue, 20 Dec 2022 08:21:07 -0500") Message-ID: <871qoj5jbw.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60145-done Cc: vagrant@debian.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Maxim Cournoyer writes: > * gnu/packages/bootloaders.scm (patman): New variable. > * gnu/packages/patches/u-boot-patman-fix-help.patch: New patch. > * gnu/packages/patches/u-boot-patman-get-maintainer.patch: Likewise. > * gnu/packages/patches/u-boot-patman-local-conf.patch: Likewise. > * gnu/local.mk (dist_patch_DATA): Register them. I just pushed this series; closing. -- Thanks, Maxim From unknown Sat Jun 21 10:40:46 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 26 Jan 2023 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator