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