gnu: libidn: Update to 1.30.
[jackhill/guix/guix.git] / gnu / packages / graphics.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Tomáš Čech <sleep_walker@gnu.org>
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 graphics)
21 #:use-module (guix download)
22 #:use-module (guix svn-download)
23 #:use-module (guix packages)
24 #:use-module (guix build-system gnu)
25 #:use-module (guix build-system cmake)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages autotools)
29 #:use-module (gnu packages bash)
30 #:use-module (gnu packages boost)
31 #:use-module (gnu packages fontutils)
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages multiprecision)
35 #:use-module (gnu packages boost)
36 #:use-module (gnu packages gl)
37 #:use-module (gnu packages qt)
38 #:use-module (gnu packages sdl)
39 #:use-module (gnu packages xorg))
40
41 (define-public cgal
42 (package
43 (name "cgal")
44 (version "4.5.1")
45 (source (origin
46 (method url-fetch)
47 (uri (string-append
48 "http://gforge.inria.fr/frs/download.php/file/34402/CGAL-"
49 version ".tar.xz"))
50 (sha256
51 (base32
52 "1565ycbds92bxmhi09avc1jl6ks141ig00j110l49gqxp9swy6zv"))))
53 (build-system cmake-build-system)
54 (arguments
55 '(;; "RelWithDebInfo" is not supported.
56 #:build-type "Release"
57
58 ;; No 'test' target.
59 #:tests? #f))
60 (inputs
61 `(("mpfr" ,mpfr)
62 ("gmp" ,gmp)
63 ("boost" ,boost)))
64 (home-page "http://cgal.org/")
65 (synopsis "Computational geometry algorithms library")
66 (description
67 "CGAL provides easy access to efficient and reliable geometric algorithms
68 in the form of a C++ library. CGAL is used in various areas needing geometric
69 computation, such as: computer graphics, scientific visualization, computer
70 aided design and modeling, geographic information systems, molecular biology,
71 medical imaging, robotics and motion planning, mesh generation, numerical
72 methods, etc. It provides data structures and algorithms such as
73 triangulations, Voronoi diagrams, polygons, polyhedra, mesh generation, and
74 many more.")
75
76 ;; The 'LICENSE' file explains that a subset is available under more
77 ;; permissive licenses.
78 (license license:gpl3+)))
79
80 (define-public ilmbase
81 (package
82 (name "ilmbase")
83 (version "2.2.0")
84 (source (origin
85 (method url-fetch)
86 (uri (string-append "mirror://savannah/openexr/ilmbase-"
87 version ".tar.gz"))
88 (sha256
89 (base32
90 "1izddjwbh1grs8080vmaix72z469qy29wrvkphgmqmcm0sv1by7c"))))
91 (build-system gnu-build-system)
92 (home-page "http://www.openexr.com/")
93 (synopsis "Utility C++ libraries for threads, maths, and exceptions")
94 (description
95 "IlmBase provides several utility libraries for C++. Half is a class
96 that encapsulates ILM's 16-bit floating-point format. IlmThread is a thread
97 abstraction. Imath implements 2D and 3D vectors, 3x3 and 4x4 matrices,
98 quaternions and other useful 2D and 3D math functions. Iex is an
99 exception-handling library.")
100 (license license:bsd-3)))
101
102 (define-public openexr
103 (package
104 (name "openexr")
105 (version "2.2.0")
106 (source (origin
107 (method url-fetch)
108 (uri (string-append "mirror://savannah/openexr/openexr-"
109 version ".tar.gz"))
110 (sha256
111 (base32
112 "0ca2j526n4wlamrxb85y2jrgcv0gf21b3a19rr0gh4rjqkv1581n"))
113 (modules '((guix build utils)))
114 (snippet
115 '(substitute* (find-files "." "tmpDir\\.h")
116 (("\"/var/tmp/\"")
117 "\"/tmp/\"")))
118 (patches (list (search-patch "openexr-missing-samples.patch")))))
119 (build-system gnu-build-system)
120 (native-inputs
121 `(("pkg-config" ,pkg-config)))
122 (propagated-inputs
123 `(("ilmbase" ,ilmbase) ;used in public headers
124 ("zlib" ,zlib))) ;OpenEXR.pc reads "-lz"
125 (home-page "http://www.openexr.com")
126 (synopsis "High-dynamic range file format library")
127 (description
128 "OpenEXR is a high dynamic-range (HDR) image file format developed for
129 use in computer imaging applications. The IlmImf C++ libraries support
130 storage of the \"EXR\" file format for storing 16-bit floating-point images.")
131 (license license:bsd-3)))
132
133 (define-public ctl
134 (package
135 (name "ctl")
136 (version "1.5.2")
137 (source (origin
138 (method url-fetch)
139 (uri (string-append "https://github.com/ampas/CTL/archive/ctl-"
140 version ".tar.gz"))
141 (sha256
142 (base32
143 "1gg04pyvw0m398akn0s1l07g5b1haqv5na1wpi5dii1jjd1w3ynp"))))
144 (build-system cmake-build-system)
145 (arguments '(#:tests? #f)) ;no 'test' target
146
147 ;; Headers include OpenEXR and IlmBase headers.
148 (propagated-inputs `(("openexr" ,openexr)))
149
150 (home-page "http://ampasctl.sourceforge.net")
151 (synopsis "Color Transformation Language")
152 (description
153 "The Color Transformation Language, or CTL, is a small programming
154 language that was designed to serve as a building block for digital color
155 management systems. CTL allows users to describe color transforms in a
156 concise and unambiguous way by expressing them as programs. In order to apply
157 a given transform to an image, the color management system instructs a CTL
158 interpreter to load and run the CTL program that describes the transform. The
159 original and the transformed image constitute the CTL program's input and
160 output.")
161
162 ;; The web site says it's under a BSD-3 license, but the 'LICENSE' file
163 ;; and headers use different wording.
164 (license (license:non-copyleft "file://LICENSE"))))
165
166 (define-public brdf-explorer
167 (package
168 (name "brdf-explorer")
169 (version "17") ;svn revision
170 (source (origin
171 ;; There are no release tarballs, and not even tags in the repo,
172 ;; so use the latest revision.
173 (method svn-fetch)
174 (uri (svn-reference
175 (url "http://github.com/wdas/brdf")
176 (revision (string->number version))))
177 (sha256
178 (base32
179 "1458fwsqxramh0gpnp24x7brfpl9afhvr1wqg6c78xqwf32960m5"))
180 (file-name (string-append name "-" version "-checkout"))))
181 (build-system gnu-build-system)
182 (arguments
183 `(#:phases (modify-phases %standard-phases
184 (replace 'configure
185 (lambda* (#:key outputs #:allow-other-keys)
186 (let ((out (assoc-ref outputs "out")))
187 (chdir "trunk")
188 (zero? (system* "qmake"
189 (string-append
190 "prefix=" out))))))
191 (add-after 'install 'wrap-program
192 (lambda* (#:key outputs #:allow-other-keys)
193 (let* ((out (assoc-ref outputs "out"))
194 (bin (string-append out "/bin"))
195 (data (string-append
196 out "/share/brdf")))
197 (with-directory-excursion bin
198 (rename-file "brdf" ".brdf-real")
199 (call-with-output-file "brdf"
200 (lambda (port)
201 (format port "#!/bin/sh
202 # Run the thing from its home, otherwise it just bails out.
203 cd \"~a\"
204 exec -a \"$0\" ~a/.brdf-real~%"
205 data bin)))
206 (chmod "brdf" #o555))))))))
207 (native-inputs
208 `(("qt" ,qt-4))) ;for 'qmake'
209 (inputs
210 `(("qt" ,qt-4)
211 ("mesa" ,mesa)
212 ("glew" ,glew)
213 ("freeglut" ,freeglut)
214 ("zlib" ,zlib)))
215 (home-page "http://www.disneyanimation.com/technology/brdf.html")
216 (synopsis
217 "Analyze bidirectional reflectance distribution functions (BRDFs)")
218 (description
219 "BRDF Explorer is an application that allows the development and analysis
220 of bidirectional reflectance distribution functions (BRDFs). It can load and
221 plot analytic BRDF functions (coded as functions in OpenGL's GLSL shader
222 language), measured material data from the MERL database, and anisotropic
223 measured material data from MIT CSAIL. Graphs and visualizations update in
224 real time as parameters are changed, making it a useful tool for evaluating
225 and understanding different BRDFs (and other component functions).")
226 (license license:ms-pl)))
227
228 (define-public agg
229 (package
230 (name "agg")
231 (version "2.5")
232 (source (origin
233 (method url-fetch)
234 (uri (string-append "http://www.antigrain.com/agg-"
235 version ".tar.gz"))
236 (sha256
237 (base32 "07wii4i824vy9qsvjsgqxppgqmfdxq0xa87i5yk53fijriadq7mb"))
238 (patches (list (search-patch "agg-am_c_prototype.patch")))))
239 (build-system gnu-build-system)
240 (arguments
241 '(#:configure-flags
242 (list (string-append "--x-includes=" (assoc-ref %build-inputs "libx11")
243 "/include")
244 (string-append "--x-libraries=" (assoc-ref %build-inputs "libx11")
245 "/lib"))
246 #:phases
247 (alist-cons-after
248 'unpack 'autoreconf
249 (lambda _
250 ;; let's call configure from configure phase and not now
251 (substitute* "autogen.sh" (("./configure") "# ./configure"))
252 (zero? (system* "sh" "autogen.sh")))
253 %standard-phases)))
254 (native-inputs
255 `(("pkg-config" ,pkg-config)
256 ("libtool" ,libtool)
257 ("autoconf" ,autoconf)
258 ("automake" ,automake)
259 ("bash" ,bash)))
260 (inputs
261 `(("libx11" ,libx11)
262 ("freetype" ,freetype)
263 ("sdl" ,sdl)))
264 (home-page "http://antigrain.com")
265 (synopsis "High-quality 2D graphics rendering engine for C++")
266 (description
267 "Anti-Grain Geometry is a high quality rendering engine written in C++.
268 It supports sub-pixel resolutions and anti-aliasing. It is also library for
269 rendering SVG graphics.")
270 (license license:gpl2+)))