gnu: Add python-i3-py.
[jackhill/guix/guix.git] / gnu / packages / graphviz.scm
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 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
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.
11 ;;;
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.
16 ;;;
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/>.
19
20 (define-module (gnu packages graphviz)
21 #:use-module (guix packages)
22 #:use-module (guix build-system gnu)
23 #:use-module (guix download)
24 #:use-module (gnu packages xorg)
25 #:use-module (gnu packages gtk)
26 #:use-module (gnu packages xml)
27 #:use-module (gnu packages glib)
28 #:use-module (gnu packages guile)
29 #:use-module (gnu packages bison)
30 #:use-module (gnu packages image)
31 #:use-module (gnu packages autotools)
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages fontutils)
34 #:use-module (gnu packages compression)
35 #:use-module (gnu packages gd)
36 #:use-module (gnu packages swig)
37 #:use-module ((guix licenses) #:select (lgpl2.0+ epl1.0)))
38
39 (define-public graphviz
40 (package
41 (name "graphviz")
42 (version "2.38.0")
43 (source (origin
44 (method url-fetch)
45 (uri (string-append
46 "http://www.graphviz.org/pub/graphviz/ARCHIVE/graphviz-"
47 version ".tar.gz"))
48 (sha256
49 (base32
50 "17l5czpvv5ilmg17frg0w4qwf89jzh2aglm9fgx0l0aakn6j7al1"))))
51 (build-system gnu-build-system)
52 (arguments
53 ;; FIXME: rtest/rtest.sh is a ksh script (!). Add ksh as an input.
54 '(#:tests? #f
55
56 #:phases (alist-cons-before
57 'build 'pre-build
58 (lambda _
59 ;; Work around bogus makefile when using an external
60 ;; libltdl. Failing to do so, one hits this error:
61 ;; "No rule to make target `-lltdl', needed by `libgvc.la'."
62 (substitute* "lib/gvc/Makefile"
63 (("am__append_5 *=.*")
64 "am_append_5 =\n")))
65 (alist-cons-after
66 'install 'move-docs
67 (lambda* (#:key outputs #:allow-other-keys)
68 (let ((out (assoc-ref outputs "out"))
69 (doc (assoc-ref outputs "doc")))
70 (mkdir-p (string-append doc "/share/graphviz"))
71 (rename-file (string-append out "/share/graphviz/doc")
72 (string-append doc "/share/graphviz/doc"))
73 #t))
74 (alist-cons-after
75 'move-docs 'move-guile-bindings
76 (lambda* (#:key outputs #:allow-other-keys)
77 (let* ((out (assoc-ref outputs "out"))
78 (lib (string-append out "/lib"))
79 (extdir (string-append lib
80 "/guile/2.0/extensions")))
81 (mkdir-p extdir)
82 (rename-file (string-append
83 lib "/graphviz/guile/libgv_guile.so")
84 (string-append extdir
85 "/libgv_guile.so"))))
86 %standard-phases)))))
87 (inputs
88 `(("libXrender" ,libxrender)
89 ("libX11" ,libx11)
90 ("gts" ,gts)
91 ("gd" ,gd) ; FIXME: Our GD is too old
92 ("guile" ,guile-2.0) ;Guile bindings
93 ("swig" ,swig)
94 ("pango" ,pango)
95 ("fontconfig" ,fontconfig)
96 ("freetype" ,freetype)
97 ("libltdl" ,libltdl)
98 ("libXaw" ,libxaw)
99 ("expat" ,expat)
100 ("libjpeg" ,libjpeg)
101 ("libpng" ,libpng)))
102 (native-inputs
103 `(("bison" ,bison)
104 ("pkg-config" ,pkg-config)))
105 (outputs '("out" "doc")) ; 5 MiB of html + pdfs
106 (home-page "http://www.graphviz.org/")
107 (synopsis "Graph visualization software")
108 (description
109 "Graphviz is a graph visualization tool suite. Graph visualization is a
110 way of representing structural information as diagrams of abstract graphs and
111 networks. It has important applications in networking, bioinformatics,
112 software engineering, database and web design, machine learning, and in visual
113 interfaces for other technical domains.")
114 (license epl1.0)))
115
116 (define-public gts
117 (package
118 (name "gts")
119 (version "0.7.6")
120 (source (origin
121 (method url-fetch)
122 (uri (string-append "mirror://sourceforge/gts/gts/" version
123 "/gts-" version ".tar.gz"))
124 (sha256
125 (base32
126 "07mqx09jxh8cv9753y2d2jsv7wp8vjmrd7zcfpbrddz3wc9kx705"))))
127 (build-system gnu-build-system)
128 (arguments
129 '(#:phases (alist-cons-before
130 'check 'pre-check
131 (lambda _
132 (chmod "test/boolean/test.sh" #o777))
133 %standard-phases)
134
135 ;; Some data files used by the test suite are missing.
136 ;; See <http://sourceforge.net/p/gts/bugs/41/>.
137 #:tests? #f))
138 (native-inputs
139 `(("pkg-config" ,pkg-config)))
140 (propagated-inputs
141 ;; The gts.pc file has glib-2.0 as required.
142 `(("glib" ,glib)))
143 (home-page "http://gts.sourceforge.net/")
144
145 ;; Note: Despite the name, this is not official GNU software.
146 (synopsis "Triangulated Surface Library")
147 (description
148 "Library intended to provide a set of useful functions to deal with
149 3D surfaces meshed with interconnected triangles.")
150 (license lgpl2.0+)))