From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id wMHJNmYWdWMWZgAAbAwnHQ (envelope-from ) for ; Wed, 16 Nov 2022 17:57:10 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id +Oi6NmYWdWNNhQEAauVa8A (envelope-from ) for ; Wed, 16 Nov 2022 17:57:10 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3FDD56470 for ; Wed, 16 Nov 2022 17:57:10 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovLii-0000cl-H0; Wed, 16 Nov 2022 11:57: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 1ovLig-0000cW-O5 for guix-patches@gnu.org; Wed, 16 Nov 2022 11:57:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ovLig-00065U-Fj for guix-patches@gnu.org; Wed, 16 Nov 2022 11:57:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ovLif-00081I-SR for guix-patches@gnu.org; Wed, 16 Nov 2022 11:57:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59313] [PATCH] gnu: linux-libre: Enable building html and info doc. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 16 Nov 2022 16:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59313 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59313@debbugs.gnu.org Cc: Maxim Cournoyer X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166861778530782 (code B ref -1); Wed, 16 Nov 2022 16:57:01 +0000 Received: (at submit) by debbugs.gnu.org; 16 Nov 2022 16:56:25 +0000 Received: from localhost ([127.0.0.1]:57990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovLi4-00080O-Gn for submit@debbugs.gnu.org; Wed, 16 Nov 2022 11:56:25 -0500 Received: from lists.gnu.org ([209.51.188.17]:37894) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovLhz-00080D-VO for submit@debbugs.gnu.org; Wed, 16 Nov 2022 11:56:22 -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 1ovLhz-0000Z9-Ef for guix-patches@gnu.org; Wed, 16 Nov 2022 11:56:19 -0500 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ovLhv-0005vT-K2 for guix-patches@gnu.org; Wed, 16 Nov 2022 11:56:18 -0500 Received: by mail-qk1-x72e.google.com with SMTP id x21so12066354qkj.0 for ; Wed, 16 Nov 2022 08:56:15 -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=bHbeul0UdOWA9ZDXTIreRCOWwHxTzapalWVdmT0cIrk=; b=ARSZva3eSJEW1/fuZPTSCyHAaaLWYk2khQcQ5e1m0Nvma+yG0FIRHyvlxhtTHY/T0O /6fcG66E3Fj3HEXY3FYWNuZ72lS7vwZeY0Z5laDV+oUvbyR6qmdi9gLBlVdavm+BhoaZ 9MV7cZ3fxCbaoyw4bTwq3aI9c8xIFlIMjGdF3BImhIV4k/X5ZjlJogoRRWY+PSS4qaZl vdcwqh8QacT48VkqORX/t5j0lX6cKcDI6hjdjZpqHBcwLPLRnaIMG2Om+TJIAHhQfwfH 3Dx9q4BJWwr7SFzAWgZ1zy/FVCV832P4PZ2pUqW8QrdEj+YxLK1EklDxdPdfS4Uu4wTk d77g== 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=bHbeul0UdOWA9ZDXTIreRCOWwHxTzapalWVdmT0cIrk=; b=DY8/H46R+3xj6gUp9T6m0bffOFXX49YKRR4fNYRjG5p0j+iJPdA3zLNDcPwITYdFpU gGK1F/EMskbQjIzKx6XB5QV+rAQIC6NKu37i0oCkUW0stxAgyPOOl+riwITbNN/1U4AX 0kh+A0AwXo9jqCuDtAAB4VPDvGsZt4NjekMzPXceWeps1eqN51939xBvJL47qqlHUP5x iPRbrMSYkJMhL67henIRyqINb+zgaHVeJTivEf5x0kBjevjE0cJueC7YwMHHIGaHQVyh /YZhiES++iC39xkgo92a1jMx1QIrNsDjQLM2kZSg1q/on/VgYWadgXl9dUXoWp6gvkbB LuAA== X-Gm-Message-State: ANoB5pkBkib8j57MGnfrOtII0nUIfB6lgyAk037RXMae7M1X1y5vlrsG qzIgQqie/k084N/4lIRqoIDHPamv62sWGA== X-Google-Smtp-Source: AA0mqf4VNwXtRjIeKnu5r1UK94n264ddKya2txx/As5T4ek9jVxF6FdWnxiOKnp4MPYxeMjL+7cQig== X-Received: by 2002:a05:620a:2623:b0:6fb:9b7e:7e5b with SMTP id z35-20020a05620a262300b006fb9b7e7e5bmr8691900qko.483.1668617773937; Wed, 16 Nov 2022 08:56:13 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-21.b2b2c.ca. [72.10.133.21]) by smtp.gmail.com with ESMTPSA id w21-20020ac843d5000000b0039c72bb51f3sm8877931qtn.86.2022.11.16.08.56.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 08:56:13 -0800 (PST) From: Maxim Cournoyer Date: Wed, 16 Nov 2022 11:55:51 -0500 Message-Id: <20221116165551.23244-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 Received-SPF: pass client-ip=2607:f8b0:4864:20::72e; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qk1-x72e.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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1668617830; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=gBb/3VTIsZs8UC0lH3cUoGerXC0bbgD8EUAlG2e6jps=; b=EoO5Tv+RKUSYDQd3OH6pYyzmk5DSKdtgbuDP1G6aADQ7/OoSQVP7dHbFYcUPtOr51pyhyt 4MqSS1IGx8GGYbssFwlUQ9UUwdESP3LtBv8MM7N51iWEEGN+Sp9uJJ4pQ0mnmwoIrIeGhK BEyViVavdRffW70LzG4Wz2xsvfqOUcAyWWi0rqbEHN5dn+SJ3IE8wANQ+uUVcc8k03mI+s QqP3mL6msM5hVK4bQe8dICHzquU3W5OeyJVFuPKmpbbnU8ydtyk5x6dSQ/SwvOlIlk44G/ ZVuJJCqb1wgfMIqMsLSbCfVOnC8t0vUcqAR+K+wFkJDiLICC+gjxMnU3hVFCog== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1668617830; a=rsa-sha256; cv=none; b=i3c2Gj1LIKFgY9jIs+xsQWmSKxroCn06devnHxraitCLdRRzIFQJmVtS/8E+wpIY4+WhQm BuZzZl+rrmzkoOxAP2f7irtraMI9ywMc6yLFVzt2KX8gmgBJPP15iQi6s5jxjmHlKaD+s5 36JOtMdbilHzVXI0wnfy85wGATHLPKJgaQVC84rUO5CcAfSPHOh5p/af26gYD/YdboX+wI RgNhhb2rE+WZNphB0FeGiwGcmytkTrA11Vv7bxfctPvrMcrKCTYfGOuZEE4GglGqm8TetX uRU/cly2oy/skaZ0yNS8+NGW6dbd3oozC08I1cm3ieNbG0w6vmckPQdiNkPrGw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=ARSZva3e; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 4.46 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=ARSZva3e; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 3FDD56470 X-Spam-Score: 4.46 X-Migadu-Scanner: scn0.migadu.com X-TUID: P+1wQPOSSpXE * gnu/packages/patches/linux-libre-infodocs-target.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. (linux-libre-6.0-source, linux-libre-5.15-source, linux-libre-5.10-source) (linux-libre-5.4-source, linux-libre-4.19-source) (linux-libre-4.9-source): Apply above patch. * gnu/packages/linux.scm (make-linux-libre): Add new patch in the default patches used. Add a BUILD-DOC? argument. (make-linux-libre*): Add a BUILD-DOC? argument. [outputs]: New field. [phases]: Conditionally add the build-doc and install-doc phases. [native-inputs]: Conditionally add graphviz, python, python-sphinx, python-sphinx-rtd-theme, texinfo and which. --- gnu/local.mk | 3 +- gnu/packages/linux.scm | 280 ++++++++++-------- .../patches/linux-libre-infodocs-target.patch | 88 ++++++ 3 files changed, 253 insertions(+), 118 deletions(-) create mode 100644 gnu/packages/patches/linux-libre-infodocs-target.patch diff --git a/gnu/local.mk b/gnu/local.mk index 71472f8410..83cd160864 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1481,7 +1481,8 @@ dist_patch_DATA = \ %D%/packages/patches/lierolibre-remove-arch-warning.patch \ %D%/packages/patches/lierolibre-try-building-other-arch.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-pam-no-setfsuid.patch \ %D%/packages/patches/linuxdcpp-openssl-1.1.patch \ diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index a879dcba8d..c45a54233c 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -33,7 +33,7 @@ ;;; Copyright © 2018, 2019 Pierre Langlois ;;; Copyright © 2018 Vasile Dumitrascu ;;; Copyright © 2019 Tim Gesthuizen -;;; Copyright © 2019, 2020, 2021 Maxim Cournoyer +;;; Copyright © 2019, 2020, 2021, 2022 Maxim Cournoyer ;;; Copyright © 2019 Stefan Stefanović ;;; Copyright © 2019-2022 Brice Waegeneire ;;; Copyright © 2019 Kei Kebreau @@ -119,6 +119,7 @@ (define-module (gnu packages linux) #:use-module (gnu packages gnupg) #:use-module (gnu packages golang) #:use-module (gnu packages gperf) + #:use-module (gnu packages graphviz) #:use-module (gnu packages gstreamer) #:use-module (gnu packages gtk) #:use-module (gnu packages haskell-apps) @@ -494,17 +495,20 @@ (define (source-with-patches source patches) (define-public linux-libre-6.0-source (source-with-patches linux-libre-6.0-pristine-source (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 (source-with-patches linux-libre-5.15-pristine-source (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 (source-with-patches linux-libre-5.10-pristine-source (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 (source-with-patches linux-libre-5.4-pristine-source @@ -512,21 +516,25 @@ (define-public linux-libre-5.4-source %linux-libre-arm-export-__sync_icache_dcache-patch ;; Pinebook Pro patch from linux-next, ;; can be dropped for linux-libre 5.7 - (search-patch - "linux-libre-support-for-Pinebook-Pro.patch")))) + (search-patches + "linux-libre-support-for-Pinebook-Pro.patch" + "linux-libre-infodocs-target.patch")))) (define-public linux-libre-4.19-source (source-with-patches linux-libre-4.19-pristine-source (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-4.14-source (source-with-patches linux-libre-4.14-pristine-source - (list %boot-logo-patch))) + (list %boot-logo-patch + (search-patch "linux-libre-infodocs-target.patch")))) (define-public linux-libre-4.9-source (source-with-patches linux-libre-4.9-pristine-source - (list %boot-logo-patch))) + (list %boot-logo-patch + (search-patch "linux-libre-infodocs-target.patch")))) ;;; @@ -767,7 +775,11 @@ (define* (make-linux-libre version gnu-revision hash-string supported-systems (configuration-file #f) (defconfig "defconfig") (extra-options %default-extra-linux-options) - (patches (list %boot-logo-patch))) + (patches + (list %boot-logo-patch + (search-patch + "linux-libre-infodocs-target.patch"))) + (build-doc? #t)) (make-linux-libre* version gnu-revision (origin (method url-fetch) @@ -778,7 +790,8 @@ (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)) + #:extra-options extra-options + #:build-doc? build-doc?)) (define* (make-linux-libre* version gnu-revision source supported-systems #:key @@ -787,7 +800,8 @@ (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)) + (extra-options %default-extra-linux-options) + (build-doc? #t)) (package (name (if extra-version (string-append "linux-libre-" extra-version) @@ -795,12 +809,135 @@ (define* (make-linux-libre* version gnu-revision source supported-systems (version version) (source source) (supported-systems supported-systems) + (outputs `("out" + ,@(if build-doc? '("doc") '()))) (build-system gnu-build-system) + (arguments + (list + #:modules '((guix build gnu-build-system) + (guix build utils) + (srfi srfi-1) + (srfi srfi-26) + (ice-9 ftw) + (ice-9 match)) + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-/bin/pwd + (lambda _ + (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" "htmldocs"))) + (add-after 'build-doc 'install-doc + (lambda _ + (with-directory-excursion "Documentation/output" + (let ((docdir (string-append + #$output:doc + "/share/doc/linux-libre/html"))) + (mkdir-p docdir) + (copy-recursively "html" docdir)) + (invoke "make" "-C" "texinfo" "install-info" + (string-append "infodir=" #$output + "/share/info")))))) + #~()) + (replace 'configure + (lambda* (#:key inputs target #:allow-other-keys) + ;; Avoid introducing timestamps. + (setenv "KCONFIG_NOTIMESTAMP" "1") + (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH")) + + ;; Other variables useful for reproducibility. + (setenv "KBUILD_BUILD_USER" "guix") + (setenv "KBUILD_BUILD_HOST" "guix") + + ;; Set ARCH and CROSS_COMPILE. + (let ((arch #$(platform-linux-architecture + (lookup-platform-by-target-or-system + (or (%current-target-system) + (%current-system)))))) + (setenv "ARCH" arch) + (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")) + + (when target + (setenv "CROSS_COMPILE" (string-append target "-")) + (format #t "`CROSS_COMPILE' set to `~a'~%" + (getenv "CROSS_COMPILE")))) + + (setenv "EXTRAVERSION" + #$(and extra-version + (string-append "-" extra-version))) + + (let ((config (assoc-ref inputs "kconfig"))) + + ;; Use a custom kernel configuration file or a default + ;; configuration file. + (if config + (begin + (copy-file config ".config") + (chmod ".config" #o666)) + (invoke "make" #$defconfig)) + + ;; Appending works even when the option wasn't in the + ;; file. The last one prevails if duplicated. + (let ((port (open-file ".config" "a")) + (extra-configuration #$(config->string extra-options))) + (display extra-configuration port) + (close-port port)) + + (invoke "make" "oldconfig")))) + (replace 'install + (lambda* (#:key inputs native-inputs #:allow-other-keys) + (let ((moddir (string-append #$output "/lib/modules")) + (dtbdir (string-append #$output "/lib/dtbs"))) + ;; Install kernel image, kernel configuration and link map. + (for-each (lambda (file) (install-file file #$output)) + (find-files "." "^(\\.config|bzImage|zImage|Image\ +|vmlinuz|System\\.map|Module\\.symvers)$")) + ;; Install device tree files + (unless (null? (find-files "." "\\.dtb$")) + (mkdir-p dtbdir) + (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir) + "dtbs_install")) + ;; Install kernel modules + (mkdir-p moddir) + (invoke "make" + ;; Disable depmod because the Guix system's + ;; module directory is an union of potentially + ;; multiple packages. It is not possible to use + ;; depmod to usefully calculate a dependency + ;; graph while building only one of them. + "DEPMOD=true" + (string-append "MODULE_DIR=" moddir) + (string-append "INSTALL_PATH=" #$output) + (string-append "INSTALL_MOD_PATH=" #$output) + "INSTALL_MOD_STRIP=1" + "modules_install") + (let* ((versions (filter (lambda (name) + (not (string-prefix? "." name))) + (scandir moddir))) + (version (match versions + ((x) x)))) + ;; There are symlinks to the build and source directory. + ;; Both will point to target /tmp/guix-build* and thus + ;; not be useful in a profile. Delete the symlinks. + (false-if-file-not-found + (delete-file + (string-append moddir "/" version "/build"))) + (false-if-file-not-found + (delete-file + (string-append moddir "/" version "/source")))))))))) (native-inputs `(("perl" ,perl) ("bc" ,bc) ("openssl" ,openssl) - ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION + ("elfutils" ,elfutils) ;needed to enable CONFIG_STACK_VALIDATION ("flex" ,flex) ("bison" ,bison) @@ -809,6 +946,16 @@ (define* (make-linux-libre* version gnu-revision source supported-systems ("mpfr" ,mpfr) ("mpc" ,mpc) + ;; For generating the documentation. + ,@(if build-doc? + `(("graphviz" ,graphviz) + ("python" ,python) + ("python-sphinx" ,python-sphinx) + ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme) + ("texinfo" ,texinfo) + ("which" ,which)) + '()) + ,@(match (let ((arch (platform-linux-architecture (lookup-platform-by-target-or-system (or (%current-target-system) @@ -817,115 +964,14 @@ (define* (make-linux-libre* version gnu-revision source supported-systems (configuration-file arch #:variant (version-major+minor version)))) - (#f ;no config for this platform + (#f ;no config for this platform '()) ((? string? config) `(("kconfig" ,config)))))) - (arguments - (list #:modules '((guix build gnu-build-system) - (guix build utils) - (srfi srfi-1) - (srfi srfi-26) - (ice-9 ftw) - (ice-9 match)) - #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'patch-/bin/pwd - (lambda _ - (substitute* (find-files "." "^Makefile(\\.include)?$") - (("/bin/pwd") "pwd")))) - (replace 'configure - (lambda* (#:key inputs target #:allow-other-keys) - ;; Avoid introducing timestamps. - (setenv "KCONFIG_NOTIMESTAMP" "1") - (setenv "KBUILD_BUILD_TIMESTAMP" - (getenv "SOURCE_DATE_EPOCH")) - - ;; Other variables useful for reproducibility. - (setenv "KBUILD_BUILD_USER" "guix") - (setenv "KBUILD_BUILD_HOST" "guix") - - ;; Set ARCH and CROSS_COMPILE. - (let ((arch #$(platform-linux-architecture - (lookup-platform-by-target-or-system - (or (%current-target-system) - (%current-system)))))) - (setenv "ARCH" arch) - (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")) - - (when target - (setenv "CROSS_COMPILE" (string-append target "-")) - (format #t "`CROSS_COMPILE' set to `~a'~%" - (getenv "CROSS_COMPILE")))) - - (setenv "EXTRAVERSION" - #$(and extra-version - (string-append "-" extra-version))) - - (let ((config (assoc-ref inputs "kconfig"))) - - ;; Use a custom kernel configuration file or a default - ;; configuration file. - (if config - (begin - (copy-file config ".config") - (chmod ".config" #o666)) - (invoke "make" #$defconfig)) - - ;; Appending works even when the option wasn't in the - ;; file. The last one prevails if duplicated. - (let ((port (open-file ".config" "a")) - (extra-configuration #$(config->string extra-options))) - (display extra-configuration port) - (close-port port)) - - (invoke "make" "oldconfig")))) - (replace 'install - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (let ((moddir (string-append #$output "/lib/modules")) - (dtbdir (string-append #$output "/lib/dtbs"))) - ;; Install kernel image, kernel configuration and link map. - (for-each (lambda (file) (install-file file #$output)) - (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$")) - ;; Install device tree files - (unless (null? (find-files "." "\\.dtb$")) - (mkdir-p dtbdir) - (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir) - "dtbs_install")) - ;; Install kernel modules - (mkdir-p moddir) - (invoke "make" - ;; Disable depmod because the Guix system's - ;; module directory is an union of potentially - ;; multiple packages. It is not possible to use - ;; depmod to usefully calculate a dependency - ;; graph while building only one of them. - "DEPMOD=true" - (string-append "MODULE_DIR=" moddir) - (string-append "INSTALL_PATH=" #$output) - (string-append "INSTALL_MOD_PATH=" #$output) - "INSTALL_MOD_STRIP=1" - "modules_install") - (let* ((versions (filter (lambda (name) - (not (string-prefix? "." name))) - (scandir moddir))) - (version (match versions - ((x) x)))) - ;; There are symlinks to the build and source directory. - ;; Both will point to target /tmp/guix-build* and thus - ;; not be useful in a profile. Delete the symlinks. - (false-if-file-not-found - (delete-file - (string-append moddir "/" version "/build"))) - (false-if-file-not-found - (delete-file - (string-append moddir "/" version "/source")))))))) - #:tests? #f)) (home-page "https://www.gnu.org/software/linux-libre/") (synopsis "100% free redistribution of a cleaned Linux kernel") - (description - "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel. -It has been modified to remove all non-free binary blobs.") + (description "GNU Linux-Libre is a free (as in freedom) variant of the +Linux kernel. It has been modified to remove all non-free binary blobs.") (license license:gpl2) (properties '((max-silent-time . 3600))))) ;don't timeout on blob scan. diff --git a/gnu/packages/patches/linux-libre-infodocs-target.patch b/gnu/packages/patches/linux-libre-infodocs-target.patch new file mode 100644 index 0000000000..e9e6495c26 --- /dev/null +++ b/gnu/packages/patches/linux-libre-infodocs-target.patch @@ -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 +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 +--- + 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 + base-commit: 4073f43cbc2a9e0a5156ff5f950973871bff49e3 -- 2.38.1