gnu: groff: Make build reproducible.
[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
60 `(#:parallel-build? #f ; parallel build fails
61 #:phases
62 (modify-phases %standard-phases
63 (add-after 'unpack 'setenv
64 (lambda _
65 (setenv "GS_GENERATE_UUIDS" "0")
66 #t)))))
67 (synopsis "Typesetting from plain text mixed with formatting commands")
68 (description
69 "Groff is a typesetting package that reads plain text and produces
70 formatted output based on formatting commands contained within the text. It
71 is usually the formatter of \"man\" documentation pages.")
72 (license gpl3+)
73 (home-page "https://www.gnu.org/software/groff/")))
74
75 ;; There are no releases, so we take the latest commit.
76 (define-public roffit
77 (let ((commit "e5228388e3faf2b7f1ae5bd048ad46ed565304c6")
78 (revision "1"))
79 (package
80 (name "roffit")
81 (version (string-append "0.11-" revision "." (string-take commit 9)))
82 (source (origin
83 (method git-fetch)
84 (uri (git-reference
85 (url "https://github.com/bagder/roffit.git")
86 (commit commit)))
87 (file-name (string-append "roffit-" commit "-checkout"))
88 (sha256
89 (base32
90 "1y7ndbqciy7h0khlpi1bv4v1614vhybnmm4jysj6fwxkw9cwv1nc"))))
91 (build-system gnu-build-system)
92 (arguments
93 `(#:test-target "test"
94 #:make-flags
95 (list (string-append "INSTALLDIR="
96 (assoc-ref %outputs "out") "/bin"))
97 #:phases
98 (modify-phases %standard-phases
99 (delete 'configure)
100 (add-before 'install 'pre-install
101 (lambda* (#:key outputs #:allow-other-keys)
102 (mkdir-p (string-append (assoc-ref outputs "out")
103 "/bin"))
104 #t)))))
105 (inputs
106 `(("perl" ,perl)))
107 (home-page "https://daniel.haxx.se/projects/roffit/")
108 (synopsis "Convert nroff files to HTML")
109 (description
110 "Roffit is a program that reads an nroff file and outputs an HTML file.
111 It is typically used to display man pages on a web site.")
112 (license expat))))