1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages pretty-print)
21 #:use-module (guix packages)
22 #:use-module (guix licenses)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages ghostscript)
27 #:use-module (gnu packages groff)
28 #:use-module (gnu packages imagemagick)
29 #:use-module (gnu packages gv)
30 #:use-module (gnu packages boost)
31 #:use-module (gnu packages bison)
32 #:use-module (gnu packages flex)
33 #:use-module (gnu packages gperf)
34 #:use-module (gnu packages perl))
43 (uri (string-append "mirror://gnu/a2ps/a2ps-"
47 "195k78m1h03m961qn7jr120z815iyb93gwi159p1p9348lyqvbpk"))
48 (patches (search-patches
49 "a2ps-CVE-2001-1593.patch"
50 "a2ps-CVE-2014-0466.patch"))))
51 (build-system gnu-build-system)
53 `(("psutils" ,psutils)
56 ("imagemagick" ,imagemagick)))
62 (modify-phases %standard-phases
63 (add-before 'build 'patch-scripts
66 '("afm/make_fonts_map.sh"
70 (("/bin/rm") (which "rm")))))
71 (add-before 'check 'patch-test-files
72 ;; Alternatively, we could unpatch the shebangs in tstfiles
73 (lambda* (#:key inputs #:allow-other-keys)
74 (let ((perl (assoc-ref inputs "perl")))
75 (substitute* '("tests/ps-ref/includeres.ps"
76 "tests/gps-ref/includeres.ps")
77 (("/usr/local/bin/perl")
78 (string-append perl "/bin/perl"))))
79 ;; Some of the reference postscript contain a 'version 3'
80 ;; string that in inconsistent with the source text in the
81 ;; tstfiles directory. Erroneous search-and-replace?
82 (substitute* '("tests/ps-ref/InsertBlock.ps"
83 "tests/gps-ref/InsertBlock.ps"
84 "tests/ps-ref/bookie.ps"
85 "tests/gps-ref/bookie.ps")
86 (("version 3") "version 2"))
87 (substitute* '("tests/ps-ref/psmandup.ps"
88 "tests/gps-ref/psmandup.ps")
89 (("#! */bin/sh") (string-append
90 "#!" (which "sh")))))))))
91 (home-page "http://www.gnu.org/software/a2ps")
92 (synopsis "Any file to PostScript, including pretty-printing")
94 "GNU a2ps converts almost anything to a PostScript file, ready for
95 printing. It accomplishes this by being able to delegate files to external
96 handlers, such as Groff and Gzip. It handles as many steps as is necessary to
97 produce a pretty-printed file. It also includes some extra abilities for
98 special cases, such as pretty-printing \"--help\" output.")
101 (define-public trueprint
108 (uri (string-append "mirror://gnu/trueprint/trueprint-"
112 "13rkc0fga10xyf56yy9dnq95zndnfadkhxflnp24skszj21y8jqh"))))
113 (build-system gnu-build-system)
115 ;; Must define DIFF_CMD for tests to pass
116 '(#:configure-flags '("CPPFLAGS=-DDIFF_CMD=\\\"diff\\\"")))
117 (home-page "http://www.gnu.org/software/trueprint")
118 (synopsis "Pretty-print C sources and other plain text to PostScript")
120 "GNU Trueprint translates C source code files as PostScript files.
121 In addition to the basic source code output, it can also perform diff-marking,
122 indentation counting, function and file indices and more.")
125 (define-public enscript
132 (uri (string-append "mirror://gnu/enscript/enscript-"
136 "1fy0ymvzrrvs889zanxcaxjfcxarm2d3k43c9frmbl1ld7dblmkd"))))
137 (build-system gnu-build-system)
138 (home-page "http://www.gnu.org/software/enscript")
139 (synopsis "Generating PostScript, including pretty-printing")
141 "GNU Enscript is a program to convert ASCII text files to PostScript,
142 HTML or RTF formats, to be stored in files or sent immediately to a printer.
143 It also includes the capability to perform syntax highlighting for several
144 different programming languages.")
147 (define-public source-highlight
149 (name "source-highlight")
154 (uri (string-append "mirror://gnu/src-highlite/source-highlight-"
158 "18xdalxg7yzrxc1njzgw7aryq2jdm7zq2yqz41sc7k6il5z6lcq1"))))
159 (build-system gnu-build-system)
160 ;; The ctags that comes with emacs does not support the --excmd options,
169 (list (string-append "--with-boost="
170 (assoc-ref %build-inputs "boost")))
171 #:parallel-tests? #f ;There appear to be race conditions
172 #:phases (alist-cons-before
173 'check 'patch-test-files
175 ;; Unpatch shebangs in test input so that source-highlight
176 ;; is still able to infer input language
177 (substitute* '("tests/test.sh"
180 (((string-append "#! *" (which "sh"))) "#!/bin/sh"))
181 ;; Initial patching unrecoverably removes whitespace, so
182 ;; remove it also in the comparison output.
183 (substitute* '("tests/test.sh.html"
184 "tests/test2.sh.html"
185 "tests/test.tcl.html")
186 (("#! */bin/sh") "#!/bin/sh")))
188 (home-page "http://www.gnu.org/software/src-highlite")
189 (synopsis "Produce a document with syntax highlighting from a source file")
191 "GNU source-highlight reads in a source code file and produces an output
192 file in which the keywords are highlighted in different colors to designate
193 their syntactic role. It supports over 150 different languages and it can
194 output to 8 different formats, including HTML, LaTeX and ODF. It can also
195 output to ANSI color escape sequences, so that highlighted source code can be
196 seen in a terminal.")
198 (properties '((ftp-directory . "/gnu/src-highlite")))))
200 (define-public astyle
207 (uri (string-append "mirror://sourceforge/astyle/astyle/astyle%20"
208 version "/astyle_" version "_linux.tar.gz"))
211 "0f9sh9kq5ajp1yz133h00fr9235p1m698x7n3h7zbrhjiwgynd6s"))))
212 (build-system gnu-build-system)
214 `(#:tests? #f ;no tests
215 #:make-flags (list (string-append "prefix=" %output)
218 #:phases (alist-replace
220 (lambda _ (chdir "build/gcc"))
222 'install 'install-libs
223 (lambda* (#:key outputs #:allow-other-keys)
224 ;; Libraries are not installed by default
225 (let* ((output (assoc-ref outputs "out"))
226 (libdir (string-append output "/lib")))
229 (for-each (lambda (l)
231 l (string-append libdir "/" (basename l))))
232 (find-files "bin" "lib*")))))
234 (home-page "http://astyle.sourceforge.net/")
235 (synopsis "Source code indenter, formatter, and beautifier")
237 "Artistic Style is a source code indenter, formatter, and beautifier for
238 the C, C++, C++/CLI, Objective‑C, C#, and Java programming languages.")