gnu: libssh: Update to 0.9.3 [fixes CVE-2019-14889].
[jackhill/guix/guix.git] / gnu / packages / pretty-print.scm
CommitLineData
58310341 1;;; GNU Guix --- Functional package management for GNU
841bddb4 2;;; Copyright © 2016, 2019 Efraim Flashner <efraim@flashner.co.il>
57b94e9d 3;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
0a15ee7b 4;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
cba988ed 5;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
edb4265e 6;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
f970946c 7;;; Copyright © 2019 Meiyo Peng <meiyo@riseup.net>
58310341
EB
8;;;
9;;; This file is part of GNU Guix.
10;;;
11;;; GNU Guix is free software; you can redistribute it and/or modify it
12;;; under the terms of the GNU General Public License as published by
13;;; the Free Software Foundation; either version 3 of the License, or (at
14;;; your option) any later version.
15;;;
16;;; GNU Guix is distributed in the hope that it will be useful, but
17;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;;; GNU General Public License for more details.
20;;;
21;;; You should have received a copy of the GNU General Public License
22;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24(define-module (gnu packages pretty-print)
25 #:use-module (guix packages)
26 #:use-module (guix licenses)
27 #:use-module (guix download)
0a15ee7b 28 #:use-module (guix build-system cmake)
58310341 29 #:use-module (guix build-system gnu)
6e48fbb1 30 #:use-module (guix utils)
58310341
EB
31 #:use-module (gnu packages)
32 #:use-module (gnu packages ghostscript)
33 #:use-module (gnu packages groff)
34 #:use-module (gnu packages imagemagick)
35 #:use-module (gnu packages gv)
36 #:use-module (gnu packages boost)
37 #:use-module (gnu packages bison)
38 #:use-module (gnu packages flex)
39 #:use-module (gnu packages gperf)
57b94e9d
RW
40 #:use-module (gnu packages lua)
41 #:use-module (gnu packages perl)
0a15ee7b 42 #:use-module (gnu packages pkg-config)
148585c2 43 #:use-module (gnu packages compression))
58310341
EB
44
45(define-public a2ps
46 (package
47 (name "a2ps")
48 (version "4.14")
cba988ed
LC
49 (source (origin
50 (method url-fetch)
51 (uri (string-append "mirror://gnu/a2ps/a2ps-"
52 version ".tar.gz"))
53 (sha256
54 (base32
55 "195k78m1h03m961qn7jr120z815iyb93gwi159p1p9348lyqvbpk"))
56 (modules '((guix build utils)))
57 (snippet
58 ;; Remove timestamp from the installed 'README' file.
6cbee49d
MW
59 '(begin
60 (substitute* "etc/README.in"
61 (("@date@")
62 "1st of some month, sometime after 1970"))
63 #t))
cba988ed
LC
64 (patches (search-patches
65 "a2ps-CVE-2001-1593.patch"
841bddb4
EF
66 "a2ps-CVE-2014-0466.patch"
67 "a2ps-CVE-2015-8107.patch"))))
58310341
EB
68 (build-system gnu-build-system)
69 (inputs
70 `(("psutils" ,psutils)
71 ("groff" ,groff)
72 ("gv" ,gv)
73 ("imagemagick" ,imagemagick)))
74 (native-inputs
75 `(("gperf" ,gperf)
c198872b 76 ("perl" ,perl)))
58310341 77 (arguments
d01f680c
EF
78 '(#:phases
79 (modify-phases %standard-phases
80 (add-before 'build 'patch-scripts
81 (lambda _
82 (substitute*
83 '("afm/make_fonts_map.sh"
84 "tests/defs"
85 "tests/backup.tst"
86 "tests/styles.tst")
87 (("/bin/rm") (which "rm")))))
88 (add-before 'check 'patch-test-files
89 ;; Alternatively, we could unpatch the shebangs in tstfiles
90 (lambda* (#:key inputs #:allow-other-keys)
91 (let ((perl (assoc-ref inputs "perl")))
92 (substitute* '("tests/ps-ref/includeres.ps"
93 "tests/gps-ref/includeres.ps")
94 (("/usr/local/bin/perl")
95 (string-append perl "/bin/perl"))))
96 ;; Some of the reference postscript contain a 'version 3'
97 ;; string that in inconsistent with the source text in the
98 ;; tstfiles directory. Erroneous search-and-replace?
99 (substitute* '("tests/ps-ref/InsertBlock.ps"
100 "tests/gps-ref/InsertBlock.ps"
101 "tests/ps-ref/bookie.ps"
102 "tests/gps-ref/bookie.ps")
103 (("version 3") "version 2"))
104 (substitute* '("tests/ps-ref/psmandup.ps"
105 "tests/gps-ref/psmandup.ps")
106 (("#! */bin/sh") (string-append
107 "#!" (which "sh")))))))))
6fd52309 108 (home-page "https://www.gnu.org/software/a2ps/")
58310341
EB
109 (synopsis "Any file to PostScript, including pretty-printing")
110 (description
111 "GNU a2ps converts almost anything to a PostScript file, ready for
35b9e423 112printing. It accomplishes this by being able to delegate files to external
58310341
EB
113handlers, such as Groff and Gzip. It handles as many steps as is necessary to
114produce a pretty-printed file. It also includes some extra abilities for
115special cases, such as pretty-printing \"--help\" output.")
116 (license gpl3+)))
117
118(define-public trueprint
119 (package
120 (name "trueprint")
121 (version "5.4")
122 (source
123 (origin
124 (method url-fetch)
125 (uri (string-append "mirror://gnu/trueprint/trueprint-"
126 version ".tar.gz"))
127 (sha256
128 (base32
129 "13rkc0fga10xyf56yy9dnq95zndnfadkhxflnp24skszj21y8jqh"))))
130 (build-system gnu-build-system)
58310341
EB
131 (arguments
132 ;; Must define DIFF_CMD for tests to pass
c198872b 133 '(#:configure-flags '("CPPFLAGS=-DDIFF_CMD=\\\"diff\\\"")))
6fd52309 134 (home-page "https://www.gnu.org/software/trueprint/")
58310341
EB
135 (synopsis "Pretty-print C sources and other plain text to PostScript")
136 (description
137 "GNU Trueprint translates C source code files as PostScript files.
138In addition to the basic source code output, it can also perform diff-marking,
139indentation counting, function and file indices and more.")
140 (license gpl2)))
141
142(define-public enscript
143 (package
144 (name "enscript")
145 (version "1.6.6")
146 (source
147 (origin
148 (method url-fetch)
149 (uri (string-append "mirror://gnu/enscript/enscript-"
150 version ".tar.gz"))
151 (sha256
152 (base32
153 "1fy0ymvzrrvs889zanxcaxjfcxarm2d3k43c9frmbl1ld7dblmkd"))))
154 (build-system gnu-build-system)
6fd52309 155 (home-page "https://www.gnu.org/software/enscript/")
58310341
EB
156 (synopsis "Generating PostScript, including pretty-printing")
157 (description
158 "GNU Enscript is a program to convert ASCII text files to PostScript,
e881752c 159HTML or RTF formats, to be stored in files or sent immediately to a printer.
58310341
EB
160It also includes the capability to perform syntax highlighting for several
161different programming languages.")
162 (license gpl3+)))
163
0a15ee7b
MB
164(define-public fmt
165 (package
166 (name "fmt")
864b7f0b 167 (version "6.0.0")
0a15ee7b
MB
168 (source (origin
169 (method url-fetch)
170 (uri (string-append
171 "https://github.com/fmtlib/fmt/releases/download/"
172 version "/fmt-" version ".zip"))
173 (sha256
174 (base32
864b7f0b 175 "0h148anbaqgch6n69pxsvs1c9wmykgd052wmzgdia7qpz8w6p8dl"))))
0a15ee7b
MB
176 (build-system cmake-build-system)
177 (native-inputs
178 `(("unzip" ,unzip)))
d30ac8f8 179 (home-page "http://fmtlib.net/")
0a15ee7b
MB
180 (synopsis "Small and fast C++ formatting library")
181 (description
182 "@code{fmt} (formerly @code{cppformat}) is a formatting library for C++.
183It can be used as a safe alternative to @code{printf} or as a fast alternative
184to @code{IOStreams}.")
185 ;; The library is bsd-2, but documentation and tests include other licenses.
186 (license (list bsd-2 bsd-3 psfl))))
187
58310341
EB
188(define-public source-highlight
189 (package
190 (name "source-highlight")
a952b10c 191 (version "3.1.8")
58310341
EB
192 (source
193 (origin
194 (method url-fetch)
195 (uri (string-append "mirror://gnu/src-highlite/source-highlight-"
196 version ".tar.gz"))
197 (sha256
198 (base32
f905286b 199 "18xdalxg7yzrxc1njzgw7aryq2jdm7zq2yqz41sc7k6il5z6lcq1"))))
58310341
EB
200 (build-system gnu-build-system)
201 ;; The ctags that comes with emacs does not support the --excmd options,
202 ;; so can't be used
203 (inputs
8a1f6a7e 204 `(("boost" ,boost)))
58310341
EB
205 (native-inputs
206 `(("bison" ,bison)
c198872b 207 ("flex" ,flex)))
58310341
EB
208 (arguments
209 `(#:configure-flags
210 (list (string-append "--with-boost="
211 (assoc-ref %build-inputs "boost")))
212 #:parallel-tests? #f ;There appear to be race conditions
dc1d3cde
KK
213 #:phases
214 (modify-phases %standard-phases
215 (add-before 'check 'patch-test-files
216 (lambda _
217 ;; Unpatch shebangs in test input so that source-highlight
218 ;; is still able to infer input language
219 (substitute* '("tests/test.sh"
220 "tests/test2.sh"
221 "tests/test.tcl")
222 (((string-append "#! *" (which "sh"))) "#!/bin/sh"))
223 ;; Initial patching unrecoverably removes whitespace, so
224 ;; remove it also in the comparison output.
225 (substitute* '("tests/test.sh.html"
226 "tests/test2.sh.html"
227 "tests/test.tcl.html")
228 (("#! */bin/sh") "#!/bin/sh"))
229 #t)))))
6fd52309 230 (home-page "https://www.gnu.org/software/src-highlite/")
58310341
EB
231 (synopsis "Produce a document with syntax highlighting from a source file")
232 (description
233 "GNU source-highlight reads in a source code file and produces an output
234file in which the keywords are highlighted in different colors to designate
235their syntactic role. It supports over 150 different languages and it can
236output to 8 different formats, including HTML, LaTeX and ODF. It can also
237output to ANSI color escape sequences, so that highlighted source code can be
238seen in a terminal.")
63e8bb12
LC
239 (license gpl3+)
240 (properties '((ftp-directory . "/gnu/src-highlite")))))
47833c90 241
57b94e9d
RW
242(define-public highlight
243 (package
244 (name "highlight")
34032ff5 245 (version "3.54")
57b94e9d
RW
246 (source
247 (origin
248 (method url-fetch)
249 (uri (string-append "http://www.andre-simon.de/zip/highlight-"
250 version ".tar.bz2"))
251 (sha256
34032ff5 252 (base32 "1l6nxk3vwd7rkxpq9aqisjyps89r008wzn3abh4566q6jigahl4a"))))
57b94e9d
RW
253 (build-system gnu-build-system)
254 (arguments
3a5c0277 255 `(#:tests? #f ; no tests
57b94e9d
RW
256 #:make-flags
257 (let ((confdir (string-append %output "/share/highlight/config/")))
258 (list (string-append "PREFIX=" %output)
259 (string-append "HL_CONFIG_DIR=" confdir)
260 (string-append "conf_dir=" confdir)))
261 #:phases
262 (modify-phases %standard-phases
3a5c0277 263 (delete 'configure) ; no configure script
57b94e9d
RW
264 (add-after 'unpack 'fix-search-for-lua
265 (lambda _
266 (substitute* "src/makefile"
15ceaa91
TGR
267 (("(LUA_PKG_NAME=).*" _ assignment)
268 (string-append assignment "lua-" ,(version-major+minor
269 (package-version lua))
270 "\n")))
57b94e9d
RW
271 #t)))))
272 (inputs
273 `(("lua" ,lua)
274 ("boost" ,boost)))
275 (native-inputs
276 `(("pkg-config" ,pkg-config)))
277 (home-page "http://www.andre-simon.de/doku/highlight/en/highlight.php")
278 (synopsis "Convert code to documents with syntax highlighting")
279 (description "Highlight converts source code to HTML, XHTML, RTF, LaTeX,
280TeX, SVG, BBCode and terminal escape sequences with colored syntax
281highlighting. Language definitions and color themes are customizable.")
282 (license gpl3+)))