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>
10 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
12 ;;; This file is part of GNU Guix.
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.
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.
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/>.
27 (define-module (gnu packages man)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix git-download)
30 #:use-module (guix download)
31 #:use-module (guix packages)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system ruby)
34 #:use-module (gnu packages dbm)
35 #:use-module (gnu packages flex)
36 #:use-module (gnu packages gawk)
37 #:use-module (gnu packages groff)
38 #:use-module (gnu packages less)
39 #:use-module (gnu packages perl)
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages linux)
42 #:use-module (gnu packages xml))
44 (define-public xmltoman
52 (string-append "https://sourceforge.net/projects/xmltoman/files/"
53 "xmltoman/xmltoman-" version ".tar.gz/xmltoman-"
54 version ".tar.gz/download"))
56 (base32 "1c0lvzr7kdy63wbn1jv6s126ds7add3pxqb0vlxd3v5a2sir91wl"))))
57 (build-system gnu-build-system)
59 `(#:tests? #f ; No tests
62 (string-append "PREFIX="
63 (assoc-ref %outputs "out")))
65 (modify-phases %standard-phases
66 (delete 'configure))))
69 ("perl-xml-parser" ,perl-xml-parser)))
70 (synopsis "XML to Man converter")
71 (description "XMLtoMan and XMLMantoHTML are two small scripts to convert xml
72 to man pages in groff format or html. It features the usual man page items such
73 as description, options, see also, etc.")
74 (home-page "http://xmltoman.sourceforge.net/")
75 (license license:gpl2+)))
86 (url "https://github.com/rtomayko/ronn.git")
89 (git-file-name name version))
91 (base32 "0fkniz7j1jp8v3i05m6hks3nsh6rzvjfi0ichpi7h4gwk5byxb94"))))
92 (build-system ruby-build-system)
94 `(#:tests? #f)) ; Library hpricot not available
95 (synopsis "Manual authoring tool")
96 (description "Ronn builds manuals. It converts simple, human readable
97 textfiles to roff for terminal display, and also to HTML for the web.")
98 (home-page "https://rtomayko.github.io/ronn/")
99 (license license:expat)))
101 (define-public libpipeline
108 "mirror://savannah/libpipeline/libpipeline-"
112 "1c5dl017xil2ssb6a5vg927bnsbc9vymfgi9ahvqbb8gypx0igsx"))))
113 (build-system gnu-build-system)
114 (home-page "http://libpipeline.nongnu.org/")
115 (synopsis "C library for manipulating pipelines of subprocesses")
117 "libpipeline is a C library for manipulating pipelines of subprocesses in
118 a flexible and convenient way.")
119 (license license:gpl3+)))
121 (define-public man-db
127 (uri (string-append "mirror://savannah/man-db/man-db-"
131 "1f4palf5bdyf3f8sa0981cqxn9cjcr2pz53ngrrsybb9n0da2nps"))))
132 (build-system gnu-build-system)
135 (modify-phases %standard-phases
136 (add-after 'patch-source-shebangs 'patch-test-shebangs
137 (lambda* (#:key outputs #:allow-other-keys)
138 ;; Patch shebangs in test scripts.
139 (let ((out (assoc-ref outputs "out")))
140 (for-each (lambda (file)
143 (string-append "#!" (which "sh")))))
144 (remove file-is-directory?
145 (find-files "src/tests" ".*")))
147 (add-after 'unpack 'patch-absolute-paths
148 (lambda* (#:key inputs #:allow-other-keys)
149 (substitute* "src/man.c"
151 (string-append "\"" (which "iconv") "\"")))
152 ;; Embed an absolute reference to "preconv", otherwise it
153 ;; falls back to searching in PATH and ultimately fails
154 ;; to render unicode data (see <https://bugs.gnu.org/30785>).
155 (substitute* "lib/encodings.c"
156 (("groff_preconv = NULL")
157 (string-append "groff_preconv = \""
158 (assoc-ref inputs "groff-minimal")
162 (let ((groff (assoc-ref %build-inputs "groff"))
163 (groff-minimal (assoc-ref %build-inputs "groff-minimal"))
164 (less (assoc-ref %build-inputs "less"))
165 (gzip (assoc-ref %build-inputs "gzip"))
166 (bzip2 (assoc-ref %build-inputs "bzip2"))
167 (xz (assoc-ref %build-inputs "xz"))
168 (util (assoc-ref %build-inputs "util-linux")))
169 ;; Invoke groff, less, gzip, bzip2, and xz directly from the store.
170 (append (list ;; Disable setuid man user.
172 ;; Don't constrain ownership of system-wide cache files.
173 ;; Otherwise creating the manpage database fails with
175 "--disable-cache-owner"
176 (string-append "--with-pager=" less "/bin/less")
177 (string-append "--with-gzip=" gzip "/bin/gzip")
178 (string-append "--with-bzip2=" bzip2 "/bin/gzip")
179 (string-append "--with-xz=" xz "/bin/xz")
180 (string-append "--with-col=" util "/bin/col")
181 ;; The default systemd directories ignore --prefix.
182 (string-append "--with-systemdsystemunitdir="
183 %output "/lib/systemd/system")
184 (string-append "--with-systemdtmpfilesdir="
185 %output "/lib/tmpfiles.d"))
187 (string-append "--with-" prog "=" groff-minimal
189 '("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))
191 ;; At run time we should refer to GROFF-MINIMAL, not GROFF (the latter
193 #:disallowed-references (,groff)
195 #:modules ((guix build gnu-build-system)
199 `(("pkg-config" ,pkg-config)
201 ("groff" ,groff))) ;needed at build time (troff, grops, soelim, etc.)
204 ("groff-minimal" ,groff-minimal)
206 ("libpipeline" ,libpipeline)
207 ;; FIXME: 4.8 and later can use libseccomp, but it causes test
208 ;; failures in the build chroot.
209 ;;("libseccomp" ,libseccomp)
210 ("util-linux" ,util-linux)))
212 (list (search-path-specification
214 (files '("share/man")))))
215 (home-page "http://man-db.nongnu.org/")
216 (synopsis "Standard Unix documentation system")
218 "Man-db is an implementation of the standard Unix documentation system
219 accessed using the man command. It uses a Berkeley DB database in place of
220 the traditional flat-text whatis databases.")
221 (license license:gpl2+)))
223 (define-public man-pages
231 (list (string-append "mirror://kernel.org/linux/docs/man-pages/"
232 "man-pages-" version ".tar.xz")
233 (string-append "mirror://kernel.org/linux/docs/man-pages/Archive/"
234 "man-pages-" version ".tar.xz")))
236 (base32 "1xzp3f6wvw3wplk1a1x09zfv0jp0pdc9wh95czndh3h8z0qwv9yf"))))
237 (build-system gnu-build-system)
239 '(#:phases (modify-phases %standard-phases (delete 'configure))
241 ;; The 'all' target depends on three targets that directly populate
242 ;; $(MANDIR) based on its current contents. Doing that in parallel
243 ;; leads to undefined behavior (see <http://bugs.gnu.org/18701>.)
247 #:make-flags (list (string-append "MANDIR="
248 (assoc-ref %outputs "out")
250 (home-page "https://www.kernel.org/doc/man-pages/")
251 (synopsis "Development manual pages from the Linux project")
253 "This package provides traditional Unix \"man pages\" documenting the
254 Linux kernel and C library interfaces employed by user-space programs.")
256 ;; Each man page has its own license; some are GPLv2+, some are MIT/X11.
257 (license license:gpl2+)))
259 (define-public help2man
266 (uri (string-append "mirror://gnu/help2man/help2man-"
270 "08q5arxz4j4pyx5q4712c2rn7p7dw7as9xg38yvmsh1c3ynvpy5p"))))
271 (build-system gnu-build-system)
272 (arguments `(;; There's no `check' target.
276 ;; TODO: Add these optional dependencies.
277 ;; ("perl-LocaleGettext" ,perl-LocaleGettext)
278 ;; ("gettext" ,gettext-minimal)
282 (home-page "https://www.gnu.org/software/help2man/")
283 (synopsis "Automatically generate man pages from program --help")
285 "GNU help2man is a program that converts the output of standard
286 \"--help\" and \"--version\" command-line arguments into a manual page
288 (license license:gpl3+)))
297 (uri (string-append "https://git.sr.ht/%7Esircmpwn/scdoc/archive/" version
299 (file-name (string-append name "-" version ".tar.gz"))
302 "13x7g1r56bshvfmlvapvz35ywnbgsh337kywb5kcv8nc6b3j3q40"))))
303 (build-system gnu-build-system)
306 (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out")))
308 (modify-phases %standard-phases
309 (delete 'configure))))
310 (home-page "https://git.sr.ht/~sircmpwn/scdoc")
311 (synopsis "Simple man page generator")
312 (description "scdoc is a simple man page generator written for POSIX systems
314 ;; MIT license, see /share/doc/scdoc-1.6.0/COPYING.
315 (license license:expat)))
317 (define-public txt2man
325 (url "https://github.com/mvertes/txt2man")
326 (commit (string-append "txt2man-" version))))
327 (file-name (git-file-name name version))
330 "1razjpvlcp85hqli77mwr9nmn5jnv3lm1fxbbqjpx1brv3h1lvm5"))))
331 (build-system gnu-build-system)
333 `(#:tests? #f ; no "check" target
334 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
335 #:phases (modify-phases %standard-phases (delete 'configure))))
338 (home-page "https://github.com/mvertes/txt2man")
339 (synopsis "Convert text to man page")
340 (description "Txt2man converts flat ASCII text to man page format.")
341 (license license:gpl2+)))