1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (gnu packages pretty-print)
20 #:use-module (guix packages)
21 #:use-module (guix licenses)
22 #:use-module (guix download)
23 #:use-module (guix build-system gnu)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages ghostscript)
26 #:use-module (gnu packages groff)
27 #:use-module (gnu packages imagemagick)
28 #:use-module (gnu packages gv)
29 #:use-module (gnu packages boost)
30 #:use-module (gnu packages bison)
31 #:use-module (gnu packages flex)
32 #:use-module (gnu packages gperf)
33 #:use-module (gnu packages perl)
34 #:use-module (gnu packages file))
43 (uri (string-append "mirror://gnu/a2ps/a2ps-"
47 "195k78m1h03m961qn7jr120z815iyb93gwi159p1p9348lyqvbpk"))))
48 (build-system gnu-build-system)
50 `(("psutils" ,psutils)
53 ("imagemagick" ,imagemagick)))
59 '(#:phases (alist-cons-before
60 'configure 'patch-configure
62 (substitute* "configure"
63 (("/usr/bin/file") (which "file"))))
68 '("afm/make_fonts_map.sh"
72 (("/bin/rm") (which "rm"))))
74 'check 'patch-test-files
75 ;; Alternatively, we could unpatch the shebangs in tstfiles
76 (lambda* (#:key inputs #:allow-other-keys)
77 (let ((perl (assoc-ref inputs "perl")))
78 (substitute* '("tests/ps-ref/includeres.ps"
79 "tests/gps-ref/includeres.ps")
80 (("/usr/local/bin/perl")
81 (string-append perl "/bin/perl"))))
82 ;; Some of the reference postscript contain a 'version 3'
83 ;; string that in inconsistent with the source text in the
84 ;; tstfiles directory. Erroneous search-and-replace?
85 (substitute* '("tests/ps-ref/InsertBlock.ps"
86 "tests/gps-ref/InsertBlock.ps"
87 "tests/ps-ref/bookie.ps"
88 "tests/gps-ref/bookie.ps")
89 (("version 3") "version 2"))
90 (substitute* '("tests/ps-ref/psmandup.ps"
91 "tests/gps-ref/psmandup.ps")
92 (("#! */bin/sh") (string-append
95 (home-page "http://www.gnu.org/software/a2ps")
96 (synopsis "Any file to PostScript, including pretty-printing")
98 "GNU a2ps converts almost anything to a PostScript file, ready for
99 printing. It accomplishes this by being able to delegate files to external
100 handlers, such as Groff and Gzip. It handles as many steps as is necessary to
101 produce a pretty-printed file. It also includes some extra abilities for
102 special cases, such as pretty-printing \"--help\" output.")
105 (define-public trueprint
112 (uri (string-append "mirror://gnu/trueprint/trueprint-"
116 "13rkc0fga10xyf56yy9dnq95zndnfadkhxflnp24skszj21y8jqh"))))
117 (build-system gnu-build-system)
118 (native-inputs `(("file" ,file)))
120 ;; Must define DIFF_CMD for tests to pass
121 '(#:configure-flags '("CPPFLAGS=-DDIFF_CMD=\\\"diff\\\"")
122 #:phases (alist-cons-before
123 'configure 'patch-configure
125 (substitute* "configure"
126 (("/usr/bin/file") (which "file"))))
128 (home-page "http://www.gnu.org/software/trueprint")
129 (synopsis "Pretty-print C sources and other plain text to PostScript")
131 "GNU Trueprint translates C source code files as PostScript files.
132 In addition to the basic source code output, it can also perform diff-marking,
133 indentation counting, function and file indices and more.")
136 (define-public enscript
143 (uri (string-append "mirror://gnu/enscript/enscript-"
147 "1fy0ymvzrrvs889zanxcaxjfcxarm2d3k43c9frmbl1ld7dblmkd"))))
148 (build-system gnu-build-system)
149 (home-page "http://www.gnu.org/software/enscript")
150 (synopsis "Generating PostScript, including pretty-printing")
152 "GNU Enscript is a program to convert ASCII text files to PostScript,
153 HTML or RTF formats, to be stored in files or sent immediately to a printer.
154 It also includes the capability to perform syntax highlighting for several
155 different programming languages.")
158 (define-public source-highlight
160 (name "source-highlight")
165 (uri (string-append "mirror://gnu/src-highlite/source-highlight-"
169 "1s49ld8cnpzhhwq0r7s0sfm3cg3nhhm0wla27lwraifrrl3y1cp1"))
172 ;; Patch submitted as Savannah item #41786
173 "source-highlight-regexrange-test.patch")))))
174 (build-system gnu-build-system)
175 ;; The ctags that comes with emacs does not support the --excmd options,
185 (list (string-append "--with-boost="
186 (assoc-ref %build-inputs "boost")))
187 #:parallel-tests? #f ;There appear to be race conditions
188 #:phases (alist-cons-before
189 'configure 'patch-configure
191 (substitute* "configure"
192 (("/usr/bin/file") (which "file"))))
194 'check 'patch-test-files
196 ;; Unpatch shebangs in test input so that source-highlight
197 ;; is still able to infer input language
198 (substitute* '("tests/test.sh"
201 (((string-append "#! *" (which "sh"))) "#!/bin/sh"))
202 ;; Initial patching unrecoverably removes whitespace, so
203 ;; remove it also in the comparison output.
204 (substitute* '("tests/test.sh.html"
205 "tests/test2.sh.html"
206 "tests/test.tcl.html")
207 (("#! */bin/sh") "#!/bin/sh")))
209 (home-page "http://www.gnu.org/software/src-highlite")
210 (synopsis "Produce a document with syntax highlighting from a source file")
212 "GNU source-highlight reads in a source code file and produces an output
213 file in which the keywords are highlighted in different colors to designate
214 their syntactic role. It supports over 150 different languages and it can
215 output to 8 different formats, including HTML, LaTeX and ODF. It can also
216 output to ANSI color escape sequences, so that highlighted source code can be
217 seen in a terminal.")