Merge branch 'core-updates'
[jackhill/guix/guix.git] / gnu / packages / groff.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2016 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 groff)
22 #:use-module (guix licenses)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix git-download)
26 #:use-module (guix build-system gnu)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages bison)
29 #:use-module (gnu packages ghostscript)
30 #:use-module (gnu packages netpbm)
31 #:use-module (gnu packages perl)
32 #:use-module (gnu packages texinfo))
33
34 (define-public groff
35 (package
36 (name "groff")
37 (version "1.22.3")
38 (source (origin
39 (method url-fetch)
40 (uri (string-append "mirror://gnu/groff/groff-" version
41 ".tar.gz"))
42 (sha256 (base32
43 "1998v2kcs288d3y7kfxpvl369nqi06zbbvjzafyvyl3pr7bajj1s"))
44 (patches (search-patches "groff-source-date-epoch.patch"))))
45 (build-system gnu-build-system)
46 (outputs '("out"
47 "doc")) ;12MiB of PS, PDF, HTML, and examples
48
49 ;; Note: groff's HTML backend uses executables from netpbm when they are in
50 ;; $PATH. In practice, not having them doesn't prevent it from install its
51 ;; own HTML doc, nor does it change its capabilities, so we removed netpbm
52 ;; from 'inputs'.
53
54 (inputs `(("ghostscript" ,ghostscript)))
55 (native-inputs `(("bison" ,bison)
56 ("perl" ,perl)
57 ("psutils" ,psutils)
58 ("texinfo" ,texinfo)))
59 (arguments '(#:parallel-build? #f)) ; parallel build fails
60 (synopsis "Typesetting from plain text mixed with formatting commands")
61 (description
62 "Groff is a typesetting package that reads plain text and produces
63 formatted output based on formatting commands contained within the text. It
64 is usually the formatter of \"man\" documentation pages.")
65 (license gpl3+)
66 (home-page "https://www.gnu.org/software/groff/")))
67
68 ;; There are no releases, so we take the latest commit.
69 (define-public roffit
70 (let ((commit "e5228388e3faf2b7f1ae5bd048ad46ed565304c6")
71 (revision "1"))
72 (package
73 (name "roffit")
74 (version (string-append "0.11-" revision "." (string-take commit 9)))
75 (source (origin
76 (method git-fetch)
77 (uri (git-reference
78 (url "https://github.com/bagder/roffit.git")
79 (commit commit)))
80 (file-name (string-append "roffit-" commit "-checkout"))
81 (sha256
82 (base32
83 "1y7ndbqciy7h0khlpi1bv4v1614vhybnmm4jysj6fwxkw9cwv1nc"))))
84 (build-system gnu-build-system)
85 (arguments
86 `(#:test-target "test"
87 #:make-flags
88 (list (string-append "INSTALLDIR="
89 (assoc-ref %outputs "out") "/bin"))
90 #:phases
91 (modify-phases %standard-phases
92 (delete 'configure)
93 (add-before 'install 'pre-install
94 (lambda* (#:key outputs #:allow-other-keys)
95 (mkdir-p (string-append (assoc-ref outputs "out")
96 "/bin"))
97 #t)))))
98 (inputs
99 `(("perl" ,perl)))
100 (home-page "https://daniel.haxx.se/projects/roffit/")
101 (synopsis "Convert nroff files to HTML")
102 (description
103 "Roffit is a program that reads an nroff file and outputs an HTML file.
104 It is typically used to display man pages on a web site.")
105 (license expat))))