gnu: facter: Update to 4.0.33.
[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)
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 (gnu packages dbm)
34 #:use-module (gnu packages flex)
35 #:use-module (gnu packages gawk)
36 #:use-module (gnu packages groff)
37 #:use-module (gnu packages less)
38 #:use-module (gnu packages perl)
39 #:use-module (gnu packages pkg-config)
40 #:use-module (gnu packages linux))
41
42 (define-public libpipeline
43 (package
44 (name "libpipeline")
45 (version "1.5.2")
46 (source (origin
47 (method url-fetch)
48 (uri (string-append
49 "mirror://savannah/libpipeline/libpipeline-"
50 version ".tar.gz"))
51 (sha256
52 (base32
53 "1ysrn22ixd4nmggy6f7qcsm7waadmlbg2i0n9mh6g7dfq54wcngx"))))
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
59 a flexible and convenient way.")
60 (license gpl3+)))
61
62 (define-public man-db
63 (package
64 (name "man-db")
65 (version "2.9.3")
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
72 "1f4palf5bdyf3f8sa0981cqxn9cjcr2pz53ngrrsybb9n0da2nps"))))
73 (build-system gnu-build-system)
74 (arguments
75 `(#:phases
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?
86 (find-files "src/tests" ".*")))
87 #t)))
88 (add-after 'unpack 'patch-absolute-paths
89 (lambda* (#:key inputs #:allow-other-keys)
90 (substitute* "src/man.c"
91 (("\"iconv\"")
92 (string-append "\"" (which "iconv") "\"")))
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\"")))
101 #t)))
102 #:configure-flags
103 (let ((groff (assoc-ref %build-inputs "groff"))
104 (groff-minimal (assoc-ref %build-inputs "groff-minimal"))
105 (less (assoc-ref %build-inputs "less"))
106 (gzip (assoc-ref %build-inputs "gzip"))
107 (bzip2 (assoc-ref %build-inputs "bzip2"))
108 (xz (assoc-ref %build-inputs "xz"))
109 (util (assoc-ref %build-inputs "util-linux")))
110 ;; Invoke groff, less, gzip, bzip2, and xz directly from the store.
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"
117 (string-append "--with-pager=" less "/bin/less")
118 (string-append "--with-gzip=" gzip "/bin/gzip")
119 (string-append "--with-bzip2=" bzip2 "/bin/gzip")
120 (string-append "--with-xz=" xz "/bin/xz")
121 (string-append "--with-col=" util "/bin/col")
122 ;; The default systemd directories ignore --prefix.
123 (string-append "--with-systemdsystemunitdir="
124 %output "/lib/systemd/system")
125 (string-append "--with-systemdtmpfilesdir="
126 %output "/lib/tmpfiles.d"))
127 (map (lambda (prog)
128 (string-append "--with-" prog "=" groff-minimal
129 "/bin/" prog))
130 '("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))
131
132 ;; At run time we should refer to GROFF-MINIMAL, not GROFF (the latter
133 ;; pulls in Perl.)
134 #:disallowed-references (,groff)
135
136 #:modules ((guix build gnu-build-system)
137 (guix build utils)
138 (srfi srfi-1))))
139 (native-inputs
140 `(("pkg-config" ,pkg-config)
141 ("flex" ,flex)
142 ("groff" ,groff))) ;needed at build time (troff, grops, soelim, etc.)
143 (inputs
144 `(("gdbm" ,gdbm)
145 ("groff-minimal" ,groff-minimal)
146 ("less" ,less)
147 ("libpipeline" ,libpipeline)
148 ;; FIXME: 4.8 and later can use libseccomp, but it causes test
149 ;; failures in the build chroot.
150 ;;("libseccomp" ,libseccomp)
151 ("util-linux" ,util-linux)))
152 (native-search-paths
153 (list (search-path-specification
154 (variable "MANPATH")
155 (files '("share/man")))))
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
160 accessed using the man command. It uses a Berkeley DB database in place of
161 the traditional flat-text whatis databases.")
162 (license gpl2+)))
163
164 (define-public man-pages
165 (package
166 (name "man-pages")
167 (version "5.07")
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
177 (base32 "13b3q7c67r0wkla4pdihl1qh09k67ms2z5jgzfqgpdqqy6mgziwd"))))
178 (build-system gnu-build-system)
179 (arguments
180 '(#:phases (modify-phases %standard-phases (delete 'configure))
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
187 #:tests? #f
188 #:make-flags (list (string-append "MANDIR="
189 (assoc-ref %outputs "out")
190 "/share/man"))))
191 (home-page "https://www.kernel.org/doc/man-pages/")
192 (synopsis "Development manual pages from the Linux project")
193 (description
194 "This package provides traditional Unix \"man pages\" documenting the
195 Linux 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
200 (define-public help2man
201 (package
202 (name "help2man")
203 (version "1.47.13")
204 (source
205 (origin
206 (method url-fetch)
207 (uri (string-append "mirror://gnu/help2man/help2man-"
208 version ".tar.xz"))
209 (sha256
210 (base32
211 "08q5arxz4j4pyx5q4712c2rn7p7dw7as9xg38yvmsh1c3ynvpy5p"))))
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)
219 ;; ("gettext" ,gettext-minimal)
220 ))
221 (native-inputs
222 `(("perl" ,perl)))
223 (home-page "https://www.gnu.org/software/help2man/")
224 (synopsis "Automatically generate man pages from program --help")
225 (description
226 "GNU help2man is a program that converts the output of standard
227 \"--help\" and \"--version\" command-line arguments into a manual page
228 automatically.")
229 (license gpl3+)))
230
231 (define-public scdoc
232 (package
233 (name "scdoc")
234 (version "1.10.1")
235 (source
236 (origin
237 (method url-fetch)
238 (uri (string-append "https://git.sr.ht/%7Esircmpwn/scdoc/archive/" version
239 ".tar.gz"))
240 (file-name (string-append name "-" version ".tar.gz"))
241 (sha256
242 (base32
243 "13x7g1r56bshvfmlvapvz35ywnbgsh337kywb5kcv8nc6b3j3q40"))))
244 (build-system gnu-build-system)
245 (arguments
246 `(#:make-flags
247 (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out")))
248 #:phases
249 (modify-phases %standard-phases
250 (delete 'configure))))
251 (home-page "https://git.sr.ht/~sircmpwn/scdoc")
252 (synopsis "Simple man page generator")
253 (description "scdoc is a simple man page generator written for POSIX systems
254 in C99.")
255 ;; MIT license, see /share/doc/scdoc-1.6.0/COPYING.
256 (license expat)))
257
258 (define-public txt2man
259 (package
260 (name "txt2man")
261 (version "1.6.0")
262 (source
263 (origin
264 (method git-fetch)
265 (uri (git-reference
266 (url "https://github.com/mvertes/txt2man")
267 (commit (string-append "txt2man-" version))))
268 (file-name (git-file-name name version))
269 (sha256
270 (base32
271 "1razjpvlcp85hqli77mwr9nmn5jnv3lm1fxbbqjpx1brv3h1lvm5"))))
272 (build-system gnu-build-system)
273 (arguments
274 `(#:tests? #f ; no "check" target
275 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
276 #:phases (modify-phases %standard-phases (delete 'configure))))
277 (inputs
278 `(("gawk" ,gawk)))
279 (home-page "https://github.com/mvertes/txt2man")
280 (synopsis "Convert text to man page")
281 (description "Txt2man converts flat ASCII text to man page format.")
282 (license gpl2+)))