| 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2012, 2014 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2014 David Thompson <dthompson2@worcester.edu> |
| 4 | ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> |
| 5 | ;;; |
| 6 | ;;; This file is part of GNU Guix. |
| 7 | ;;; |
| 8 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
| 9 | ;;; under the terms of the GNU General Public License as published by |
| 10 | ;;; the Free Software Foundation; either version 3 of the License, or (at |
| 11 | ;;; your option) any later version. |
| 12 | ;;; |
| 13 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
| 14 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | ;;; GNU General Public License for more details. |
| 17 | ;;; |
| 18 | ;;; You should have received a copy of the GNU General Public License |
| 19 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 20 | |
| 21 | (define-module (gnu packages man) |
| 22 | #:use-module (guix licenses) |
| 23 | #:use-module (guix download) |
| 24 | #:use-module (guix packages) |
| 25 | #:use-module (guix build-system gnu) |
| 26 | #:use-module (gnu packages flex) |
| 27 | #:use-module (gnu packages gawk) |
| 28 | #:use-module (gnu packages gdbm) |
| 29 | #:use-module (gnu packages groff) |
| 30 | #:use-module (gnu packages less) |
| 31 | #:use-module (gnu packages lynx) |
| 32 | #:use-module (gnu packages perl) |
| 33 | #:use-module (gnu packages pkg-config)) |
| 34 | |
| 35 | (define-public libpipeline |
| 36 | (package |
| 37 | (name "libpipeline") |
| 38 | (version "1.3.0") |
| 39 | (source (origin |
| 40 | (method url-fetch) |
| 41 | (uri (string-append |
| 42 | "mirror://savannah/libpipeline/libpipeline-" |
| 43 | version ".tar.gz")) |
| 44 | (sha256 |
| 45 | (base32 |
| 46 | "12d6ldcj7kv2nv832b23v97g7035d0ybq0ig7h0yr7xk9czd3z7i")))) |
| 47 | (build-system gnu-build-system) |
| 48 | (home-page "http://libpipeline.nongnu.org/") |
| 49 | (synopsis "C library for manipulating pipelines of subprocesses") |
| 50 | (description |
| 51 | "libpipeline is a C library for manipulating pipelines of subprocesses in |
| 52 | a flexible and convenient way.") |
| 53 | (license gpl3+))) |
| 54 | |
| 55 | (define-public man-db |
| 56 | (package |
| 57 | (name "man-db") |
| 58 | (version "2.6.6") |
| 59 | (source (origin |
| 60 | (method url-fetch) |
| 61 | (uri (string-append "mirror://savannah/man-db/man-db-" |
| 62 | version ".tar.xz")) |
| 63 | (sha256 |
| 64 | (base32 |
| 65 | "1hv6byj6sg6cp3jyf08gbmdm4pwhvd5hzmb94xl0w7prin6hzabx")))) |
| 66 | (build-system gnu-build-system) |
| 67 | (arguments |
| 68 | '(#:phases |
| 69 | (alist-cons-after |
| 70 | 'patch-source-shebangs 'patch-test-shebangs |
| 71 | (lambda* (#:key outputs #:allow-other-keys) |
| 72 | ;; Patch shebangs in test scripts. |
| 73 | (let ((out (assoc-ref outputs "out"))) |
| 74 | (for-each (lambda (file) |
| 75 | (substitute* file |
| 76 | (("#! /bin/sh") |
| 77 | (string-append "#!" (which "sh"))))) |
| 78 | (remove file-is-directory? |
| 79 | (find-files "src/tests" ".*"))))) |
| 80 | %standard-phases) |
| 81 | #:configure-flags |
| 82 | (let ((groff (assoc-ref %build-inputs "groff")) |
| 83 | (less (assoc-ref %build-inputs "less")) |
| 84 | (gzip (assoc-ref %build-inputs "gzip")) |
| 85 | (bzip2 (assoc-ref %build-inputs "bzip2")) |
| 86 | (xz (assoc-ref %build-inputs "xz"))) |
| 87 | ;; Invoke groff, less, gzip, bzip2, and xz directly from the store. |
| 88 | (append (list "--disable-setuid" ;; Disable setuid man user. |
| 89 | (string-append "--with-pager=" less "/bin/less") |
| 90 | (string-append "--with-gzip=" gzip "/bin/gzip") |
| 91 | (string-append "--with-bzip2=" bzip2 "/bin/gzip") |
| 92 | (string-append "--with-xz=" xz "/bin/xz")) |
| 93 | (map (lambda (prog) |
| 94 | (string-append "--with-" prog "=" groff "/bin/" prog)) |
| 95 | '("nroff" "eqn" "neqn" "tbl" "refer" "pic")))) |
| 96 | #:modules ((guix build gnu-build-system) |
| 97 | (guix build utils) |
| 98 | (srfi srfi-1)))) |
| 99 | (native-inputs |
| 100 | `(("pkg-config" ,pkg-config))) |
| 101 | (inputs |
| 102 | `(("flex" ,flex) |
| 103 | ("gdbm" ,gdbm) |
| 104 | ("groff" ,groff) |
| 105 | ("less" ,less) |
| 106 | ("libpipeline" ,libpipeline))) |
| 107 | (native-search-paths |
| 108 | (list (search-path-specification |
| 109 | (variable "MANPATH") |
| 110 | (files '("share/man"))))) |
| 111 | (home-page "http://man-db.nongnu.org/") |
| 112 | (synopsis "Standard Unix documentation system") |
| 113 | (description |
| 114 | "Man-db is an implementation of the standard Unix documentation system |
| 115 | accessed using the man command. It uses a Berkeley DB database in place of |
| 116 | the traditional flat-text whatis databases.") |
| 117 | (license gpl2+))) |
| 118 | |
| 119 | (define-public man-pages |
| 120 | (package |
| 121 | (name "man-pages") |
| 122 | (version "3.69") |
| 123 | (source (origin |
| 124 | (method url-fetch) |
| 125 | (uri (string-append |
| 126 | "mirror://kernel.org/linux/docs/man-pages/man-pages-" |
| 127 | version ".tar.xz")) |
| 128 | (sha256 |
| 129 | (base32 |
| 130 | "18zzmdzjihdnyg4vamk0jp6v6826vrsgal3kqqxvfq9bzyrh8xm2")))) |
| 131 | (build-system gnu-build-system) |
| 132 | (arguments |
| 133 | '(#:phases (alist-delete 'configure %standard-phases) |
| 134 | |
| 135 | ;; The 'all' target depends on three targets that directly populate |
| 136 | ;; $(MANDIR) based on its current contents. Doing that in parallel |
| 137 | ;; leads to undefined behavior (see <http://bugs.gnu.org/18701>.) |
| 138 | #:parallel-build? #f |
| 139 | |
| 140 | #:tests? #f |
| 141 | #:make-flags (list (string-append "MANDIR=" |
| 142 | (assoc-ref %outputs "out") |
| 143 | "/share/man")))) |
| 144 | (home-page "http://www.kernel.org/doc/man-pages/") |
| 145 | (synopsis "Development manual pages from the Linux project") |
| 146 | (description |
| 147 | "This package provides traditional Unix \"man pages\" documenting the |
| 148 | Linux kernel and C library interfaces employed by user-space programs.") |
| 149 | |
| 150 | ;; Each man page has its own license; some are GPLv2+, some are MIT/X11. |
| 151 | (license gpl2+))) |
| 152 | |
| 153 | (define-public help2man |
| 154 | (package |
| 155 | (name "help2man") |
| 156 | (version "1.46.4") |
| 157 | (source |
| 158 | (origin |
| 159 | (method url-fetch) |
| 160 | (uri (string-append "mirror://gnu/help2man/help2man-" |
| 161 | version ".tar.xz")) |
| 162 | (sha256 |
| 163 | (base32 |
| 164 | "0csn7jx7nhlrflalw1992p3l5afawlpdyjdff2q5bk5hadgz3rqs")))) |
| 165 | (build-system gnu-build-system) |
| 166 | (arguments `(;; There's no `check' target. |
| 167 | #:tests? #f)) |
| 168 | (inputs |
| 169 | `(("perl" ,perl) |
| 170 | ;; TODO: Add these optional dependencies. |
| 171 | ;; ("perl-LocaleGettext" ,perl-LocaleGettext) |
| 172 | ;; ("gettext" ,gnu-gettext) |
| 173 | )) |
| 174 | (home-page "http://www.gnu.org/software/help2man/") |
| 175 | (synopsis "Automatically generate man pages from program --help") |
| 176 | (description |
| 177 | "GNU help2man is a program that converts the output of standard |
| 178 | \"--help\" and \"--version\" command-line arguments into a manual page |
| 179 | automatically.") |
| 180 | (license gpl3+))) |
| 181 | |
| 182 | (define-public txt2man |
| 183 | (package |
| 184 | (name "txt2man") |
| 185 | (version "1.5.6") |
| 186 | (source |
| 187 | (origin |
| 188 | (method url-fetch) |
| 189 | (uri (string-append |
| 190 | "https://github.com/mvertes/txt2man/archive/txt2man-" |
| 191 | version ".tar.gz")) |
| 192 | (sha256 |
| 193 | (base32 |
| 194 | "0sjq687jknq65wbnjh2siq8hc09ydpnlmrkrnwl66mrhd4n9g7fz")))) |
| 195 | (build-system gnu-build-system) |
| 196 | (arguments |
| 197 | `(#:tests? #f ; no "check" target |
| 198 | #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out"))) |
| 199 | #:phases (alist-delete 'configure %standard-phases))) |
| 200 | (inputs |
| 201 | `(("gawk" ,gawk))) |
| 202 | (home-page "https://github.com/mvertes/txt2man") |
| 203 | (synopsis "Convert text to man page") |
| 204 | (description "Txt2man converts flat ASCII text to man page format.") |
| 205 | (license gpl2+))) |