Commit | Line | Data |
---|---|---|
cd2e0b64 | 1 | ;;; GNU Guix --- Functional package management for GNU |
9f511106 | 2 | ;;; Copyright © 2012, 2014, 2015, 2017, 2018, 2021 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> |
6412b01a | 7 | ;;; Copyright © 2017–2021 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) | |
9e371e95 | 28 | #:use-module ((guix licenses) #:prefix license:) |
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) |
e445ae9a | 33 | #:use-module (guix build-system ruby) |
24f1ce9e | 34 | #:use-module (guix utils) |
9f511106 | 35 | #:use-module (gnu packages compression) |
255d1bbe | 36 | #:use-module (gnu packages dbm) |
67ca0a01 | 37 | #:use-module (gnu packages flex) |
dd6b54b8 | 38 | #:use-module (gnu packages gawk) |
67ca0a01 DT |
39 | #:use-module (gnu packages groff) |
40 | #:use-module (gnu packages less) | |
cb3da233 | 41 | #:use-module (gnu packages perl) |
d2eb275a | 42 | #:use-module (gnu packages pkg-config) |
e047b265 RG |
43 | #:use-module (gnu packages linux) |
44 | #:use-module (gnu packages xml)) | |
45 | ||
46 | (define-public xmltoman | |
47 | (package | |
48 | (name "xmltoman") | |
49 | (version "0.4") | |
50 | (source | |
51 | (origin | |
52 | (method url-fetch) | |
53 | (uri | |
54 | (string-append "https://sourceforge.net/projects/xmltoman/files/" | |
55 | "xmltoman/xmltoman-" version ".tar.gz/xmltoman-" | |
56 | version ".tar.gz/download")) | |
57 | (sha256 | |
58 | (base32 "1c0lvzr7kdy63wbn1jv6s126ds7add3pxqb0vlxd3v5a2sir91wl")))) | |
59 | (build-system gnu-build-system) | |
60 | (arguments | |
61 | `(#:tests? #f ; No tests | |
62 | #:make-flags | |
63 | (list | |
64 | (string-append "PREFIX=" | |
65 | (assoc-ref %outputs "out"))) | |
66 | #:phases | |
67 | (modify-phases %standard-phases | |
68 | (delete 'configure)))) | |
69 | (propagated-inputs | |
70 | `(("perl" ,perl) | |
71 | ("perl-xml-parser" ,perl-xml-parser))) | |
72 | (synopsis "XML to Man converter") | |
73 | (description "XMLtoMan and XMLMantoHTML are two small scripts to convert xml | |
74 | to man pages in groff format or html. It features the usual man page items such | |
75 | as description, options, see also, etc.") | |
76 | (home-page "http://xmltoman.sourceforge.net/") | |
9e371e95 | 77 | (license license:gpl2+))) |
cd2e0b64 | 78 | |
e445ae9a RG |
79 | (define-public ronn |
80 | (package | |
81 | (name "ronn") | |
82 | (version "0.7.3") | |
83 | (source | |
84 | (origin | |
85 | (method git-fetch) | |
86 | (uri | |
87 | (git-reference | |
8ed4c468 | 88 | (url "https://github.com/rtomayko/ronn") |
e445ae9a RG |
89 | (commit version))) |
90 | (file-name | |
91 | (git-file-name name version)) | |
92 | (sha256 | |
93 | (base32 "0fkniz7j1jp8v3i05m6hks3nsh6rzvjfi0ichpi7h4gwk5byxb94")))) | |
94 | (build-system ruby-build-system) | |
95 | (arguments | |
96 | `(#:tests? #f)) ; Library hpricot not available | |
97 | (synopsis "Manual authoring tool") | |
98 | (description "Ronn builds manuals. It converts simple, human readable | |
99 | textfiles to roff for terminal display, and also to HTML for the web.") | |
100 | (home-page "https://rtomayko.github.io/ronn/") | |
9e371e95 | 101 | (license license:expat))) |
e445ae9a | 102 | |
cd2e0b64 DT |
103 | (define-public libpipeline |
104 | (package | |
105 | (name "libpipeline") | |
d74a85ec | 106 | (version "1.5.3") |
cd2e0b64 DT |
107 | (source (origin |
108 | (method url-fetch) | |
109 | (uri (string-append | |
110 | "mirror://savannah/libpipeline/libpipeline-" | |
111 | version ".tar.gz")) | |
112 | (sha256 | |
113 | (base32 | |
d74a85ec | 114 | "1c5dl017xil2ssb6a5vg927bnsbc9vymfgi9ahvqbb8gypx0igsx")))) |
cd2e0b64 DT |
115 | (build-system gnu-build-system) |
116 | (home-page "http://libpipeline.nongnu.org/") | |
117 | (synopsis "C library for manipulating pipelines of subprocesses") | |
118 | (description | |
119 | "libpipeline is a C library for manipulating pipelines of subprocesses in | |
120 | a flexible and convenient way.") | |
9e371e95 | 121 | (license license:gpl3+))) |
67ca0a01 DT |
122 | |
123 | (define-public man-db | |
124 | (package | |
125 | (name "man-db") | |
6412b01a | 126 | (version "2.9.4") |
67ca0a01 DT |
127 | (source (origin |
128 | (method url-fetch) | |
129 | (uri (string-append "mirror://savannah/man-db/man-db-" | |
130 | version ".tar.xz")) | |
131 | (sha256 | |
132 | (base32 | |
6412b01a | 133 | "0mk7n7yn6scy785jhg1j14b3q9l0cgvpry49r0ldjsnizbnrjv5n")))) |
67ca0a01 DT |
134 | (build-system gnu-build-system) |
135 | (arguments | |
c85f0691 | 136 | `(#:phases |
e79b3c37 RW |
137 | (modify-phases %standard-phases |
138 | (add-after 'patch-source-shebangs 'patch-test-shebangs | |
139 | (lambda* (#:key outputs #:allow-other-keys) | |
140 | ;; Patch shebangs in test scripts. | |
141 | (let ((out (assoc-ref outputs "out"))) | |
142 | (for-each (lambda (file) | |
143 | (substitute* file | |
144 | (("#! /bin/sh") | |
145 | (string-append "#!" (which "sh"))))) | |
146 | (remove file-is-directory? | |
ff57d5b1 MW |
147 | (find-files "src/tests" ".*"))) |
148 | #t))) | |
073f5f20 | 149 | (add-after 'unpack 'patch-absolute-paths |
ea55a395 RW |
150 | (lambda* (#:key inputs #:allow-other-keys) |
151 | (substitute* "src/man.c" | |
152 | (("\"iconv\"") | |
153 | (string-append "\"" (which "iconv") "\""))) | |
073f5f20 MB |
154 | ;; Embed an absolute reference to "preconv", otherwise it |
155 | ;; falls back to searching in PATH and ultimately fails | |
156 | ;; to render unicode data (see <https://bugs.gnu.org/30785>). | |
157 | (substitute* "lib/encodings.c" | |
158 | (("groff_preconv = NULL") | |
159 | (string-append "groff_preconv = \"" | |
160 | (assoc-ref inputs "groff-minimal") | |
161 | "/bin/preconv\""))) | |
ea55a395 | 162 | #t))) |
67ca0a01 DT |
163 | #:configure-flags |
164 | (let ((groff (assoc-ref %build-inputs "groff")) | |
c85f0691 | 165 | (groff-minimal (assoc-ref %build-inputs "groff-minimal")) |
67ca0a01 DT |
166 | (less (assoc-ref %build-inputs "less")) |
167 | (gzip (assoc-ref %build-inputs "gzip")) | |
d2eb275a AK |
168 | (bzip2 (assoc-ref %build-inputs "bzip2")) |
169 | (xz (assoc-ref %build-inputs "xz")) | |
170 | (util (assoc-ref %build-inputs "util-linux"))) | |
67ca0a01 | 171 | ;; Invoke groff, less, gzip, bzip2, and xz directly from the store. |
28790093 LF |
172 | (append (list ;; Disable setuid man user. |
173 | "--disable-setuid" | |
174 | ;; Don't constrain ownership of system-wide cache files. | |
175 | ;; Otherwise creating the manpage database fails with | |
176 | ;; man-db > 2.7.5. | |
177 | "--disable-cache-owner" | |
67ca0a01 DT |
178 | (string-append "--with-pager=" less "/bin/less") |
179 | (string-append "--with-gzip=" gzip "/bin/gzip") | |
180 | (string-append "--with-bzip2=" bzip2 "/bin/gzip") | |
d2eb275a | 181 | (string-append "--with-xz=" xz "/bin/xz") |
a37f9722 | 182 | (string-append "--with-col=" util "/bin/col") |
4ac71127 TGR |
183 | ;; The default systemd directories ignore --prefix. |
184 | (string-append "--with-systemdsystemunitdir=" | |
185 | %output "/lib/systemd/system") | |
a37f9722 AK |
186 | (string-append "--with-systemdtmpfilesdir=" |
187 | %output "/lib/tmpfiles.d")) | |
67ca0a01 | 188 | (map (lambda (prog) |
c85f0691 LC |
189 | (string-append "--with-" prog "=" groff-minimal |
190 | "/bin/" prog)) | |
67ca0a01 | 191 | '("nroff" "eqn" "neqn" "tbl" "refer" "pic")))) |
c85f0691 LC |
192 | |
193 | ;; At run time we should refer to GROFF-MINIMAL, not GROFF (the latter | |
194 | ;; pulls in Perl.) | |
195 | #:disallowed-references (,groff) | |
196 | ||
67ca0a01 DT |
197 | #:modules ((guix build gnu-build-system) |
198 | (guix build utils) | |
199 | (srfi srfi-1)))) | |
200 | (native-inputs | |
c85f0691 | 201 | `(("pkg-config" ,pkg-config) |
4a5ae4eb | 202 | ("flex" ,flex) |
c85f0691 | 203 | ("groff" ,groff))) ;needed at build time (troff, grops, soelim, etc.) |
67ca0a01 | 204 | (inputs |
4a5ae4eb | 205 | `(("gdbm" ,gdbm) |
c85f0691 | 206 | ("groff-minimal" ,groff-minimal) |
67ca0a01 | 207 | ("less" ,less) |
d2eb275a | 208 | ("libpipeline" ,libpipeline) |
880e2170 MB |
209 | ;; FIXME: 4.8 and later can use libseccomp, but it causes test |
210 | ;; failures in the build chroot. | |
211 | ;;("libseccomp" ,libseccomp) | |
d2eb275a | 212 | ("util-linux" ,util-linux))) |
2b42718b LC |
213 | (native-search-paths |
214 | (list (search-path-specification | |
215 | (variable "MANPATH") | |
af070955 | 216 | (files '("share/man"))))) |
67ca0a01 DT |
217 | (home-page "http://man-db.nongnu.org/") |
218 | (synopsis "Standard Unix documentation system") | |
219 | (description | |
220 | "Man-db is an implementation of the standard Unix documentation system | |
221 | accessed using the man command. It uses a Berkeley DB database in place of | |
222 | the traditional flat-text whatis databases.") | |
9e371e95 | 223 | (license license:gpl2+))) |
cb3da233 | 224 | |
9f511106 LC |
225 | (define-public mandoc |
226 | (package | |
227 | (name "mandoc") | |
228 | (version "1.14.5") | |
229 | (source (origin | |
230 | (method url-fetch) | |
231 | (uri (string-append "https://mandoc.bsd.lv/snapshots/mandoc-" | |
232 | version ".tar.gz")) | |
233 | (sha256 | |
234 | (base32 | |
235 | "1xyqllxpjj1kimlipx11pzyywf5c25i4wmv0lqm7ph3gnlnb86c2")))) | |
236 | (build-system gnu-build-system) | |
237 | (arguments | |
238 | `(#:test-target "regress" | |
239 | #:phases (modify-phases %standard-phases | |
240 | (add-before 'configure 'set-prefix | |
241 | (lambda* (#:key outputs #:allow-other-keys) | |
242 | (substitute* "configure" | |
243 | (("^CC=.*") | |
244 | (string-append "CC=" ,(cc-for-target) "\n")) | |
245 | (("^DEFCFLAGS=\\\\\"") | |
246 | "DEFCFLAGS=\"-O2 ") | |
247 | (("^UTF8_LOCALE=.*") ;used for tests | |
248 | "UTF8_LOCALE=en_US.UTF-8\n") | |
249 | (("^MANPATH_(BASE|DEFAULT)=.*" _ which) | |
250 | (string-append "MANPATH_" which "=" | |
251 | "/run/current-system/profile/share/man\n")) | |
252 | (("^PREFIX=.*") | |
253 | (string-append "PREFIX=" (assoc-ref outputs "out") | |
254 | "\n")))))))) | |
255 | (native-inputs `(("perl" ,perl))) ;used to run tests | |
256 | (inputs `(("zlib" ,zlib))) | |
257 | (synopsis "Tools for BSD mdoc and man pages") | |
258 | (description | |
259 | "mandoc is a suite of tools compiling mdoc, the roff macro language of | |
260 | choice for BSD manual pages, and man, the predominant historical language for | |
261 | UNIX manuals. It is small and quite fast. The main component of the toolset | |
262 | is the @command{mandoc} utility program, based on the libmandoc validating | |
263 | compiler, to format output for UTF-8 and ASCII UNIX terminals, HTML 5, | |
264 | PostScript, and PDF. Additional tools include the @command{man} viewer, and | |
265 | @command{apropos} and @command{whatis}.") | |
266 | (home-page "https://mandoc.bsd.lv/") | |
267 | (license license:isc))) | |
268 | ||
c5cd288b LC |
269 | (define-public man-pages |
270 | (package | |
271 | (name "man-pages") | |
4d2553e7 | 272 | (version "5.11") |
792d3ed7 TGR |
273 | (source |
274 | (origin | |
275 | (method url-fetch) | |
276 | (uri | |
277 | (list (string-append "mirror://kernel.org/linux/docs/man-pages/" | |
278 | "man-pages-" version ".tar.xz") | |
279 | (string-append "mirror://kernel.org/linux/docs/man-pages/Archive/" | |
280 | "man-pages-" version ".tar.xz"))) | |
281 | (sha256 | |
4d2553e7 | 282 | (base32 "1aiwn6yi19idg4jbf7x4x5i06macjv7r8d5fgp1rwnc4a775vniy")))) |
c5cd288b LC |
283 | (build-system gnu-build-system) |
284 | (arguments | |
dc1d3cde | 285 | '(#:phases (modify-phases %standard-phases (delete 'configure)) |
3b509259 LC |
286 | |
287 | ;; The 'all' target depends on three targets that directly populate | |
288 | ;; $(MANDIR) based on its current contents. Doing that in parallel | |
289 | ;; leads to undefined behavior (see <http://bugs.gnu.org/18701>.) | |
290 | #:parallel-build? #f | |
291 | ||
c5cd288b LC |
292 | #:tests? #f |
293 | #:make-flags (list (string-append "MANDIR=" | |
294 | (assoc-ref %outputs "out") | |
295 | "/share/man")))) | |
4e128dd5 | 296 | (home-page "https://www.kernel.org/doc/man-pages/") |
c5cd288b LC |
297 | (synopsis "Development manual pages from the Linux project") |
298 | (description | |
299 | "This package provides traditional Unix \"man pages\" documenting the | |
300 | Linux kernel and C library interfaces employed by user-space programs.") | |
301 | ||
302 | ;; Each man page has its own license; some are GPLv2+, some are MIT/X11. | |
9e371e95 | 303 | (license license:gpl2+))) |
c5cd288b | 304 | |
cb3da233 DT |
305 | (define-public help2man |
306 | (package | |
307 | (name "help2man") | |
f605eef2 | 308 | (version "1.47.13") |
cb3da233 DT |
309 | (source |
310 | (origin | |
311 | (method url-fetch) | |
312 | (uri (string-append "mirror://gnu/help2man/help2man-" | |
313 | version ".tar.xz")) | |
314 | (sha256 | |
315 | (base32 | |
f605eef2 | 316 | "08q5arxz4j4pyx5q4712c2rn7p7dw7as9xg38yvmsh1c3ynvpy5p")))) |
cb3da233 DT |
317 | (build-system gnu-build-system) |
318 | (arguments `(;; There's no `check' target. | |
319 | #:tests? #f)) | |
320 | (inputs | |
321 | `(("perl" ,perl) | |
322 | ;; TODO: Add these optional dependencies. | |
323 | ;; ("perl-LocaleGettext" ,perl-LocaleGettext) | |
b94a6ca0 | 324 | ;; ("gettext" ,gettext-minimal) |
cb3da233 | 325 | )) |
642328ab MO |
326 | (native-inputs |
327 | `(("perl" ,perl))) | |
6fd52309 | 328 | (home-page "https://www.gnu.org/software/help2man/") |
cb3da233 DT |
329 | (synopsis "Automatically generate man pages from program --help") |
330 | (description | |
331 | "GNU help2man is a program that converts the output of standard | |
332 | \"--help\" and \"--version\" command-line arguments into a manual page | |
333 | automatically.") | |
9e371e95 | 334 | (license license:gpl3+))) |
dd6b54b8 | 335 | |
e2dd54c0 RH |
336 | (define-public scdoc |
337 | (package | |
338 | (name "scdoc") | |
031610aa | 339 | (version "1.10.1") |
e2dd54c0 RH |
340 | (source |
341 | (origin | |
841e5fb4 TGR |
342 | (method git-fetch) |
343 | (uri (git-reference | |
344 | (url "https://git.sr.ht/~sircmpwn/scdoc") | |
345 | (commit version))) | |
346 | (file-name (git-file-name name version)) | |
e2dd54c0 | 347 | (sha256 |
841e5fb4 | 348 | (base32 "1xmh6fnp378xmiycslg4migs1vx7yly4i1cf2vbbnwim9c9g0aw7")))) |
e2dd54c0 RH |
349 | (build-system gnu-build-system) |
350 | (arguments | |
84836379 | 351 | `(#:make-flags |
24f1ce9e TGR |
352 | (list (string-append "CC=" ,(cc-for-target)) |
353 | (string-append "PREFIX=" (assoc-ref %outputs "out"))) | |
e2dd54c0 RH |
354 | #:phases |
355 | (modify-phases %standard-phases | |
84836379 | 356 | (delete 'configure)))) |
e2dd54c0 RH |
357 | (home-page "https://git.sr.ht/~sircmpwn/scdoc") |
358 | (synopsis "Simple man page generator") | |
359 | (description "scdoc is a simple man page generator written for POSIX systems | |
360 | in C99.") | |
361 | ;; MIT license, see /share/doc/scdoc-1.6.0/COPYING. | |
9e371e95 | 362 | (license license:expat))) |
e2dd54c0 | 363 | |
dd6b54b8 RW |
364 | (define-public txt2man |
365 | (package | |
366 | (name "txt2man") | |
53c36279 | 367 | (version "1.6.0") |
dd6b54b8 RW |
368 | (source |
369 | (origin | |
fcc8f2fc EF |
370 | (method git-fetch) |
371 | (uri (git-reference | |
372 | (url "https://github.com/mvertes/txt2man") | |
373 | (commit (string-append "txt2man-" version)))) | |
374 | (file-name (git-file-name name version)) | |
dd6b54b8 RW |
375 | (sha256 |
376 | (base32 | |
fcc8f2fc | 377 | "1razjpvlcp85hqli77mwr9nmn5jnv3lm1fxbbqjpx1brv3h1lvm5")))) |
dd6b54b8 RW |
378 | (build-system gnu-build-system) |
379 | (arguments | |
380 | `(#:tests? #f ; no "check" target | |
381 | #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out"))) | |
dc1d3cde | 382 | #:phases (modify-phases %standard-phases (delete 'configure)))) |
dd6b54b8 RW |
383 | (inputs |
384 | `(("gawk" ,gawk))) | |
385 | (home-page "https://github.com/mvertes/txt2man") | |
386 | (synopsis "Convert text to man page") | |
387 | (description "Txt2man converts flat ASCII text to man page format.") | |
9e371e95 | 388 | (license license:gpl2+))) |