Merge branch 'gnome-updates'
[jackhill/guix/guix.git] / gnu / packages / graphics.scm
CommitLineData
f327b36e 1;;; GNU Guix --- Functional package management for GNU
f0b86898 2;;; Copyright © 2015, 2016 Ludovic Courtès <ludo@gnu.org>
e9f1fa39 3;;; Copyright © 2015 Tomáš Čech <sleep_walker@gnu.org>
5e8276dc 4;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
0e2f2aeb 5;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
f327b36e
LC
6;;;
7;;; This file is part of GNU Guix.
8;;;
9;;; GNU Guix is free software; you can redistribute it and/or modify it
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
14;;; GNU Guix is distributed in the hope that it will be useful, but
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22(define-module (gnu packages graphics)
23 #:use-module (guix download)
a29bfc28 24 #:use-module (guix svn-download)
f327b36e
LC
25 #:use-module (guix packages)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix build-system cmake)
28 #:use-module ((guix licenses) #:prefix license:)
cab6a253 29 #:use-module (gnu packages)
0e2f2aeb
RW
30 #:use-module (gnu packages algebra)
31 #:use-module (gnu packages audio)
87bafa07
32 #:use-module (gnu packages autotools)
33 #:use-module (gnu packages bash)
96d15e48 34 #:use-module (gnu packages bison)
87bafa07 35 #:use-module (gnu packages boost)
96d15e48
RW
36 #:use-module (gnu packages doxygen)
37 #:use-module (gnu packages haskell)
99d7460d
LC
38 #:use-module (gnu packages image)
39 #:use-module (gnu packages python)
96d15e48 40 #:use-module (gnu packages flex)
87bafa07 41 #:use-module (gnu packages fontutils)
cab6a253 42 #:use-module (gnu packages pkg-config)
0e2f2aeb 43 #:use-module (gnu packages pulseaudio) ;libsndfile, libsamplerate
cab6a253 44 #:use-module (gnu packages compression)
f327b36e 45 #:use-module (gnu packages multiprecision)
a29bfc28
LC
46 #:use-module (gnu packages boost)
47 #:use-module (gnu packages gl)
96d15e48
RW
48 #:use-module (gnu packages glib)
49 #:use-module (gnu packages graphviz)
50 #:use-module (gnu packages gtk)
51 #:use-module (gnu packages gnome)
0e2f2aeb
RW
52 #:use-module (gnu packages image)
53 #:use-module (gnu packages jemalloc)
54 #:use-module (gnu packages photo)
55 #:use-module (gnu packages python)
87bafa07 56 #:use-module (gnu packages qt)
96d15e48 57 #:use-module (gnu packages readline)
87bafa07 58 #:use-module (gnu packages sdl)
0e2f2aeb 59 #:use-module (gnu packages video)
96d15e48 60 #:use-module (gnu packages xml)
87bafa07 61 #:use-module (gnu packages xorg))
f327b36e 62
0e2f2aeb
RW
63(define-public blender
64 (package
65 (name "blender")
66 (version "2.76b")
67 (source (origin
68 (method url-fetch)
69 (uri (string-append "http://download.blender.org/source/"
70 "blender-" version ".tar.gz"))
71 (sha256
72 (base32
73 "0pb0mlj4vj0iir528ifqq67nsh3ca1942933d9cwlbpcja2jm1dx"))))
74 (build-system cmake-build-system)
75 (arguments
76 `(;; Test files are very large and not included in the release tarball.
77 #:tests? #f
78 #:configure-flags
79 (list "-DWITH_CODEC_FFMPEG=ON"
80 "-DWITH_CODEC_SNDFILE=ON"
81 "-DWITH_CYCLES=ON"
82 "-DWITH_DOC_MANPAGE=ON"
83 "-DWITH_FFTW3=ON"
84 "-DWITH_GAMEENGINE=ON"
85 "-DWITH_IMAGE_OPENJPEG=ON"
86 "-DWITH_INPUT_NDOF=ON"
87 "-DWITH_INSTALL_PORTABLE=OFF"
88 "-DWITH_JACK=ON"
89 "-DWITH_MOD_OCEANSIM=ON"
90 "-DWITH_PLAYER=ON"
91 "-DWITH_PYTHON_INSTALL=OFF"
92 "-DWITH_SYSTEM_OPENJPEG=ON")
93 #:phases
94 (modify-phases %standard-phases
95 (add-after 'unpack 'fix-broken-import
96 (lambda _
97 (substitute* "release/scripts/addons/io_scene_fbx/json2fbx.py"
98 (("import encode_bin") "from . import encode_bin"))
99 #t))
100 (add-after 'set-paths 'add-ilmbase-include-path
101 (lambda* (#:key inputs #:allow-other-keys)
102 ;; OpenEXR propagates ilmbase, but its include files do not appear
103 ;; in the CPATH, so we need to add "$ilmbase/include/OpenEXR/" to
104 ;; the CPATH to satisfy the dependency on "half.h".
105 (setenv "CPATH"
106 (string-append (assoc-ref inputs "ilmbase")
107 "/include/OpenEXR"
108 ":" (or (getenv "CPATH") "")))
109 #t)))))
110 (inputs
111 `(("boost" ,boost)
112 ("jemalloc" ,jemalloc)
113 ("libx11" ,libx11)
114 ("openimageio" ,openimageio)
115 ("openexr" ,openexr)
116 ("ilmbase" ,ilmbase)
117 ("openjpeg" ,openjpeg-1)
118 ("libjpeg" ,libjpeg)
119 ("libpng" ,libpng)
120 ("libtiff" ,libtiff)
f0b86898 121 ("ffmpeg-2.8" ,ffmpeg-2.8) ;<https://lists.gnu.org/archive/html/guix-devel/2016-04/msg01019.html>
0e2f2aeb
RW
122 ("fftw" ,fftw)
123 ("jack" ,jack-1)
124 ("libsndfile" ,libsndfile)
125 ("freetype" ,freetype)
126 ("glew" ,glew)
127 ("openal" ,openal)
128 ("python" ,python-wrapper)
129 ("zlib" ,zlib)))
130 (home-page "http://blender.org/")
131 (synopsis "3D graphics creation suite")
132 (description
133 "Blender is a 3D graphics creation suite. It supports the entirety of
134the 3D pipeline—modeling, rigging, animation, simulation, rendering,
135compositing and motion tracking, even video editing and game creation. The
136application can be customized via its API for Python scripting.")
137 (license license:gpl2+)))
138
f327b36e
LC
139(define-public cgal
140 (package
141 (name "cgal")
61fe5a57 142 (version "4.6.3")
f327b36e
LC
143 (source (origin
144 (method url-fetch)
145 (uri (string-append
61fe5a57
AE
146 "http://gforge.inria.fr/frs/download.php/file/"
147 "35139/CGAL-4.6.3.tar.xz"))
f327b36e
LC
148 (sha256
149 (base32
61fe5a57 150 "08gwjjh0qz3fakj1y2nsl2qvb0qv5lc7k1pxwjkagh37hxxh4f73"))))
f327b36e
LC
151 (build-system cmake-build-system)
152 (arguments
153 '(;; "RelWithDebInfo" is not supported.
154 #:build-type "Release"
155
156 ;; No 'test' target.
157 #:tests? #f))
158 (inputs
159 `(("mpfr" ,mpfr)
160 ("gmp" ,gmp)
161 ("boost" ,boost)))
162 (home-page "http://cgal.org/")
163 (synopsis "Computational geometry algorithms library")
164 (description
165 "CGAL provides easy access to efficient and reliable geometric algorithms
166in the form of a C++ library. CGAL is used in various areas needing geometric
167computation, such as: computer graphics, scientific visualization, computer
168aided design and modeling, geographic information systems, molecular biology,
169medical imaging, robotics and motion planning, mesh generation, numerical
170methods, etc. It provides data structures and algorithms such as
171triangulations, Voronoi diagrams, polygons, polyhedra, mesh generation, and
172many more.")
173
174 ;; The 'LICENSE' file explains that a subset is available under more
175 ;; permissive licenses.
176 (license license:gpl3+)))
cab6a253
LC
177
178(define-public ilmbase
179 (package
180 (name "ilmbase")
181 (version "2.2.0")
182 (source (origin
183 (method url-fetch)
184 (uri (string-append "mirror://savannah/openexr/ilmbase-"
185 version ".tar.gz"))
186 (sha256
187 (base32
5e8276dc 188 "1izddjwbh1grs8080vmaix72z469qy29wrvkphgmqmcm0sv1by7c"))
fc1adab1 189 (patches (search-patches "ilmbase-fix-tests.patch"))))
cab6a253
LC
190 (build-system gnu-build-system)
191 (home-page "http://www.openexr.com/")
192 (synopsis "Utility C++ libraries for threads, maths, and exceptions")
193 (description
194 "IlmBase provides several utility libraries for C++. Half is a class
195that encapsulates ILM's 16-bit floating-point format. IlmThread is a thread
196abstraction. Imath implements 2D and 3D vectors, 3x3 and 4x4 matrices,
197quaternions and other useful 2D and 3D math functions. Iex is an
198exception-handling library.")
199 (license license:bsd-3)))
200
201(define-public openexr
202 (package
203 (name "openexr")
204 (version "2.2.0")
205 (source (origin
206 (method url-fetch)
207 (uri (string-append "mirror://savannah/openexr/openexr-"
208 version ".tar.gz"))
209 (sha256
210 (base32
211 "0ca2j526n4wlamrxb85y2jrgcv0gf21b3a19rr0gh4rjqkv1581n"))
212 (modules '((guix build utils)))
213 (snippet
214 '(substitute* (find-files "." "tmpDir\\.h")
215 (("\"/var/tmp/\"")
216 "\"/tmp/\"")))
fc1adab1 217 (patches (search-patches "openexr-missing-samples.patch"))))
cab6a253 218 (build-system gnu-build-system)
bce6f7ce
LF
219 (arguments
220 '(#:phases
221 (modify-phases %standard-phases
222 (add-after 'unpack 'disable-broken-test
223 ;; This test fails on i686. Upstream developers suggest that
224 ;; this test is broken on i686 and can be safely disabled:
225 ;; https://github.com/openexr/openexr/issues/67#issuecomment-21169748
226 (lambda _
227 (substitute* "IlmImfTest/main.cpp"
228 (("#include \"testOptimizedInterleavePatterns.h\"")
229 "//#include \"testOptimizedInterleavePatterns.h\"")
230 (("TEST \\(testOptimizedInterleavePatterns")
231 "//TEST (testOptimizedInterleavePatterns"))
232 #t)))))
cab6a253
LC
233 (native-inputs
234 `(("pkg-config" ,pkg-config)))
235 (propagated-inputs
236 `(("ilmbase" ,ilmbase) ;used in public headers
237 ("zlib" ,zlib))) ;OpenEXR.pc reads "-lz"
238 (home-page "http://www.openexr.com")
9f2840cb 239 (synopsis "High-dynamic range file format library")
cab6a253
LC
240 (description
241 "OpenEXR is a high dynamic-range (HDR) image file format developed for
9f2840cb
LC
242use in computer imaging applications. The IlmImf C++ libraries support
243storage of the \"EXR\" file format for storing 16-bit floating-point images.")
cab6a253 244 (license license:bsd-3)))
9d620590 245
71299c12
RW
246(define-public openimageio
247 (package
248 (name "openimageio")
249 (version "1.5.18")
250 (source (origin
251 (method url-fetch)
252 (uri (string-append "https://github.com/OpenImageIO/oiio/"
253 "archive/Release-" version ".tar.gz"))
254 (file-name (string-append name "-" version ".tar.gz"))
255 (sha256
256 (base32
c91d3fb7 257 "0mn7cz19mn8dcrhkq15h25gl20ammr1wz0j2j3c2vxs6ph7zn8jy"))
fc1adab1 258 (patches (search-patches "openimageio-boost-1.60.patch"))))
71299c12
RW
259 (build-system cmake-build-system)
260 ;; FIXME: To run all tests successfully, test image sets from multiple
261 ;; third party sources have to be present. For details see
262 ;; https://github.com/OpenImageIO/oiio/blob/master/INSTALL
263 (arguments `(#:tests? #f))
264 (native-inputs
265 `(("pkg-config" ,pkg-config)))
266 (inputs
267 `(("boost" ,boost)
268 ("libpng" ,libpng)
269 ("libjpeg" ,libjpeg-8)
270 ("libtiff" ,libtiff)
271 ("giflib" ,giflib)
272 ("openexr" ,openexr)
273 ("ilmbase" ,ilmbase)
274 ("python" ,python-2)
275 ("zlib" ,zlib)))
276 (synopsis "C++ library for reading and writing images")
277 (description
278 "OpenImageIO is a library for reading and writing images, and a bunch of
279related classes, utilities, and applications. There is a particular emphasis
280on formats and functionality used in professional, large-scale animation and
281visual effects work for film.")
282 (home-page "http://www.openimageio.org")
283 (license license:bsd-3)))
284
96d15e48
RW
285(define-public rapicorn
286 (package
287 (name "rapicorn")
288 (version "16.0.0")
289 (source (origin
290 (method url-fetch)
291 (uri (string-append "https://testbit.eu/pub/dists/rapicorn/"
292 "rapicorn-" version ".tar.xz"))
293 (sha256
294 (base32
295 "1y51yjrpsihas1jy905m9p3r8iiyhq6bwi2690c564i5dnix1f9d"))))
296 (build-system gnu-build-system)
297 (arguments
298 `(;; FIXME: At least "testrcore1" fails.
299 #:tests? #f
300 #:phases
301 (modify-phases %standard-phases
302 (add-after 'unpack 'replace-/bin/ls
303 (lambda _
304 (substitute* (cons "Makefile.decl"
305 (find-files "." "^Makefile\\.in$"))
306 (("/bin/ls") (which "ls")))
307 #t)))))
308 ;; These libraries are listed in the "Required" section of the pkg-config
309 ;; file.
310 (propagated-inputs
311 `(("librsvg" ,librsvg)
312 ("cairo" ,cairo)
313 ("pango" ,pango)
314 ("libxml2" ,libxml2)))
315 (inputs
316 `(("gdk-pixbuf" ,gdk-pixbuf)
317 ("libpng" ,libpng-1.2)
318 ("readline" ,readline)
319 ("libcroco" ,libcroco)
320 ("python" ,python-2)
321 ("cython" ,python2-cython)))
322 (native-inputs
323 `(("pandoc" ,ghc-pandoc)
324 ("bison" ,bison)
325 ("flex" ,flex)
326 ("doxygen" ,doxygen)
327 ("graphviz" ,graphviz)
328 ("intltool" ,intltool)
329 ("pkg-config" ,pkg-config)))
330 (home-page "http://rapicorn.org")
331 (synopsis "Toolkit for rapid development of user interfaces")
332 (description
333 "Rapicorn is a toolkit for rapid development of user interfaces in C++
334and Python. The user interface is designed in a declarative markup language
335and is connected to the programming logic using data bindings and commands.")
336 (license license:mpl2.0)))
337
9d620590
LC
338(define-public ctl
339 (package
340 (name "ctl")
341 (version "1.5.2")
342 (source (origin
343 (method url-fetch)
344 (uri (string-append "https://github.com/ampas/CTL/archive/ctl-"
345 version ".tar.gz"))
346 (sha256
347 (base32
348 "1gg04pyvw0m398akn0s1l07g5b1haqv5na1wpi5dii1jjd1w3ynp"))))
349 (build-system cmake-build-system)
350 (arguments '(#:tests? #f)) ;no 'test' target
351
352 ;; Headers include OpenEXR and IlmBase headers.
353 (propagated-inputs `(("openexr" ,openexr)))
354
355 (home-page "http://ampasctl.sourceforge.net")
356 (synopsis "Color Transformation Language")
357 (description
358 "The Color Transformation Language, or CTL, is a small programming
359language that was designed to serve as a building block for digital color
360management systems. CTL allows users to describe color transforms in a
361concise and unambiguous way by expressing them as programs. In order to apply
362a given transform to an image, the color management system instructs a CTL
363interpreter to load and run the CTL program that describes the transform. The
364original and the transformed image constitute the CTL program's input and
365output.")
366
367 ;; The web site says it's under a BSD-3 license, but the 'LICENSE' file
368 ;; and headers use different wording.
166191b3 369 (license (license:non-copyleft "file://LICENSE"))))
a29bfc28
LC
370
371(define-public brdf-explorer
372 (package
373 (name "brdf-explorer")
374 (version "17") ;svn revision
375 (source (origin
376 ;; There are no release tarballs, and not even tags in the repo,
377 ;; so use the latest revision.
378 (method svn-fetch)
379 (uri (svn-reference
380 (url "http://github.com/wdas/brdf")
381 (revision (string->number version))))
382 (sha256
383 (base32
384 "1458fwsqxramh0gpnp24x7brfpl9afhvr1wqg6c78xqwf32960m5"))
385 (file-name (string-append name "-" version "-checkout"))))
386 (build-system gnu-build-system)
387 (arguments
388 `(#:phases (modify-phases %standard-phases
f8503e2b 389 (replace 'configure
a29bfc28
LC
390 (lambda* (#:key outputs #:allow-other-keys)
391 (let ((out (assoc-ref outputs "out")))
392 (chdir "trunk")
393 (zero? (system* "qmake"
394 (string-append
395 "prefix=" out))))))
f8503e2b 396 (add-after 'install 'wrap-program
a29bfc28
LC
397 (lambda* (#:key outputs #:allow-other-keys)
398 (let* ((out (assoc-ref outputs "out"))
399 (bin (string-append out "/bin"))
400 (data (string-append
401 out "/share/brdf")))
402 (with-directory-excursion bin
403 (rename-file "brdf" ".brdf-real")
404 (call-with-output-file "brdf"
405 (lambda (port)
406 (format port "#!/bin/sh
407# Run the thing from its home, otherwise it just bails out.
408cd \"~a\"
409exec -a \"$0\" ~a/.brdf-real~%"
410 data bin)))
411 (chmod "brdf" #o555))))))))
412 (native-inputs
413 `(("qt" ,qt-4))) ;for 'qmake'
414 (inputs
415 `(("qt" ,qt-4)
416 ("mesa" ,mesa)
417 ("glew" ,glew)
418 ("freeglut" ,freeglut)
419 ("zlib" ,zlib)))
420 (home-page "http://www.disneyanimation.com/technology/brdf.html")
421 (synopsis
422 "Analyze bidirectional reflectance distribution functions (BRDFs)")
423 (description
424 "BRDF Explorer is an application that allows the development and analysis
425of bidirectional reflectance distribution functions (BRDFs). It can load and
426plot analytic BRDF functions (coded as functions in OpenGL's GLSL shader
427language), measured material data from the MERL database, and anisotropic
428measured material data from MIT CSAIL. Graphs and visualizations update in
429real time as parameters are changed, making it a useful tool for evaluating
430and understanding different BRDFs (and other component functions).")
431 (license license:ms-pl)))
87bafa07
432
433(define-public agg
434 (package
435 (name "agg")
436 (version "2.5")
437 (source (origin
438 (method url-fetch)
7db0799d
LC
439 (uri (list (string-append
440 "ftp://ftp.fau.de/gentoo/distfiles/agg-"
441 version ".tar.gz")
442 (string-append
443 "ftp://ftp.ula.ve/gentoo/distfiles/agg-"
444 version ".tar.gz")
445
446 ;; Site was discontinued.
447 (string-append "http://www.antigrain.com/agg-"
448 version ".tar.gz")))
87bafa07
449 (sha256
450 (base32 "07wii4i824vy9qsvjsgqxppgqmfdxq0xa87i5yk53fijriadq7mb"))
fc1adab1 451 (patches (search-patches "agg-am_c_prototype.patch"))))
87bafa07
452 (build-system gnu-build-system)
453 (arguments
454 '(#:configure-flags
455 (list (string-append "--x-includes=" (assoc-ref %build-inputs "libx11")
456 "/include")
457 (string-append "--x-libraries=" (assoc-ref %build-inputs "libx11")
458 "/lib"))
459 #:phases
460 (alist-cons-after
461 'unpack 'autoreconf
462 (lambda _
463 ;; let's call configure from configure phase and not now
464 (substitute* "autogen.sh" (("./configure") "# ./configure"))
465 (zero? (system* "sh" "autogen.sh")))
466 %standard-phases)))
467 (native-inputs
468 `(("pkg-config" ,pkg-config)
469 ("libtool" ,libtool)
470 ("autoconf" ,autoconf)
471 ("automake" ,automake)
472 ("bash" ,bash)))
473 (inputs
474 `(("libx11" ,libx11)
475 ("freetype" ,freetype)
476 ("sdl" ,sdl)))
7db0799d
LC
477
478 ;; Antigrain.com was discontinued.
479 (home-page "http://agg.sourceforge.net/antigrain.com/index.html")
87bafa07
480 (synopsis "High-quality 2D graphics rendering engine for C++")
481 (description
482 "Anti-Grain Geometry is a high quality rendering engine written in C++.
483It supports sub-pixel resolutions and anti-aliasing. It is also library for
484rendering SVG graphics.")
485 (license license:gpl2+)))