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>
11 ;;; This file is part of GNU Guix.
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.
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.
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/>.
26 (define-module (gnu packages man)
27 #:use-module (guix licenses)
28 #:use-module (guix git-download)
29 #:use-module (guix download)
30 #:use-module (guix packages)
31 #:use-module (guix build-system gnu)
32 #:use-module (gnu packages dbm)
33 #:use-module (gnu packages flex)
34 #:use-module (gnu packages gawk)
35 #:use-module (gnu packages groff)
36 #:use-module (gnu packages less)
37 #:use-module (gnu packages perl)
38 #:use-module (gnu packages pkg-config)
39 #:use-module (gnu packages linux))
41 (define-public libpipeline
48 "mirror://savannah/libpipeline/libpipeline-"
52 "1ysrn22ixd4nmggy6f7qcsm7waadmlbg2i0n9mh6g7dfq54wcngx"))))
53 (build-system gnu-build-system)
54 (home-page "http://libpipeline.nongnu.org/")
55 (synopsis "C library for manipulating pipelines of subprocesses")
57 "libpipeline is a C library for manipulating pipelines of subprocesses in
58 a flexible and convenient way.")
67 (uri (string-append "mirror://savannah/man-db/man-db-"
71 "0ky7aq8313xa1y0zdwdbz5yvjfjb3xy0xymbimd2d9q9bky8lgds"))))
72 (build-system gnu-build-system)
75 (modify-phases %standard-phases
76 (add-after 'patch-source-shebangs 'patch-test-shebangs
77 (lambda* (#:key outputs #:allow-other-keys)
78 ;; Patch shebangs in test scripts.
79 (let ((out (assoc-ref outputs "out")))
80 (for-each (lambda (file)
83 (string-append "#!" (which "sh")))))
84 (remove file-is-directory?
85 (find-files "src/tests" ".*")))
87 (add-after 'unpack 'patch-absolute-paths
88 (lambda* (#:key inputs #:allow-other-keys)
89 (substitute* "src/man.c"
91 (string-append "\"" (which "iconv") "\"")))
92 ;; Embed an absolute reference to "preconv", otherwise it
93 ;; falls back to searching in PATH and ultimately fails
94 ;; to render unicode data (see <https://bugs.gnu.org/30785>).
95 (substitute* "lib/encodings.c"
96 (("groff_preconv = NULL")
97 (string-append "groff_preconv = \""
98 (assoc-ref inputs "groff-minimal")
102 (let ((groff (assoc-ref %build-inputs "groff"))
103 (groff-minimal (assoc-ref %build-inputs "groff-minimal"))
104 (less (assoc-ref %build-inputs "less"))
105 (gzip (assoc-ref %build-inputs "gzip"))
106 (bzip2 (assoc-ref %build-inputs "bzip2"))
107 (xz (assoc-ref %build-inputs "xz"))
108 (util (assoc-ref %build-inputs "util-linux")))
109 ;; Invoke groff, less, gzip, bzip2, and xz directly from the store.
110 (append (list ;; Disable setuid man user.
112 ;; Don't constrain ownership of system-wide cache files.
113 ;; Otherwise creating the manpage database fails with
115 "--disable-cache-owner"
116 (string-append "--with-pager=" less "/bin/less")
117 (string-append "--with-gzip=" gzip "/bin/gzip")
118 (string-append "--with-bzip2=" bzip2 "/bin/gzip")
119 (string-append "--with-xz=" xz "/bin/xz")
120 (string-append "--with-col=" util "/bin/col")
121 ;; The default systemd directories ignore --prefix.
122 (string-append "--with-systemdsystemunitdir="
123 %output "/lib/systemd/system")
124 (string-append "--with-systemdtmpfilesdir="
125 %output "/lib/tmpfiles.d"))
127 (string-append "--with-" prog "=" groff-minimal
129 '("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))
131 ;; At run time we should refer to GROFF-MINIMAL, not GROFF (the latter
133 #:disallowed-references (,groff)
135 #:modules ((guix build gnu-build-system)
139 `(("pkg-config" ,pkg-config)
140 ("groff" ,groff))) ;needed at build time (troff, grops, soelim, etc.)
144 ("groff-minimal" ,groff-minimal)
146 ("libpipeline" ,libpipeline)
147 ;; FIXME: 4.8 and later can use libseccomp, but it causes test
148 ;; failures in the build chroot.
149 ;;("libseccomp" ,libseccomp)
150 ("util-linux" ,util-linux)))
152 (list (search-path-specification
154 (files '("share/man")))))
155 (home-page "http://man-db.nongnu.org/")
156 (synopsis "Standard Unix documentation system")
158 "Man-db is an implementation of the standard Unix documentation system
159 accessed using the man command. It uses a Berkeley DB database in place of
160 the traditional flat-text whatis databases.")
163 (define-public man-pages
171 (list (string-append "mirror://kernel.org/linux/docs/man-pages/"
172 "man-pages-" version ".tar.xz")
173 (string-append "mirror://kernel.org/linux/docs/man-pages/Archive/"
174 "man-pages-" version ".tar.xz")))
176 (base32 "0izb6shcczvg37cyd3kzxsfsrffqj1qw9nqhhq9mi4kd36qkbcfm"))))
177 (build-system gnu-build-system)
179 '(#:phases (modify-phases %standard-phases (delete 'configure))
181 ;; The 'all' target depends on three targets that directly populate
182 ;; $(MANDIR) based on its current contents. Doing that in parallel
183 ;; leads to undefined behavior (see <http://bugs.gnu.org/18701>.)
187 #:make-flags (list (string-append "MANDIR="
188 (assoc-ref %outputs "out")
190 (home-page "https://www.kernel.org/doc/man-pages/")
191 (synopsis "Development manual pages from the Linux project")
193 "This package provides traditional Unix \"man pages\" documenting the
194 Linux kernel and C library interfaces employed by user-space programs.")
196 ;; Each man page has its own license; some are GPLv2+, some are MIT/X11.
199 (define-public help2man
206 (uri (string-append "mirror://gnu/help2man/help2man-"
210 "1yywli520246aba12vpgj7bhr1r13swad3xm49a0cygqcgywnwgk"))))
211 (build-system gnu-build-system)
212 (arguments `(;; There's no `check' target.
216 ;; TODO: Add these optional dependencies.
217 ;; ("perl-LocaleGettext" ,perl-LocaleGettext)
218 ;; ("gettext" ,gettext-minimal)
220 (home-page "https://www.gnu.org/software/help2man/")
221 (synopsis "Automatically generate man pages from program --help")
223 "GNU help2man is a program that converts the output of standard
224 \"--help\" and \"--version\" command-line arguments into a manual page
228 (define-public help2man/latest
234 (uri (string-append "mirror://gnu/help2man/help2man-"
238 "08q5arxz4j4pyx5q4712c2rn7p7dw7as9xg38yvmsh1c3ynvpy5p"))))))
247 (uri (string-append "https://git.sr.ht/%7Esircmpwn/scdoc/archive/" version
249 (file-name (string-append name "-" version ".tar.gz"))
252 "13x7g1r56bshvfmlvapvz35ywnbgsh337kywb5kcv8nc6b3j3q40"))))
253 (build-system gnu-build-system)
256 (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out")))
258 (modify-phases %standard-phases
259 (delete 'configure))))
260 (home-page "https://git.sr.ht/~sircmpwn/scdoc")
261 (synopsis "Simple man page generator")
262 (description "scdoc is a simple man page generator written for POSIX systems
264 ;; MIT license, see /share/doc/scdoc-1.6.0/COPYING.
267 (define-public txt2man
275 (url "https://github.com/mvertes/txt2man")
276 (commit (string-append "txt2man-" version))))
277 (file-name (git-file-name name version))
280 "1razjpvlcp85hqli77mwr9nmn5jnv3lm1fxbbqjpx1brv3h1lvm5"))))
281 (build-system gnu-build-system)
283 `(#:tests? #f ; no "check" target
284 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
285 #:phases (modify-phases %standard-phases (delete 'configure))))
288 (home-page "https://github.com/mvertes/txt2man")
289 (synopsis "Convert text to man page")
290 (description "Txt2man converts flat ASCII text to man page format.")