1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2014, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014 David Thompson <dthompson2@worcester.edu>
4 ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2015 Alex Kost <alezost@gmail.com>
6 ;;; Copyright © 2015, 2016, 2020 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; Copyright © 2018, 2019 Rutger Helling <rhelling@mykolab.com>
9 ;;; Copyright © 2018, 2019 Marius Bakke <mbakke@fastmail.com>
10 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
12 ;;; This file is part of GNU Guix.
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27 (define-module (gnu packages man)
28 #:use-module (guix licenses)
29 #:use-module (guix git-download)
30 #:use-module (guix download)
31 #:use-module (guix packages)
32 #:use-module (guix build-system gnu)
33 #:use-module (gnu packages dbm)
34 #:use-module (gnu packages flex)
35 #:use-module (gnu packages gawk)
36 #:use-module (gnu packages groff)
37 #:use-module (gnu packages less)
38 #:use-module (gnu packages perl)
39 #:use-module (gnu packages pkg-config)
40 #:use-module (gnu packages linux))
42 (define-public libpipeline
49 "mirror://savannah/libpipeline/libpipeline-"
53 "1ysrn22ixd4nmggy6f7qcsm7waadmlbg2i0n9mh6g7dfq54wcngx"))))
54 (build-system gnu-build-system)
55 (home-page "http://libpipeline.nongnu.org/")
56 (synopsis "C library for manipulating pipelines of subprocesses")
58 "libpipeline is a C library for manipulating pipelines of subprocesses in
59 a flexible and convenient way.")
68 (uri (string-append "mirror://savannah/man-db/man-db-"
72 "1f4palf5bdyf3f8sa0981cqxn9cjcr2pz53ngrrsybb9n0da2nps"))))
73 (build-system gnu-build-system)
76 (modify-phases %standard-phases
77 (add-after 'patch-source-shebangs 'patch-test-shebangs
78 (lambda* (#:key outputs #:allow-other-keys)
79 ;; Patch shebangs in test scripts.
80 (let ((out (assoc-ref outputs "out")))
81 (for-each (lambda (file)
84 (string-append "#!" (which "sh")))))
85 (remove file-is-directory?
86 (find-files "src/tests" ".*")))
88 (add-after 'unpack 'patch-absolute-paths
89 (lambda* (#:key inputs #:allow-other-keys)
90 (substitute* "src/man.c"
92 (string-append "\"" (which "iconv") "\"")))
93 ;; Embed an absolute reference to "preconv", otherwise it
94 ;; falls back to searching in PATH and ultimately fails
95 ;; to render unicode data (see <https://bugs.gnu.org/30785>).
96 (substitute* "lib/encodings.c"
97 (("groff_preconv = NULL")
98 (string-append "groff_preconv = \""
99 (assoc-ref inputs "groff-minimal")
103 (let ((groff (assoc-ref %build-inputs "groff"))
104 (groff-minimal (assoc-ref %build-inputs "groff-minimal"))
105 (less (assoc-ref %build-inputs "less"))
106 (gzip (assoc-ref %build-inputs "gzip"))
107 (bzip2 (assoc-ref %build-inputs "bzip2"))
108 (xz (assoc-ref %build-inputs "xz"))
109 (util (assoc-ref %build-inputs "util-linux")))
110 ;; Invoke groff, less, gzip, bzip2, and xz directly from the store.
111 (append (list ;; Disable setuid man user.
113 ;; Don't constrain ownership of system-wide cache files.
114 ;; Otherwise creating the manpage database fails with
116 "--disable-cache-owner"
117 (string-append "--with-pager=" less "/bin/less")
118 (string-append "--with-gzip=" gzip "/bin/gzip")
119 (string-append "--with-bzip2=" bzip2 "/bin/gzip")
120 (string-append "--with-xz=" xz "/bin/xz")
121 (string-append "--with-col=" util "/bin/col")
122 ;; The default systemd directories ignore --prefix.
123 (string-append "--with-systemdsystemunitdir="
124 %output "/lib/systemd/system")
125 (string-append "--with-systemdtmpfilesdir="
126 %output "/lib/tmpfiles.d"))
128 (string-append "--with-" prog "=" groff-minimal
130 '("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))
132 ;; At run time we should refer to GROFF-MINIMAL, not GROFF (the latter
134 #:disallowed-references (,groff)
136 #:modules ((guix build gnu-build-system)
140 `(("pkg-config" ,pkg-config)
142 ("groff" ,groff))) ;needed at build time (troff, grops, soelim, etc.)
145 ("groff-minimal" ,groff-minimal)
147 ("libpipeline" ,libpipeline)
148 ;; FIXME: 4.8 and later can use libseccomp, but it causes test
149 ;; failures in the build chroot.
150 ;;("libseccomp" ,libseccomp)
151 ("util-linux" ,util-linux)))
153 (list (search-path-specification
155 (files '("share/man")))))
156 (home-page "http://man-db.nongnu.org/")
157 (synopsis "Standard Unix documentation system")
159 "Man-db is an implementation of the standard Unix documentation system
160 accessed using the man command. It uses a Berkeley DB database in place of
161 the traditional flat-text whatis databases.")
164 (define-public man-pages
172 (list (string-append "mirror://kernel.org/linux/docs/man-pages/"
173 "man-pages-" version ".tar.xz")
174 (string-append "mirror://kernel.org/linux/docs/man-pages/Archive/"
175 "man-pages-" version ".tar.xz")))
177 (base32 "13b3q7c67r0wkla4pdihl1qh09k67ms2z5jgzfqgpdqqy6mgziwd"))))
178 (build-system gnu-build-system)
180 '(#:phases (modify-phases %standard-phases (delete 'configure))
182 ;; The 'all' target depends on three targets that directly populate
183 ;; $(MANDIR) based on its current contents. Doing that in parallel
184 ;; leads to undefined behavior (see <http://bugs.gnu.org/18701>.)
188 #:make-flags (list (string-append "MANDIR="
189 (assoc-ref %outputs "out")
191 (home-page "https://www.kernel.org/doc/man-pages/")
192 (synopsis "Development manual pages from the Linux project")
194 "This package provides traditional Unix \"man pages\" documenting the
195 Linux kernel and C library interfaces employed by user-space programs.")
197 ;; Each man page has its own license; some are GPLv2+, some are MIT/X11.
200 (define-public help2man
207 (uri (string-append "mirror://gnu/help2man/help2man-"
211 "08q5arxz4j4pyx5q4712c2rn7p7dw7as9xg38yvmsh1c3ynvpy5p"))))
212 (build-system gnu-build-system)
213 (arguments `(;; There's no `check' target.
217 ;; TODO: Add these optional dependencies.
218 ;; ("perl-LocaleGettext" ,perl-LocaleGettext)
219 ;; ("gettext" ,gettext-minimal)
223 (home-page "https://www.gnu.org/software/help2man/")
224 (synopsis "Automatically generate man pages from program --help")
226 "GNU help2man is a program that converts the output of standard
227 \"--help\" and \"--version\" command-line arguments into a manual page
238 (uri (string-append "https://git.sr.ht/%7Esircmpwn/scdoc/archive/" version
240 (file-name (string-append name "-" version ".tar.gz"))
243 "13x7g1r56bshvfmlvapvz35ywnbgsh337kywb5kcv8nc6b3j3q40"))))
244 (build-system gnu-build-system)
247 (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out")))
249 (modify-phases %standard-phases
250 (delete 'configure))))
251 (home-page "https://git.sr.ht/~sircmpwn/scdoc")
252 (synopsis "Simple man page generator")
253 (description "scdoc is a simple man page generator written for POSIX systems
255 ;; MIT license, see /share/doc/scdoc-1.6.0/COPYING.
258 (define-public txt2man
266 (url "https://github.com/mvertes/txt2man")
267 (commit (string-append "txt2man-" version))))
268 (file-name (git-file-name name version))
271 "1razjpvlcp85hqli77mwr9nmn5jnv3lm1fxbbqjpx1brv3h1lvm5"))))
272 (build-system gnu-build-system)
274 `(#:tests? #f ; no "check" target
275 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
276 #:phases (modify-phases %standard-phases (delete 'configure))))
279 (home-page "https://github.com/mvertes/txt2man")
280 (synopsis "Convert text to man page")
281 (description "Txt2man converts flat ASCII text to man page format.")