1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2014, 2015, 2017 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 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; This file is part of GNU Guix.
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24 (define-module (gnu packages man)
25 #:use-module (guix licenses)
26 #:use-module (guix download)
27 #:use-module (guix packages)
28 #:use-module (guix build-system gnu)
29 #:use-module (gnu packages databases)
30 #:use-module (gnu packages flex)
31 #:use-module (gnu packages gawk)
32 #:use-module (gnu packages groff)
33 #:use-module (gnu packages less)
34 #:use-module (gnu packages perl)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages linux))
38 (define-public libpipeline
45 "mirror://savannah/libpipeline/libpipeline-"
49 "0avg525wvifcvjrwa6i1r6kvahmsswj0mpxrsxzzdzra9wpf2whd"))))
50 (build-system gnu-build-system)
51 (home-page "http://libpipeline.nongnu.org/")
52 (synopsis "C library for manipulating pipelines of subprocesses")
54 "libpipeline is a C library for manipulating pipelines of subprocesses in
55 a flexible and convenient way.")
64 (uri (string-append "mirror://savannah/man-db/man-db-"
68 "1b641kcgjvyc41pj67dn4p0zvwlj1vx3l6nf7qdcc7kf6v5a2cjr"))))
69 (build-system gnu-build-system)
72 (modify-phases %standard-phases
73 (add-after 'patch-source-shebangs 'patch-test-shebangs
74 (lambda* (#:key outputs #:allow-other-keys)
75 ;; Patch shebangs in test scripts.
76 (let ((out (assoc-ref outputs "out")))
77 (for-each (lambda (file)
80 (string-append "#!" (which "sh")))))
81 (remove file-is-directory?
82 (find-files "src/tests" ".*")))
84 (add-after 'unpack 'patch-iconv-path
85 (lambda* (#:key inputs #:allow-other-keys)
86 (substitute* "src/man.c"
88 (string-append "\"" (which "iconv") "\"")))
91 (let ((groff (assoc-ref %build-inputs "groff"))
92 (groff-minimal (assoc-ref %build-inputs "groff-minimal"))
93 (less (assoc-ref %build-inputs "less"))
94 (gzip (assoc-ref %build-inputs "gzip"))
95 (bzip2 (assoc-ref %build-inputs "bzip2"))
96 (xz (assoc-ref %build-inputs "xz"))
97 (util (assoc-ref %build-inputs "util-linux")))
98 ;; Invoke groff, less, gzip, bzip2, and xz directly from the store.
99 (append (list ;; Disable setuid man user.
101 ;; Don't constrain ownership of system-wide cache files.
102 ;; Otherwise creating the manpage database fails with
104 "--disable-cache-owner"
105 (string-append "--with-pager=" less "/bin/less")
106 (string-append "--with-gzip=" gzip "/bin/gzip")
107 (string-append "--with-bzip2=" bzip2 "/bin/gzip")
108 (string-append "--with-xz=" xz "/bin/xz")
109 (string-append "--with-col=" util "/bin/col")
110 ;; Default value is "/usr/lib/tmpfiles.d" (not
111 ;; prefix-sensitive).
112 (string-append "--with-systemdtmpfilesdir="
113 %output "/lib/tmpfiles.d"))
115 (string-append "--with-" prog "=" groff-minimal
117 '("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))
119 ;; At run time we should refer to GROFF-MINIMAL, not GROFF (the latter
121 #:disallowed-references (,groff)
123 #:modules ((guix build gnu-build-system)
127 `(("pkg-config" ,pkg-config)
128 ("groff" ,groff))) ;needed at build time (troff, grops, soelim, etc.)
132 ("groff-minimal" ,groff-minimal)
134 ("libpipeline" ,libpipeline)
135 ;; FIXME: 4.8 and later can use libseccomp, but it causes test
136 ;; failures in the build chroot.
137 ;;("libseccomp" ,libseccomp)
138 ("util-linux" ,util-linux)))
140 (list (search-path-specification
142 (files '("share/man")))))
143 (home-page "http://man-db.nongnu.org/")
144 (synopsis "Standard Unix documentation system")
146 "Man-db is an implementation of the standard Unix documentation system
147 accessed using the man command. It uses a Berkeley DB database in place of
148 the traditional flat-text whatis databases.")
151 (define-public man-pages
160 "mirror://kernel.org/linux/docs/man-pages/man-pages-"
163 "mirror://kernel.org/linux/docs/man-pages/Archive/"
164 "man-pages-" version ".tar.xz")))
167 "1d2d6llazg3inwjiz22cn46mbm5ydpbyh9qb55z4j3nm4w6wrzs7"))))
168 (build-system gnu-build-system)
170 '(#:phases (modify-phases %standard-phases (delete 'configure))
172 ;; The 'all' target depends on three targets that directly populate
173 ;; $(MANDIR) based on its current contents. Doing that in parallel
174 ;; leads to undefined behavior (see <http://bugs.gnu.org/18701>.)
178 #:make-flags (list (string-append "MANDIR="
179 (assoc-ref %outputs "out")
181 (home-page "https://www.kernel.org/doc/man-pages/")
182 (synopsis "Development manual pages from the Linux project")
184 "This package provides traditional Unix \"man pages\" documenting the
185 Linux kernel and C library interfaces employed by user-space programs.")
187 ;; Each man page has its own license; some are GPLv2+, some are MIT/X11.
190 (define-public help2man
197 (uri (string-append "mirror://gnu/help2man/help2man-"
201 "0vz4dlrvy4vc6l7w0a7n668pfa0rdm73wr2gar58wqranyah46yr"))))
202 (build-system gnu-build-system)
203 (arguments `(;; There's no `check' target.
207 ;; TODO: Add these optional dependencies.
208 ;; ("perl-LocaleGettext" ,perl-LocaleGettext)
209 ;; ("gettext" ,gettext-minimal)
211 (home-page "https://www.gnu.org/software/help2man/")
212 (synopsis "Automatically generate man pages from program --help")
214 "GNU help2man is a program that converts the output of standard
215 \"--help\" and \"--version\" command-line arguments into a manual page
219 (define-public txt2man
227 "https://github.com/mvertes/txt2man/archive/txt2man-"
231 "168cj96974n2z0igin6j1ic1m45zyic7nm5ark7frq8j78rrx4zn"))))
232 (build-system gnu-build-system)
234 `(#:tests? #f ; no "check" target
235 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
236 #:phases (modify-phases %standard-phases (delete 'configure))))
239 (home-page "https://github.com/mvertes/txt2man")
240 (synopsis "Convert text to man page")
241 (description "Txt2man converts flat ASCII text to man page format.")