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> |
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 | |
59 | a flexible and convenient way.") | |
60 | (license gpl3+))) | |
67ca0a01 DT |
61 | |
62 | (define-public man-db | |
63 | (package | |
64 | (name "man-db") | |
eee9eab7 | 65 | (version "2.9.3") |
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 | |
eee9eab7 | 72 | "1f4palf5bdyf3f8sa0981cqxn9cjcr2pz53ngrrsybb9n0da2nps")))) |
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 | |
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+))) | |
cb3da233 | 163 | |
c5cd288b LC |
164 | (define-public man-pages |
165 | (package | |
166 | (name "man-pages") | |
0d0c5185 | 167 | (version "5.08") |
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 | |
0d0c5185 | 177 | (base32 "1xzp3f6wvw3wplk1a1x09zfv0jp0pdc9wh95czndh3h8z0qwv9yf")))) |
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 | |
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 | ||
cb3da233 DT |
200 | (define-public help2man |
201 | (package | |
202 | (name "help2man") | |
f605eef2 | 203 | (version "1.47.13") |
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 | |
f605eef2 | 211 | "08q5arxz4j4pyx5q4712c2rn7p7dw7as9xg38yvmsh1c3ynvpy5p")))) |
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 | )) |
642328ab MO |
221 | (native-inputs |
222 | `(("perl" ,perl))) | |
6fd52309 | 223 | (home-page "https://www.gnu.org/software/help2man/") |
cb3da233 DT |
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+))) | |
dd6b54b8 | 230 | |
e2dd54c0 RH |
231 | (define-public scdoc |
232 | (package | |
233 | (name "scdoc") | |
031610aa | 234 | (version "1.10.1") |
e2dd54c0 RH |
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 | |
031610aa | 243 | "13x7g1r56bshvfmlvapvz35ywnbgsh337kywb5kcv8nc6b3j3q40")))) |
e2dd54c0 RH |
244 | (build-system gnu-build-system) |
245 | (arguments | |
84836379 BT |
246 | `(#:make-flags |
247 | (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out"))) | |
e2dd54c0 RH |
248 | #:phases |
249 | (modify-phases %standard-phases | |
84836379 | 250 | (delete 'configure)))) |
e2dd54c0 RH |
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 | ||
dd6b54b8 RW |
258 | (define-public txt2man |
259 | (package | |
260 | (name "txt2man") | |
53c36279 | 261 | (version "1.6.0") |
dd6b54b8 RW |
262 | (source |
263 | (origin | |
fcc8f2fc EF |
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)) | |
dd6b54b8 RW |
269 | (sha256 |
270 | (base32 | |
fcc8f2fc | 271 | "1razjpvlcp85hqli77mwr9nmn5jnv3lm1fxbbqjpx1brv3h1lvm5")))) |
dd6b54b8 RW |
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"))) | |
dc1d3cde | 276 | #:phases (modify-phases %standard-phases (delete 'configure)))) |
dd6b54b8 RW |
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+))) |