gnu: gimp: Update to 2.10.0.
[jackhill/guix/guix.git] / gnu / packages / graphviz.scm
CommitLineData
b1b07d72 1;;; GNU Guix --- Functional package management for GNU
3246cc91 2;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org>
88377435 3;;; Copyright © 2015 Efraim Flashner <efraim@flashner.co.il>
d109b1e8 4;;; Copyright © 2016 Theodoros Foradis <theodoros@foradis.org>
6414410d 5;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
6a4ad78d 6;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
2b295f5a 7;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
d56ecf62 8;;; Copyright © 2018 Mathieu Lirzin <mthl@gnu.org>
b1b07d72
LC
9;;;
10;;; This file is part of GNU Guix.
11;;;
12;;; GNU Guix is free software; you can redistribute it and/or modify it
13;;; under the terms of the GNU General Public License as published by
14;;; the Free Software Foundation; either version 3 of the License, or (at
15;;; your option) any later version.
16;;;
17;;; GNU Guix is distributed in the hope that it will be useful, but
18;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;;; GNU General Public License for more details.
21;;;
22;;; You should have received a copy of the GNU General Public License
23;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25(define-module (gnu packages graphviz)
26 #:use-module (guix packages)
27 #:use-module (guix build-system gnu)
abdd28e8 28 #:use-module (guix build-system python)
b1b07d72
LC
29 #:use-module (guix download)
30 #:use-module (gnu packages xorg)
31 #:use-module (gnu packages gtk)
32 #:use-module (gnu packages xml)
33 #:use-module (gnu packages glib)
93d2456c 34 #:use-module (gnu packages guile)
b1b07d72 35 #:use-module (gnu packages bison)
e55354b8 36 #:use-module (gnu packages image)
b1b07d72
LC
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages pkg-config)
abdd28e8
TF
39 #:use-module (gnu packages glib)
40 #:use-module (gnu packages gtk)
41 #:use-module (gnu packages gnome)
b1b07d72
LC
42 #:use-module (gnu packages fontutils)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages gd)
93d2456c 45 #:use-module (gnu packages swig)
2b295f5a 46 #:use-module (gnu packages python)
d56ecf62 47 #:use-module (gnu packages tex)
6414410d 48 #:use-module ((guix licenses) #:prefix license:))
b1b07d72
LC
49
50(define-public graphviz
51 (package
52 (name "graphviz")
cca9c756 53 (version "2.40.1")
b1b07d72 54 (source (origin
2170cc76
AI
55 (method url-fetch)
56 (uri (string-append
57 "http://www.graphviz.org/pub/graphviz/ARCHIVE/graphviz-"
58 version ".tar.gz"))
59 (sha256
60 (base32
cca9c756 61 "08d4ygkxz2f553bxj6087da56a23kx1khv0j8ycxa102vvx1hlna"))))
b1b07d72
LC
62 (build-system gnu-build-system)
63 (arguments
64 ;; FIXME: rtest/rtest.sh is a ksh script (!). Add ksh as an input.
65 '(#:tests? #f
2170cc76
AI
66 #:phases
67 (modify-phases %standard-phases
2170cc76
AI
68 (add-after 'install 'move-docs
69 (lambda* (#:key outputs #:allow-other-keys)
70 (let ((out (assoc-ref outputs "out"))
71 (doc (assoc-ref outputs "doc")))
72 (mkdir-p (string-append doc "/share/graphviz"))
73 (rename-file (string-append out "/share/graphviz/doc")
74 (string-append doc "/share/graphviz/doc"))
75 #t)))
76 (add-after 'move-docs 'move-guile-bindings
77 (lambda* (#:key outputs #:allow-other-keys)
78 (let* ((out (assoc-ref outputs "out"))
79 (lib (string-append out "/lib"))
80 (extdir (string-append lib
81 "/guile/2.0/extensions")))
82 (mkdir-p extdir)
83 (rename-file (string-append
84 lib "/graphviz/guile/libgv_guile.so")
85 (string-append extdir
86 "/libgv_guile.so"))
87 #t))))))
b1b07d72
LC
88 (inputs
89 `(("libXrender" ,libxrender)
90 ("libX11" ,libx11)
91 ("gts" ,gts)
92 ("gd" ,gd) ; FIXME: Our GD is too old
93d2456c
RJ
93 ("guile" ,guile-2.0) ;Guile bindings
94 ("swig" ,swig)
b1b07d72
LC
95 ("pango" ,pango)
96 ("fontconfig" ,fontconfig)
97 ("freetype" ,freetype)
3246cc91 98 ("libltdl" ,libltdl)
b1b07d72
LC
99 ("libXaw" ,libxaw)
100 ("expat" ,expat)
101 ("libjpeg" ,libjpeg)
c4c4cc05
JD
102 ("libpng" ,libpng)))
103 (native-inputs
104 `(("bison" ,bison)
b1b07d72 105 ("pkg-config" ,pkg-config)))
88377435 106 (outputs '("out" "doc")) ; 5 MiB of html + pdfs
b1b07d72
LC
107 (home-page "http://www.graphviz.org/")
108 (synopsis "Graph visualization software")
109 (description
30ac136d 110 "Graphviz is a graph visualization tool suite. Graph visualization is a
b1b07d72
LC
111way of representing structural information as diagrams of abstract graphs and
112networks. It has important applications in networking, bioinformatics,
113software engineering, database and web design, machine learning, and in visual
114interfaces for other technical domains.")
6414410d
RW
115 (license license:epl1.0)))
116
117(define-public python-graphviz
118 (package
119 (name "python-graphviz")
4bd76eac 120 (version "0.8.2")
6414410d
RW
121 (source (origin
122 (method url-fetch)
123 (uri (pypi-uri "graphviz" version ".zip"))
124 (sha256
125 (base32
4bd76eac 126 "148h7ln8z65c1723w9vpx8khkvl9iigh8csv0qd4pidc53042rv0"))))
6414410d
RW
127 (build-system python-build-system)
128 (native-inputs
129 `(("unzip" ,unzip)))
130 (home-page "https://github.com/xflr6/graphviz")
131 (synopsis "Simple Python interface for Graphviz")
132 (description
133 "This package provides a simple Python interface for the Graphviz graph
134visualization tool suite.")
135 (license license:expat)))
136
137(define-public python2-graphviz
138 (package-with-python2 python-graphviz))
b1b07d72
LC
139
140(define-public gts
141 (package
142 (name "gts")
143 (version "0.7.6")
144 (source (origin
145 (method url-fetch)
de67e922
LF
146 (uri (string-append "mirror://sourceforge/gts/gts/" version
147 "/gts-" version ".tar.gz"))
b1b07d72
LC
148 (sha256
149 (base32
150 "07mqx09jxh8cv9753y2d2jsv7wp8vjmrd7zcfpbrddz3wc9kx705"))))
151 (build-system gnu-build-system)
152 (arguments
153 '(#:phases (alist-cons-before
154 'check 'pre-check
155 (lambda _
156 (chmod "test/boolean/test.sh" #o777))
157 %standard-phases)
158
159 ;; Some data files used by the test suite are missing.
160 ;; See <http://sourceforge.net/p/gts/bugs/41/>.
161 #:tests? #f))
c4c4cc05 162 (native-inputs
b1b07d72
LC
163 `(("pkg-config" ,pkg-config)))
164 (propagated-inputs
165 ;; The gts.pc file has glib-2.0 as required.
166 `(("glib" ,glib)))
167 (home-page "http://gts.sourceforge.net/")
168
169 ;; Note: Despite the name, this is not official GNU software.
170 (synopsis "Triangulated Surface Library")
171 (description
172 "Library intended to provide a set of useful functions to deal with
1733D surfaces meshed with interconnected triangles.")
6414410d 174 (license license:lgpl2.0+)))
abdd28e8
TF
175
176(define-public xdot
177 (package
178 (name "xdot")
179 (version "0.7")
180 (source
181 (origin
182 (method url-fetch)
183 (uri (pypi-uri "xdot" version))
184 (sha256
185 (base32
186 "1q0f3pskb09saw1qkd2s6vmk80rq5zjhq8l93dfr2x6r04r0q46j"))))
187 (build-system python-build-system)
188 (arguments
189 `(#:phases
190 (modify-phases %standard-phases
191 ;; We wrap xdot, so that we don't propagate gtk+ and graphviz
192 (add-after 'install 'wrap
193 (lambda* (#:key inputs outputs #:allow-other-keys)
194 (wrap-program (string-append (assoc-ref outputs "out") "/bin/xdot")
195 `("GI_TYPELIB_PATH" ":" prefix
196 (,(string-append
197 (assoc-ref inputs "gtk+") "/lib/girepository-1.0"
198 ":" (assoc-ref inputs "pango") "/lib/girepository-1.0"
199 ":" (assoc-ref inputs "gdk-pixbuf") "/lib/girepository-1.0"
200 ":" (assoc-ref inputs "atk") "/lib/girepository-1.0")))
201 `("PATH" ":" prefix
202 (,(string-append (assoc-ref inputs "graphviz") "/bin"))))
203 #t)))))
204 (inputs
205 `(("atk" ,atk)
206 ("gdk-pixbuf" ,gdk-pixbuf+svg)
207 ("graphviz" ,graphviz)
208 ("gtk+" ,gtk+)
209 ("python-pycairo" ,python-pycairo)
210 ("python-pygobject" ,python-pygobject)))
211 (home-page "https://pypi.python.org/pypi/xdot")
212 (synopsis "Interactive viewer for graphviz dot files")
213 (description "Xdot is an interactive viewer for graphs written in
214@code{graphviz}’s dot language. Internally, it uses the xdot output format as
215an intermediate format,and @code{gtk} and @code{cairo} for rendering. Xdot can
216be used either as a standalone application, or as a python library.")
6414410d 217 (license license:lgpl3+)))
2b295f5a
GB
218
219(define-public python-pydot
220 (package
221 (name "python-pydot")
222 (version "1.2.3")
223 (source
224 (origin
225 (method url-fetch)
226 (uri (pypi-uri "pydot" version))
227 (sha256
228 (base32
229 "00imlz0033dygb9gdag1xr0cybn33gk5jsdi9ffbszzr97rd7dgd"))))
230 (build-system python-build-system)
231 ;; FIXME: No tests in PyPi release tarball.
232 (arguments '(#:tests? #f))
233 (propagated-inputs
234 `(("python-pyparsing" ,python-pyparsing)))
235 (home-page "https://github.com/erocarrera/pydot")
236 (synopsis "Python interface to Graphviz's DOT language")
237 (description
238 "Pydot provides an interface to create, handle, modify and process
239graphs in Graphviz's DOT language, written in pure Python.")
240 (license license:expat)))
241
242(define-public python2-pydot
243 (package-with-python2 python-pydot))
d56ecf62
ML
244
245(define-public dot2tex
246 (package
247 (name "dot2tex")
248 (version "2.9.0")
249 (source (origin
250 (method url-fetch)
251 (uri (pypi-uri "dot2tex" version))
252 (sha256
253 (base32
254 "0jhdwp0wv2h0xb7j2s5xiv7i8yaqgfpwwqcyrjvaxkfwsynm8gkx"))))
255 (build-system python-build-system)
256 (arguments
257 `(#:python ,python-2))
258 (inputs
259 `(("texlive-latex-preview" ,texlive-latex-preview)
260 ("graphviz" ,graphviz)))
261 (propagated-inputs
262 `(("python-pyparsing" ,python2-pyparsing)))
263 (home-page "https://github.com/kjellmf/dot2tex")
264 (synopsis "Graphviz to LaTeX converter")
265 (description
266 "The purpose of @code{dot2tex} is to give graphs generated by Graphviz a
267more LaTeX friendly look and feel. This is accomplished by converting
268@code{xdot} output from Graphviz to a series of PSTricks or PGF/TikZ commands.
269This approach allows:
270
271@itemize @bullet
272@item Typesetting labels with LaTeX, allowing mathematical notation
273@item Using native PSTricks and PGF/TikZ commands for drawing arrows
274@item Using backend specific styles to customize the output
275@end itemize")
276 (license license:expat)))