1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2014, 2015, 2017, 2018, 2021 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–2021 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 (guix utils)
35 #:use-module (gnu packages compression)
36 #:use-module (gnu packages dbm)
37 #:use-module (gnu packages flex)
38 #:use-module (gnu packages gawk)
39 #:use-module (gnu packages groff)
40 #:use-module (gnu packages less)
41 #:use-module (gnu packages perl)
42 #:use-module (gnu packages pkg-config)
43 #:use-module (gnu packages linux)
44 #:use-module (gnu packages xml))
46 (define-public xmltoman
54 (string-append "https://sourceforge.net/projects/xmltoman/files/"
55 "xmltoman/xmltoman-" version ".tar.gz/xmltoman-"
56 version ".tar.gz/download"))
58 (base32 "1c0lvzr7kdy63wbn1jv6s126ds7add3pxqb0vlxd3v5a2sir91wl"))))
59 (build-system gnu-build-system)
61 `(#:tests? #f ; No tests
64 (string-append "PREFIX="
65 (assoc-ref %outputs "out")))
67 (modify-phases %standard-phases
68 (delete 'configure))))
71 ("perl-xml-parser" ,perl-xml-parser)))
72 (synopsis "XML to Man converter")
73 (description "XMLtoMan and XMLMantoHTML are two small scripts to convert xml
74 to man pages in groff format or html. It features the usual man page items such
75 as description, options, see also, etc.")
76 (home-page "http://xmltoman.sourceforge.net/")
77 (license license:gpl2+)))
88 (url "https://github.com/rtomayko/ronn")
91 (git-file-name name version))
93 (base32 "0fkniz7j1jp8v3i05m6hks3nsh6rzvjfi0ichpi7h4gwk5byxb94"))))
94 (build-system ruby-build-system)
96 `(#:tests? #f)) ; Library hpricot not available
97 (synopsis "Manual authoring tool")
98 (description "Ronn builds manuals. It converts simple, human readable
99 textfiles to roff for terminal display, and also to HTML for the web.")
100 (home-page "https://rtomayko.github.io/ronn/")
101 (license license:expat)))
103 (define-public libpipeline
110 "mirror://savannah/libpipeline/libpipeline-"
114 "1c5dl017xil2ssb6a5vg927bnsbc9vymfgi9ahvqbb8gypx0igsx"))))
115 (build-system gnu-build-system)
116 (home-page "http://libpipeline.nongnu.org/")
117 (synopsis "C library for manipulating pipelines of subprocesses")
119 "libpipeline is a C library for manipulating pipelines of subprocesses in
120 a flexible and convenient way.")
121 (license license:gpl3+)))
123 (define-public man-db
129 (uri (string-append "mirror://savannah/man-db/man-db-"
133 "0mk7n7yn6scy785jhg1j14b3q9l0cgvpry49r0ldjsnizbnrjv5n"))))
134 (build-system gnu-build-system)
137 (modify-phases %standard-phases
138 (add-after 'patch-source-shebangs 'patch-test-shebangs
139 (lambda* (#:key outputs #:allow-other-keys)
140 ;; Patch shebangs in test scripts.
141 (let ((out (assoc-ref outputs "out")))
142 (for-each (lambda (file)
145 (string-append "#!" (which "sh")))))
146 (remove file-is-directory?
147 (find-files "src/tests" ".*")))
149 (add-after 'unpack 'patch-absolute-paths
150 (lambda* (#:key inputs #:allow-other-keys)
151 (substitute* "src/man.c"
153 (string-append "\"" (which "iconv") "\"")))
154 ;; Embed an absolute reference to "preconv", otherwise it
155 ;; falls back to searching in PATH and ultimately fails
156 ;; to render unicode data (see <https://bugs.gnu.org/30785>).
157 (substitute* "lib/encodings.c"
158 (("groff_preconv = NULL")
159 (string-append "groff_preconv = \""
160 (assoc-ref inputs "groff-minimal")
164 (let ((groff (assoc-ref %build-inputs "groff"))
165 (groff-minimal (assoc-ref %build-inputs "groff-minimal"))
166 (less (assoc-ref %build-inputs "less"))
167 (gzip (assoc-ref %build-inputs "gzip"))
168 (bzip2 (assoc-ref %build-inputs "bzip2"))
169 (xz (assoc-ref %build-inputs "xz"))
170 (util (assoc-ref %build-inputs "util-linux")))
171 ;; Invoke groff, less, gzip, bzip2, and xz directly from the store.
172 (append (list ;; Disable setuid man user.
174 ;; Don't constrain ownership of system-wide cache files.
175 ;; Otherwise creating the manpage database fails with
177 "--disable-cache-owner"
178 (string-append "--with-pager=" less "/bin/less")
179 (string-append "--with-gzip=" gzip "/bin/gzip")
180 (string-append "--with-bzip2=" bzip2 "/bin/gzip")
181 (string-append "--with-xz=" xz "/bin/xz")
182 (string-append "--with-col=" util "/bin/col")
183 ;; The default systemd directories ignore --prefix.
184 (string-append "--with-systemdsystemunitdir="
185 %output "/lib/systemd/system")
186 (string-append "--with-systemdtmpfilesdir="
187 %output "/lib/tmpfiles.d"))
189 (string-append "--with-" prog "=" groff-minimal
191 '("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))
193 ;; At run time we should refer to GROFF-MINIMAL, not GROFF (the latter
195 #:disallowed-references (,groff)
197 #:modules ((guix build gnu-build-system)
201 `(("pkg-config" ,pkg-config)
203 ("groff" ,groff))) ;needed at build time (troff, grops, soelim, etc.)
206 ("groff-minimal" ,groff-minimal)
208 ("libpipeline" ,libpipeline)
209 ;; FIXME: 4.8 and later can use libseccomp, but it causes test
210 ;; failures in the build chroot.
211 ;;("libseccomp" ,libseccomp)
212 ("util-linux" ,util-linux)))
214 (list (search-path-specification
216 (files '("share/man")))))
217 (home-page "http://man-db.nongnu.org/")
218 (synopsis "Standard Unix documentation system")
220 "Man-db is an implementation of the standard Unix documentation system
221 accessed using the man command. It uses a Berkeley DB database in place of
222 the traditional flat-text whatis databases.")
223 (license license:gpl2+)))
225 (define-public mandoc
231 (uri (string-append "https://mandoc.bsd.lv/snapshots/mandoc-"
235 "1xyqllxpjj1kimlipx11pzyywf5c25i4wmv0lqm7ph3gnlnb86c2"))))
236 (build-system gnu-build-system)
238 `(#:test-target "regress"
239 #:phases (modify-phases %standard-phases
240 (add-before 'configure 'set-prefix
241 (lambda* (#:key outputs #:allow-other-keys)
242 (substitute* "configure"
244 (string-append "CC=" ,(cc-for-target) "\n"))
245 (("^DEFCFLAGS=\\\\\"")
247 (("^UTF8_LOCALE=.*") ;used for tests
248 "UTF8_LOCALE=en_US.UTF-8\n")
249 (("^MANPATH_(BASE|DEFAULT)=.*" _ which)
250 (string-append "MANPATH_" which "="
251 "/run/current-system/profile/share/man\n"))
253 (string-append "PREFIX=" (assoc-ref outputs "out")
255 (native-inputs `(("perl" ,perl))) ;used to run tests
256 (inputs `(("zlib" ,zlib)))
257 (synopsis "Tools for BSD mdoc and man pages")
259 "mandoc is a suite of tools compiling mdoc, the roff macro language of
260 choice for BSD manual pages, and man, the predominant historical language for
261 UNIX manuals. It is small and quite fast. The main component of the toolset
262 is the @command{mandoc} utility program, based on the libmandoc validating
263 compiler, to format output for UTF-8 and ASCII UNIX terminals, HTML 5,
264 PostScript, and PDF. Additional tools include the @command{man} viewer, and
265 @command{apropos} and @command{whatis}.")
266 (home-page "https://mandoc.bsd.lv/")
267 (license license:isc)))
269 (define-public man-pages
277 (list (string-append "mirror://kernel.org/linux/docs/man-pages/"
278 "man-pages-" version ".tar.xz")
279 (string-append "mirror://kernel.org/linux/docs/man-pages/Archive/"
280 "man-pages-" version ".tar.xz")))
282 (base32 "1aiwn6yi19idg4jbf7x4x5i06macjv7r8d5fgp1rwnc4a775vniy"))))
283 (build-system gnu-build-system)
285 '(#:phases (modify-phases %standard-phases (delete 'configure))
287 ;; The 'all' target depends on three targets that directly populate
288 ;; $(MANDIR) based on its current contents. Doing that in parallel
289 ;; leads to undefined behavior (see <http://bugs.gnu.org/18701>.)
293 #:make-flags (list (string-append "MANDIR="
294 (assoc-ref %outputs "out")
296 (home-page "https://www.kernel.org/doc/man-pages/")
297 (synopsis "Development manual pages from the Linux project")
299 "This package provides traditional Unix \"man pages\" documenting the
300 Linux kernel and C library interfaces employed by user-space programs.")
302 ;; Each man page has its own license; some are GPLv2+, some are MIT/X11.
303 (license license:gpl2+)))
305 (define-public help2man
312 (uri (string-append "mirror://gnu/help2man/help2man-"
316 "08q5arxz4j4pyx5q4712c2rn7p7dw7as9xg38yvmsh1c3ynvpy5p"))))
317 (build-system gnu-build-system)
318 (arguments `(;; There's no `check' target.
322 ;; TODO: Add these optional dependencies.
323 ;; ("perl-LocaleGettext" ,perl-LocaleGettext)
324 ;; ("gettext" ,gettext-minimal)
328 (home-page "https://www.gnu.org/software/help2man/")
329 (synopsis "Automatically generate man pages from program --help")
331 "GNU help2man is a program that converts the output of standard
332 \"--help\" and \"--version\" command-line arguments into a manual page
334 (license license:gpl3+)))
344 (url "https://git.sr.ht/~sircmpwn/scdoc")
346 (file-name (git-file-name name version))
348 (base32 "1xmh6fnp378xmiycslg4migs1vx7yly4i1cf2vbbnwim9c9g0aw7"))))
349 (build-system gnu-build-system)
352 (list (string-append "CC=" ,(cc-for-target))
353 (string-append "PREFIX=" (assoc-ref %outputs "out")))
355 (modify-phases %standard-phases
356 (delete 'configure))))
357 (home-page "https://git.sr.ht/~sircmpwn/scdoc")
358 (synopsis "Simple man page generator")
359 (description "scdoc is a simple man page generator written for POSIX systems
361 ;; MIT license, see /share/doc/scdoc-1.6.0/COPYING.
362 (license license:expat)))
364 (define-public txt2man
372 (url "https://github.com/mvertes/txt2man")
373 (commit (string-append "txt2man-" version))))
374 (file-name (git-file-name name version))
377 "1razjpvlcp85hqli77mwr9nmn5jnv3lm1fxbbqjpx1brv3h1lvm5"))))
378 (build-system gnu-build-system)
380 `(#:tests? #f ; no "check" target
381 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
382 #:phases (modify-phases %standard-phases (delete 'configure))))
385 (home-page "https://github.com/mvertes/txt2man")
386 (synopsis "Convert text to man page")
387 (description "Txt2man converts flat ASCII text to man page format.")
388 (license license:gpl2+)))