aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-12-03 20:57:24 -0500
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-12-06 22:03:44 -0500
commitf57fbc2fb1b20823f433781d08047df5d7bc31df (patch)
treed9585b95efd042600c6d2e96951e061a25d695f2
parentb94724e8b2102be0fe9d19e9dfe44d6f7101bd4b (diff)
downloadguix-f57fbc2fb1b20823f433781d08047df5d7bc31df.tar
guix-f57fbc2fb1b20823f433781d08047df5d7bc31df.tar.gz
gnu: linux-libre: Move documentation to a separate package.
* gnu/packages/linux.scm (linux-libre-5.15-source) (linux-libre-5.10-source): Do not apply linux-libre-infodocs-target.patch. (make-linux-libre): Remove BUILD-DOC? argument, and adjust patches conditional. (make-linux-libre*): Likewise. Remove build-doc? validation. [arguments]: Move documentation related phases to the new linux-libre-documentation. [native-inputs]: Move the documentation related native inputs to linux-libre-documentation. (linux-libre-documentation): New variable. * guix/build-system/linux-module.scm (make-linux-module-builder) [arguments]: Do not delete build-doc and install-doc phases, which no longer exist for linux-libre.
-rw-r--r--gnu/packages/linux.scm81
-rw-r--r--guix/build-system/linux-module.scm2
2 files changed, 42 insertions, 41 deletions
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 49e90a9ba6..18e9016806 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -524,14 +524,12 @@ corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
(define-public linux-libre-5.15-source
(source-with-patches linux-libre-5.15-pristine-source
(list %boot-logo-patch
- %linux-libre-arm-export-__sync_icache_dcache-patch
- (search-patch "linux-libre-infodocs-target.patch"))))
+ %linux-libre-arm-export-__sync_icache_dcache-patch)))
(define-public linux-libre-5.10-source
(source-with-patches linux-libre-5.10-pristine-source
(list %boot-logo-patch
- %linux-libre-arm-export-__sync_icache_dcache-patch
- (search-patch "linux-libre-infodocs-target.patch"))))
+ %linux-libre-arm-export-__sync_icache_dcache-patch)))
(define-public linux-libre-5.4-source
(source-with-patches linux-libre-5.4-pristine-source
@@ -799,10 +797,9 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
(configuration-file #f)
(defconfig "defconfig")
(extra-options %default-extra-linux-options)
- (build-doc? (doc-supported? version))
(patches
`(,%boot-logo-patch
- ,@(if build-doc?
+ ,@(if (doc-supported? version)
(list (search-patch
"linux-libre-infodocs-target.patch"))
'()))))
@@ -816,8 +813,7 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
#:extra-version extra-version
#:configuration-file configuration-file
#:defconfig defconfig
- #:extra-options extra-options
- #:build-doc? build-doc?))
+ #:extra-options extra-options))
(define* (make-linux-libre* version gnu-revision source supported-systems
#:key
@@ -826,10 +822,7 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
;; See kernel-config for an example.
(configuration-file #f)
(defconfig "defconfig")
- (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"))
+ (extra-options %default-extra-linux-options))
(package
(name (if extra-version
(string-append "linux-libre-" extra-version)
@@ -854,20 +847,6 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
(substitute* (find-files
"." "^Makefile(\\.include)?$")
(("/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"))))))
- #~())
(add-before 'configure 'set-environment
(lambda* (#:key target #:allow-other-keys)
;; Avoid introducing timestamps.
@@ -967,19 +946,6 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
("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)
@@ -1018,6 +984,43 @@ Linux kernel. It has been modified to remove all non-free binary blobs.")
(define-public linux-libre-source linux-libre-6.0-source)
(define-public linux-libre linux-libre-6.0)
+(define-public linux-libre-documentation
+ (package
+ (inherit linux-libre)
+ (name "linux-libre-documentation")
+ (arguments
+ (list
+ #:tests? #f
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'build
+ (lambda _
+ (substitute* "Documentation/Makefile"
+ ;; Remove problematic environment check script.
+ ((".*scripts/sphinx-pre-install.*") ""))
+ (invoke "make" "infodocs")))
+ (replace 'install
+ (lambda _
+ (let* ((info-dir (string-append #$output "/share/info"))
+ (info (string-append info-dir
+ "/TheLinuxKernel.info.gz")))
+ (with-directory-excursion "Documentation/output"
+ (invoke "make" "-C" "texinfo" "install-info"
+ (string-append "infodir=" info-dir)))
+ ;; Create a symlink, for convenience.
+ (symlink info (string-append info-dir
+ "/linux.info.gz"))))))))
+ (native-inputs
+ (list graphviz
+ perl
+ python
+ python-sphinx
+ texinfo
+ which))
+ (synopsis "Documentation for the kernel Linux-Libre")
+ (description "This package provides the documentation for the kernel
+Linux-Libre, as an Info manual. To consult it, run @samp{info linux}.")))
+
(define-public linux-libre-5.15
(make-linux-libre* linux-libre-5.15-version
linux-libre-5.15-gnu-revision
diff --git a/guix/build-system/linux-module.scm b/guix/build-system/linux-module.scm
index c1ddeaea10..e46195b53c 100644
--- a/guix/build-system/linux-module.scm
+++ b/guix/build-system/linux-module.scm
@@ -67,8 +67,6 @@
(lambda _
(invoke "make" "modules_prepare")))
(delete 'strip) ;faster
- (delete 'build-doc) ;costly and not useful here
- (delete 'install-doc)
(replace 'install
(lambda* (#:key inputs #:allow-other-keys)
(let ((out-lib-build (string-append #$output "/lib/modules/build")))