gnu: r-fourcseq: Move to (gnu packages bioconductor).
[jackhill/guix/guix.git] / gnu / packages / man.scm
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>
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)
28 #:use-module ((guix licenses) #:prefix license:)
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 (guix build-system ruby)
34 #:use-module (gnu packages dbm)
35 #:use-module (gnu packages flex)
36 #:use-module (gnu packages gawk)
37 #:use-module (gnu packages groff)
38 #:use-module (gnu packages less)
39 #:use-module (gnu packages perl)
40 #:use-module (gnu packages pkg-config)
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
72 to man pages in groff format or html. It features the usual man page items such
73 as description, options, see also, etc.")
74 (home-page "http://xmltoman.sourceforge.net/")
75 (license license:gpl2+)))
76
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
97 textfiles to roff for terminal display, and also to HTML for the web.")
98 (home-page "https://rtomayko.github.io/ronn/")
99 (license license:expat)))
100
101 (define-public libpipeline
102 (package
103 (name "libpipeline")
104 (version "1.5.3")
105 (source (origin
106 (method url-fetch)
107 (uri (string-append
108 "mirror://savannah/libpipeline/libpipeline-"
109 version ".tar.gz"))
110 (sha256
111 (base32
112 "1c5dl017xil2ssb6a5vg927bnsbc9vymfgi9ahvqbb8gypx0igsx"))))
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
118 a flexible and convenient way.")
119 (license license:gpl3+)))
120
121 (define-public man-db
122 (package
123 (name "man-db")
124 (version "2.9.3")
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
131 "1f4palf5bdyf3f8sa0981cqxn9cjcr2pz53ngrrsybb9n0da2nps"))))
132 (build-system gnu-build-system)
133 (arguments
134 `(#:phases
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?
145 (find-files "src/tests" ".*")))
146 #t)))
147 (add-after 'unpack 'patch-absolute-paths
148 (lambda* (#:key inputs #:allow-other-keys)
149 (substitute* "src/man.c"
150 (("\"iconv\"")
151 (string-append "\"" (which "iconv") "\"")))
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\"")))
160 #t)))
161 #:configure-flags
162 (let ((groff (assoc-ref %build-inputs "groff"))
163 (groff-minimal (assoc-ref %build-inputs "groff-minimal"))
164 (less (assoc-ref %build-inputs "less"))
165 (gzip (assoc-ref %build-inputs "gzip"))
166 (bzip2 (assoc-ref %build-inputs "bzip2"))
167 (xz (assoc-ref %build-inputs "xz"))
168 (util (assoc-ref %build-inputs "util-linux")))
169 ;; Invoke groff, less, gzip, bzip2, and xz directly from the store.
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"
176 (string-append "--with-pager=" less "/bin/less")
177 (string-append "--with-gzip=" gzip "/bin/gzip")
178 (string-append "--with-bzip2=" bzip2 "/bin/gzip")
179 (string-append "--with-xz=" xz "/bin/xz")
180 (string-append "--with-col=" util "/bin/col")
181 ;; The default systemd directories ignore --prefix.
182 (string-append "--with-systemdsystemunitdir="
183 %output "/lib/systemd/system")
184 (string-append "--with-systemdtmpfilesdir="
185 %output "/lib/tmpfiles.d"))
186 (map (lambda (prog)
187 (string-append "--with-" prog "=" groff-minimal
188 "/bin/" prog))
189 '("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))
190
191 ;; At run time we should refer to GROFF-MINIMAL, not GROFF (the latter
192 ;; pulls in Perl.)
193 #:disallowed-references (,groff)
194
195 #:modules ((guix build gnu-build-system)
196 (guix build utils)
197 (srfi srfi-1))))
198 (native-inputs
199 `(("pkg-config" ,pkg-config)
200 ("flex" ,flex)
201 ("groff" ,groff))) ;needed at build time (troff, grops, soelim, etc.)
202 (inputs
203 `(("gdbm" ,gdbm)
204 ("groff-minimal" ,groff-minimal)
205 ("less" ,less)
206 ("libpipeline" ,libpipeline)
207 ;; FIXME: 4.8 and later can use libseccomp, but it causes test
208 ;; failures in the build chroot.
209 ;;("libseccomp" ,libseccomp)
210 ("util-linux" ,util-linux)))
211 (native-search-paths
212 (list (search-path-specification
213 (variable "MANPATH")
214 (files '("share/man")))))
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
219 accessed using the man command. It uses a Berkeley DB database in place of
220 the traditional flat-text whatis databases.")
221 (license license:gpl2+)))
222
223 (define-public man-pages
224 (package
225 (name "man-pages")
226 (version "5.08")
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
236 (base32 "1xzp3f6wvw3wplk1a1x09zfv0jp0pdc9wh95czndh3h8z0qwv9yf"))))
237 (build-system gnu-build-system)
238 (arguments
239 '(#:phases (modify-phases %standard-phases (delete 'configure))
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
246 #:tests? #f
247 #:make-flags (list (string-append "MANDIR="
248 (assoc-ref %outputs "out")
249 "/share/man"))))
250 (home-page "https://www.kernel.org/doc/man-pages/")
251 (synopsis "Development manual pages from the Linux project")
252 (description
253 "This package provides traditional Unix \"man pages\" documenting the
254 Linux 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.
257 (license license:gpl2+)))
258
259 (define-public help2man
260 (package
261 (name "help2man")
262 (version "1.47.13")
263 (source
264 (origin
265 (method url-fetch)
266 (uri (string-append "mirror://gnu/help2man/help2man-"
267 version ".tar.xz"))
268 (sha256
269 (base32
270 "08q5arxz4j4pyx5q4712c2rn7p7dw7as9xg38yvmsh1c3ynvpy5p"))))
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)
278 ;; ("gettext" ,gettext-minimal)
279 ))
280 (native-inputs
281 `(("perl" ,perl)))
282 (home-page "https://www.gnu.org/software/help2man/")
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
287 automatically.")
288 (license license:gpl3+)))
289
290 (define-public scdoc
291 (package
292 (name "scdoc")
293 (version "1.10.1")
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
302 "13x7g1r56bshvfmlvapvz35ywnbgsh337kywb5kcv8nc6b3j3q40"))))
303 (build-system gnu-build-system)
304 (arguments
305 `(#:make-flags
306 (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out")))
307 #:phases
308 (modify-phases %standard-phases
309 (delete 'configure))))
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
313 in C99.")
314 ;; MIT license, see /share/doc/scdoc-1.6.0/COPYING.
315 (license license:expat)))
316
317 (define-public txt2man
318 (package
319 (name "txt2man")
320 (version "1.6.0")
321 (source
322 (origin
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))
328 (sha256
329 (base32
330 "1razjpvlcp85hqli77mwr9nmn5jnv3lm1fxbbqjpx1brv3h1lvm5"))))
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")))
335 #:phases (modify-phases %standard-phases (delete 'configure))))
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.")
341 (license license:gpl2+)))