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 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
5 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
7 ;;; This file is part of GNU Guix.
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.
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.
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/>.
22 (define-module (gnu packages graphics)
23 #:use-module (guix download)
24 #:use-module (guix svn-download)
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:)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages algebra)
31 #:use-module (gnu packages audio)
32 #:use-module (gnu packages autotools)
33 #:use-module (gnu packages bash)
34 #:use-module (gnu packages boost)
35 #:use-module (gnu packages image)
36 #:use-module (gnu packages python)
37 #:use-module (gnu packages fontutils)
38 #:use-module (gnu packages pkg-config)
39 #:use-module (gnu packages pulseaudio) ;libsndfile, libsamplerate
40 #:use-module (gnu packages compression)
41 #:use-module (gnu packages multiprecision)
42 #:use-module (gnu packages boost)
43 #:use-module (gnu packages gl)
44 #:use-module (gnu packages image)
45 #:use-module (gnu packages jemalloc)
46 #:use-module (gnu packages photo)
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages qt)
49 #:use-module (gnu packages sdl)
50 #:use-module (gnu packages video)
51 #:use-module (gnu packages xorg))
53 (define-public blender
59 (uri (string-append "http://download.blender.org/source/"
60 "blender-" version ".tar.gz"))
63 "0pb0mlj4vj0iir528ifqq67nsh3ca1942933d9cwlbpcja2jm1dx"))))
64 (build-system cmake-build-system)
66 `(;; Test files are very large and not included in the release tarball.
69 (list "-DWITH_CODEC_FFMPEG=ON"
70 "-DWITH_CODEC_SNDFILE=ON"
72 "-DWITH_DOC_MANPAGE=ON"
74 "-DWITH_GAMEENGINE=ON"
75 "-DWITH_IMAGE_OPENJPEG=ON"
76 "-DWITH_INPUT_NDOF=ON"
77 "-DWITH_INSTALL_PORTABLE=OFF"
79 "-DWITH_MOD_OCEANSIM=ON"
81 "-DWITH_PYTHON_INSTALL=OFF"
82 "-DWITH_SYSTEM_OPENJPEG=ON")
84 (modify-phases %standard-phases
85 (add-after 'unpack 'fix-broken-import
87 (substitute* "release/scripts/addons/io_scene_fbx/json2fbx.py"
88 (("import encode_bin") "from . import encode_bin"))
90 (add-after 'set-paths 'add-ilmbase-include-path
91 (lambda* (#:key inputs #:allow-other-keys)
92 ;; OpenEXR propagates ilmbase, but its include files do not appear
93 ;; in the CPATH, so we need to add "$ilmbase/include/OpenEXR/" to
94 ;; the CPATH to satisfy the dependency on "half.h".
96 (string-append (assoc-ref inputs "ilmbase")
98 ":" (or (getenv "CPATH") "")))
102 ("jemalloc" ,jemalloc)
104 ("openimageio" ,openimageio)
107 ("openjpeg" ,openjpeg-1)
114 ("libsndfile" ,libsndfile)
115 ("freetype" ,freetype)
118 ("python" ,python-wrapper)
120 (home-page "http://blender.org/")
121 (synopsis "3D graphics creation suite")
123 "Blender is a 3D graphics creation suite. It supports the entirety of
124 the 3D pipeline—modeling, rigging, animation, simulation, rendering,
125 compositing and motion tracking, even video editing and game creation. The
126 application can be customized via its API for Python scripting.")
127 (license license:gpl2+)))
136 "http://gforge.inria.fr/frs/download.php/file/"
137 "35139/CGAL-4.6.3.tar.xz"))
140 "08gwjjh0qz3fakj1y2nsl2qvb0qv5lc7k1pxwjkagh37hxxh4f73"))))
141 (build-system cmake-build-system)
143 '(;; "RelWithDebInfo" is not supported.
144 #:build-type "Release"
152 (home-page "http://cgal.org/")
153 (synopsis "Computational geometry algorithms library")
155 "CGAL provides easy access to efficient and reliable geometric algorithms
156 in the form of a C++ library. CGAL is used in various areas needing geometric
157 computation, such as: computer graphics, scientific visualization, computer
158 aided design and modeling, geographic information systems, molecular biology,
159 medical imaging, robotics and motion planning, mesh generation, numerical
160 methods, etc. It provides data structures and algorithms such as
161 triangulations, Voronoi diagrams, polygons, polyhedra, mesh generation, and
164 ;; The 'LICENSE' file explains that a subset is available under more
165 ;; permissive licenses.
166 (license license:gpl3+)))
168 (define-public ilmbase
174 (uri (string-append "mirror://savannah/openexr/ilmbase-"
178 "1izddjwbh1grs8080vmaix72z469qy29wrvkphgmqmcm0sv1by7c"))
179 (patches (search-patches "ilmbase-fix-tests.patch"))))
180 (build-system gnu-build-system)
181 (home-page "http://www.openexr.com/")
182 (synopsis "Utility C++ libraries for threads, maths, and exceptions")
184 "IlmBase provides several utility libraries for C++. Half is a class
185 that encapsulates ILM's 16-bit floating-point format. IlmThread is a thread
186 abstraction. Imath implements 2D and 3D vectors, 3x3 and 4x4 matrices,
187 quaternions and other useful 2D and 3D math functions. Iex is an
188 exception-handling library.")
189 (license license:bsd-3)))
191 (define-public openexr
197 (uri (string-append "mirror://savannah/openexr/openexr-"
201 "0ca2j526n4wlamrxb85y2jrgcv0gf21b3a19rr0gh4rjqkv1581n"))
202 (modules '((guix build utils)))
204 '(substitute* (find-files "." "tmpDir\\.h")
207 (patches (search-patches "openexr-missing-samples.patch"))))
208 (build-system gnu-build-system)
211 (modify-phases %standard-phases
212 (add-after 'unpack 'disable-broken-test
213 ;; This test fails on i686. Upstream developers suggest that
214 ;; this test is broken on i686 and can be safely disabled:
215 ;; https://github.com/openexr/openexr/issues/67#issuecomment-21169748
217 (substitute* "IlmImfTest/main.cpp"
218 (("#include \"testOptimizedInterleavePatterns.h\"")
219 "//#include \"testOptimizedInterleavePatterns.h\"")
220 (("TEST \\(testOptimizedInterleavePatterns")
221 "//TEST (testOptimizedInterleavePatterns"))
224 `(("pkg-config" ,pkg-config)))
226 `(("ilmbase" ,ilmbase) ;used in public headers
227 ("zlib" ,zlib))) ;OpenEXR.pc reads "-lz"
228 (home-page "http://www.openexr.com")
229 (synopsis "High-dynamic range file format library")
231 "OpenEXR is a high dynamic-range (HDR) image file format developed for
232 use in computer imaging applications. The IlmImf C++ libraries support
233 storage of the \"EXR\" file format for storing 16-bit floating-point images.")
234 (license license:bsd-3)))
236 (define-public openimageio
242 (uri (string-append "https://github.com/OpenImageIO/oiio/"
243 "archive/Release-" version ".tar.gz"))
244 (file-name (string-append name "-" version ".tar.gz"))
247 "0mn7cz19mn8dcrhkq15h25gl20ammr1wz0j2j3c2vxs6ph7zn8jy"))
248 (patches (search-patches "openimageio-boost-1.60.patch"))))
249 (build-system cmake-build-system)
250 ;; FIXME: To run all tests successfully, test image sets from multiple
251 ;; third party sources have to be present. For details see
252 ;; https://github.com/OpenImageIO/oiio/blob/master/INSTALL
253 (arguments `(#:tests? #f))
255 `(("pkg-config" ,pkg-config)))
259 ("libjpeg" ,libjpeg-8)
266 (synopsis "C++ library for reading and writing images")
268 "OpenImageIO is a library for reading and writing images, and a bunch of
269 related classes, utilities, and applications. There is a particular emphasis
270 on formats and functionality used in professional, large-scale animation and
271 visual effects work for film.")
272 (home-page "http://www.openimageio.org")
273 (license license:bsd-3)))
281 (uri (string-append "https://github.com/ampas/CTL/archive/ctl-"
285 "1gg04pyvw0m398akn0s1l07g5b1haqv5na1wpi5dii1jjd1w3ynp"))))
286 (build-system cmake-build-system)
287 (arguments '(#:tests? #f)) ;no 'test' target
289 ;; Headers include OpenEXR and IlmBase headers.
290 (propagated-inputs `(("openexr" ,openexr)))
292 (home-page "http://ampasctl.sourceforge.net")
293 (synopsis "Color Transformation Language")
295 "The Color Transformation Language, or CTL, is a small programming
296 language that was designed to serve as a building block for digital color
297 management systems. CTL allows users to describe color transforms in a
298 concise and unambiguous way by expressing them as programs. In order to apply
299 a given transform to an image, the color management system instructs a CTL
300 interpreter to load and run the CTL program that describes the transform. The
301 original and the transformed image constitute the CTL program's input and
304 ;; The web site says it's under a BSD-3 license, but the 'LICENSE' file
305 ;; and headers use different wording.
306 (license (license:non-copyleft "file://LICENSE"))))
308 (define-public brdf-explorer
310 (name "brdf-explorer")
311 (version "17") ;svn revision
313 ;; There are no release tarballs, and not even tags in the repo,
314 ;; so use the latest revision.
317 (url "http://github.com/wdas/brdf")
318 (revision (string->number version))))
321 "1458fwsqxramh0gpnp24x7brfpl9afhvr1wqg6c78xqwf32960m5"))
322 (file-name (string-append name "-" version "-checkout"))))
323 (build-system gnu-build-system)
325 `(#:phases (modify-phases %standard-phases
327 (lambda* (#:key outputs #:allow-other-keys)
328 (let ((out (assoc-ref outputs "out")))
330 (zero? (system* "qmake"
333 (add-after 'install 'wrap-program
334 (lambda* (#:key outputs #:allow-other-keys)
335 (let* ((out (assoc-ref outputs "out"))
336 (bin (string-append out "/bin"))
339 (with-directory-excursion bin
340 (rename-file "brdf" ".brdf-real")
341 (call-with-output-file "brdf"
343 (format port "#!/bin/sh
344 # Run the thing from its home, otherwise it just bails out.
346 exec -a \"$0\" ~a/.brdf-real~%"
348 (chmod "brdf" #o555))))))))
350 `(("qt" ,qt-4))) ;for 'qmake'
355 ("freeglut" ,freeglut)
357 (home-page "http://www.disneyanimation.com/technology/brdf.html")
359 "Analyze bidirectional reflectance distribution functions (BRDFs)")
361 "BRDF Explorer is an application that allows the development and analysis
362 of bidirectional reflectance distribution functions (BRDFs). It can load and
363 plot analytic BRDF functions (coded as functions in OpenGL's GLSL shader
364 language), measured material data from the MERL database, and anisotropic
365 measured material data from MIT CSAIL. Graphs and visualizations update in
366 real time as parameters are changed, making it a useful tool for evaluating
367 and understanding different BRDFs (and other component functions).")
368 (license license:ms-pl)))
376 (uri (list (string-append
377 "ftp://ftp.fau.de/gentoo/distfiles/agg-"
380 "ftp://ftp.ula.ve/gentoo/distfiles/agg-"
383 ;; Site was discontinued.
384 (string-append "http://www.antigrain.com/agg-"
387 (base32 "07wii4i824vy9qsvjsgqxppgqmfdxq0xa87i5yk53fijriadq7mb"))
388 (patches (search-patches "agg-am_c_prototype.patch"))))
389 (build-system gnu-build-system)
392 (list (string-append "--x-includes=" (assoc-ref %build-inputs "libx11")
394 (string-append "--x-libraries=" (assoc-ref %build-inputs "libx11")
400 ;; let's call configure from configure phase and not now
401 (substitute* "autogen.sh" (("./configure") "# ./configure"))
402 (zero? (system* "sh" "autogen.sh")))
405 `(("pkg-config" ,pkg-config)
407 ("autoconf" ,autoconf)
408 ("automake" ,automake)
412 ("freetype" ,freetype)
415 ;; Antigrain.com was discontinued.
416 (home-page "http://agg.sourceforge.net/antigrain.com/index.html")
417 (synopsis "High-quality 2D graphics rendering engine for C++")
419 "Anti-Grain Geometry is a high quality rendering engine written in C++.
420 It supports sub-pixel resolutions and anti-aliasing. It is also library for
421 rendering SVG graphics.")
422 (license license:gpl2+)))