gnu: commencement: bash-mesboot0: Break store file-name in comment.
[jackhill/guix/guix.git] / gnu / packages / man.scm
CommitLineData
cd2e0b64 1;;; GNU Guix --- Functional package management for GNU
5e9ce98a 2;;; Copyright © 2012, 2014, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
cd2e0b64 3;;; Copyright © 2014 David Thompson <dthompson2@worcester.edu>
e79b3c37 4;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
d2eb275a 5;;; Copyright © 2015 Alex Kost <alezost@gmail.com>
fcc8f2fc 6;;; Copyright © 2015, 2016, 2020 Efraim Flashner <efraim@flashner.co.il>
330e2796 7;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
e1c3ffcf 8;;; Copyright © 2018, 2019 Rutger Helling <rhelling@mykolab.com>
073f5f20 9;;; Copyright © 2018, 2019 Marius Bakke <mbakke@fastmail.com>
4a5ae4eb 10;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
cd2e0b64
DT
11;;;
12;;; This file is part of GNU Guix.
13;;;
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.
18;;;
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.
23;;;
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/>.
26
27(define-module (gnu packages man)
9e371e95 28 #:use-module ((guix licenses) #:prefix license:)
fcc8f2fc 29 #:use-module (guix git-download)
cd2e0b64
DT
30 #:use-module (guix download)
31 #:use-module (guix packages)
67ca0a01 32 #:use-module (guix build-system gnu)
e445ae9a 33 #:use-module (guix build-system ruby)
255d1bbe 34 #:use-module (gnu packages dbm)
67ca0a01 35 #:use-module (gnu packages flex)
dd6b54b8 36 #:use-module (gnu packages gawk)
67ca0a01
DT
37 #:use-module (gnu packages groff)
38 #:use-module (gnu packages less)
cb3da233 39 #:use-module (gnu packages perl)
d2eb275a 40 #:use-module (gnu packages pkg-config)
e047b265
RG
41 #:use-module (gnu packages linux)
42 #:use-module (gnu packages xml))
43
44(define-public xmltoman
45 (package
46 (name "xmltoman")
47 (version "0.4")
48 (source
49 (origin
50 (method url-fetch)
51 (uri
52 (string-append "https://sourceforge.net/projects/xmltoman/files/"
53 "xmltoman/xmltoman-" version ".tar.gz/xmltoman-"
54 version ".tar.gz/download"))
55 (sha256
56 (base32 "1c0lvzr7kdy63wbn1jv6s126ds7add3pxqb0vlxd3v5a2sir91wl"))))
57 (build-system gnu-build-system)
58 (arguments
59 `(#:tests? #f ; No tests
60 #:make-flags
61 (list
62 (string-append "PREFIX="
63 (assoc-ref %outputs "out")))
64 #:phases
65 (modify-phases %standard-phases
66 (delete 'configure))))
67 (propagated-inputs
68 `(("perl" ,perl)
69 ("perl-xml-parser" ,perl-xml-parser)))
70 (synopsis "XML to Man converter")
71 (description "XMLtoMan and XMLMantoHTML are two small scripts to convert xml
72to man pages in groff format or html. It features the usual man page items such
73as description, options, see also, etc.")
74 (home-page "http://xmltoman.sourceforge.net/")
9e371e95 75 (license license:gpl2+)))
cd2e0b64 76
e445ae9a
RG
77(define-public ronn
78 (package
79 (name "ronn")
80 (version "0.7.3")
81 (source
82 (origin
83 (method git-fetch)
84 (uri
85 (git-reference
86 (url "https://github.com/rtomayko/ronn.git")
87 (commit version)))
88 (file-name
89 (git-file-name name version))
90 (sha256
91 (base32 "0fkniz7j1jp8v3i05m6hks3nsh6rzvjfi0ichpi7h4gwk5byxb94"))))
92 (build-system ruby-build-system)
93 (arguments
94 `(#:tests? #f)) ; Library hpricot not available
95 (synopsis "Manual authoring tool")
96 (description "Ronn builds manuals. It converts simple, human readable
97textfiles to roff for terminal display, and also to HTML for the web.")
98 (home-page "https://rtomayko.github.io/ronn/")
9e371e95 99 (license license:expat)))
e445ae9a 100
cd2e0b64
DT
101(define-public libpipeline
102 (package
103 (name "libpipeline")
d74a85ec 104 (version "1.5.3")
cd2e0b64
DT
105 (source (origin
106 (method url-fetch)
107 (uri (string-append
108 "mirror://savannah/libpipeline/libpipeline-"
109 version ".tar.gz"))
110 (sha256
111 (base32
d74a85ec 112 "1c5dl017xil2ssb6a5vg927bnsbc9vymfgi9ahvqbb8gypx0igsx"))))
cd2e0b64
DT
113 (build-system gnu-build-system)
114 (home-page "http://libpipeline.nongnu.org/")
115 (synopsis "C library for manipulating pipelines of subprocesses")
116 (description
117 "libpipeline is a C library for manipulating pipelines of subprocesses in
118a flexible and convenient way.")
9e371e95 119 (license license:gpl3+)))
67ca0a01
DT
120
121(define-public man-db
122 (package
123 (name "man-db")
eee9eab7 124 (version "2.9.3")
67ca0a01
DT
125 (source (origin
126 (method url-fetch)
127 (uri (string-append "mirror://savannah/man-db/man-db-"
128 version ".tar.xz"))
129 (sha256
130 (base32
eee9eab7 131 "1f4palf5bdyf3f8sa0981cqxn9cjcr2pz53ngrrsybb9n0da2nps"))))
67ca0a01
DT
132 (build-system gnu-build-system)
133 (arguments
c85f0691 134 `(#:phases
e79b3c37
RW
135 (modify-phases %standard-phases
136 (add-after 'patch-source-shebangs 'patch-test-shebangs
137 (lambda* (#:key outputs #:allow-other-keys)
138 ;; Patch shebangs in test scripts.
139 (let ((out (assoc-ref outputs "out")))
140 (for-each (lambda (file)
141 (substitute* file
142 (("#! /bin/sh")
143 (string-append "#!" (which "sh")))))
144 (remove file-is-directory?
ff57d5b1
MW
145 (find-files "src/tests" ".*")))
146 #t)))
073f5f20 147 (add-after 'unpack 'patch-absolute-paths
ea55a395
RW
148 (lambda* (#:key inputs #:allow-other-keys)
149 (substitute* "src/man.c"
150 (("\"iconv\"")
151 (string-append "\"" (which "iconv") "\"")))
073f5f20
MB
152 ;; Embed an absolute reference to "preconv", otherwise it
153 ;; falls back to searching in PATH and ultimately fails
154 ;; to render unicode data (see <https://bugs.gnu.org/30785>).
155 (substitute* "lib/encodings.c"
156 (("groff_preconv = NULL")
157 (string-append "groff_preconv = \""
158 (assoc-ref inputs "groff-minimal")
159 "/bin/preconv\"")))
ea55a395 160 #t)))
67ca0a01
DT
161 #:configure-flags
162 (let ((groff (assoc-ref %build-inputs "groff"))
c85f0691 163 (groff-minimal (assoc-ref %build-inputs "groff-minimal"))
67ca0a01
DT
164 (less (assoc-ref %build-inputs "less"))
165 (gzip (assoc-ref %build-inputs "gzip"))
d2eb275a
AK
166 (bzip2 (assoc-ref %build-inputs "bzip2"))
167 (xz (assoc-ref %build-inputs "xz"))
168 (util (assoc-ref %build-inputs "util-linux")))
67ca0a01 169 ;; Invoke groff, less, gzip, bzip2, and xz directly from the store.
28790093
LF
170 (append (list ;; Disable setuid man user.
171 "--disable-setuid"
172 ;; Don't constrain ownership of system-wide cache files.
173 ;; Otherwise creating the manpage database fails with
174 ;; man-db > 2.7.5.
175 "--disable-cache-owner"
67ca0a01
DT
176 (string-append "--with-pager=" less "/bin/less")
177 (string-append "--with-gzip=" gzip "/bin/gzip")
178 (string-append "--with-bzip2=" bzip2 "/bin/gzip")
d2eb275a 179 (string-append "--with-xz=" xz "/bin/xz")
a37f9722 180 (string-append "--with-col=" util "/bin/col")
4ac71127
TGR
181 ;; The default systemd directories ignore --prefix.
182 (string-append "--with-systemdsystemunitdir="
183 %output "/lib/systemd/system")
a37f9722
AK
184 (string-append "--with-systemdtmpfilesdir="
185 %output "/lib/tmpfiles.d"))
67ca0a01 186 (map (lambda (prog)
c85f0691
LC
187 (string-append "--with-" prog "=" groff-minimal
188 "/bin/" prog))
67ca0a01 189 '("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))
c85f0691
LC
190
191 ;; At run time we should refer to GROFF-MINIMAL, not GROFF (the latter
192 ;; pulls in Perl.)
193 #:disallowed-references (,groff)
194
67ca0a01
DT
195 #:modules ((guix build gnu-build-system)
196 (guix build utils)
197 (srfi srfi-1))))
198 (native-inputs
c85f0691 199 `(("pkg-config" ,pkg-config)
4a5ae4eb 200 ("flex" ,flex)
c85f0691 201 ("groff" ,groff))) ;needed at build time (troff, grops, soelim, etc.)
67ca0a01 202 (inputs
4a5ae4eb 203 `(("gdbm" ,gdbm)
c85f0691 204 ("groff-minimal" ,groff-minimal)
67ca0a01 205 ("less" ,less)
d2eb275a 206 ("libpipeline" ,libpipeline)
880e2170
MB
207 ;; FIXME: 4.8 and later can use libseccomp, but it causes test
208 ;; failures in the build chroot.
209 ;;("libseccomp" ,libseccomp)
d2eb275a 210 ("util-linux" ,util-linux)))
2b42718b
LC
211 (native-search-paths
212 (list (search-path-specification
213 (variable "MANPATH")
af070955 214 (files '("share/man")))))
67ca0a01
DT
215 (home-page "http://man-db.nongnu.org/")
216 (synopsis "Standard Unix documentation system")
217 (description
218 "Man-db is an implementation of the standard Unix documentation system
219accessed using the man command. It uses a Berkeley DB database in place of
220the traditional flat-text whatis databases.")
9e371e95 221 (license license:gpl2+)))
cb3da233 222
c5cd288b
LC
223(define-public man-pages
224 (package
225 (name "man-pages")
0d0c5185 226 (version "5.08")
792d3ed7
TGR
227 (source
228 (origin
229 (method url-fetch)
230 (uri
231 (list (string-append "mirror://kernel.org/linux/docs/man-pages/"
232 "man-pages-" version ".tar.xz")
233 (string-append "mirror://kernel.org/linux/docs/man-pages/Archive/"
234 "man-pages-" version ".tar.xz")))
235 (sha256
0d0c5185 236 (base32 "1xzp3f6wvw3wplk1a1x09zfv0jp0pdc9wh95czndh3h8z0qwv9yf"))))
c5cd288b
LC
237 (build-system gnu-build-system)
238 (arguments
dc1d3cde 239 '(#:phases (modify-phases %standard-phases (delete 'configure))
3b509259
LC
240
241 ;; The 'all' target depends on three targets that directly populate
242 ;; $(MANDIR) based on its current contents. Doing that in parallel
243 ;; leads to undefined behavior (see <http://bugs.gnu.org/18701>.)
244 #:parallel-build? #f
245
c5cd288b
LC
246 #:tests? #f
247 #:make-flags (list (string-append "MANDIR="
248 (assoc-ref %outputs "out")
249 "/share/man"))))
4e128dd5 250 (home-page "https://www.kernel.org/doc/man-pages/")
c5cd288b
LC
251 (synopsis "Development manual pages from the Linux project")
252 (description
253 "This package provides traditional Unix \"man pages\" documenting the
254Linux kernel and C library interfaces employed by user-space programs.")
255
256 ;; Each man page has its own license; some are GPLv2+, some are MIT/X11.
9e371e95 257 (license license:gpl2+)))
c5cd288b 258
cb3da233
DT
259(define-public help2man
260 (package
261 (name "help2man")
f605eef2 262 (version "1.47.13")
cb3da233
DT
263 (source
264 (origin
265 (method url-fetch)
266 (uri (string-append "mirror://gnu/help2man/help2man-"
267 version ".tar.xz"))
268 (sha256
269 (base32
f605eef2 270 "08q5arxz4j4pyx5q4712c2rn7p7dw7as9xg38yvmsh1c3ynvpy5p"))))
cb3da233
DT
271 (build-system gnu-build-system)
272 (arguments `(;; There's no `check' target.
273 #:tests? #f))
274 (inputs
275 `(("perl" ,perl)
276 ;; TODO: Add these optional dependencies.
277 ;; ("perl-LocaleGettext" ,perl-LocaleGettext)
b94a6ca0 278 ;; ("gettext" ,gettext-minimal)
cb3da233 279 ))
642328ab
MO
280 (native-inputs
281 `(("perl" ,perl)))
6fd52309 282 (home-page "https://www.gnu.org/software/help2man/")
cb3da233
DT
283 (synopsis "Automatically generate man pages from program --help")
284 (description
285 "GNU help2man is a program that converts the output of standard
286\"--help\" and \"--version\" command-line arguments into a manual page
287automatically.")
9e371e95 288 (license license:gpl3+)))
dd6b54b8 289
e2dd54c0
RH
290(define-public scdoc
291 (package
292 (name "scdoc")
031610aa 293 (version "1.10.1")
e2dd54c0
RH
294 (source
295 (origin
296 (method url-fetch)
297 (uri (string-append "https://git.sr.ht/%7Esircmpwn/scdoc/archive/" version
298 ".tar.gz"))
299 (file-name (string-append name "-" version ".tar.gz"))
300 (sha256
301 (base32
031610aa 302 "13x7g1r56bshvfmlvapvz35ywnbgsh337kywb5kcv8nc6b3j3q40"))))
e2dd54c0
RH
303 (build-system gnu-build-system)
304 (arguments
84836379
BT
305 `(#:make-flags
306 (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out")))
e2dd54c0
RH
307 #:phases
308 (modify-phases %standard-phases
84836379 309 (delete 'configure))))
e2dd54c0
RH
310 (home-page "https://git.sr.ht/~sircmpwn/scdoc")
311 (synopsis "Simple man page generator")
312 (description "scdoc is a simple man page generator written for POSIX systems
313in C99.")
314 ;; MIT license, see /share/doc/scdoc-1.6.0/COPYING.
9e371e95 315 (license license:expat)))
e2dd54c0 316
dd6b54b8
RW
317(define-public txt2man
318 (package
319 (name "txt2man")
53c36279 320 (version "1.6.0")
dd6b54b8
RW
321 (source
322 (origin
fcc8f2fc
EF
323 (method git-fetch)
324 (uri (git-reference
325 (url "https://github.com/mvertes/txt2man")
326 (commit (string-append "txt2man-" version))))
327 (file-name (git-file-name name version))
dd6b54b8
RW
328 (sha256
329 (base32
fcc8f2fc 330 "1razjpvlcp85hqli77mwr9nmn5jnv3lm1fxbbqjpx1brv3h1lvm5"))))
dd6b54b8
RW
331 (build-system gnu-build-system)
332 (arguments
333 `(#:tests? #f ; no "check" target
334 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
dc1d3cde 335 #:phases (modify-phases %standard-phases (delete 'configure))))
dd6b54b8
RW
336 (inputs
337 `(("gawk" ,gawk)))
338 (home-page "https://github.com/mvertes/txt2man")
339 (synopsis "Convert text to man page")
340 (description "Txt2man converts flat ASCII text to man page format.")
9e371e95 341 (license license:gpl2+)))