From fe4a77e672174c326f7d8cf9ad7810ed34f1f4e0 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 29 Jan 2024 09:54:15 +0200 Subject: gnu: hexyl: Install man-page. * gnu/packages/rust-apps.scm (hexyl)[source]: Add snippet to fix the version string in the man-page. [arguments]: Add a phase to build the man-page. [native-inputs]: Add pandoc on systems where it is supported. Change-Id: I1dc98862020a5176f15adb8a2579f249c233f2da --- gnu/packages/rust-apps.scm | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'gnu/packages/rust-apps.scm') diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index f5d4062d2c..fe27bdf675 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -657,7 +657,11 @@ (define-public hexyl (uri (crate-uri "hexyl" version)) (file-name (string-append name "-" version ".tar.gz")) (sha256 - (base32 "0fhbc4ibpbbgcgx2v6wzxcn63jz76cvdp2f8jdg747h65hvp5bcm")))) + (base32 "0fhbc4ibpbbgcgx2v6wzxcn63jz76cvdp2f8jdg747h65hvp5bcm")) + (snippet + #~(begin (use-modules (guix build utils)) + (substitute* "doc/hexyl.1.md" + (("0\\.12\\.0") "0.14.0")))))) (build-system cargo-build-system) (arguments `(#:install-source? #f @@ -673,7 +677,25 @@ (define-public hexyl #:cargo-development-inputs (("rust-assert-cmd" ,rust-assert-cmd-2) ("rust-predicates" ,rust-predicates-3) - ("rust-pretty-assertions" ,rust-pretty-assertions-1)))) + ("rust-pretty-assertions" ,rust-pretty-assertions-1)) + #:phases + (modify-phases %standard-phases + (add-after 'install 'install-manual + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((man1 (string-append (assoc-ref outputs "out") + "/share/man/man1"))) + (when (assoc-ref inputs "pandoc") + (mkdir-p man1) + (with-output-to-file (string-append man1 "/hexyl.1") + (lambda _ + (invoke "pandoc" "--standalone" + "--from" "markdown" + "--to" "man" + "doc/hexyl.1.md")))))))))) + (native-inputs + (if (supported-package? pandoc) + (list pandoc) + '())) (home-page "https://github.com/sharkdp/hexyl") (synopsis "Command-line hex viewer") (description -- cgit v1.2.3