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