me
/
guix
Archived
1
0
Fork 0

gnu: linux-libre: Enable building info doc.

* gnu/packages/patches/linux-libre-infodocs-target.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/linux.scm (linux-libre-6.0-source, linux-libre-5.15-source)
(linux-libre-5.10-source): Apply above patch.
(doc-supported?): New procedure.
(make-linux-libre) [DOC-SUPPORTED?]: Add new patch in
the default patches used.  Add a BUILD-DOC? argument.
(make-linux-libre*): Add a BUILD-DOC? argument.  Validate BUILD-DOC? for
supported VERSION.
[arguments]: Conditionally add the build-doc and install-doc phases.
[native-inputs]: Conditionally add fontconfig, graphviz, python-wrapper,
python-sphinx, texinfo and which.
master
Maxim Cournoyer 2022-11-15 14:05:36 -05:00
parent 5f8c11d48e
commit 82c43b276d
No known key found for this signature in database
GPG Key ID: 1260E46482E63562
3 changed files with 250 additions and 114 deletions

View File

@ -1483,6 +1483,7 @@ dist_patch_DATA = \
%D%/packages/patches/lierolibre-try-building-other-arch.patch \ %D%/packages/patches/lierolibre-try-building-other-arch.patch \
%D%/packages/patches/linbox-fix-pkgconfig.patch \ %D%/packages/patches/linbox-fix-pkgconfig.patch \
%D%/packages/patches/linphone-desktop-without-sdk.patch \ %D%/packages/patches/linphone-desktop-without-sdk.patch \
%D%/packages/patches/linux-libre-infodocs-target.patch \
%D%/packages/patches/linux-libre-support-for-Pinebook-Pro.patch \ %D%/packages/patches/linux-libre-support-for-Pinebook-Pro.patch \
%D%/packages/patches/linux-pam-no-setfsuid.patch \ %D%/packages/patches/linux-pam-no-setfsuid.patch \
%D%/packages/patches/linuxdcpp-openssl-1.1.patch \ %D%/packages/patches/linuxdcpp-openssl-1.1.patch \

View File

