mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-26 06:18:07 -05:00
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.
This commit is contained in:
parent
62f80d215e
commit
1590d6d58e
1 changed files with 21 additions and 9 deletions
|
@ -403,20 +403,26 @@ (define-public exa
|
|||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'build 'build-manual
|
||||
(lambda _
|
||||
(lambda* (#:key inputs #:allow-other-keys)
|
||||
(when (assoc-ref inputs "pandoc")
|
||||
(map (lambda (page)
|
||||
(system (string-append
|
||||
"pandoc --standalone -f markdown -t man man/"
|
||||
page ".md > " page)))
|
||||
`("exa.1" "exa_colors.5"))))
|
||||
(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 @@ (define-public exa
|
|||
(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
|
||||
|
|
Loading…
Reference in a new issue