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

* 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 <brice@waegenei.re>
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
 ;;; Copyright © 2021 Stefan <stefan-guix@vodafonemail.de>
+;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;;
 ;;; 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





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

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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221217043549.23069-1-maxim.cournoyer@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=60145@debbugs.gnu.org \
    --cc=vagrant@debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).