@ -33,7 +33,7 @@
;;; Copyright © 2018, 2019 Pierre Langlois <pierre.langlois@gmx.com> ;;; Copyright © 2018, 2019 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com> ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de> ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
;;; Copyright © 2019, 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2019, 2020, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com> ;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com>
;;; Copyright © 2019-2022 Brice Waegeneire <brice@waegenei.re> ;;; Copyright © 2019-2022 Brice Waegeneire <brice@waegenei.re>
;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net> ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
@ -108,8 +108,9 @@
#:use-module (gnu packages docbook) #:use-module (gnu packages docbook)
#:use-module (gnu packages documentation) #:use-module (gnu packages documentation)
#:use-module (gnu packages elf) #:use-module (gnu packages elf)
#:use-module (gnu packages flex)
#:use-module (gnu packages file) #:use-module (gnu packages file)
#:use-module (gnu packages flex)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages freedesktop) #:use-module (gnu packages freedesktop)
#:use-module (gnu packages gawk) #:use-module (gnu packages gawk)
#:use-module (gnu packages gcc) #:use-module (gnu packages gcc)
@ -119,6 +120,7 @@
#:use-module (gnu packages gnupg) #:use-module (gnu packages gnupg)
#:use-module (gnu packages golang) #:use-module (gnu packages golang)
#:use-module (gnu packages gperf) #:use-module (gnu packages gperf)
#:use-module (gnu packages graphviz)
#:use-module (gnu packages gstreamer) #:use-module (gnu packages gstreamer)
#:use-module (gnu packages gtk) #:use-module (gnu packages gtk)
#:use-module (gnu packages haskell-apps) #:use-module (gnu packages haskell-apps)
@ -494,17 +496,20 @@ corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
(define-public linux-libre-6.0-source (define-public linux-libre-6.0-source
(source-with-patches linux-libre-6.0-pristine-source (source-with-patches linux-libre-6.0-pristine-source
(list %boot-logo-patch (list %boot-logo-patch
%linux-libre-arm-export-__sync_icache_dcache-patch))) %linux-libre-arm-export-__sync_icache_dcache-patch
(search-patch "linux-libre-infodocs-target.patch"))))
(define-public linux-libre-5.15-source (define-public linux-libre-5.15-source
(source-with-patches linux-libre-5.15-pristine-source (source-with-patches linux-libre-5.15-pristine-source
(list %boot-logo-patch (list %boot-logo-patch
%linux-libre-arm-export-__sync_icache_dcache-patch))) %linux-libre-arm-export-__sync_icache_dcache-patch
(search-patch "linux-libre-infodocs-target.patch"))))
(define-public linux-libre-5.10-source (define-public linux-libre-5.10-source
(source-with-patches linux-libre-5.10-pristine-source (source-with-patches linux-libre-5.10-pristine-source
(list %boot-logo-patch (list %boot-logo-patch
%linux-libre-arm-export-__sync_icache_dcache-patch))) %linux-libre-arm-export-__sync_icache_dcache-patch
(search-patch "linux-libre-infodocs-target.patch"))))
(define-public linux-libre-5.4-source (define-public linux-libre-5.4-source
(source-with-patches linux-libre-5.4-pristine-source (source-with-patches linux-libre-5.4-pristine-source
@ -759,6 +764,11 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
;;; Kernel package utilities. ;;; Kernel package utilities.
;;; ;;;
(define (doc-supported? version)
;; Versions older than 5.10 have different enough build scripts that the
;; infodocs patch doesn't apply.
(version>=? version "5.10"))
(define* (make-linux-libre version gnu-revision hash-string supported-systems (define* (make-linux-libre version gnu-revision hash-string supported-systems
#:key #:key
(extra-version #f) (extra-version #f)
@ -767,7 +777,13 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
(configuration-file #f) (configuration-file #f)
(defconfig "defconfig") (defconfig "defconfig")
(extra-options %default-extra-linux-options) (extra-options %default-extra-linux-options)
(patches (list %boot-logo-patch))) (build-doc? (doc-supported? version))
(patches
`(,%boot-logo-patch
,@(if build-doc?
(list (search-patch
"linux-libre-infodocs-target.patch"))
'()))))
(make-linux-libre* version gnu-revision (make-linux-libre* version gnu-revision
(origin (origin
(method url-fetch) (method url-fetch)
@ -778,7 +794,8 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
#:extra-version extra-version #:extra-version extra-version
#:configuration-file configuration-file #:configuration-file configuration-file
#:defconfig defconfig #:defconfig defconfig
#:extra-options extra-options)) #:extra-options extra-options
#:build-doc? build-doc?))
(define* (make-linux-libre* version gnu-revision source supported-systems (define* (make-linux-libre* version gnu-revision source supported-systems
#:key #:key
@ -787,7 +804,10 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
;; See kernel-config for an example. ;; See kernel-config for an example.
(configuration-file #f) (configuration-file #f)
(defconfig "defconfig") (defconfig "defconfig")
(extra-options %default-extra-linux-options)) (extra-options %default-extra-linux-options)
(build-doc? (doc-supported? version)))
(when (and build-doc? (not (doc-supported? version)))
(error "unsupported 'build-doc?' for kernels <5.10"))
(package (package
(name (if extra-version (name (if extra-version
(string-append "linux-libre-" extra-version) (string-append "linux-libre-" extra-version)
@ -796,50 +816,41 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
(source source) (source source)
(supported-systems supported-systems) (supported-systems supported-systems)
(build-system gnu-build-system) (build-system gnu-build-system)
(native-inputs
`(("perl" ,perl)
("bc" ,bc)
("openssl" ,openssl)
("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
("flex" ,flex)
("bison" ,bison)
;; These are needed to compile the GCC plugins.
("gmp" ,gmp)
("mpfr" ,mpfr)
("mpc" ,mpc)
,@(match (let ((arch (platform-linux-architecture
(lookup-platform-by-target-or-system
(or (%current-target-system)
(%current-system))))))
(and configuration-file arch
(configuration-file
arch
#:variant (version-major+minor version))))
(#f ;no config for this platform
'())
((? string? config)
`(("kconfig" ,config))))))
(arguments (arguments
(list #:modules '((guix build gnu-build-system) (list
#:modules '((guix build gnu-build-system)
(guix build utils) (guix build utils)
(srfi srfi-1) (srfi srfi-1)
(srfi srfi-26) (srfi srfi-26)
(ice-9 ftw) (ice-9 ftw)
(ice-9 match)) (ice-9 match))
#:tests? #f
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'unpack 'patch-/bin/pwd (add-after 'unpack 'patch-/bin/pwd
(lambda _ (lambda _
(substitute* (find-files "." "^Makefile(\\.include)?$") (substitute* (find-files
"." "^Makefile(\\.include)?$")
(("/bin/pwd") "pwd")))) (("/bin/pwd") "pwd"))))
#$@(if build-doc?
#~((add-before 'configure 'build-doc
(lambda _
(substitute* "Documentation/Makefile"
;; Remove problematic environment check script.
((".*scripts/sphinx-pre-install.*") ""))
(invoke "make" "infodocs")))
(add-after 'build-doc 'install-doc
(lambda _
(with-directory-excursion "Documentation/output"
(invoke "make" "-C" "texinfo" "install-info"
(string-append "infodir=" #$output
"/share/info"))))))
#~())
(replace 'configure (replace 'configure
(lambda* (#:key inputs target #:allow-other-keys) (lambda* (#:key inputs target #:allow-other-keys)
;; Avoid introducing timestamps. ;; Avoid introducing timestamps.
(setenv "KCONFIG_NOTIMESTAMP" "1") (setenv "KCONFIG_NOTIMESTAMP" "1")
(setenv "KBUILD_BUILD_TIMESTAMP" (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
(getenv "SOURCE_DATE_EPOCH"))
;; Other variables useful for reproducibility. ;; Other variables useful for reproducibility.
(setenv "KBUILD_BUILD_USER" "guix") (setenv "KBUILD_BUILD_USER" "guix")
@ -886,7 +897,8 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
(dtbdir (string-append #$output "/lib/dtbs"))) (dtbdir (string-append #$output "/lib/dtbs")))
;; Install kernel image, kernel configuration and link map. ;; Install kernel image, kernel configuration and link map.
(for-each (lambda (file) (install-file file #$output)) (for-each (lambda (file) (install-file file #$output))
(find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$")) (find-files "." "^(\\.config|bzImage|zImage|Image\
|vmlinuz|System\\.map|Module\\.symvers)$"))
;; Install device tree files ;; Install device tree files
(unless (null? (find-files "." "\\.dtb$")) (unless (null? (find-files "." "\\.dtb$"))
(mkdir-p dtbdir) (mkdir-p dtbdir)
@ -919,13 +931,48 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
(string-append moddir "/" version "/build"))) (string-append moddir "/" version "/build")))
(false-if-file-not-found (false-if-file-not-found
(delete-file (delete-file
(string-append moddir "/" version "/source")))))))) (string-append moddir "/" version "/source"))))))))))
#:tests? #f)) (native-inputs
`(("perl" ,perl)
("bc" ,bc)
("openssl" ,openssl)
("elfutils" ,elfutils) ;needed to enable CONFIG_STACK_VALIDATION
("flex" ,flex)
("bison" ,bison)
;; These are needed to compile the GCC plugins.
("gmp" ,gmp)
("mpfr" ,mpfr)
("mpc" ,mpc)
;; For generating the documentation.
,@(if build-doc?
;; TODO: remove fontconfig after the 5.10 kernel is dropped.
;; Also replace python-wrapper by python at that time.
`(("fontconfig" ,fontconfig)
("graphviz" ,graphviz)
("python" ,python-wrapper)
("python-sphinx" ,python-sphinx)
("texinfo" ,texinfo)
("which" ,which))
'())
,@(match (let ((arch (platform-linux-architecture
(lookup-platform-by-target-or-system
(or (%current-target-system)
(%current-system))))))
(and configuration-file arch
(configuration-file
arch
#:variant (version-major+minor version))))
(#f ;no config for this platform
'())
((? string? config)
`(("kconfig" ,config))))))
(home-page "https://www.gnu.org/software/linux-libre/") (home-page "https://www.gnu.org/software/linux-libre/")
(synopsis "100% free redistribution of a cleaned Linux kernel") (synopsis "100% free redistribution of a cleaned Linux kernel")
(description (description "GNU Linux-Libre is a free (as in freedom) variant of the
"GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel. Linux kernel. It has been modified to remove all non-free binary blobs.")
It has been modified to remove all non-free binary blobs.")
(license license:gpl2) (license license:gpl2)
(properties '((max-silent-time . 3600))))) ;don't timeout on blob scan. (properties '((max-silent-time . 3600))))) ;don't timeout on blob scan.

View File

@ -0,0 +1,88 @@
Upstream status: https://marc.info/?l=linux-doc&m=166861669723994&w=2
From 7edb5b278ee383ff9bed525329b2cdbe22317bf2 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Mon, 14 Nov 2022 22:51:11 -0500
Subject: [PATCH] doc: add texinfodocs and infodocs targets
Sphinx supports generating Texinfo sources and Info documentation,
which can be navigated easily and is convenient to search (via the
indexed nodes or anchors, for example).
This change also causes the html output to appear under its own output
sub-directory, which makes it easier to install, since it's clean from
.doctrees or other output formats.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
---
Documentation/Makefile | 13 ++++++++++++-
Documentation/userspace-api/media/Makefile | 3 ++-
Makefile | 2 +-
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 64d44c1ecad3..bd8dac560633 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -93,7 +93,16 @@ quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4)
htmldocs:
@$(srctree)/scripts/sphinx-pre-install --version-check
- @+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var)))
+ @+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),html,$(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 define above.
+infodocs: texinfodocs
+ $(MAKE) -C $(BUILDDIR)/texinfo info
linkcheckdocs:
@$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,linkcheck,$(var),,$(var)))
@@ -143,6 +152,8 @@ cleandocs:
dochelp:
@echo ' Linux kernel internal 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/Documentation/userspace-api/media/Makefile b/Documentation/userspace-api/media/Makefile
index 00922aa7efde..3d8aaf5c253b 100644
--- a/Documentation/userspace-api/media/Makefile
+++ b/Documentation/userspace-api/media/Makefile
@@ -47,10 +47,11 @@ $(BUILDDIR)/lirc.h.rst: ${UAPI}/lirc.h ${PARSER} $(SRC_DIR)/lirc.h.rst.exception
# 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
diff --git a/Makefile b/Makefile
index 58cd4f5e1c3a..b3266c408b6c 100644
--- a/Makefile
+++ b/Makefile
@@ -1785,7 +1785,7 @@ $(help-board-dirs): help-%:
# Documentation targets
# ---------------------------------------------------------------------------
DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs \
- linkcheckdocs dochelp refcheckdocs
+ linkcheckdocs dochelp refcheckdocs texinfodocs infodocs
PHONY += $(DOC_TARGETS)
$(DOC_TARGETS):
$(Q)$(MAKE) $(build)=Documentation $@
base-commit: 81e7cfa3a9eb4ba6993a9c71772fdab21bc5d870
--
2.38.1