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