gnu: Move non-compilers out of haskell.scm.
[jackhill/guix/guix.git] / gnu / packages / graphics.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Tomáš Čech <sleep_walker@gnu.org>
4 ;;; Copyright © 2016, 2019 Leo Famulari <leo@famulari.name>
5 ;;; Copyright © 2016, 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
6 ;;; Copyright © 2016, 2018 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
8 ;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
9 ;;; Copyright © 2017, 2018 Ben Woodcroft <donttrustben@gmail.com>
10 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
12 ;;; Copyright © 2018 Alex Kost <alezost@gmail.com>
13 ;;; Copyright © 2018 Kei Kebreau <kkebreau@posteo.net>
14 ;;; Copyright © 2019 Mark H Weaver <mhw@netris.org>
15 ;;; Copyright © 2019 Carlo Zancanaro <carlo@zancanaro.id.au>
16 ;;;
17 ;;; This file is part of GNU Guix.
18 ;;;
19 ;;; GNU Guix is free software; you can redistribute it and/or modify it
20 ;;; under the terms of the GNU General Public License as published by
21 ;;; the Free Software Foundation; either version 3 of the License, or (at
22 ;;; your option) any later version.
23 ;;;
24 ;;; GNU Guix is distributed in the hope that it will be useful, but
25 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ;;; GNU General Public License for more details.
28 ;;;
29 ;;; You should have received a copy of the GNU General Public License
30 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31
32 (define-module (gnu packages graphics)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages algebra)
35 #:use-module (gnu packages audio)
36 #:use-module (gnu packages autotools)
37 #:use-module (gnu packages bash)
38 #:use-module (gnu packages bison)
39 #:use-module (gnu packages boost)
40 #:use-module (gnu packages check)
41 #:use-module (gnu packages compression)
42 #:use-module (gnu packages documentation)
43 #:use-module (gnu packages flex)
44 #:use-module (gnu packages fonts)
45 #:use-module (gnu packages fontutils)
46 #:use-module (gnu packages ghostscript)
47 #:use-module (gnu packages gl)
48 #:use-module (gnu packages glib)
49 #:use-module (gnu packages gnome)
50 #:use-module (gnu packages graphviz)
51 #:use-module (gnu packages gtk)
52 #:use-module (gnu packages haskell-xyz)
53 #:use-module (gnu packages image)
54 #:use-module (gnu packages imagemagick)
55 #:use-module (gnu packages jemalloc)
56 #:use-module (gnu packages multiprecision)
57 #:use-module (gnu packages pdf)
58 #:use-module (gnu packages perl)
59 #:use-module (gnu packages photo)
60 #:use-module (gnu packages pkg-config)
61 #:use-module (gnu packages pth)
62 #:use-module (gnu packages pulseaudio) ; libsndfile, libsamplerate
63 #:use-module (gnu packages python)
64 #:use-module (gnu packages python-xyz)
65 #:use-module (gnu packages qt)
66 #:use-module (gnu packages readline)
67 #:use-module (gnu packages sdl)
68 #:use-module (gnu packages swig)
69 #:use-module (gnu packages video)
70 #:use-module (gnu packages xml)
71 #:use-module (gnu packages xorg)
72 #:use-module (guix build-system cmake)
73 #:use-module (guix build-system gnu)
74 #:use-module (guix build-system python)
75 #:use-module (guix download)
76 #:use-module (guix git-download)
77 #:use-module ((guix licenses) #:prefix license:)
78 #:use-module (guix packages)
79 #:use-module (guix utils))
80
81 (define-public blender
82 (package
83 (name "blender")
84 (version "2.80")
85 (source (origin
86 (method url-fetch)
87 (uri (string-append "https://download.blender.org/source/"
88 "blender-" version ".tar.gz"))
89 (sha256
90 (base32
91 "1h550jisdbis50hxwk5kxrvrk1a6sh2fsri3yyj66vhzbi87x7fd"))))
92 (build-system cmake-build-system)
93 (arguments
94 (let ((python-version (version-major+minor (package-version python))))
95 `(;; Test files are very large and not included in the release tarball.
96 #:tests? #f
97 #:configure-flags
98 (list "-DWITH_CODEC_FFMPEG=ON"
99 "-DWITH_CODEC_SNDFILE=ON"
100 "-DWITH_CYCLES=ON"
101 "-DWITH_DOC_MANPAGE=ON"
102 "-DWITH_FFTW3=ON"
103 "-DWITH_IMAGE_OPENJPEG=ON"
104 "-DWITH_INPUT_NDOF=ON"
105 "-DWITH_INSTALL_PORTABLE=OFF"
106 "-DWITH_JACK=ON"
107 "-DWITH_MOD_OCEANSIM=ON"
108 "-DWITH_OPENSUBDIV=ON"
109 "-DWITH_PYTHON_INSTALL=OFF"
110 (string-append "-DPYTHON_LIBRARY=python" ,python-version "m")
111 (string-append "-DPYTHON_LIBPATH=" (assoc-ref %build-inputs "python")
112 "/lib")
113 (string-append "-DPYTHON_INCLUDE_DIR=" (assoc-ref %build-inputs "python")
114 "/include/python" ,python-version "m")
115 (string-append "-DPYTHON_VERSION=" ,python-version)
116 (string-append "-DPYTHON_NUMPY_PATH="
117 (assoc-ref %build-inputs "python-numpy")
118 "/lib/python" ,python-version "/site-packages/"))
119 #:phases
120 (modify-phases %standard-phases
121 ;; XXX This file doesn't exist in the Git sources but will probably
122 ;; exist in the eventual 2.80 source tarball.
123 ; (add-after 'unpack 'fix-broken-import
124 ; (lambda _
125 ; (substitute* "release/scripts/addons/io_scene_fbx/json2fbx.py"
126 ; (("import encode_bin") "from . import encode_bin"))
127 ; #t))
128 (add-after 'set-paths 'add-ilmbase-include-path
129 (lambda* (#:key inputs #:allow-other-keys)
130 ;; OpenEXR propagates ilmbase, but its include files do not appear
131 ;; in the CPATH, so we need to add "$ilmbase/include/OpenEXR/" to
132 ;; the CPATH to satisfy the dependency on "half.h".
133 (setenv "CPATH"
134 (string-append (assoc-ref inputs "ilmbase")
135 "/include/OpenEXR"
136 ":" (or (getenv "CPATH") "")))
137 #t))))))
138 (inputs
139 `(("boost" ,boost)
140 ("jemalloc" ,jemalloc)
141 ("libx11" ,libx11)
142 ("openimageio" ,openimageio)
143 ("openexr" ,openexr)
144 ("opensubdiv" ,opensubdiv)
145 ("ilmbase" ,ilmbase)
146 ("openjpeg" ,openjpeg)
147 ("libjpeg" ,libjpeg)
148 ("libpng" ,libpng)
149 ("libtiff" ,libtiff)
150 ("ffmpeg" ,ffmpeg)
151 ("fftw" ,fftw)
152 ("jack" ,jack-1)
153 ("libsndfile" ,libsndfile)
154 ("freetype" ,freetype)
155 ("glew" ,glew)
156 ("openal" ,openal)
157 ("python" ,python)
158 ("python-numpy" ,python-numpy)
159 ("zlib" ,zlib)))
160 (home-page "https://blender.org/")
161 (synopsis "3D graphics creation suite")
162 (description
163 "Blender is a 3D graphics creation suite. It supports the entirety of
164 the 3D pipeline—modeling, rigging, animation, simulation, rendering,
165 compositing and motion tracking, even video editing and game creation. The
166 application can be customized via its API for Python scripting.")
167 (license license:gpl2+)))
168
169 (define-public blender-2.79
170 (package
171 (name "blender")
172 (version "2.79b")
173 (source (origin
174 (method url-fetch)
175 (uri (string-append "https://download.blender.org/source/"
176 "blender-" version ".tar.gz"))
177 (sha256
178 (base32
179 "1g4kcdqmf67srzhi3hkdnr4z1ph4h9sza1pahz38mrj998q4r52c"))
180 (patches (search-patches "blender-2.79-newer-ffmpeg.patch"
181 "blender-2.79-python-3.7-fix.patch"))))
182 (build-system cmake-build-system)
183 (arguments
184 (let ((python-version (version-major+minor (package-version python))))
185 `(;; Test files are very large and not included in the release tarball.
186 #:tests? #f
187 #:configure-flags
188 (list "-DWITH_CODEC_FFMPEG=ON"
189 "-DWITH_CODEC_SNDFILE=ON"
190 "-DWITH_CYCLES=ON"
191 "-DWITH_DOC_MANPAGE=ON"
192 "-DWITH_FFTW3=ON"
193 "-DWITH_GAMEENGINE=ON"
194 "-DWITH_IMAGE_OPENJPEG=ON"
195 "-DWITH_INPUT_NDOF=ON"
196 "-DWITH_INSTALL_PORTABLE=OFF"
197 "-DWITH_JACK=ON"
198 "-DWITH_MOD_OCEANSIM=ON"
199 "-DWITH_PLAYER=ON"
200 "-DWITH_PYTHON_INSTALL=OFF"
201 "-DWITH_PYTHON_INSTALL=OFF"
202 "-DWITH_SYSTEM_OPENJPEG=ON"
203 (string-append "-DPYTHON_LIBRARY=python" ,python-version "m")
204 (string-append "-DPYTHON_LIBPATH=" (assoc-ref %build-inputs "python")
205 "/lib")
206 (string-append "-DPYTHON_INCLUDE_DIR=" (assoc-ref %build-inputs "python")
207 "/include/python" ,python-version "m")
208 (string-append "-DPYTHON_VERSION=" ,python-version))
209 #:phases
210 (modify-phases %standard-phases
211 (add-after 'unpack 'fix-broken-import
212 (lambda _
213 (substitute* "release/scripts/addons/io_scene_fbx/json2fbx.py"
214 (("import encode_bin") "from . import encode_bin"))
215 #t))
216 (add-after 'set-paths 'add-ilmbase-include-path
217 (lambda* (#:key inputs #:allow-other-keys)
218 ;; OpenEXR propagates ilmbase, but its include files do not appear
219 ;; in the CPATH, so we need to add "$ilmbase/include/OpenEXR/" to
220 ;; the CPATH to satisfy the dependency on "half.h".
221 (setenv "CPATH"
222 (string-append (assoc-ref inputs "ilmbase")
223 "/include/OpenEXR"
224 ":" (or (getenv "CPATH") "")))
225 #t))))))
226 (inputs
227 `(("boost" ,boost)
228 ("jemalloc" ,jemalloc)
229 ("libx11" ,libx11)
230 ("openimageio" ,openimageio-1.7)
231 ("openexr" ,openexr)
232 ("ilmbase" ,ilmbase)
233 ("openjpeg" ,openjpeg-1)
234 ("libjpeg" ,libjpeg)
235 ("libpng" ,libpng)
236 ("libtiff" ,libtiff)
237 ("ffmpeg" ,ffmpeg)
238 ("fftw" ,fftw)
239 ("jack" ,jack-1)
240 ("libsndfile" ,libsndfile)
241 ("freetype" ,freetype)
242 ("glew" ,glew)
243 ("openal" ,openal)
244 ("python" ,python)
245 ("zlib" ,zlib)))
246 (home-page "https://blender.org/")
247 (synopsis "3D graphics creation suite")
248 (description
249 "Blender is a 3D graphics creation suite. It supports the entirety of
250 the 3D pipeline—modeling, rigging, animation, simulation, rendering,
251 compositing and motion tracking, even video editing and game creation. The
252 application can be customized via its API for Python scripting.
253
254 NOTE: This older version of Blender is the last release that does not require
255 OpenGL 3. It is retained for use with older computers.")
256 (license license:gpl2+)))
257
258 (define-public assimp
259 (package
260 (name "assimp")
261 (version "4.1.0")
262 (source (origin
263 (method git-fetch)
264 (uri (git-reference
265 (url "https://github.com/assimp/assimp.git")
266 (commit (string-append "v" version))))
267 (file-name (git-file-name name version))
268 (sha256
269 (base32
270 "1rhyqfhzifdj7yibyanph3rh13ykw3i98dnn8mz65j780472hw28"))))
271 (build-system cmake-build-system)
272 (inputs
273 `(("zlib" ,zlib)))
274 (home-page "http://www.assimp.org/")
275 (synopsis "Asset import library")
276 (description
277 "The Open Asset Import Library loads more than 40 3D file formats into
278 one unified data structure. Additionally, assimp features various mesh post
279 processing tools: normals and tangent space generation, triangulation, vertex
280 cache locality optimization, removal of degenerate primitives and duplicate
281 vertices, sorting by primitive type, merging of redundant materials and many
282 more.")
283 (license license:bsd-3)))
284
285 (define-public cgal
286 (package
287 (name "cgal")
288 (version "4.8.1")
289 (source (origin
290 (method url-fetch)
291 (uri (string-append
292 "https://github.com/CGAL/cgal/releases/download/releases/"
293 "CGAL-" version "/CGAL-" version ".tar.xz"))
294 (sha256
295 (base32
296 "1c41yzl2jg3d6zx5k0iccwqwibp950q7dr7z7pp4xi9wlph3c87s"))))
297 (build-system cmake-build-system)
298 (arguments
299 '(;; "RelWithDebInfo" is not supported.
300 #:build-type "Release"
301
302 ;; No 'test' target.
303 #:tests? #f))
304 (inputs
305 `(("mpfr" ,mpfr)
306 ("gmp" ,gmp)
307 ("boost" ,boost)))
308 (home-page "http://cgal.org/")
309 (synopsis "Computational geometry algorithms library")
310 (description
311 "CGAL provides easy access to efficient and reliable geometric algorithms
312 in the form of a C++ library. CGAL is used in various areas needing geometric
313 computation, such as: computer graphics, scientific visualization, computer
314 aided design and modeling, geographic information systems, molecular biology,
315 medical imaging, robotics and motion planning, mesh generation, numerical
316 methods, etc. It provides data structures and algorithms such as
317 triangulations, Voronoi diagrams, polygons, polyhedra, mesh generation, and
318 many more.")
319
320 ;; The 'LICENSE' file explains that a subset is available under more
321 ;; permissive licenses.
322 (license license:gpl3+)))
323
324 (define-public ilmbase
325 (package
326 (name "ilmbase")
327 (version "2.3.0")
328 (source (origin
329 (method url-fetch)
330 (uri (string-append "https://github.com/openexr/openexr/releases"
331 "/download/v" version "/ilmbase-"
332 version ".tar.gz"))
333 (sha256
334 (base32
335 "0qiq5bqq9rxhqjiym2k36sx4vq8adgrz6xf6qwizi9bqm78phsa5"))
336 (patches (search-patches "ilmbase-fix-tests.patch"))))
337 (build-system gnu-build-system)
338 (home-page "http://www.openexr.com/")
339 (synopsis "Utility C++ libraries for threads, maths, and exceptions")
340 (description
341 "IlmBase provides several utility libraries for C++. Half is a class
342 that encapsulates ILM's 16-bit floating-point format. IlmThread is a thread
343 abstraction. Imath implements 2D and 3D vectors, 3x3 and 4x4 matrices,
344 quaternions and other useful 2D and 3D math functions. Iex is an
345 exception-handling library.")
346 (license license:bsd-3)))
347
348 (define-public ogre
349 (package
350 (name "ogre")
351 (version "1.10.11")
352 (source
353 (origin
354 (method git-fetch)
355 (uri (git-reference
356 (url "https://github.com/OGRECave/ogre.git")
357 (commit (string-append "v" version))))
358 (file-name (git-file-name name version))
359 (sha256
360 (base32
361 "072rzw9mxymbiypgkrbkk9h10rgly6gczik4dlmssk6xkpqckaqr"))))
362 (build-system cmake-build-system)
363 (arguments
364 '(#:phases
365 (modify-phases %standard-phases
366 (add-before 'configure 'pre-configure
367 (lambda* (#:key inputs #:allow-other-keys)
368 (substitute* "Tests/CMakeLists.txt"
369 (("URL(.*)$")
370 (string-append "URL " (assoc-ref inputs "googletest-source"))))
371 #t)))
372 #:configure-flags
373 (list "-DOGRE_BUILD_TESTS=TRUE"
374 (string-append "-DCMAKE_INSTALL_RPATH="
375 (assoc-ref %outputs "out") "/lib:"
376 (assoc-ref %outputs "out") "/lib/OGRE:"
377 (assoc-ref %build-inputs "googletest") "/lib")
378 "-DOGRE_INSTALL_DOCS=TRUE"
379 "-DOGRE_INSTALL_SAMPLES=TRUE"
380 "-DOGRE_INSTALL_SAMPLES_SOURCE=TRUE")))
381 (native-inputs
382 `(("boost" ,boost)
383 ("doxygen" ,doxygen)
384 ("googletest-source" ,(package-source googletest))
385 ("pkg-config" ,pkg-config)))
386 (inputs
387 `(("font-dejavu" ,font-dejavu)
388 ("freeimage" ,freeimage)
389 ("freetype" ,freetype)
390 ("glu" ,glu)
391 ("googletest" ,googletest)
392 ("sdl2" ,sdl2)
393 ("libxaw" ,libxaw)
394 ("libxrandr" ,libxrandr)
395 ("tinyxml" ,tinyxml)
396 ("zziplib" ,zziplib)))
397 (synopsis "Scene-oriented, flexible 3D engine written in C++")
398 (description
399 "OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented,
400 flexible 3D engine written in C++ designed to make it easier and more intuitive
401 for developers to produce applications utilising hardware-accelerated 3D
402 graphics.")
403 (home-page "http://www.ogre3d.org/")
404 (license license:expat)))
405
406 (define-public openexr
407 (package
408 (name "openexr")
409 (version "2.3.0")
410 (source (origin
411 (method url-fetch)
412 (uri (string-append "https://github.com/openexr/openexr/releases"
413 "/download/v" version "/openexr-"
414 version ".tar.gz"))
415 (sha256
416 (base32
417 "19jywbs9qjvsbkvlvzayzi81s976k53wg53vw4xj66lcgylb6v7x"))
418 (modules '((guix build utils)))
419 (snippet
420 '(begin
421 (substitute* (find-files "." "tmpDir\\.h")
422 (("\"/var/tmp/\"")
423 "\"/tmp/\""))
424 #t))))
425 (build-system gnu-build-system)
426 (arguments
427 '(#:phases
428 (modify-phases %standard-phases
429 (add-after 'unpack 'disable-broken-test
430 ;; This test fails on i686. Upstream developers suggest that
431 ;; this test is broken on i686 and can be safely disabled:
432 ;; https://github.com/openexr/openexr/issues/67#issuecomment-21169748
433 (lambda _
434 (substitute* "IlmImfTest/main.cpp"
435 (("#include \"testOptimizedInterleavePatterns.h\"")
436 "//#include \"testOptimizedInterleavePatterns.h\"")
437 (("TEST \\(testOptimizedInterleavePatterns")
438 "//TEST (testOptimizedInterleavePatterns"))
439 #t)))))
440 (native-inputs
441 `(("pkg-config" ,pkg-config)))
442 (propagated-inputs
443 `(("ilmbase" ,ilmbase) ;used in public headers
444 ("zlib" ,zlib))) ;OpenEXR.pc reads "-lz"
445 (home-page "http://www.openexr.com")
446 (synopsis "High-dynamic range file format library")
447 (description
448 "OpenEXR is a high dynamic-range (HDR) image file format developed for
449 use in computer imaging applications. The IlmImf C++ libraries support
450 storage of the \"EXR\" file format for storing 16-bit floating-point images.")
451 (license license:bsd-3)))
452
453 (define-public openimageio
454 (package
455 (name "openimageio")
456 (version "1.8.17")
457 (source (origin
458 (method git-fetch)
459 (uri (git-reference
460 (url "https://github.com/OpenImageIO/oiio.git")
461 (commit (string-append "Release-" version))))
462 (file-name (git-file-name name version))
463 (sha256
464 (base32
465 "0zq34szprgkrrayg5sl3whrsx2l6lr8nw4hdrnwv2qhn70jbi2w2"))))
466 (build-system cmake-build-system)
467 ;; FIXME: To run all tests successfully, test image sets from multiple
468 ;; third party sources have to be present. For details see
469 ;; https://github.com/OpenImageIO/oiio/blob/master/INSTALL
470 (arguments `(#:tests? #f))
471 (native-inputs
472 `(("pkg-config" ,pkg-config)))
473 (inputs
474 `(("boost" ,boost)
475 ("libpng" ,libpng)
476 ("libjpeg" ,libjpeg)
477 ("libtiff" ,libtiff)
478 ("giflib" ,giflib)
479 ("openexr" ,openexr)
480 ("ilmbase" ,ilmbase)
481 ("python" ,python-2)
482 ("zlib" ,zlib)))
483 (synopsis "C++ library for reading and writing images")
484 (description
485 "OpenImageIO is a library for reading and writing images, and a bunch of
486 related classes, utilities, and applications. There is a particular emphasis
487 on formats and functionality used in professional, large-scale animation and
488 visual effects work for film.")
489 (home-page "http://www.openimageio.org")
490 (license license:bsd-3)))
491
492 ;; This older version of OpenImageIO is required for Blender 2.79.
493 (define-public openimageio-1.7
494 (package
495 (inherit openimageio)
496 (name "openimageio")
497 (version "1.7.19")
498 (source (origin
499 (method git-fetch)
500 (uri (git-reference
501 (url "https://github.com/OpenImageIO/oiio.git")
502 (commit (string-append "Release-" version))))
503 (file-name (git-file-name name version))
504 (sha256
505 (base32
506 "0yxxy43l3lllw7maqg42dlkgqms2d4772sxzxk7kmxg4lnhsvndc"))))))
507
508 (define-public openscenegraph
509 (package
510 (name "openscenegraph")
511 (version "3.6.3")
512 (source
513 (origin
514 (method git-fetch)
515 (uri (git-reference
516 (url "https://github.com/openscenegraph/OpenSceneGraph")
517 (commit (string-append "OpenSceneGraph-" version))))
518 (sha256
519 (base32
520 "0h32z15sa8sbq276j0iib0n707m8bs4p5ji9z2ah411446paad9q"))
521 (file-name (git-file-name name version))))
522 (properties
523 `((upstream-name . "OpenSceneGraph")))
524 (build-system cmake-build-system)
525 (arguments
526 `(#:tests? #f ; no test target available
527 ;; Without this flag, 'rd' will be added to the name of the
528 ;; library binaries and break linking with other programs.
529 #:build-type "Release"
530 #:configure-flags
531 (list (string-append "-DCMAKE_INSTALL_RPATH="
532 (assoc-ref %outputs "out") "/lib:"
533 (assoc-ref %outputs "out") "/lib64"))))
534 (native-inputs
535 `(("pkg-config" ,pkg-config)
536 ("unzip" ,unzip)))
537 (inputs
538 `(("giflib" ,giflib)
539 ("jasper" ,jasper)
540 ("librsvg" ,librsvg)
541 ("libxrandr" ,libxrandr)
542 ("ffmpeg" ,ffmpeg)
543 ("mesa" ,mesa)))
544 (synopsis "High performance real-time graphics toolkit")
545 (description
546 "The OpenSceneGraph is a high performance 3D graphics toolkit
547 used by application developers in fields such as visual simulation, games,
548 virtual reality, scientific visualization and modeling.")
549 (home-page "http://www.openscenegraph.org")
550 ;; The 'LICENSE' file explains that the source is licensed under
551 ;; LGPL 2.1, but with 4 exceptions. This version is called OSGPL.
552 (license license:lgpl2.1)))
553
554 ;; We need this for simgear
555 (define-public openscenegraph-3.4
556 (package (inherit openscenegraph)
557 (name "openscenegraph")
558 (version "3.4.1")
559 (source
560 (origin
561 (method git-fetch)
562 (uri (git-reference
563 (url "https://github.com/openscenegraph/OpenSceneGraph")
564 (commit (string-append "OpenSceneGraph-" version))))
565 (file-name (git-file-name name version))
566 (sha256
567 (base32
568 "1fbzg1ihjpxk6smlq80p3h3ggllbr16ihd2fxpfwzam8yr8yxip9"))))
569 (arguments
570 (substitute-keyword-arguments (package-arguments openscenegraph)
571 ((#:configure-flags flags)
572 `(cons
573 ;; The jpeg plugin requires conversion between integers and booleans
574 "-DCMAKE_CXX_FLAGS=-fpermissive"
575 ,flags))))
576 (inputs
577 `(("libjpeg" ,libjpeg)
578 ,@(package-inputs openscenegraph)))))
579
580 (define-public povray
581 (package
582 (name "povray")
583 (version "3.7.0.8")
584 (source (origin
585 (method git-fetch)
586 (uri (git-reference
587 (url "https://github.com/POV-Ray/povray")
588 (commit (string-append "v" version))))
589 (file-name (git-file-name name version))
590 (sha256
591 (base32
592 "1q114n4m3r7qy3yn954fq7p46rg7ypdax5fazxr9yj1jklf1lh6z"))
593 (modules '((guix build utils)))
594 (snippet
595 '(begin
596 ;; Delete bundled libraries.
597 (delete-file-recursively "libraries")
598 #t))))
599 (build-system gnu-build-system)
600 (native-inputs
601 `(("autoconf" ,autoconf)
602 ("automake" ,automake)
603 ("pkg-config" ,pkg-config)))
604 (inputs
605 `(("boost" ,boost)
606 ("libjpeg" ,libjpeg)
607 ("libpng" ,libpng)
608 ("libtiff" ,libtiff)
609 ("openexr" ,openexr)
610 ("sdl" ,sdl)
611 ("zlib" ,zlib)))
612 (arguments
613 '(#:configure-flags
614 (list "COMPILED_BY=Guix"
615 (string-append "--with-boost-libdir="
616 (assoc-ref %build-inputs "boost") "/lib")
617 "CXXFLAGS=-std=c++11"
618 "--disable-optimiz-arch")
619 #:phases
620 (modify-phases %standard-phases
621 (add-after 'unpack 'run-prebuild
622 (lambda _
623 (setenv "HOME" (getcwd))
624 (with-directory-excursion "unix"
625 (substitute* "prebuild.sh"
626 (("/bin/sh") (which "sh")))
627 (invoke "sh" "prebuild.sh"))
628 #t))
629 ;; The bootstrap script is run by the prebuild script in the
630 ;; "run-prebuild" phase.
631 (delete 'bootstrap))))
632 (synopsis "Tool for creating three-dimensional graphics")
633 (description
634 "@code{POV-Ray} is short for the Persistence of Vision Raytracer, a tool
635 for producing high-quality computer graphics. @code{POV-Ray} creates
636 three-dimensional, photo-realistic images using a rendering technique called
637 ray-tracing. It reads in a text file containing information describing the
638 objects and lighting in a scene and generates an image of that scene from the
639 view point of a camera also described in the text file. Ray-tracing is not a
640 fast process by any means, but it produces very high quality images with
641 realistic reflections, shading, perspective and other effects.")
642 (home-page "http://www.povray.org/")
643 (license license:agpl3+)))
644
645 (define-public rapicorn
646 (package
647 (name "rapicorn")
648 (version "16.0.0")
649 (source (origin
650 (method url-fetch)
651 (uri (string-append "https://testbit.eu/pub/dists/rapicorn/"
652 "rapicorn-" version ".tar.xz"))
653 (sha256
654 (base32
655 "1y51yjrpsihas1jy905m9p3r8iiyhq6bwi2690c564i5dnix1f9d"))
656 (patches (search-patches "rapicorn-isnan.patch"))))
657 (build-system gnu-build-system)
658 (arguments
659 `(#:phases
660 (modify-phases %standard-phases
661 (add-after 'unpack 'fix-tests
662 (lambda _
663 ;; Our grep does not support perl regular expressions.
664 (substitute* "taptool.sh"
665 (("grep -P") "grep -E"))
666 ;; Disable path tests because we cannot access /bin or /sbin.
667 (substitute* "rcore/tests/multitest.cc"
668 (("TCMP \\(Path::equals \\(\"/bin\"") "//"))
669 #t))
670 (add-before 'check 'pre-check
671 (lambda _
672 ;; The test suite requires a running X server (with DISPLAY
673 ;; number 99 or higher).
674 (system "Xvfb :99 &")
675 (setenv "DISPLAY" ":99")
676 #t))
677 (add-after 'unpack 'replace-fhs-paths
678 (lambda _
679 (substitute* (cons "Makefile.decl"
680 (find-files "." "^Makefile\\.in$"))
681 (("/bin/ls") (which "ls"))
682 (("/usr/bin/env") (which "env")))
683 #t)))))
684 ;; These libraries are listed in the "Required" section of the pkg-config
685 ;; file.
686 (propagated-inputs
687 `(("librsvg" ,librsvg)
688 ("cairo" ,cairo)
689 ("pango" ,pango)
690 ("libxml2" ,libxml2)
691 ("python2-enum34" ,python2-enum34)))
692 (inputs
693 `(("gdk-pixbuf" ,gdk-pixbuf)
694 ("libpng" ,libpng-1.2)
695 ("readline" ,readline)
696 ("libcroco" ,libcroco)
697 ("python" ,python-2)
698 ("cython" ,python2-cython)))
699 (native-inputs
700 `(("pandoc" ,ghc-pandoc)
701 ("bison" ,bison)
702 ("flex" ,flex)
703 ("doxygen" ,doxygen)
704 ("graphviz" ,graphviz)
705 ("intltool" ,intltool)
706 ("pkg-config" ,pkg-config)
707 ("xvfb" ,xorg-server)))
708 (home-page "https://rapicorn.testbit.org/")
709 (synopsis "Toolkit for rapid development of user interfaces")
710 (description
711 "Rapicorn is a toolkit for rapid development of user interfaces in C++
712 and Python. The user interface is designed in a declarative markup language
713 and is connected to the programming logic using data bindings and commands.")
714 (license license:mpl2.0)))
715
716 (define-public ctl
717 (package
718 (name "ctl")
719 (version "1.5.2")
720 (source (origin
721 (method url-fetch)
722 (uri (string-append "https://github.com/ampas/CTL/archive/ctl-"
723 version ".tar.gz"))
724 (sha256
725 (base32
726 "1gg04pyvw0m398akn0s1l07g5b1haqv5na1wpi5dii1jjd1w3ynp"))))
727 (build-system cmake-build-system)
728 (arguments '(#:tests? #f)) ;no 'test' target
729
730 ;; Headers include OpenEXR and IlmBase headers.
731 (propagated-inputs `(("openexr" ,openexr)))
732
733 (home-page "http://ampasctl.sourceforge.net")
734 (synopsis "Color Transformation Language")
735 (description
736 "The Color Transformation Language, or CTL, is a small programming
737 language that was designed to serve as a building block for digital color
738 management systems. CTL allows users to describe color transforms in a
739 concise and unambiguous way by expressing them as programs. In order to apply
740 a given transform to an image, the color management system instructs a CTL
741 interpreter to load and run the CTL program that describes the transform. The
742 original and the transformed image constitute the CTL program's input and
743 output.")
744
745 ;; The web site says it's under a BSD-3 license, but the 'LICENSE' file
746 ;; and headers use different wording.
747 (license (license:non-copyleft "file://LICENSE"))))
748
749 (define-public brdf-explorer
750 ;; There are no release tarballs, and not even tags in the repo,
751 ;; so use the latest revision.
752 (let ((commit "5b2cd46f38a06e47207fa7229b72d37beb945019")
753 (revision "1"))
754 (package
755 (name "brdf-explorer")
756 (version (string-append "1.0.0-" revision "." (string-take commit 9)))
757 (source (origin
758 (method git-fetch)
759 (uri (git-reference
760 (url "https://github.com/wdas/brdf.git")
761 (commit commit)))
762 (sha256
763 (base32
764 "06vzbiajzbi2xl8jlff5d45bc9wd68i3jdndfab1f3jgfrd8bsgx"))
765 (file-name (string-append name "-" version "-checkout"))))
766 (build-system gnu-build-system)
767 (arguments
768 `(#:phases (modify-phases %standard-phases
769 (replace 'configure
770 (lambda* (#:key outputs #:allow-other-keys)
771 (let ((out (assoc-ref outputs "out")))
772 (invoke "qmake"
773 (string-append "prefix=" out)))))
774 (add-after 'install 'wrap-program
775 (lambda* (#:key outputs #:allow-other-keys)
776 (let* ((out (assoc-ref outputs "out"))
777 (bin (string-append out "/bin"))
778 (data (string-append
779 out "/share/brdf")))
780 (with-directory-excursion bin
781 (rename-file "brdf" ".brdf-real")
782 (call-with-output-file "brdf"
783 (lambda (port)
784 (format port "#!/bin/sh
785 # Run the thing from its home, otherwise it just bails out.
786 cd \"~a\"
787 exec -a \"$0\" ~a/.brdf-real~%"
788 data bin)))
789 (chmod "brdf" #o555)))
790 #t)))))
791 (native-inputs
792 `(("qttools" ,qttools))) ;for 'qmake'
793 (inputs
794 `(("qtbase" ,qtbase)
795 ("mesa" ,mesa)
796 ("glew" ,glew)
797 ("freeglut" ,freeglut)
798 ("zlib" ,zlib)))
799 (home-page "http://www.disneyanimation.com/technology/brdf.html")
800 (synopsis
801 "Analyze bidirectional reflectance distribution functions (BRDFs)")
802 (description
803 "BRDF Explorer is an application that allows the development and analysis
804 of bidirectional reflectance distribution functions (BRDFs). It can load and
805 plot analytic BRDF functions (coded as functions in OpenGL's GLSL shader
806 language), measured material data from the MERL database, and anisotropic
807 measured material data from MIT CSAIL. Graphs and visualizations update in
808 real time as parameters are changed, making it a useful tool for evaluating
809 and understanding different BRDFs (and other component functions).")
810 (license license:ms-pl))))
811
812 (define-public agg
813 (package
814 (name "agg")
815 (version "2.5")
816 (source (origin
817 (method url-fetch)
818 (uri (list (string-append
819 "ftp://ftp.fau.de/gentoo/distfiles/agg-"
820 version ".tar.gz")
821 (string-append
822 "ftp://ftp.ula.ve/gentoo/distfiles/agg-"
823 version ".tar.gz")
824
825 ;; Site was discontinued.
826 (string-append "http://www.antigrain.com/agg-"
827 version ".tar.gz")))
828 (sha256
829 (base32 "07wii4i824vy9qsvjsgqxppgqmfdxq0xa87i5yk53fijriadq7mb"))
830 (patches (search-patches "agg-am_c_prototype.patch"))))
831 (build-system gnu-build-system)
832 (arguments
833 '(#:configure-flags
834 (list (string-append "--x-includes=" (assoc-ref %build-inputs "libx11")
835 "/include")
836 (string-append "--x-libraries=" (assoc-ref %build-inputs "libx11")
837 "/lib")
838 "--disable-examples")
839 #:phases
840 (modify-phases %standard-phases
841 (replace 'bootstrap
842 (lambda _
843 ;; let's call configure from configure phase and not now
844 (substitute* "autogen.sh" (("./configure") "# ./configure"))
845 (invoke "sh" "autogen.sh"))))))
846 (native-inputs
847 `(("pkg-config" ,pkg-config)
848 ("libtool" ,libtool)
849 ("autoconf" ,autoconf)
850 ("automake" ,automake)))
851 (inputs
852 `(("libx11" ,libx11)
853 ("freetype" ,freetype)
854 ("sdl" ,sdl)))
855
856 ;; Antigrain.com was discontinued.
857 (home-page "http://agg.sourceforge.net/antigrain.com/index.html")
858 (synopsis "High-quality 2D graphics rendering engine for C++")
859 (description
860 "Anti-Grain Geometry is a high quality rendering engine written in C++.
861 It supports sub-pixel resolutions and anti-aliasing. It is also library for
862 rendering SVG graphics.")
863 (license license:gpl2+)))
864
865 (define-public python-pastel
866 (package
867 (name "python-pastel")
868 (version "0.1.0")
869 (source
870 (origin
871 (method url-fetch)
872 (uri (pypi-uri "pastel" version))
873 (sha256
874 (base32
875 "1hqbm934n5yjwn31aq8h7shrr0rcy326wrqfc856vyn0gr0sy21i"))))
876 (build-system python-build-system)
877 (native-inputs
878 `(("python-pytest" ,python-pytest)))
879 (home-page "https://github.com/sdispater/pastel")
880 (synopsis "Library to colorize strings in your terminal")
881 (description "Pastel is a simple library to help you colorize strings in
882 your terminal. It comes bundled with predefined styles:
883 @enumerate
884 @item info: green
885 @item comment: yellow
886 @item question: black on cyan
887 @item error: white on red
888 @end enumerate
889 ")
890 (license license:expat)))
891
892 (define-public python2-pastel
893 (package-with-python2 python-pastel))
894
895 (define-public fgallery
896 (package
897 (name "fgallery")
898 (version "1.8.2")
899 (source (origin
900 (method url-fetch)
901 (uri
902 (string-append
903 "http://www.thregr.org/~wavexx/software/fgallery/releases/"
904 "fgallery-" version ".zip"))
905 (sha256
906 (base32
907 "18wlvqbxcng8pawimbc8f2422s8fnk840hfr6946lzsxr0ijakvf"))))
908 (build-system gnu-build-system)
909 (arguments
910 `(#:tests? #f ; no tests
911 #:phases
912 (modify-phases %standard-phases
913 (delete 'configure)
914 (delete 'build)
915 (replace 'install
916 (lambda* (#:key inputs outputs #:allow-other-keys)
917 (let* ((out (assoc-ref outputs "out"))
918 (bin (string-append out "/bin/"))
919 (share (string-append out "/share/fgallery"))
920 (man (string-append out "/share/man/man1"))
921 (perl5lib (getenv "PERL5LIB"))
922 (script (string-append share "/fgallery")))
923 (define (bin-directory input-name)
924 (string-append (assoc-ref inputs input-name) "/bin"))
925
926 (mkdir-p man)
927 (copy-file "fgallery.1" (string-append man "/fgallery.1"))
928
929 (mkdir-p share)
930 (copy-recursively "." share)
931
932 ;; fgallery copies files from store when it is run. The
933 ;; read-only permissions from the store directories will cause
934 ;; fgallery to fail. Do not preserve file attributes when
935 ;; copying files to prevent it.
936 (substitute* script
937 (("'cp'")
938 "'cp', '--no-preserve=all'"))
939
940 (mkdir-p bin)
941 (symlink script (string-append out "/bin/fgallery"))
942
943 (wrap-program script
944 `("PATH" ":" prefix
945 ,(map bin-directory '("imagemagick"
946 "lcms"
947 "fbida"
948 "libjpeg"
949 "zip"
950 "jpegoptim"
951 "pngcrush"
952 "p7zip")))
953 `("PERL5LIB" ":" prefix (,perl5lib)))
954 #t))))))
955 (native-inputs
956 `(("unzip" ,unzip)))
957 ;; TODO: Add missing optional dependency: facedetect.
958 (inputs
959 `(("imagemagick" ,imagemagick)
960 ("lcms" ,lcms)
961 ("fbida" ,fbida)
962 ("libjpeg" ,libjpeg)
963 ("zip" ,zip)
964 ("perl" ,perl)
965 ("perl-cpanel-json-xs" ,perl-cpanel-json-xs)
966 ("perl-image-exiftool" ,perl-image-exiftool)
967 ("jpegoptim" ,jpegoptim)
968 ("pngcrush" ,pngcrush)
969 ("p7zip" ,p7zip)))
970 (home-page "http://www.thregr.org/~wavexx/software/fgallery/")
971 (synopsis "Static photo gallery generator")
972 (description
973 "FGallery is a static, JavaScript photo gallery generator with minimalist
974 look. The result can be uploaded on any web server without additional
975 requirements.")
976 (license license:gpl2+)))
977
978 (define-public opensubdiv
979 (package
980 (name "opensubdiv")
981 (version "3_4_0")
982 (source (origin
983 (method git-fetch)
984 (uri (git-reference
985 (url "https://github.com/PixarAnimationStudios/OpenSubdiv")
986 (commit (string-append "v" version))))
987 (file-name (git-file-name name version))
988 (sha256
989 (base32
990 "0cippg6aqc5dlya1cmh3908pwssrg52fwgyylnvz5343yrxmgk12"))))
991 (build-system cmake-build-system)
992 (arguments
993 `(#:phases (modify-phases %standard-phases
994 (add-before 'configure 'set-glew-location
995 (lambda* (#:key inputs #:allow-other-keys)
996 (setenv "GLEW_LOCATION" (assoc-ref inputs "glew"))
997 #t))
998 (add-before 'check 'start-xorg-server
999 (lambda* (#:key inputs #:allow-other-keys)
1000 ;; The test suite requires a running X server.
1001 (system (string-append (assoc-ref inputs "xorg-server")
1002 "/bin/Xvfb :1 &"))
1003 (setenv "DISPLAY" ":1")
1004 #t)))))
1005 (native-inputs
1006 `(("xorg-server" ,xorg-server)))
1007 (inputs
1008 `(("glew" ,glew)
1009 ("libxrandr" ,libxrandr)
1010 ("libxcursor" ,libxcursor)
1011 ("libxinerama" ,libxinerama)
1012 ("libxi" ,libxi)
1013 ("zlib" ,zlib)
1014 ("glfw" ,glfw)))
1015 (home-page "http://graphics.pixar.com/opensubdiv/")
1016 (synopsis "High performance subdivision surface evaluation")
1017 (description "OpenSubdiv is a set of libraries that implement high
1018 performance subdivision surface (subdiv) evaluation on massively parallel CPU
1019 and GPU architectures.")
1020 (license license:asl2.0)))