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