gnu: OpenEXR: Update to 2.5.0.
[jackhill/guix/guix.git] / gnu / packages / graphics.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Tomáš Čech <sleep_walker@gnu.org>
4 ;;; Copyright © 2016, 2019 Leo Famulari <leo@famulari.name>
5 ;;; Copyright © 2016, 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
6 ;;; Copyright © 2016, 2018 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
8 ;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
9 ;;; Copyright © 2017, 2018 Ben Woodcroft <donttrustben@gmail.com>
10 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
12 ;;; Copyright © 2018 Alex Kost <alezost@gmail.com>
13 ;;; Copyright © 2018 Kei Kebreau <kkebreau@posteo.net>
14 ;;; Copyright © 2019 Mark H Weaver <mhw@netris.org>
15 ;;; Copyright © 2019 Carlo Zancanaro <carlo@zancanaro.id.au>
16 ;;; Copyright © 2019 Steve Sprang <scs@stevesprang.com>
17 ;;; Copyright © 2019 John Soo <jsoo1@asu.edu>
18 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
19 ;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
20 ;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
21 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
22 ;;; 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 ;; This older version of OpenImageIO is required for Blender 2.79.
486 (define-public openimageio-1.7
487 (package
488 (inherit openimageio)
489 (name "openimageio")
490 (version "1.7.19")
491 (source (origin
492 (method git-fetch)
493 (uri (git-reference
494 (url "https://github.com/OpenImageIO/oiio.git")
495 (commit (string-append "Release-" version))))
496 (file-name (git-file-name name version))
497 (sha256
498 (base32
499 "0yxxy43l3lllw7maqg42dlkgqms2d4772sxzxk7kmxg4lnhsvndc"))))))
500
501 (define-public openscenegraph
502 (package
503 (name "openscenegraph")
504 (version "3.6.5")
505 (source
506 (origin
507 (method git-fetch)
508 (uri (git-reference
509 (url "https://github.com/openscenegraph/OpenSceneGraph")
510 (commit (string-append "OpenSceneGraph-" version))))
511 (sha256
512 (base32 "00i14h82qg3xzcyd8p02wrarnmby3aiwmz0z43l50byc9f8i05n1"))
513 (file-name (git-file-name name version))))
514 (properties
515 `((upstream-name . "OpenSceneGraph")))
516 (build-system cmake-build-system)
517 (arguments
518 `(#:tests? #f ; no test target available
519 ;; Without this flag, 'rd' will be added to the name of the
520 ;; library binaries and break linking with other programs.
521 #:build-type "Release"
522 #:configure-flags
523 (list (string-append "-DCMAKE_INSTALL_RPATH="
524 (assoc-ref %outputs "out") "/lib:"
525 (assoc-ref %outputs "out") "/lib64"))))
526 (native-inputs
527 `(("pkg-config" ,pkg-config)
528 ("unzip" ,unzip)))
529 (inputs
530 `(("giflib" ,giflib)
531 ("libjpeg" ,libjpeg-turbo) ; required for the JPEG texture plugin.
532 ("jasper" ,jasper)
533 ("librsvg" ,librsvg)
534 ("libxrandr" ,libxrandr)
535 ("ffmpeg" ,ffmpeg)
536 ("mesa" ,mesa)))
537 (synopsis "High-performance real-time graphics toolkit")
538 (description
539 "The OpenSceneGraph is a high-performance 3D graphics toolkit
540 used by application developers in fields such as visual simulation, games,
541 virtual reality, scientific visualization and modeling.")
542 (home-page "http://www.openscenegraph.org")
543 ;; The 'LICENSE' file explains that the source is licensed under
544 ;; LGPL 2.1, but with 4 exceptions. This version is called OSGPL.
545 (license license:lgpl2.1)))
546
547 ;; We need this for simgear
548 (define-public openscenegraph-3.4
549 (package (inherit openscenegraph)
550 (name "openscenegraph")
551 (version "3.4.1")
552 (source
553 (origin
554 (method git-fetch)
555 (uri (git-reference
556 (url "https://github.com/openscenegraph/OpenSceneGraph")
557 (commit (string-append "OpenSceneGraph-" version))))
558 (file-name (git-file-name name version))
559 (sha256
560 (base32
561 "1fbzg1ihjpxk6smlq80p3h3ggllbr16ihd2fxpfwzam8yr8yxip9"))))
562 (arguments
563 (substitute-keyword-arguments (package-arguments openscenegraph)
564 ((#:configure-flags flags)
565 `(cons
566 ;; The jpeg plugin requires conversion between integers and booleans
567 "-DCMAKE_CXX_FLAGS=-fpermissive"
568 ,flags))))
569 (inputs
570 `(("libjpeg" ,libjpeg-turbo)
571 ,@(package-inputs openscenegraph)))))
572
573
574 (define-public openmw-openscenegraph
575 ;; OpenMW prefers its own fork of openscenegraph:
576 ;; https://wiki.openmw.org/index.php?title=Development_Environment_Setup#OpenSceneGraph.
577 (let ((commit "36a962845a2c87a6671fd822157e0729d164e940"))
578 (hidden-package
579 (package
580 (inherit openscenegraph)
581 (version (git-version "3.6" "1" commit))
582 (source
583 (origin
584 (method git-fetch)
585 (uri (git-reference
586 (url "https://github.com/OpenMW/osg/")
587 (commit commit)))
588 (file-name (git-file-name (package-name openscenegraph) version))
589 (sha256
590 (base32
591 "05yhgq3qm5q277y32n5sf36vx5nv5qd3zlhz4csgd3a6190jrnia"))))
592 (arguments
593 (substitute-keyword-arguments (package-arguments openscenegraph)
594 ((#:configure-flags flags)
595 ;; As per the above wiki link, the following plugins are enough:
596 `(append
597 '("-DBUILD_OSG_PLUGINS_BY_DEFAULT=0"
598 "-DBUILD_OSG_PLUGIN_OSG=1"
599 "-DBUILD_OSG_PLUGIN_DDS=1"
600 "-DBUILD_OSG_PLUGIN_TGA=1"
601 "-DBUILD_OSG_PLUGIN_BMP=1"
602 "-DBUILD_OSG_PLUGIN_JPEG=1"
603 "-DBUILD_OSG_PLUGIN_PNG=1"
604 "-DBUILD_OSG_DEPRECATED_SERIALIZERS=0"
605 ;; The jpeg plugin requires conversion between integers and booleans
606 "-DCMAKE_CXX_FLAGS=-fpermissive")
607 ,flags))))))))
608
609 (define-public povray
610 (package
611 (name "povray")
612 (version "3.7.0.8")
613 (source (origin
614 (method git-fetch)
615 (uri (git-reference
616 (url "https://github.com/POV-Ray/povray")
617 (commit (string-append "v" version))))
618 (file-name (git-file-name name version))
619 (sha256
620 (base32
621 "1q114n4m3r7qy3yn954fq7p46rg7ypdax5fazxr9yj1jklf1lh6z"))
622 (modules '((guix build utils)))
623 (snippet
624 '(begin
625 ;; Delete bundled libraries.
626 (delete-file-recursively "libraries")
627 #t))))
628 (build-system gnu-build-system)
629 (native-inputs
630 `(("autoconf" ,autoconf)
631 ("automake" ,automake)
632 ("pkg-config" ,pkg-config)))
633 (inputs
634 `(("boost" ,boost)
635 ("libjpeg" ,libjpeg-turbo)
636 ("libpng" ,libpng)
637 ("libtiff" ,libtiff)
638 ("openexr" ,openexr)
639 ("sdl" ,sdl)
640 ("zlib" ,zlib)))
641 (arguments
642 '(#:configure-flags
643 (list "COMPILED_BY=Guix"
644 (string-append "--with-boost-libdir="
645 (assoc-ref %build-inputs "boost") "/lib")
646 "--disable-optimiz-arch")
647 #:phases
648 (modify-phases %standard-phases
649 (add-after 'unpack 'run-prebuild
650 (lambda _
651 (setenv "HOME" (getcwd))
652 (with-directory-excursion "unix"
653 (substitute* "prebuild.sh"
654 (("/bin/sh") (which "sh")))
655 (invoke "sh" "prebuild.sh"))
656 #t))
657 ;; The bootstrap script is run by the prebuild script in the
658 ;; "run-prebuild" phase.
659 (delete 'bootstrap))))
660 (synopsis "Tool for creating three-dimensional graphics")
661 (description
662 "@code{POV-Ray} is short for the Persistence of Vision Raytracer, a tool
663 for producing high-quality computer graphics. @code{POV-Ray} creates
664 three-dimensional, photo-realistic images using a rendering technique called
665 ray-tracing. It reads in a text file containing information describing the
666 objects and lighting in a scene and generates an image of that scene from the
667 view point of a camera also described in the text file. Ray-tracing is not a
668 fast process by any means, but it produces very high quality images with
669 realistic reflections, shading, perspective and other effects.")
670 (home-page "http://www.povray.org/")
671 (license license:agpl3+)))
672
673 (define-public rapicorn
674 (package
675 (name "rapicorn")
676 (version "16.0.0")
677 (source (origin
678 (method url-fetch)
679 (uri (string-append "https://testbit.eu/pub/dists/rapicorn/"
680 "rapicorn-" version ".tar.xz"))
681 (sha256
682 (base32
683 "1y51yjrpsihas1jy905m9p3r8iiyhq6bwi2690c564i5dnix1f9d"))
684 (patches (search-patches "rapicorn-isnan.patch"))))
685 (build-system gnu-build-system)
686 (arguments
687 `(#:phases
688 (modify-phases %standard-phases
689 (add-after 'unpack 'fix-tests
690 (lambda _
691 ;; Our grep does not support perl regular expressions.
692 (substitute* "taptool.sh"
693 (("grep -P") "grep -E"))
694 ;; Disable path tests because we cannot access /bin or /sbin.
695 (substitute* "rcore/tests/multitest.cc"
696 (("TCMP \\(Path::equals \\(\"/bin\"") "//"))
697 #t))
698 (add-before 'check 'pre-check
699 (lambda _
700 ;; The test suite requires a running X server (with DISPLAY
701 ;; number 99 or higher).
702 (system "Xvfb :99 &")
703 (setenv "DISPLAY" ":99")
704 #t))
705 (add-after 'unpack 'replace-fhs-paths
706 (lambda _
707 (substitute* (cons "Makefile.decl"
708 (find-files "." "^Makefile\\.in$"))
709 (("/bin/ls") (which "ls"))
710 (("/usr/bin/env") (which "env")))
711 #t)))))
712 ;; These libraries are listed in the "Required" section of the pkg-config
713 ;; file.
714 (propagated-inputs
715 `(("librsvg" ,librsvg)
716 ("cairo" ,cairo)
717 ("pango" ,pango)
718 ("libxml2" ,libxml2)
719 ("python2-enum34" ,python2-enum34)))
720 (inputs
721 `(("gdk-pixbuf" ,gdk-pixbuf)
722 ("libpng" ,libpng-1.2)
723 ("readline" ,readline)
724 ("libcroco" ,libcroco)
725 ("python" ,python-2)
726 ("cython" ,python2-cython)))
727 (native-inputs
728 `(("pandoc" ,ghc-pandoc)
729 ("bison" ,bison)
730 ("flex" ,flex)
731 ("doxygen" ,doxygen)
732 ("graphviz" ,graphviz)
733 ("intltool" ,intltool)
734 ("pkg-config" ,pkg-config)
735 ("xvfb" ,xorg-server-for-tests)))
736 (home-page "https://rapicorn.testbit.org/")
737 (synopsis "Toolkit for rapid development of user interfaces")
738 (description
739 "Rapicorn is a toolkit for rapid development of user interfaces in C++
740 and Python. The user interface is designed in a declarative markup language
741 and is connected to the programming logic using data bindings and commands.")
742 (license license:mpl2.0)))
743
744 (define-public ctl
745 (package
746 (name "ctl")
747 (version "1.5.2")
748 (source (origin
749 (method url-fetch)
750 (uri (string-append "https://github.com/ampas/CTL/archive/ctl-"
751 version ".tar.gz"))
752 (sha256
753 (base32
754 "1gg04pyvw0m398akn0s1l07g5b1haqv5na1wpi5dii1jjd1w3ynp"))))
755 (build-system cmake-build-system)
756 (arguments '(#:tests? #f)) ;no 'test' target
757
758 ;; Headers include OpenEXR and IlmBase headers.
759 (propagated-inputs `(("openexr" ,openexr)))
760
761 (home-page "http://ampasctl.sourceforge.net")
762 (synopsis "Color Transformation Language")
763 (description
764 "The Color Transformation Language, or CTL, is a small programming
765 language that was designed to serve as a building block for digital color
766 management systems. CTL allows users to describe color transforms in a
767 concise and unambiguous way by expressing them as programs. In order to apply
768 a given transform to an image, the color management system instructs a CTL
769 interpreter to load and run the CTL program that describes the transform. The
770 original and the transformed image constitute the CTL program's input and
771 output.")
772
773 ;; The web site says it's under a BSD-3 license, but the 'LICENSE' file
774 ;; and headers use different wording.
775 (license (license:non-copyleft "file://LICENSE"))))
776
777 (define-public brdf-explorer
778 ;; There are no release tarballs, and not even tags in the repo,
779 ;; so use the latest revision.
780 (let ((commit "5b2cd46f38a06e47207fa7229b72d37beb945019")
781 (revision "1"))
782 (package
783 (name "brdf-explorer")
784 (version (string-append "1.0.0-" revision "." (string-take commit 9)))
785 (source (origin
786 (method git-fetch)
787 (uri (git-reference
788 (url "https://github.com/wdas/brdf.git")
789 (commit commit)))
790 (sha256
791 (base32
792 "06vzbiajzbi2xl8jlff5d45bc9wd68i3jdndfab1f3jgfrd8bsgx"))
793 (file-name (string-append name "-" version "-checkout"))))
794 (build-system gnu-build-system)
795 (arguments
796 `(#:phases (modify-phases %standard-phases
797 (replace 'configure
798 (lambda* (#:key outputs #:allow-other-keys)
799 (let ((out (assoc-ref outputs "out")))
800 (invoke "qmake"
801 (string-append "prefix=" out)))))
802 (add-after 'install 'wrap-program
803 (lambda* (#:key outputs #:allow-other-keys)
804 (let* ((out (assoc-ref outputs "out"))
805 (bin (string-append out "/bin"))
806 (data (string-append
807 out "/share/brdf")))
808 (with-directory-excursion bin
809 (rename-file "brdf" ".brdf-real")
810 (call-with-output-file "brdf"
811 (lambda (port)
812 (format port "#!/bin/sh
813 # Run the thing from its home, otherwise it just bails out.
814 cd \"~a\"
815 exec -a \"$0\" ~a/.brdf-real~%"
816 data bin)))
817 (chmod "brdf" #o555)))
818 #t)))))
819 (native-inputs
820 `(("qttools" ,qttools))) ;for 'qmake'
821 (inputs
822 `(("qtbase" ,qtbase)
823 ("mesa" ,mesa)
824 ("glew" ,glew)
825 ("freeglut" ,freeglut)
826 ("zlib" ,zlib)))
827 (home-page "https://www.disneyanimation.com/technology/brdf.html")
828 (synopsis
829 "Analyze bidirectional reflectance distribution functions (BRDFs)")
830 (description
831 "BRDF Explorer is an application that allows the development and analysis
832 of bidirectional reflectance distribution functions (BRDFs). It can load and
833 plot analytic BRDF functions (coded as functions in OpenGL's GLSL shader
834 language), measured material data from the MERL database, and anisotropic
835 measured material data from MIT CSAIL. Graphs and visualizations update in
836 real time as parameters are changed, making it a useful tool for evaluating
837 and understanding different BRDFs (and other component functions).")
838 (license license:ms-pl))))
839
840 (define-public agg
841 (package
842 (name "agg")
843 (version "2.5")
844 (source (origin
845 (method url-fetch)
846 (uri (list (string-append
847 "ftp://ftp.fau.de/gentoo/distfiles/agg-"
848 version ".tar.gz")
849 (string-append
850 "ftp://ftp.ula.ve/gentoo/distfiles/agg-"
851 version ".tar.gz")
852
853 ;; Site was discontinued.
854 (string-append "http://www.antigrain.com/agg-"
855 version ".tar.gz")))
856 (sha256
857 (base32 "07wii4i824vy9qsvjsgqxppgqmfdxq0xa87i5yk53fijriadq7mb"))
858 (patches (search-patches "agg-am_c_prototype.patch"))))
859 (build-system gnu-build-system)
860 (arguments
861 '(#:configure-flags
862 (list (string-append "--x-includes=" (assoc-ref %build-inputs "libx11")
863 "/include")
864 (string-append "--x-libraries=" (assoc-ref %build-inputs "libx11")
865 "/lib")
866 "--disable-examples")
867 #:phases
868 (modify-phases %standard-phases
869 (replace 'bootstrap
870 (lambda _
871 ;; let's call configure from configure phase and not now
872 (substitute* "autogen.sh" (("./configure") "# ./configure"))
873 (invoke "sh" "autogen.sh"))))))
874 (native-inputs
875 `(("pkg-config" ,pkg-config)
876 ("libtool" ,libtool)
877 ("autoconf" ,autoconf)
878 ("automake" ,automake)))
879 (inputs
880 `(("libx11" ,libx11)
881 ("freetype" ,freetype)
882 ("sdl" ,sdl)))
883
884 ;; Antigrain.com was discontinued.
885 (home-page "http://agg.sourceforge.net/antigrain.com/index.html")
886 (synopsis "High-quality 2D graphics rendering engine for C++")
887 (description
888 "Anti-Grain Geometry is a high quality rendering engine written in C++.
889 It supports sub-pixel resolutions and anti-aliasing. It is also library for
890 rendering SVG graphics.")
891 (license license:gpl2+)))
892
893 (define-public python-pastel
894 (package
895 (name "python-pastel")
896 (version "0.2.0")
897 (source
898 (origin
899 (method url-fetch)
900 (uri (pypi-uri "pastel" version))
901 (sha256
902 (base32
903 "0dnaw44ss10i10z4ksy0xljknvjap7rb7g0b8p6yzm5x4g2my5a6"))))
904 (build-system python-build-system)
905 (arguments
906 `(#:phases (modify-phases %standard-phases
907 (replace 'check
908 (lambda _ (invoke "pytest" "pastel" "tests/"))))))
909 (native-inputs
910 `(("python-pytest" ,python-pytest)))
911 (home-page "https://github.com/sdispater/pastel")
912 (synopsis "Library to colorize strings in your terminal")
913 (description "Pastel is a simple library to help you colorize strings in
914 your terminal.")
915 (license license:expat)))
916
917 (define-public python2-pastel
918 (package-with-python2 python-pastel))
919
920 (define-public fgallery
921 (package
922 (name "fgallery")
923 (version "1.8.2")
924 (source (origin
925 (method url-fetch)
926 (uri
927 (string-append
928 "http://www.thregr.org/~wavexx/software/fgallery/releases/"
929 "fgallery-" version ".zip"))
930 (sha256
931 (base32
932 "18wlvqbxcng8pawimbc8f2422s8fnk840hfr6946lzsxr0ijakvf"))))
933 (build-system gnu-build-system)
934 (arguments
935 `(#:tests? #f ; no tests
936 #:phases
937 (modify-phases %standard-phases
938 (delete 'configure)
939 (delete 'build)
940 (replace 'install
941 (lambda* (#:key inputs outputs #:allow-other-keys)
942 (let* ((out (assoc-ref outputs "out"))
943 (bin (string-append out "/bin/"))
944 (share (string-append out "/share/fgallery"))
945 (man (string-append out "/share/man/man1"))
946 (perl5lib (getenv "PERL5LIB"))
947 (script (string-append share "/fgallery")))
948 (define (bin-directory input-name)
949 (string-append (assoc-ref inputs input-name) "/bin"))
950
951 (mkdir-p man)
952 (copy-file "fgallery.1" (string-append man "/fgallery.1"))
953
954 (mkdir-p share)
955 (copy-recursively "." share)
956
957 ;; fgallery copies files from store when it is run. The
958 ;; read-only permissions from the store directories will cause
959 ;; fgallery to fail. Do not preserve file attributes when
960 ;; copying files to prevent it.
961 (substitute* script
962 (("'cp'")
963 "'cp', '--no-preserve=all'"))
964
965 (mkdir-p bin)
966 (symlink script (string-append out "/bin/fgallery"))
967
968 (wrap-program script
969 `("PATH" ":" prefix
970 ,(map bin-directory '("imagemagick"
971 "lcms"
972 "fbida"
973 "libjpeg"
974 "zip"
975 "jpegoptim"
976 "pngcrush"
977 "p7zip")))
978 `("PERL5LIB" ":" prefix (,perl5lib)))
979 #t))))))
980 (native-inputs
981 `(("unzip" ,unzip)))
982 ;; TODO: Add missing optional dependency: facedetect.
983 (inputs
984 `(("imagemagick" ,imagemagick)
985 ("lcms" ,lcms)
986 ("fbida" ,fbida)
987 ("libjpeg" ,libjpeg-turbo)
988 ("zip" ,zip)
989 ("perl" ,perl)
990 ("perl-cpanel-json-xs" ,perl-cpanel-json-xs)
991 ("perl-image-exiftool" ,perl-image-exiftool)
992 ("jpegoptim" ,jpegoptim)
993 ("pngcrush" ,pngcrush)
994 ("p7zip" ,p7zip)))
995 (home-page "http://www.thregr.org/~wavexx/software/fgallery/")
996 (synopsis "Static photo gallery generator")
997 (description
998 "FGallery is a static, JavaScript photo gallery generator with minimalist
999 look. The result can be uploaded on any web server without additional
1000 requirements.")
1001 (license license:gpl2+)))
1002
1003 (define-public opensubdiv
1004 (package
1005 (name "opensubdiv")
1006 (version "3.4.0")
1007 (source (origin
1008 (method git-fetch)
1009 (uri (git-reference
1010 (url "https://github.com/PixarAnimationStudios/OpenSubdiv")
1011 (commit (string-append "v" (string-join (string-split version #\.)
1012 "_")))))
1013 (file-name (git-file-name name version))
1014 (sha256
1015 (base32
1016 "0cippg6aqc5dlya1cmh3908pwssrg52fwgyylnvz5343yrxmgk12"))))
1017 (build-system cmake-build-system)
1018 (arguments
1019 `(#:phases (modify-phases %standard-phases
1020 (add-before 'configure 'set-glew-location
1021 (lambda* (#:key inputs #:allow-other-keys)
1022 (setenv "GLEW_LOCATION" (assoc-ref inputs "glew"))
1023 #t))
1024 (add-before 'check 'start-xorg-server
1025 (lambda* (#:key inputs #:allow-other-keys)
1026 ;; The test suite requires a running X server.
1027 (system (string-append (assoc-ref inputs "xorg-server")
1028 "/bin/Xvfb :1 &"))
1029 (setenv "DISPLAY" ":1")
1030 #t)))))
1031 (native-inputs
1032 `(("xorg-server" ,xorg-server-for-tests)))
1033 (inputs
1034 `(("glew" ,glew)
1035 ("libxrandr" ,libxrandr)
1036 ("libxcursor" ,libxcursor)
1037 ("libxinerama" ,libxinerama)
1038 ("libxi" ,libxi)
1039 ("zlib" ,zlib)
1040 ("glfw" ,glfw)))
1041 (home-page "https://graphics.pixar.com/opensubdiv/")
1042 (synopsis "High performance subdivision surface evaluation")
1043 (description "OpenSubdiv is a set of libraries that implement high
1044 performance subdivision surface (subdiv) evaluation on massively parallel CPU
1045 and GPU architectures.")
1046 (license license:asl2.0)))
1047
1048 (define-public opencsg
1049 (let ((dot-to-dash (lambda (c) (if (char=? c #\.) #\- c))))
1050 (package
1051 (name "opencsg")
1052 (version "1.4.2")
1053 (source
1054 (origin
1055 (method git-fetch)
1056 (uri (git-reference
1057 (url "https://github.com/floriankirsch/OpenCSG.git")
1058 (commit (string-append "opencsg-"
1059 (string-map dot-to-dash version)
1060 "-release"))))
1061 (file-name (git-file-name name version))
1062 (sha256
1063 (base32
1064 "00m4vs6jn3scqczscc4591l1d6zg6anqp9v1ldf9ymf70rdyvm7m"))))
1065 (build-system gnu-build-system)
1066 (arguments
1067 `(#:phases
1068 (modify-phases %standard-phases
1069 (replace 'configure
1070 (lambda* (#:key outputs #:allow-other-keys)
1071 (substitute* "src/Makefile"
1072 (("/usr/local") (assoc-ref outputs "out")))
1073 #t))
1074 (add-before 'build 'skip-example
1075 (lambda _ (chdir "src") #t)))))
1076 (inputs
1077 `(("glew" ,glew)
1078 ("freeglut" ,freeglut)))
1079 (synopsis "Library for rendering Constructive Solid Geometry (CSG)")
1080 (description
1081 "OpenCSG is a library for rendering Constructive Solid Geometry (CSG) using
1082 OpenGL. CSG is an approach for modeling complex 3D-shapes using simpler ones.
1083 For example, two shapes can be combined by uniting them, by intersecting them,
1084 or by subtracting one shape from the other.")
1085 (home-page "http://www.opencsg.org/")
1086 (license license:gpl2))))
1087
1088 (define-public coin3D
1089 ;; The ‘4.0.0’ zip archive isn't stable, nor in fact a release. See:
1090 ;; https://bitbucket.org/Coin3D/coin/issues/179/coin-400-srczip-has-been-modified
1091 (let ((revision 1)
1092 (changeset "ab8d0e47a4de3230a8137feb39c142d6ba45f97d"))
1093 (package
1094 (name "coin3D")
1095 (version
1096 (simple-format #f "3.1.3-~A-~A" revision (string-take changeset 7)))
1097 (source
1098 (origin
1099 (method hg-fetch)
1100 (uri (hg-reference
1101 (url "https://bitbucket.org/Coin3D/coin")
1102 (changeset changeset)))
1103 (file-name (git-file-name name version))
1104 (sha256
1105 (base32 "1ff44jz6lg4rylljvy69n1hcjh9y6achbv9jpn1cv2sf8cxn3r2j"))
1106 (modules '((guix build utils)))
1107 (snippet
1108 '(begin
1109 (for-each delete-file
1110 '("cfg/csubst.exe"
1111 "cfg/wrapmsvc.exe"))
1112 #t))))
1113 (build-system cmake-build-system)
1114 (native-inputs
1115 `(("doxygen" ,doxygen)
1116 ("graphviz" ,graphviz)))
1117 (inputs
1118 `(("boost" ,boost)
1119 ("freeglut" ,freeglut)
1120 ("glew" ,glew)))
1121 (arguments
1122 `(#:configure-flags
1123 (list
1124 "-DCOIN_BUILD_DOCUMENTATION_MAN=ON"
1125 (string-append "-DBOOST_ROOT="
1126 (assoc-ref %build-inputs "boost")))))
1127 (home-page "https://bitbucket.org/Coin3D/coin/wiki/Home")
1128 (synopsis
1129 "High-level 3D visualization library with Open Inventor 2.1 API")
1130 (description
1131 "Coin is a 3D graphics library with an Application Programming Interface
1132 based on the Open Inventor 2.1 API. For those who are not familiar with
1133 Open Inventor, it is a scene-graph based retain-mode rendering and model
1134 interaction library, written in C++, which has become the de facto
1135 standard graphics library for 3D visualization and visual simulation
1136 software in the scientific and engineering community.")
1137 (license license:bsd-3))))
1138
1139 (define-public superfamiconv
1140 (package
1141 (name "superfamiconv")
1142 (version "0.8.8")
1143 (source
1144 (origin
1145 (method git-fetch)
1146 (uri (git-reference
1147 (url "https://github.com/Optiroc/SuperFamiconv")
1148 (commit (string-append "v" version))))
1149 (file-name (git-file-name name version))
1150 (sha256
1151 (base32
1152 "0848szv6a2b8wdganh6mw5i8vn8cqvn1kbwzx7mb9wlrf5wzqn37"))))
1153 (build-system gnu-build-system)
1154 (arguments
1155 `(#:tests? #f ; no tests
1156 #:phases
1157 (modify-phases %standard-phases
1158 (delete 'configure)
1159 (replace 'install
1160 (lambda* (#:key outputs #:allow-other-keys)
1161 (let* ((outdir (assoc-ref outputs "out"))
1162 (bindir (string-append outdir "/bin")))
1163 (install-file "bin/superfamiconv" bindir)
1164 #t))))))
1165 (home-page "https://github.com/Optiroc/SuperFamiconv")
1166 (synopsis "Tile graphics converter supporting SNES, Game Boy Color
1167 and PC Engine formats")
1168 (description "SuperFamiconv is a converter for tiled graphics, supporting
1169 the graphics formats of the SNES, Game Boy Color and PC Engine game consoles.
1170 Automated palette selection is supported.")
1171 (license license:expat)))