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