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