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