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