1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2016 Theodoros Foradis <theodoros@foradis.org>
5 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
6 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
8 ;;; Copyright © 2018 Mathieu Lirzin <mthl@gnu.org>
10 ;;; This file is part of GNU Guix.
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.
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.
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/>.
25 (define-module (gnu packages graphviz)
26 #:use-module (guix packages)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix build-system python)
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)
34 #:use-module (gnu packages guile)
35 #:use-module (gnu packages bison)
36 #:use-module (gnu packages image)
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages pkg-config)
39 #:use-module (gnu packages glib)
40 #:use-module (gnu packages gtk)
41 #:use-module (gnu packages gnome)
42 #:use-module (gnu packages fontutils)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages gd)
45 #:use-module (gnu packages swig)
46 #:use-module (gnu packages python)
47 #:use-module (gnu packages tex)
48 #:use-module ((guix licenses) #:prefix license:))
50 (define-public graphviz
57 "http://www.graphviz.org/pub/graphviz/ARCHIVE/graphviz-"
61 "08d4ygkxz2f553bxj6087da56a23kx1khv0j8ycxa102vvx1hlna"))))
62 (build-system gnu-build-system)
64 ;; FIXME: rtest/rtest.sh is a ksh script (!). Add ksh as an input.
67 (modify-phases %standard-phases
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"))
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")))
83 (rename-file (string-append
84 lib "/graphviz/guile/libgv_guile.so")
89 `(("libXrender" ,libxrender)
92 ("gd" ,gd) ; FIXME: Our GD is too old
93 ("guile" ,guile-2.0) ;Guile bindings
96 ("fontconfig" ,fontconfig)
97 ("freetype" ,freetype)
105 ("pkg-config" ,pkg-config)))
106 (outputs '("out" "doc")) ; 5 MiB of html + pdfs
107 (home-page "http://www.graphviz.org/")
108 (synopsis "Graph visualization software")
110 "Graphviz is a graph visualization tool suite. Graph visualization is a
111 way of representing structural information as diagrams of abstract graphs and
112 networks. It has important applications in networking, bioinformatics,
113 software engineering, database and web design, machine learning, and in visual
114 interfaces for other technical domains.")
115 (license license:epl1.0)))
117 (define-public python-graphviz
119 (name "python-graphviz")
123 (uri (pypi-uri "graphviz" version ".zip"))
126 "0gnl11w98iib7vif92f3vircavy2v1yl9sl54y6hhk1mwm0f07f6"))))
127 (build-system python-build-system)
130 (home-page "https://github.com/xflr6/graphviz")
131 (synopsis "Simple Python interface for Graphviz")
133 "This package provides a simple Python interface for the Graphviz graph
134 visualization tool suite.")
135 (license license:expat)))
137 (define-public python2-graphviz
138 (package-with-python2 python-graphviz))
146 (uri (string-append "mirror://sourceforge/gts/gts/" version
147 "/gts-" version ".tar.gz"))
150 "07mqx09jxh8cv9753y2d2jsv7wp8vjmrd7zcfpbrddz3wc9kx705"))))
151 (build-system gnu-build-system)
154 (modify-phases %standard-phases
155 (add-before 'check 'pre-check
157 (chmod "test/boolean/test.sh" #o777)
160 ;; Some data files used by the test suite are missing.
161 ;; See <http://sourceforge.net/p/gts/bugs/41/>.
164 `(("pkg-config" ,pkg-config)))
166 ;; The gts.pc file has glib-2.0 as required.
168 (home-page "http://gts.sourceforge.net/")
170 ;; Note: Despite the name, this is not official GNU software.
171 (synopsis "Triangulated Surface Library")
173 "Library intended to provide a set of useful functions to deal with
174 3D surfaces meshed with interconnected triangles.")
175 (license license:lgpl2.0+)))
184 (uri (pypi-uri "xdot" version))
187 "1q0f3pskb09saw1qkd2s6vmk80rq5zjhq8l93dfr2x6r04r0q46j"))))
188 (build-system python-build-system)
191 (modify-phases %standard-phases
192 ;; We wrap xdot, so that we don't propagate gtk+ and graphviz
193 (add-after 'install 'wrap
194 (lambda* (#:key inputs outputs #:allow-other-keys)
195 (wrap-program (string-append (assoc-ref outputs "out") "/bin/xdot")
196 `("GI_TYPELIB_PATH" ":" prefix
198 (assoc-ref inputs "gtk+") "/lib/girepository-1.0"
199 ":" (assoc-ref inputs "pango") "/lib/girepository-1.0"
200 ":" (assoc-ref inputs "gdk-pixbuf") "/lib/girepository-1.0"
201 ":" (assoc-ref inputs "atk") "/lib/girepository-1.0")))
203 (,(string-append (assoc-ref inputs "graphviz") "/bin"))))
207 ("gdk-pixbuf" ,gdk-pixbuf+svg)
208 ("graphviz" ,graphviz)
210 ("python-pycairo" ,python-pycairo)
211 ("python-pygobject" ,python-pygobject)))
212 (home-page "https://pypi.python.org/pypi/xdot")
213 (synopsis "Interactive viewer for graphviz dot files")
214 (description "Xdot is an interactive viewer for graphs written in
215 @code{graphviz}’s dot language. Internally, it uses the xdot output format as
216 an intermediate format,and @code{gtk} and @code{cairo} for rendering. Xdot can
217 be used either as a standalone application, or as a python library.")
218 (license license:lgpl3+)))
220 (define-public python-pydot
222 (name "python-pydot")
227 (uri (pypi-uri "pydot" version))
230 "00imlz0033dygb9gdag1xr0cybn33gk5jsdi9ffbszzr97rd7dgd"))))
231 (build-system python-build-system)
232 ;; FIXME: No tests in PyPi release tarball.
233 (arguments '(#:tests? #f))
235 `(("python-pyparsing" ,python-pyparsing)))
236 (home-page "https://github.com/erocarrera/pydot")
237 (synopsis "Python interface to Graphviz's DOT language")
239 "Pydot provides an interface to create, handle, modify and process
240 graphs in Graphviz's DOT language, written in pure Python.")
241 (license license:expat)))
243 (define-public python2-pydot
244 (package-with-python2 python-pydot))
246 (define-public dot2tex
252 (uri (pypi-uri "dot2tex" version))
255 "0jhdwp0wv2h0xb7j2s5xiv7i8yaqgfpwwqcyrjvaxkfwsynm8gkx"))))
256 (build-system python-build-system)
258 `(#:python ,python-2))
260 `(("texlive-latex-preview" ,texlive-latex-preview)
261 ("graphviz" ,graphviz)))
263 `(("python-pyparsing" ,python2-pyparsing)))
264 (home-page "https://github.com/kjellmf/dot2tex")
265 (synopsis "Graphviz to LaTeX converter")
267 "The purpose of @code{dot2tex} is to give graphs generated by Graphviz a
268 more LaTeX friendly look and feel. This is accomplished by converting
269 @code{xdot} output from Graphviz to a series of PSTricks or PGF/TikZ commands.
270 This approach allows:
273 @item Typesetting labels with LaTeX, allowing mathematical notation
274 @item Using native PSTricks and PGF/TikZ commands for drawing arrows
275 @item Using backend specific styles to customize the output
277 (license license:expat)))