GNU bug report logs - #59811
[PATCH] gnu: linux-libre: Move documentation to a separate package.

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Sun, 4 Dec 2022 02:39:02 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 59811 in the body.
You can then email your comments to 59811 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#59811; Package guix-patches. (Sun, 04 Dec 2022 02:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 04 Dec 2022 02:39:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH] gnu: linux-libre: Move documentation to a separate package.
Date: Sat,  3 Dec 2022 21:38:04 -0500
* 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.
---
 gnu/packages/linux.scm             | 82 ++++++++++++++++--------------
 guix/build-system/linux-module.scm |  2 -
 2 files changed, 43 insertions(+), 41 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 8c417fb600..f22f6ed8cf 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -523,14 +523,12 @@ (define-public linux-libre-6.0-source
 (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
@@ -798,10 +796,9 @@ (define* (make-linux-libre version gnu-revision hash-string supported-systems
                            (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"))
                                     '()))))
@@ -815,8 +812,7 @@ (define* (make-linux-libre version gnu-revision hash-string supported-systems
                      #: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
@@ -825,10 +821,7 @@ (define* (make-linux-libre* version gnu-revision source supported-systems
                             ;; 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)
@@ -853,20 +846,6 @@ (define* (make-linux-libre* version gnu-revision source supported-systems
               (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.
@@ -966,19 +945,6 @@ (define* (make-linux-libre* version gnu-revision source supported-systems
        ("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)
@@ -1017,6 +983,44 @@ (define-public linux-libre-pristine-source linux-libre-6.0-pristine-source)
 (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 fontconfig
+           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 @@ (define (make-linux-module-builder linux)
               (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")))

base-commit: bf46192d4c7c4cd8d71edb8ace2cdf86322aafe7
-- 
2.38.1





Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Wed, 07 Dec 2022 03:24:01 GMT) Full text and rfc822 format available.

Notification sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
bug acknowledged by developer. (Wed, 07 Dec 2022 03:24:01 GMT) Full text and rfc822 format available.

Message #10 received at 59811-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 59811-done <at> debbugs.gnu.org
Subject: Re: bug#59811: [PATCH] gnu: linux-libre: Move documentation to a
 separate package.
Date: Tue, 06 Dec 2022 22:22:54 -0500
Hi,

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:

> * 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.

I've tested this for a couple days and it seems fine, so I've applied it
to master already.  You can now 'info linux' to read its doc.

Closing.

-- 
Thanks,
Maxim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 04 Jan 2023 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 109 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.