You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

282 lines
11 KiB

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2014, 2015, 2017, 2018 Ludovic Courtès <>
;;; Copyright © 2014 David Thompson <>
;;; Copyright © 2015, 2016 Ricardo Wurmus <>
;;; Copyright © 2015 Alex Kost <>
;;; Copyright © 2015, 2016, 2020 Efraim Flashner <>
;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <>
;;; Copyright © 2018, 2019 Rutger Helling <>
;;; Copyright © 2018, 2019 Marius Bakke <>
;;; Copyright © 2020 Vincent Legoll <>
;;; This file is part of GNU Guix.
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; GNU General Public License for more details.
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix. If not, see <>.
(define-module (gnu packages man)
#:use-module (guix licenses)
#:use-module (guix git-download)
#:use-module (guix download)
#:use-module (guix packages)
#:use-module (guix build-system gnu)
#:use-module (gnu packages dbm)
#:use-module (gnu packages flex)
#:use-module (gnu packages gawk)
#:use-module (gnu packages groff)
#:use-module (gnu packages less)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages linux))
(define-public libpipeline
(name "libpipeline")
(version "1.5.2")
(source (origin
(method url-fetch)
(uri (string-append
version ".tar.gz"))
(build-system gnu-build-system)
(home-page "")
(synopsis "C library for manipulating pipelines of subprocesses")
"libpipeline is a C library for manipulating pipelines of subprocesses in
a flexible and convenient way.")
(license gpl3+)))
(define-public man-db
(name "man-db")
(version "2.9.3")
(source (origin
(method url-fetch)
(uri (string-append "mirror://savannah/man-db/man-db-"
version ".tar.xz"))
(build-system gnu-build-system)
(modify-phases %standard-phases
(add-after 'patch-source-shebangs 'patch-test-shebangs
(lambda* (#:key outputs #:allow-other-keys)
;; Patch shebangs in test scripts.
(let ((out (assoc-ref outputs "out")))
(for-each (lambda (file)
(substitute* file
(("#! /bin/sh")
(string-append "#!" (which "sh")))))
(remove file-is-directory?
(find-files "src/tests" ".*")))
(add-after 'unpack 'patch-absolute-paths
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "src/man.c"
(string-append "\"" (which "iconv") "\"")))
;; Embed an absolute reference to "preconv", otherwise it
;; falls back to searching in PATH and ultimately fails
;; to render unicode data (see <>).
(substitute* "lib/encodings.c"
(("groff_preconv = NULL")
(string-append "groff_preconv = \""
(assoc-ref inputs "groff-minimal")
(let ((groff (assoc-ref %build-inputs "groff"))
(groff-minimal (assoc-ref %build-inputs "groff-minimal"))
(less (assoc-ref %build-inputs "less"))
(gzip (assoc-ref %build-inputs "gzip"))
(bzip2 (assoc-ref %build-inputs "bzip2"))
(xz (assoc-ref %build-inputs "xz"))
(util (assoc-ref %build-inputs "util-linux")))
;; Invoke groff, less, gzip, bzip2, and xz directly from the store.
(append (list ;; Disable setuid man user.
;; Don't constrain ownership of system-wide cache files.
;; Otherwise creating the manpage database fails with
;; man-db > 2.7.5.
(string-append "--with-pager=" less "/bin/less")
(string-append "--with-gzip=" gzip "/bin/gzip")
(string-append "--with-bzip2=" bzip2 "/bin/gzip")
(string-append "--with-xz=" xz "/bin/xz")
(string-append "--with-col=" util "/bin/col")
;; The default systemd directories ignore --prefix.
(string-append "--with-systemdsystemunitdir="
%output "/lib/systemd/system")
(string-append "--with-systemdtmpfilesdir="
%output "/lib/tmpfiles.d"))
(map (lambda (prog)
(string-append "--with-" prog "=" groff-minimal
"/bin/" prog))
'("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))
;; At run time we should refer to GROFF-MINIMAL, not GROFF (the latter
;; pulls in Perl.)
#:disallowed-references (,groff)
#:modules ((guix build gnu-build-system)
(guix build utils)
(srfi srfi-1))))
`(("pkg-config" ,pkg-config)
("flex" ,flex)
("groff" ,groff))) ;needed at build time (troff, grops, soelim, etc.)
`(("gdbm" ,gdbm)
("groff-minimal" ,groff-minimal)
("less" ,less)
("libpipeline" ,libpipeline)
;; FIXME: 4.8 and later can use libseccomp, but it causes test
;; failures in the build chroot.
;;("libseccomp" ,libseccomp)
("util-linux" ,util-linux)))
(list (search-path-specification
(variable "MANPATH")
(files '("share/man")))))
(home-page "")
(synopsis "Standard Unix documentation system")
"Man-db is an implementation of the standard Unix documentation system
accessed using the man command. It uses a Berkeley DB database in place of
the traditional flat-text whatis databases.")
(license gpl2+)))
(define-public man-pages
(name "man-pages")
(version "5.07")
(method url-fetch)
(list (string-append "mirror://"
"man-pages-" version ".tar.xz")
(string-append "mirror://"
"man-pages-" version ".tar.xz")))
(base32 "13b3q7c67r0wkla4pdihl1qh09k67ms2z5jgzfqgpdqqy6mgziwd"))))
(build-system gnu-build-system)
'(#:phases (modify-phases %standard-phases (delete 'configure))
;; The 'all' target depends on three targets that directly populate
;; $(MANDIR) based on its current contents. Doing that in parallel
;; leads to undefined behavior (see <>.)
#:parallel-build? #f
#:tests? #f
#:make-flags (list (string-append "MANDIR="
(assoc-ref %outputs "out")
(home-page "")
(synopsis "Development manual pages from the Linux project")
"This package provides traditional Unix \"man pages\" documenting the
Linux kernel and C library interfaces employed by user-space programs.")
;; Each man page has its own license; some are GPLv2+, some are MIT/X11.
(license gpl2+)))
(define-public help2man
(name "help2man")
(version "1.47.13")
(method url-fetch)
(uri (string-append "mirror://gnu/help2man/help2man-"
version ".tar.xz"))
(build-system gnu-build-system)
(arguments `(;; There's no `check' target.
#:tests? #f))
`(("perl" ,perl)
;; TODO: Add these optional dependencies.
;; ("perl-LocaleGettext" ,perl-LocaleGettext)
;; ("gettext" ,gettext-minimal)
`(("perl" ,perl)))
(home-page "")
(synopsis "Automatically generate man pages from program --help")
"GNU help2man is a program that converts the output of standard
\"--help\" and \"--version\" command-line arguments into a manual page
(license gpl3+)))
(define-public scdoc
(name "scdoc")
(version "1.10.1")
(method url-fetch)
(uri (string-append "" version
(file-name (string-append name "-" version ".tar.gz"))
(build-system gnu-build-system)
(list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out")))
(modify-phases %standard-phases
(delete 'configure))))
(home-page "")
(synopsis "Simple man page generator")
(description "scdoc is a simple man page generator written for POSIX systems
in C99.")
;; MIT license, see /share/doc/scdoc-1.6.0/COPYING.
(license expat)))
(define-public txt2man
(name "txt2man")
(version "1.6.0")
(method git-fetch)
(uri (git-reference
(url "")
(commit (string-append "txt2man-" version))))
(file-name (git-file-name name version))
(build-system gnu-build-system)
`(#:tests? #f ; no "check" target
#:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
#:phases (modify-phases %standard-phases (delete 'configure))))
`(("gawk" ,gawk)))
(home-page "")
(synopsis "Convert text to man page")
(description "Txt2man converts flat ASCII text to man page format.")
(license gpl2+)))