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 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 "0gqgs4zc3r87apns0k5qp689p2ylxx2596s2mkmkxjjay99brv88"))))
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" ".*"))))))
83 (add-after 'unpack 'patch-iconv-path
84 (lambda* (#:key inputs #:allow-other-keys)
85 (substitute* "src/man.c"
87 (string-append "\"" (which "iconv") "\"")))
90 (let ((groff (assoc-ref %build-inputs "groff"))
91 (groff-minimal (assoc-ref %build-inputs "groff-minimal"))
92 (less (assoc-ref %build-inputs "less"))
93 (gzip (assoc-ref %build-inputs "gzip"))
94 (bzip2 (assoc-ref %build-inputs "bzip2"))
95 (xz (assoc-ref %build-inputs "xz"))
96 (util (assoc-ref %build-inputs "util-linux")))
97 ;; Invoke groff, less, gzip, bzip2, and xz directly from the store.
98 (append (list ;; Disable setuid man user.
100 ;; Don't constrain ownership of system-wide cache files.
101 ;; Otherwise creating the manpage database fails with
103 "--disable-cache-owner"
104 (string-append "--with-pager=" less "/bin/less")
105 (string-append "--with-gzip=" gzip "/bin/gzip")
106 (string-append "--with-bzip2=" bzip2 "/bin/gzip")
107 (string-append "--with-xz=" xz "/bin/xz")
108 (string-append "--with-col=" util "/bin/col")
109 ;; Default value is "/usr/lib/tmpfiles.d" (not
110 ;; prefix-sensitive).
111 (string-append "--with-systemdtmpfilesdir="
112 %output "/lib/tmpfiles.d"))
114 (string-append "--with-" prog "=" groff-minimal
116 '("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))
118 ;; At run time we should refer to GROFF-MINIMAL, not GROFF (the latter
120 #:disallowed-references (,groff)
122 #:modules ((guix build gnu-build-system)
126 `(("pkg-config" ,pkg-config)
127 ("groff" ,groff))) ;needed at build time (troff, grops, soelim, etc.)
131 ("groff-minimal" ,groff-minimal)
133 ("libpipeline" ,libpipeline)
134 ("util-linux" ,util-linux)))
136 (list (search-path-specification
138 (files '("share/man")))))
139 (home-page "http://man-db.nongnu.org/")
140 (synopsis "Standard Unix documentation system")
142 "Man-db is an implementation of the standard Unix documentation system
143 accessed using the man command. It uses a Berkeley DB database in place of
144 the traditional flat-text whatis databases.")
147 (define-public man-pages
156 "mirror://kernel.org/linux/docs/man-pages/man-pages-"
159 "mirror://kernel.org/linux/docs/man-pages/Archive/"
160 "man-pages-" version ".tar.xz")))
163 "0wf9ymqxk1k5xwcl3n919p66a1aayif3x4cahj4w04y3k1wbhlih"))))
164 (build-system gnu-build-system)
166 '(#:phases (modify-phases %standard-phases (delete 'configure))
168 ;; The 'all' target depends on three targets that directly populate
169 ;; $(MANDIR) based on its current contents. Doing that in parallel
170 ;; leads to undefined behavior (see <http://bugs.gnu.org/18701>.)
174 #:make-flags (list (string-append "MANDIR="
175 (assoc-ref %outputs "out")
177 (home-page "https://www.kernel.org/doc/man-pages/")
178 (synopsis "Development manual pages from the Linux project")
180 "This package provides traditional Unix \"man pages\" documenting the
181 Linux kernel and C library interfaces employed by user-space programs.")
183 ;; Each man page has its own license; some are GPLv2+, some are MIT/X11.
186 (define-public help2man
193 (uri (string-append "mirror://gnu/help2man/help2man-"
197 "1cb14kp380jzk1yi4i7x9d8qplc8c5mgcbgycgs9ggpx34jhp9kw"))))
198 (build-system gnu-build-system)
199 (arguments `(;; There's no `check' target.
203 ;; TODO: Add these optional dependencies.
204 ;; ("perl-LocaleGettext" ,perl-LocaleGettext)
205 ;; ("gettext" ,gettext-minimal)
207 (home-page "https://www.gnu.org/software/help2man/")
208 (synopsis "Automatically generate man pages from program --help")
210 "GNU help2man is a program that converts the output of standard
211 \"--help\" and \"--version\" command-line arguments into a manual page
215 (define-public txt2man
223 "https://github.com/mvertes/txt2man/archive/txt2man-"
227 "168cj96974n2z0igin6j1ic1m45zyic7nm5ark7frq8j78rrx4zn"))))
228 (build-system gnu-build-system)
230 `(#:tests? #f ; no "check" target
231 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
232 #:phases (modify-phases %standard-phases (delete 'configure))))
235 (home-page "https://github.com/mvertes/txt2man")
236 (synopsis "Convert text to man page")
237 (description "Txt2man converts flat ASCII text to man page format.")