gnu: mame: Update to 0.206.
[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>
a916c826 6;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
4b179fb2 7;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
e2dd54c0 8;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
073f5f20 9;;; Copyright © 2018, 2019 Marius Bakke <mbakke@fastmail.com>
cd2e0b64
DT
10;;;
11;;; This file is part of GNU Guix.
12;;;
13;;; GNU Guix is free software; you can redistribute it and/or modify it
14;;; under the terms of the GNU General Public License as published by
15;;; the Free Software Foundation; either version 3 of the License, or (at
16;;; your option) any later version.
17;;;
18;;; GNU Guix is distributed in the hope that it will be useful, but
19;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;;; GNU General Public License for more details.
22;;;
23;;; You should have received a copy of the GNU General Public License
24;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26(define-module (gnu packages man)
27 #:use-module (guix licenses)
28 #:use-module (guix download)
29 #:use-module (guix packages)
67ca0a01 30 #:use-module (guix build-system gnu)
255d1bbe 31 #:use-module (gnu packages dbm)
67ca0a01 32 #:use-module (gnu packages flex)
dd6b54b8 33 #:use-module (gnu packages gawk)
67ca0a01
DT
34 #:use-module (gnu packages groff)
35 #:use-module (gnu packages less)
cb3da233 36 #:use-module (gnu packages perl)
d2eb275a
AK
37 #:use-module (gnu packages pkg-config)
38 #:use-module (gnu packages linux))
cd2e0b64
DT
39
40(define-public libpipeline
41 (package
42 (name "libpipeline")
97156ba2 43 (version "1.5.0")
cd2e0b64
DT
44 (source (origin
45 (method url-fetch)
46 (uri (string-append
47 "mirror://savannah/libpipeline/libpipeline-"
48 version ".tar.gz"))
49 (sha256
50 (base32
97156ba2 51 "0avg525wvifcvjrwa6i1r6kvahmsswj0mpxrsxzzdzra9wpf2whd"))))
cd2e0b64
DT
52 (build-system gnu-build-system)
53 (home-page "http://libpipeline.nongnu.org/")
54 (synopsis "C library for manipulating pipelines of subprocesses")
55 (description
56 "libpipeline is a C library for manipulating pipelines of subprocesses in
57a flexible and convenient way.")
58 (license gpl3+)))
67ca0a01
DT
59
60(define-public man-db
61 (package
62 (name "man-db")
c33a27ce 63 (version "2.8.3")
67ca0a01
DT
64 (source (origin
65 (method url-fetch)
66 (uri (string-append "mirror://savannah/man-db/man-db-"
67 version ".tar.xz"))
68 (sha256
69 (base32
c33a27ce 70 "1b641kcgjvyc41pj67dn4p0zvwlj1vx3l6nf7qdcc7kf6v5a2cjr"))))
67ca0a01
DT
71 (build-system gnu-build-system)
72 (arguments
c85f0691 73 `(#:phases
e79b3c37
RW
74 (modify-phases %standard-phases
75 (add-after 'patch-source-shebangs 'patch-test-shebangs
76 (lambda* (#:key outputs #:allow-other-keys)
77 ;; Patch shebangs in test scripts.
78 (let ((out (assoc-ref outputs "out")))
79 (for-each (lambda (file)
80 (substitute* file
81 (("#! /bin/sh")
82 (string-append "#!" (which "sh")))))
83 (remove file-is-directory?
ff57d5b1
MW
84 (find-files "src/tests" ".*")))
85 #t)))
073f5f20 86 (add-after 'unpack 'patch-absolute-paths
ea55a395
RW
87 (lambda* (#:key inputs #:allow-other-keys)
88 (substitute* "src/man.c"
89 (("\"iconv\"")
90 (string-append "\"" (which "iconv") "\"")))
073f5f20
MB
91 ;; Embed an absolute reference to "preconv", otherwise it
92 ;; falls back to searching in PATH and ultimately fails
93 ;; to render unicode data (see <https://bugs.gnu.org/30785>).
94 (substitute* "lib/encodings.c"
95 (("groff_preconv = NULL")
96 (string-append "groff_preconv = \""
97 (assoc-ref inputs "groff-minimal")
98 "/bin/preconv\"")))
ea55a395 99 #t)))
67ca0a01
DT
100 #:configure-flags
101 (let ((groff (assoc-ref %build-inputs "groff"))
c85f0691 102 (groff-minimal (assoc-ref %build-inputs "groff-minimal"))
67ca0a01
DT
103 (less (assoc-ref %build-inputs "less"))
104 (gzip (assoc-ref %build-inputs "gzip"))
d2eb275a
AK
105 (bzip2 (assoc-ref %build-inputs "bzip2"))
106 (xz (assoc-ref %build-inputs "xz"))
107 (util (assoc-ref %build-inputs "util-linux")))
67ca0a01 108 ;; Invoke groff, less, gzip, bzip2, and xz directly from the store.
28790093
LF
109 (append (list ;; Disable setuid man user.
110 "--disable-setuid"
111 ;; Don't constrain ownership of system-wide cache files.
112 ;; Otherwise creating the manpage database fails with
113 ;; man-db > 2.7.5.
114 "--disable-cache-owner"
67ca0a01
DT
115 (string-append "--with-pager=" less "/bin/less")
116 (string-append "--with-gzip=" gzip "/bin/gzip")
117 (string-append "--with-bzip2=" bzip2 "/bin/gzip")
d2eb275a 118 (string-append "--with-xz=" xz "/bin/xz")
a37f9722
AK
119 (string-append "--with-col=" util "/bin/col")
120 ;; Default value is "/usr/lib/tmpfiles.d" (not
121 ;; prefix-sensitive).
122 (string-append "--with-systemdtmpfilesdir="
123 %output "/lib/tmpfiles.d"))
67ca0a01 124 (map (lambda (prog)
c85f0691
LC
125 (string-append "--with-" prog "=" groff-minimal
126 "/bin/" prog))
67ca0a01 127 '("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))
c85f0691
LC
128
129 ;; At run time we should refer to GROFF-MINIMAL, not GROFF (the latter
130 ;; pulls in Perl.)
131 #:disallowed-references (,groff)
132
67ca0a01
DT
133 #:modules ((guix build gnu-build-system)
134 (guix build utils)
135 (srfi srfi-1))))
136 (native-inputs
c85f0691
LC
137 `(("pkg-config" ,pkg-config)
138 ("groff" ,groff))) ;needed at build time (troff, grops, soelim, etc.)
67ca0a01
DT
139 (inputs
140 `(("flex" ,flex)
141 ("gdbm" ,gdbm)
c85f0691 142 ("groff-minimal" ,groff-minimal)
67ca0a01 143 ("less" ,less)
d2eb275a 144 ("libpipeline" ,libpipeline)
880e2170
MB
145 ;; FIXME: 4.8 and later can use libseccomp, but it causes test
146 ;; failures in the build chroot.
147 ;;("libseccomp" ,libseccomp)
d2eb275a 148 ("util-linux" ,util-linux)))
2b42718b
LC
149 (native-search-paths
150 (list (search-path-specification
151 (variable "MANPATH")
af070955 152 (files '("share/man")))))
67ca0a01
DT
153 (home-page "http://man-db.nongnu.org/")
154 (synopsis "Standard Unix documentation system")
155 (description
156 "Man-db is an implementation of the standard Unix documentation system
157accessed using the man command. It uses a Berkeley DB database in place of
158the traditional flat-text whatis databases.")
159 (license gpl2+)))
cb3da233 160
c5cd288b
LC
161(define-public man-pages
162 (package
163 (name "man-pages")
0ef3c023 164 (version "4.16")
c5cd288b
LC
165 (source (origin
166 (method url-fetch)
a916c826
EF
167 (uri
168 (list
169 (string-append
dcd3ed9c 170 "mirror://kernel.org/linux/docs/man-pages/man-pages-"
a916c826
EF
171 version ".tar.xz")
172 (string-append
173 "mirror://kernel.org/linux/docs/man-pages/Archive/"
174 "man-pages-" version ".tar.xz")))
c5cd288b
LC
175 (sha256
176 (base32
0ef3c023 177 "1d2d6llazg3inwjiz22cn46mbm5ydpbyh9qb55z4j3nm4w6wrzs7"))))
c5cd288b
LC
178 (build-system gnu-build-system)
179 (arguments
dc1d3cde 180 '(#:phases (modify-phases %standard-phases (delete 'configure))
3b509259
LC
181
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>.)
185 #:parallel-build? #f
186
c5cd288b
LC
187 #:tests? #f
188 #:make-flags (list (string-append "MANDIR="
189 (assoc-ref %outputs "out")
190 "/share/man"))))
4e128dd5 191 (home-page "https://www.kernel.org/doc/man-pages/")
c5cd288b
LC
192 (synopsis "Development manual pages from the Linux project")
193 (description
194 "This package provides traditional Unix \"man pages\" documenting the
195Linux kernel and C library interfaces employed by user-space programs.")
196
197 ;; Each man page has its own license; some are GPLv2+, some are MIT/X11.
198 (license gpl2+)))
199
cb3da233
DT
200(define-public help2man
201 (package
202 (name "help2man")
a9f5a7e1 203 (version "1.47.6")
cb3da233
DT
204 (source
205 (origin
206 (method url-fetch)
207 (uri (string-append "mirror://gnu/help2man/help2man-"
208 version ".tar.xz"))
209 (sha256
210 (base32
a9f5a7e1 211 "0vz4dlrvy4vc6l7w0a7n668pfa0rdm73wr2gar58wqranyah46yr"))))
cb3da233
DT
212 (build-system gnu-build-system)
213 (arguments `(;; There's no `check' target.
214 #:tests? #f))
215 (inputs
216 `(("perl" ,perl)
217 ;; TODO: Add these optional dependencies.
218 ;; ("perl-LocaleGettext" ,perl-LocaleGettext)
b94a6ca0 219 ;; ("gettext" ,gettext-minimal)
cb3da233 220 ))
6fd52309 221 (home-page "https://www.gnu.org/software/help2man/")
cb3da233
DT
222 (synopsis "Automatically generate man pages from program --help")
223 (description
224 "GNU help2man is a program that converts the output of standard
225\"--help\" and \"--version\" command-line arguments into a manual page
226automatically.")
227 (license gpl3+)))
dd6b54b8 228
5e9ce98a
LC
229(define-public help2man/latest
230 (package
231 (inherit help2man)
232 (version "1.47.8")
233 (source (origin
234 (method url-fetch)
235 (uri (string-append "mirror://gnu/help2man/help2man-"
236 version ".tar.xz"))
237 (sha256
238 (base32
239 "1p5830h88cx0zn0snwaj0vpph81xicpsirfwlxmcgjrlmn0nm3sj"))))))
240
e2dd54c0
RH
241(define-public scdoc
242 (package
243 (name "scdoc")
244 (version "1.6.0")
245 (source
246 (origin
247 (method url-fetch)
248 (uri (string-append "https://git.sr.ht/%7Esircmpwn/scdoc/archive/" version
249 ".tar.gz"))
250 (file-name (string-append name "-" version ".tar.gz"))
251 (sha256
252 (base32
253 "1ca3js4arkg28gg2iszxxyrq7kgsrz482d1szv5dfd471h3vr5m3"))))
254 (build-system gnu-build-system)
255 (arguments
256 `(#:make-flags '("CC=gcc")
257 #:phases
258 (modify-phases %standard-phases
259 (delete 'configure)
260 (add-before 'install 'hardcode-paths
261 (lambda* (#:key outputs #:allow-other-keys)
262 (substitute* "Makefile"
263 (("/usr/local") (assoc-ref outputs "out")))
264 #t)))))
265 (home-page "https://git.sr.ht/~sircmpwn/scdoc")
266 (synopsis "Simple man page generator")
267 (description "scdoc is a simple man page generator written for POSIX systems
268in C99.")
269 ;; MIT license, see /share/doc/scdoc-1.6.0/COPYING.
270 (license expat)))
271
dd6b54b8
RW
272(define-public txt2man
273 (package
274 (name "txt2man")
53c36279 275 (version "1.6.0")
dd6b54b8
RW
276 (source
277 (origin
278 (method url-fetch)
279 (uri (string-append
280 "https://github.com/mvertes/txt2man/archive/txt2man-"
281 version ".tar.gz"))
282 (sha256
283 (base32
53c36279 284 "168cj96974n2z0igin6j1ic1m45zyic7nm5ark7frq8j78rrx4zn"))))
dd6b54b8
RW
285 (build-system gnu-build-system)
286 (arguments
287 `(#:tests? #f ; no "check" target
288 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
dc1d3cde 289 #:phases (modify-phases %standard-phases (delete 'configure))))
dd6b54b8
RW
290 (inputs
291 `(("gawk" ,gawk)))
292 (home-page "https://github.com/mvertes/txt2man")
293 (synopsis "Convert text to man page")
294 (description "Txt2man converts flat ASCII text to man page format.")
295 (license gpl2+)))