gnu: scdoc: Update to 1.10.1.
[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 ;;;
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 git-download)
29 #:use-module (guix download)
30 #:use-module (guix packages)
31 #:use-module (guix build-system gnu)
32 #:use-module (gnu packages dbm)
33 #:use-module (gnu packages flex)
34 #:use-module (gnu packages gawk)
35 #:use-module (gnu packages groff)
36 #:use-module (gnu packages less)
37 #:use-module (gnu packages perl)
38 #:use-module (gnu packages pkg-config)
39 #:use-module (gnu packages linux))
40
41 (define-public libpipeline
42 (package
43 (name "libpipeline")
44 (version "1.5.2")
45 (source (origin
46 (method url-fetch)
47 (uri (string-append
48 "mirror://savannah/libpipeline/libpipeline-"
49 version ".tar.gz"))
50 (sha256
51 (base32
52 "1ysrn22ixd4nmggy6f7qcsm7waadmlbg2i0n9mh6g7dfq54wcngx"))))
53 (build-system gnu-build-system)
54 (home-page "http://libpipeline.nongnu.org/")
55 (synopsis "C library for manipulating pipelines of subprocesses")
56 (description
57 "libpipeline is a C library for manipulating pipelines of subprocesses in
58 a flexible and convenient way.")
59 (license gpl3+)))
60
61 (define-public man-db
62 (package
63 (name "man-db")
64 (version "2.9.1")
65 (source (origin
66 (method url-fetch)
67 (uri (string-append "mirror://savannah/man-db/man-db-"
68 version ".tar.xz"))
69 (sha256
70 (base32
71 "0ky7aq8313xa1y0zdwdbz5yvjfjb3xy0xymbimd2d9q9bky8lgds"))))
72 (build-system gnu-build-system)
73 (arguments
74 `(#:phases
75 (modify-phases %standard-phases
76 (add-after 'patch-source-shebangs 'patch-test-shebangs
77 (lambda* (#:key outputs #:allow-other-keys)
78 ;; Patch shebangs in test scripts.
79 (let ((out (assoc-ref outputs "out")))
80 (for-each (lambda (file)
81 (substitute* file
82 (("#! /bin/sh")
83 (string-append "#!" (which "sh")))))
84 (remove file-is-directory?
85 (find-files "src/tests" ".*")))
86 #t)))
87 (add-after 'unpack 'patch-absolute-paths
88 (lambda* (#:key inputs #:allow-other-keys)
89 (substitute* "src/man.c"
90 (("\"iconv\"")
91 (string-append "\"" (which "iconv") "\"")))
92 ;; Embed an absolute reference to "preconv", otherwise it
93 ;; falls back to searching in PATH and ultimately fails
94 ;; to render unicode data (see <https://bugs.gnu.org/30785>).
95 (substitute* "lib/encodings.c"
96 (("groff_preconv = NULL")
97 (string-append "groff_preconv = \""
98 (assoc-ref inputs "groff-minimal")
99 "/bin/preconv\"")))
100 #t)))
101 #:configure-flags
102 (let ((groff (assoc-ref %build-inputs "groff"))
103 (groff-minimal (assoc-ref %build-inputs "groff-minimal"))
104 (less (assoc-ref %build-inputs "less"))
105 (gzip (assoc-ref %build-inputs "gzip"))
106 (bzip2 (assoc-ref %build-inputs "bzip2"))
107 (xz (assoc-ref %build-inputs "xz"))
108 (util (assoc-ref %build-inputs "util-linux")))
109 ;; Invoke groff, less, gzip, bzip2, and xz directly from the store.
110 (append (list ;; Disable setuid man user.
111 "--disable-setuid"
112 ;; Don't constrain ownership of system-wide cache files.
113 ;; Otherwise creating the manpage database fails with
114 ;; man-db > 2.7.5.
115 "--disable-cache-owner"
116 (string-append "--with-pager=" less "/bin/less")
117 (string-append "--with-gzip=" gzip "/bin/gzip")
118 (string-append "--with-bzip2=" bzip2 "/bin/gzip")
119 (string-append "--with-xz=" xz "/bin/xz")
120 (string-append "--with-col=" util "/bin/col")
121 ;; The default systemd directories ignore --prefix.
122 (string-append "--with-systemdsystemunitdir="
123 %output "/lib/systemd/system")
124 (string-append "--with-systemdtmpfilesdir="
125 %output "/lib/tmpfiles.d"))
126 (map (lambda (prog)
127 (string-append "--with-" prog "=" groff-minimal
128 "/bin/" prog))
129 '("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))
130
131 ;; At run time we should refer to GROFF-MINIMAL, not GROFF (the latter
132 ;; pulls in Perl.)
133 #:disallowed-references (,groff)
134
135 #:modules ((guix build gnu-build-system)
136 (guix build utils)
137 (srfi srfi-1))))
138 (native-inputs
139 `(("pkg-config" ,pkg-config)
140 ("groff" ,groff))) ;needed at build time (troff, grops, soelim, etc.)
141 (inputs
142 `(("flex" ,flex)
143 ("gdbm" ,gdbm)
144 ("groff-minimal" ,groff-minimal)
145 ("less" ,less)
146 ("libpipeline" ,libpipeline)
147 ;; FIXME: 4.8 and later can use libseccomp, but it causes test
148 ;; failures in the build chroot.
149 ;;("libseccomp" ,libseccomp)
150 ("util-linux" ,util-linux)))
151 (native-search-paths
152 (list (search-path-specification
153 (variable "MANPATH")
154 (files '("share/man")))))
155 (home-page "http://man-db.nongnu.org/")
156 (synopsis "Standard Unix documentation system")
157 (description
158 "Man-db is an implementation of the standard Unix documentation system
159 accessed using the man command. It uses a Berkeley DB database in place of
160 the traditional flat-text whatis databases.")
161 (license gpl2+)))
162
163 (define-public man-pages
164 (package
165 (name "man-pages")
166 (version "5.05")
167 (source
168 (origin
169 (method url-fetch)
170 (uri
171 (list (string-append "mirror://kernel.org/linux/docs/man-pages/"
172 "man-pages-" version ".tar.xz")
173 (string-append "mirror://kernel.org/linux/docs/man-pages/Archive/"
174 "man-pages-" version ".tar.xz")))
175 (sha256
176 (base32 "0izb6shcczvg37cyd3kzxsfsrffqj1qw9nqhhq9mi4kd36qkbcfm"))))
177 (build-system gnu-build-system)
178 (arguments
179 '(#:phases (modify-phases %standard-phases (delete 'configure))
180
181 ;; The 'all' target depends on three targets that directly populate
182 ;; $(MANDIR) based on its current contents. Doing that in parallel
183 ;; leads to undefined behavior (see <http://bugs.gnu.org/18701>.)
184 #:parallel-build? #f
185
186 #:tests? #f
187 #:make-flags (list (string-append "MANDIR="
188 (assoc-ref %outputs "out")
189 "/share/man"))))
190 (home-page "https://www.kernel.org/doc/man-pages/")
191 (synopsis "Development manual pages from the Linux project")
192 (description
193 "This package provides traditional Unix \"man pages\" documenting the
194 Linux kernel and C library interfaces employed by user-space programs.")
195
196 ;; Each man page has its own license; some are GPLv2+, some are MIT/X11.
197 (license gpl2+)))
198
199 (define-public help2man
200 (package
201 (name "help2man")
202 (version "1.47.10")
203 (source
204 (origin
205 (method url-fetch)
206 (uri (string-append "mirror://gnu/help2man/help2man-"
207 version ".tar.xz"))
208 (sha256
209 (base32
210 "1yywli520246aba12vpgj7bhr1r13swad3xm49a0cygqcgywnwgk"))))
211 (build-system gnu-build-system)
212 (arguments `(;; There's no `check' target.
213 #:tests? #f))
214 (inputs
215 `(("perl" ,perl)
216 ;; TODO: Add these optional dependencies.
217 ;; ("perl-LocaleGettext" ,perl-LocaleGettext)
218 ;; ("gettext" ,gettext-minimal)
219 ))
220 (home-page "https://www.gnu.org/software/help2man/")
221 (synopsis "Automatically generate man pages from program --help")
222 (description
223 "GNU help2man is a program that converts the output of standard
224 \"--help\" and \"--version\" command-line arguments into a manual page
225 automatically.")
226 (license gpl3+)))
227
228 (define-public help2man/latest
229 (package
230 (inherit help2man)
231 (version "1.47.13")
232 (source (origin
233 (method url-fetch)
234 (uri (string-append "mirror://gnu/help2man/help2man-"
235 version ".tar.xz"))
236 (sha256
237 (base32
238 "08q5arxz4j4pyx5q4712c2rn7p7dw7as9xg38yvmsh1c3ynvpy5p"))))))
239
240 (define-public scdoc
241 (package
242 (name "scdoc")
243 (version "1.10.1")
244 (source
245 (origin
246 (method url-fetch)
247 (uri (string-append "https://git.sr.ht/%7Esircmpwn/scdoc/archive/" version
248 ".tar.gz"))
249 (file-name (string-append name "-" version ".tar.gz"))
250 (sha256
251 (base32
252 "13x7g1r56bshvfmlvapvz35ywnbgsh337kywb5kcv8nc6b3j3q40"))))
253 (build-system gnu-build-system)
254 (arguments
255 `(#:make-flags
256 (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out")))
257 #:phases
258 (modify-phases %standard-phases
259 (delete 'configure))))
260 (home-page "https://git.sr.ht/~sircmpwn/scdoc")
261 (synopsis "Simple man page generator")
262 (description "scdoc is a simple man page generator written for POSIX systems
263 in C99.")
264 ;; MIT license, see /share/doc/scdoc-1.6.0/COPYING.
265 (license expat)))
266
267 (define-public txt2man
268 (package
269 (name "txt2man")
270 (version "1.6.0")
271 (source
272 (origin
273 (method git-fetch)
274 (uri (git-reference
275 (url "https://github.com/mvertes/txt2man")
276 (commit (string-append "txt2man-" version))))
277 (file-name (git-file-name name version))
278 (sha256
279 (base32
280 "1razjpvlcp85hqli77mwr9nmn5jnv3lm1fxbbqjpx1brv3h1lvm5"))))
281 (build-system gnu-build-system)
282 (arguments
283 `(#:tests? #f ; no "check" target
284 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
285 #:phases (modify-phases %standard-phases (delete 'configure))))
286 (inputs
287 `(("gawk" ,gawk)))
288 (home-page "https://github.com/mvertes/txt2man")
289 (synopsis "Convert text to man page")
290 (description "Txt2man converts flat ASCII text to man page format.")
291 (license gpl2+)))