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