diff mbox series

[bug#63420,v1,3/4] gnu: btrfs-progs: Make the python-sphinx input conditional.

Message ID 20230510163925.3071-3-GNUtoo@cyberdimension.org
State New
Headers show
Series Guix patches for btrfs-progs | expand

Commit Message

Denis 'GNUtoo' Carikli May 10, 2023, 4:39 p.m. UTC
* gnu/packages/linux.scm (btrfs-progs) [native-inputs]:
  Make the python-sphinx input conditional.
  [arguments]: Conditionally add --disable-documentation to
  configure flags.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
---
 gnu/packages/linux.scm | 42 ++++++++++++++++++++++++++++++------------
 1 file changed, 30 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index a71100baab..e910c47ab9 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -5894,9 +5894,18 @@  (define-public btrfs-progs
     (arguments
      (list
       #:configure-flags
-      ;; The ‘Python support’ was never actually installed by previous
-      ;; versions of this package, but did prevent cross-compilation.
-      #~(list "--disable-python")
+      #~(append
+         ;; Without --disable-documentation, it complains about missing
+         ;; python-sphinx on systems where this package isn't available
+         ;; (because it requires Rust).
+         (if #$@(member (%current-system)
+                        (package-transitive-supported-systems
+                         python-sphinx))
+             '()
+             (list "--disable-documentation"))
+         ;; The ‘Python support’ was never actually installed by previous
+         ;; versions of this package, but did prevent cross-compilation.
+         (list "--disable-python"))
       #:phases #~(modify-phases %standard-phases
                    (add-after 'unpack 'patch-makefile
                      (lambda* (#:key outputs #:allow-other-keys)
@@ -5935,15 +5944,24 @@  (define-public btrfs-progs
                   `(,zlib "static")
                   `(,zstd "lib")
                   `(,zstd "static")))
-    (native-inputs (list pkg-config
-                         python-sphinx ;; For building documentation.
-                         acl           ;; For tests.
-                         lvm2          ;; For dmsetup.
-                         grep          ;; Need Perl regexp support.
-                         libaio
-                         liburing
-                         util-linux    ;; For fallocate.
-                         which))
+    (native-inputs
+     (append
+      ;; For building documentation. Since python-sphinx
+      ;; requires Rust, add it conditionally depending on such
+      ;; support.
+      (if (member (%current-system)
+                  (package-transitive-supported-systems
+                   python-sphinx))
+          (list python-sphinx)
+          '())
+      (list pkg-config
+            acl           ;; For tests.
+            lvm2          ;; For dmsetup.
+            grep          ;; Need Perl regexp support.
+            libaio
+            liburing
+            util-linux    ;; For fallocate.
+            which)))
     (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
     (synopsis "Create and manage btrfs copy-on-write file systems")
     (description