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