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