diff options
author | Efraim Flashner <efraim@flashner.co.il> | 2022-09-28 13:47:54 +0300 |
---|---|---|
committer | Efraim Flashner <efraim@flashner.co.il> | 2022-09-28 13:52:12 +0300 |
commit | 1590d6d58e4d1dcb482982a88c7eba70c41bc226 (patch) | |
tree | 998539992a374739dba8114fb848d14739adce26 /gnu/packages/rust-apps.scm | |
parent | 62f80d215eea62b120416d638f62668482d40ffb (diff) | |
download | guix-1590d6d58e4d1dcb482982a88c7eba70c41bc226.tar guix-1590d6d58e4d1dcb482982a88c7eba70c41bc226.tar.gz |
gnu: exa: Only build with pandoc when supported.
* gnu/packages/rust-apps.scm (exa)[arguments]: Adjust custom
'build-manual phase to only build when pandoc is available. Adjust
custom 'install-extras to only install man pages when they are
available.
[native-inputs]: Only include pandoc on systems where it is supported.
Diffstat (limited to 'gnu/packages/rust-apps.scm')
-rw-r--r-- | gnu/packages/rust-apps.scm | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index bced34bfdb..74581bc1e5 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -403,20 +403,26 @@ Features include: #:phases (modify-phases %standard-phases (add-after 'build 'build-manual - (lambda _ - (map (lambda (page) - (system (string-append - "pandoc --standalone -f markdown -t man man/" - page ".md > " page))) - `("exa.1" "exa_colors.5")))) + (lambda* (#:key inputs #:allow-other-keys) + (when (assoc-ref inputs "pandoc") + (map (lambda (page) + (with-output-to-file page + (lambda _ + (invoke "pandoc" "--standalone" + "-f" "markdown" + "-t" "man" + (string-append "man/" page ".md"))))) + (list "exa.1" "exa_colors.5"))))) (add-after 'install 'install-extras (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (share (string-append out "/share")) (man1 (string-append share "/man/man1")) (man5 (string-append share "/man/man5"))) - (install-file "exa.1" man1) - (install-file "exa_colors.5" man5) + (when (file-exists? "exa.1") + (install-file "exa.1" man1)) + (when (file-exists? "exa_colors.5") + (install-file "exa_colors.5" man5)) (mkdir-p (string-append out "/etc/bash_completion.d")) (mkdir-p (string-append share "/fish/vendor_completions.d")) (mkdir-p (string-append share "/zsh/site-functions")) @@ -429,7 +435,13 @@ Features include: (string-append share "/zsh/site-functions/_exa")))))))) (inputs (list libgit2 zlib)) - (native-inputs (list pkg-config pandoc)) + (native-inputs + (append + (list pkg-config) + (if (member (%current-system) + (package-transitive-supported-systems pandoc)) + (list pandoc) + '()))) (home-page "https://the.exa.website/") (synopsis "Modern replacement for ls") (description "@code{exa} is a modern replacement for the command-line |