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