gnu: emacs-extempore-mode: Update to 0.0.0-1.09518ae.
[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)
28 #:use-module (guix licenses)
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)
255d1bbe 33 #:use-module (gnu packages dbm)
67ca0a01 34 #:use-module (gnu packages flex)
dd6b54b8 35 #:use-module (gnu packages gawk)
67ca0a01
DT
36 #:use-module (gnu packages groff)
37 #:use-module (gnu packages less)
cb3da233 38 #:use-module (gnu packages perl)
d2eb275a
AK
39 #:use-module (gnu packages pkg-config)
40 #:use-module (gnu packages linux))
cd2e0b64
DT
41
42(define-public libpipeline
43 (package
44 (name "libpipeline")
bbaaee63 45 (version "1.5.2")
cd2e0b64
DT
46 (source (origin
47 (method url-fetch)
48 (uri (string-append
49 "mirror://savannah/libpipeline/libpipeline-"
50 version ".tar.gz"))
51 (sha256
52 (base32
bbaaee63 53 "1ysrn22ixd4nmggy6f7qcsm7waadmlbg2i0n9mh6g7dfq54wcngx"))))
cd2e0b64
DT
54 (build-system gnu-build-system)
55 (home-page "http://libpipeline.nongnu.org/")
56 (synopsis "C library for manipulating pipelines of subprocesses")
57 (description
58 "libpipeline is a C library for manipulating pipelines of subprocesses in
59a flexible and convenient way.")
60 (license gpl3+)))
67ca0a01
DT
61
62(define-public man-db
63 (package
64 (name "man-db")
3a83862d 65 (version "2.9.1")
67ca0a01
DT
66 (source (origin
67 (method url-fetch)
68 (uri (string-append "mirror://savannah/man-db/man-db-"
69 version ".tar.xz"))
70 (sha256
71 (base32
3a83862d 72 "0ky7aq8313xa1y0zdwdbz5yvjfjb3xy0xymbimd2d9q9bky8lgds"))))
67ca0a01
DT
73 (build-system gnu-build-system)
74 (arguments
c85f0691 75 `(#:phases
e79b3c37
RW
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)
82 (substitute* file
83 (("#! /bin/sh")
84 (string-append "#!" (which "sh")))))
85 (remove file-is-directory?
ff57d5b1
MW
86 (find-files "src/tests" ".*")))
87 #t)))
073f5f20 88 (add-after 'unpack 'patch-absolute-paths
ea55a395
RW
89 (lambda* (#:key inputs #:allow-other-keys)
90 (substitute* "src/man.c"
91 (("\"iconv\"")
92 (string-append "\"" (which "iconv") "\"")))
073f5f20
MB
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")
100 "/bin/preconv\"")))
ea55a395 101 #t)))
67ca0a01
DT
102 #:configure-flags
103 (let ((groff (assoc-ref %build-inputs "groff"))
c85f0691 104 (groff-minimal (assoc-ref %build-inputs "groff-minimal"))
67ca0a01
DT
105 (less (assoc-ref %build-inputs "less"))
106 (gzip (assoc-ref %build-inputs "gzip"))
d2eb275a
AK
107 (bzip2 (assoc-ref %build-inputs "bzip2"))
108 (xz (assoc-ref %build-inputs "xz"))
109 (util (assoc-ref %build-inputs "util-linux")))
67ca0a01 110 ;; Invoke groff, less, gzip, bzip2, and xz directly from the store.
28790093
LF
111 (append (list ;; Disable setuid man user.
112 "--disable-setuid"
113 ;; Don't constrain ownership of system-wide cache files.
114 ;; Otherwise creating the manpage database fails with
115 ;; man-db > 2.7.5.
116 "--disable-cache-owner"
67ca0a01
DT
117 (string-append "--with-pager=" less "/bin/less")
118 (string-append "--with-gzip=" gzip "/bin/gzip")
119 (string-append "--with-bzip2=" bzip2 "/bin/gzip")
d2eb275a 120 (string-append "--with-xz=" xz "/bin/xz")
a37f9722 121 (string-append "--with-col=" util "/bin/col")
4ac71127
TGR
122 ;; The default systemd directories ignore --prefix.
123 (string-append "--with-systemdsystemunitdir="
124 %output "/lib/systemd/system")
a37f9722
AK
125 (string-append "--with-systemdtmpfilesdir="
126 %output "/lib/tmpfiles.d"))
67ca0a01 127 (map (lambda (prog)
c85f0691
LC
128 (string-append "--with-" prog "=" groff-minimal
129 "/bin/" prog))
67ca0a01 130 '("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))
c85f0691
LC
131
132 ;; At run time we should refer to GROFF-MINIMAL, not GROFF (the latter
133 ;; pulls in Perl.)
134 #:disallowed-references (,groff)
135
67ca0a01
DT
136 #:modules ((guix build gnu-build-system)
137 (guix build utils)
138 (srfi srfi-1))))
139 (native-inputs
c85f0691 140 `(("pkg-config" ,pkg-config)
4a5ae4eb 141 ("flex" ,flex)
c85f0691 142 ("groff" ,groff))) ;needed at build time (troff, grops, soelim, etc.)
67ca0a01 143 (inputs
4a5ae4eb 144 `(("gdbm" ,gdbm)
c85f0691 145 ("groff-minimal" ,groff-minimal)
67ca0a01 146 ("less" ,less)
d2eb275a 147 ("libpipeline" ,libpipeline)
880e2170
MB
148 ;; FIXME: 4.8 and later can use libseccomp, but it causes test
149 ;; failures in the build chroot.
150 ;;("libseccomp" ,libseccomp)
d2eb275a 151 ("util-linux" ,util-linux)))
2b42718b
LC
152 (native-search-paths
153 (list (search-path-specification
154 (variable "MANPATH")
af070955 155 (files '("share/man")))))
67ca0a01
DT
156 (home-page "http://man-db.nongnu.org/")
157 (synopsis "Standard Unix documentation system")
158 (description
159 "Man-db is an implementation of the standard Unix documentation system
160accessed using the man command. It uses a Berkeley DB database in place of
161the traditional flat-text whatis databases.")
162 (license gpl2+)))
cb3da233 163
c5cd288b
LC
164(define-public man-pages
165 (package
166 (name "man-pages")
49f8912b 167 (version "5.06")
792d3ed7
TGR
168 (source
169 (origin
170 (method url-fetch)
171 (uri
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")))
176 (sha256
49f8912b 177 (base32 "0l7ypgl36jswa077qvdh1rcsvnwr64vja6cc32bab86sm41akf3h"))))
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")
848e600d 203 (version "1.47.10")
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
848e600d 211 "1yywli520246aba12vpgj7bhr1r13swad3xm49a0cygqcgywnwgk"))))
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)
9ea9ff6b 232 (version "1.47.13")
5e9ce98a
LC
233 (source (origin
234 (method url-fetch)
235 (uri (string-append "mirror://gnu/help2man/help2man-"
236 version ".tar.xz"))
237 (sha256
238 (base32
9ea9ff6b 239 "08q5arxz4j4pyx5q4712c2rn7p7dw7as9xg38yvmsh1c3ynvpy5p"))))))
5e9ce98a 240
e2dd54c0
RH
241(define-public scdoc
242 (package
243 (name "scdoc")
031610aa 244 (version "1.10.1")
e2dd54c0
RH
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
031610aa 253 "13x7g1r56bshvfmlvapvz35ywnbgsh337kywb5kcv8nc6b3j3q40"))))
e2dd54c0
RH
254 (build-system gnu-build-system)
255 (arguments
84836379
BT
256 `(#:make-flags
257 (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out")))
e2dd54c0
RH
258 #:phases
259 (modify-phases %standard-phases
84836379 260 (delete 'configure))))
e2dd54c0
RH
261 (home-page "https://git.sr.ht/~sircmpwn/scdoc")
262 (synopsis "Simple man page generator")
263 (description "scdoc is a simple man page generator written for POSIX systems
264in C99.")
265 ;; MIT license, see /share/doc/scdoc-1.6.0/COPYING.
266 (license expat)))
267
dd6b54b8
RW
268(define-public txt2man
269 (package
270 (name "txt2man")
53c36279 271 (version "1.6.0")
dd6b54b8
RW
272 (source
273 (origin
fcc8f2fc
EF
274 (method git-fetch)
275 (uri (git-reference
276 (url "https://github.com/mvertes/txt2man")
277 (commit (string-append "txt2man-" version))))
278 (file-name (git-file-name name version))
dd6b54b8
RW
279 (sha256
280 (base32
fcc8f2fc 281 "1razjpvlcp85hqli77mwr9nmn5jnv3lm1fxbbqjpx1brv3h1lvm5"))))
dd6b54b8
RW
282 (build-system gnu-build-system)
283 (arguments
284 `(#:tests? #f ; no "check" target
285 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
dc1d3cde 286 #:phases (modify-phases %standard-phases (delete 'configure))))
dd6b54b8
RW
287 (inputs
288 `(("gawk" ,gawk)))
289 (home-page "https://github.com/mvertes/txt2man")
290 (synopsis "Convert text to man page")
291 (description "Txt2man converts flat ASCII text to man page format.")
292 (license gpl2+)))