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, 2019 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 ;;; Copyright © 2019 Carlo Zancanaro <carlo@zancanaro.id.au>
16 ;;; Copyright © 2019 Steve Sprang <scs@stevesprang.com>
17 ;;; Copyright © 2019 John Soo <jsoo1@asu.edu>
18 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
19 ;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
20 ;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
22 ;;; This file is part of GNU Guix.
24 ;;; GNU Guix is free software; you can redistribute it and/or modify it
25 ;;; under the terms of the GNU General Public License as published by
26 ;;; the Free Software Foundation; either version 3 of the License, or (at
27 ;;; your option) any later version.
29 ;;; GNU Guix is distributed in the hope that it will be useful, but
30 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
31 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 ;;; GNU General Public License for more details.
34 ;;; You should have received a copy of the GNU General Public License
35 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
37 (define-module (gnu packages graphics)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages algebra)
40 #:use-module (gnu packages audio)
41 #:use-module (gnu packages autotools)
42 #:use-module (gnu packages bash)
43 #:use-module (gnu packages bison)
44 #:use-module (gnu packages boost)
45 #:use-module (gnu packages check)
46 #:use-module (gnu packages compression)
47 #:use-module (gnu packages documentation)
48 #:use-module (gnu packages flex)
49 #:use-module (gnu packages fonts)
50 #:use-module (gnu packages fontutils)
51 #:use-module (gnu packages ghostscript)
52 #:use-module (gnu packages gl)
53 #:use-module (gnu packages glib)
54 #:use-module (gnu packages gnome)
55 #:use-module (gnu packages graphviz)
56 #:use-module (gnu packages gtk)
57 #:use-module (gnu packages haskell-xyz)
58 #:use-module (gnu packages image)
59 #:use-module (gnu packages imagemagick)
60 #:use-module (gnu packages jemalloc)
61 #:use-module (gnu packages multiprecision)
62 #:use-module (gnu packages pdf)
63 #:use-module (gnu packages perl)
64 #:use-module (gnu packages photo)
65 #:use-module (gnu packages pkg-config)
66 #:use-module (gnu packages pth)
67 #:use-module (gnu packages pulseaudio) ; libsndfile, libsamplerate
68 #:use-module (gnu packages python)
69 #:use-module (gnu packages python-xyz)
70 #:use-module (gnu packages qt)
71 #:use-module (gnu packages readline)
72 #:use-module (gnu packages sdl)
73 #:use-module (gnu packages swig)
74 #:use-module (gnu packages video)
75 #:use-module (gnu packages xml)
76 #:use-module (gnu packages xorg)
77 #:use-module (guix build-system cmake)
78 #:use-module (guix build-system gnu)
79 #:use-module (guix build-system python)
80 #:use-module (guix download)
81 #:use-module (guix git-download)
82 #:use-module (guix hg-download)
83 #:use-module ((guix licenses) #:prefix license:)
84 #:use-module (guix packages)
85 #:use-module (guix utils))
87 (define-public blender
93 (uri (string-append "https://download.blender.org/source/"
94 "blender-" version ".tar.gz"))
97 "1h550jisdbis50hxwk5kxrvrk1a6sh2fsri3yyj66vhzbi87x7fd"))))
98 (build-system cmake-build-system)
100 (let ((python-version (version-major+minor (package-version python))))
101 `(;; Test files are very large and not included in the release tarball.
104 (list "-DWITH_CODEC_FFMPEG=ON"
105 "-DWITH_CODEC_SNDFILE=ON"
107 "-DWITH_DOC_MANPAGE=ON"
109 "-DWITH_IMAGE_OPENJPEG=ON"
110 "-DWITH_INPUT_NDOF=ON"
111 "-DWITH_INSTALL_PORTABLE=OFF"
113 "-DWITH_MOD_OCEANSIM=ON"
114 "-DWITH_OPENSUBDIV=ON"
115 "-DWITH_PYTHON_INSTALL=OFF"
116 (string-append "-DPYTHON_LIBRARY=python" ,python-version "m")
117 (string-append "-DPYTHON_LIBPATH=" (assoc-ref %build-inputs "python")
119 (string-append "-DPYTHON_INCLUDE_DIR=" (assoc-ref %build-inputs "python")
120 "/include/python" ,python-version "m")
121 (string-append "-DPYTHON_VERSION=" ,python-version)
122 (string-append "-DPYTHON_NUMPY_PATH="
123 (assoc-ref %build-inputs "python-numpy")
124 "/lib/python" ,python-version "/site-packages/"))
126 (modify-phases %standard-phases
127 ;; XXX This file doesn't exist in the Git sources but will probably
128 ;; exist in the eventual 2.80 source tarball.
129 ; (add-after 'unpack 'fix-broken-import
131 ; (substitute* "release/scripts/addons/io_scene_fbx/json2fbx.py"
132 ; (("import encode_bin") "from . import encode_bin"))
134 (add-after 'set-paths 'add-ilmbase-include-path
135 (lambda* (#:key inputs #:allow-other-keys)
136 ;; OpenEXR propagates ilmbase, but its include files do not appear
137 ;; in the CPATH, so we need to add "$ilmbase/include/OpenEXR/" to
138 ;; the CPATH to satisfy the dependency on "half.h".
140 (string-append (assoc-ref inputs "ilmbase")
142 ":" (or (getenv "CPATH") "")))
146 ("jemalloc" ,jemalloc)
148 ("openimageio" ,openimageio)
150 ("opensubdiv" ,opensubdiv)
152 ("openjpeg" ,openjpeg)
159 ("libsndfile" ,libsndfile)
160 ("freetype" ,freetype)
164 ("python-numpy" ,python-numpy)
166 (home-page "https://blender.org/")
167 (synopsis "3D graphics creation suite")
169 "Blender is a 3D graphics creation suite. It supports the entirety of
170 the 3D pipeline—modeling, rigging, animation, simulation, rendering,
171 compositing and motion tracking, even video editing and game creation. The
172 application can be customized via its API for Python scripting.")
173 (license license:gpl2+)))
175 (define-public blender-2.79
181 (uri (string-append "https://download.blender.org/source/"
182 "blender-" version ".tar.gz"))
185 "1g4kcdqmf67srzhi3hkdnr4z1ph4h9sza1pahz38mrj998q4r52c"))
186 (patches (search-patches "blender-2.79-newer-ffmpeg.patch"
187 "blender-2.79-python-3.7-fix.patch"))))
188 (build-system cmake-build-system)
190 (let ((python-version (version-major+minor (package-version python))))
191 `(;; Test files are very large and not included in the release tarball.
194 (list "-DWITH_CODEC_FFMPEG=ON"
195 "-DWITH_CODEC_SNDFILE=ON"
197 "-DWITH_DOC_MANPAGE=ON"
199 "-DWITH_GAMEENGINE=ON"
200 "-DWITH_IMAGE_OPENJPEG=ON"
201 "-DWITH_INPUT_NDOF=ON"
202 "-DWITH_INSTALL_PORTABLE=OFF"
204 "-DWITH_MOD_OCEANSIM=ON"
206 "-DWITH_PYTHON_INSTALL=OFF"
207 "-DWITH_PYTHON_INSTALL=OFF"
208 "-DWITH_SYSTEM_OPENJPEG=ON"
209 (string-append "-DPYTHON_LIBRARY=python" ,python-version "m")
210 (string-append "-DPYTHON_LIBPATH=" (assoc-ref %build-inputs "python")
212 (string-append "-DPYTHON_INCLUDE_DIR=" (assoc-ref %build-inputs "python")
213 "/include/python" ,python-version "m")
214 (string-append "-DPYTHON_VERSION=" ,python-version))
216 (modify-phases %standard-phases
217 (add-after 'unpack 'fix-broken-import
219 (substitute* "release/scripts/addons/io_scene_fbx/json2fbx.py"
220 (("import encode_bin") "from . import encode_bin"))
222 (add-after 'set-paths 'add-ilmbase-include-path
223 (lambda* (#:key inputs #:allow-other-keys)
224 ;; OpenEXR propagates ilmbase, but its include files do not appear
225 ;; in the CPATH, so we need to add "$ilmbase/include/OpenEXR/" to
226 ;; the CPATH to satisfy the dependency on "half.h".
228 (string-append (assoc-ref inputs "ilmbase")
230 ":" (or (getenv "CPATH") "")))
234 ("jemalloc" ,jemalloc)
236 ("openimageio" ,openimageio-1.7)
239 ("openjpeg" ,openjpeg-1)
246 ("libsndfile" ,libsndfile)
247 ("freetype" ,freetype)
252 (home-page "https://blender.org/")
253 (synopsis "3D graphics creation suite")
255 "Blender is a 3D graphics creation suite. It supports the entirety of
256 the 3D pipeline—modeling, rigging, animation, simulation, rendering,
257 compositing and motion tracking, even video editing and game creation. The
258 application can be customized via its API for Python scripting.
260 NOTE: This older version of Blender is the last release that does not require
261 OpenGL 3. It is retained for use with older computers.")
262 (license license:gpl2+)))
264 (define-public assimp
271 (url "https://github.com/assimp/assimp.git")
272 (commit (string-append "v" version))))
273 (file-name (git-file-name name version))
276 "1rhyqfhzifdj7yibyanph3rh13ykw3i98dnn8mz65j780472hw28"))))
277 (build-system cmake-build-system)
280 (home-page "http://www.assimp.org/")
281 (synopsis "Asset import library")
283 "The Open Asset Import Library loads more than 40 3D file formats into
284 one unified data structure. Additionally, assimp features various mesh post
285 processing tools: normals and tangent space generation, triangulation, vertex
286 cache locality optimization, removal of degenerate primitives and duplicate
287 vertices, sorting by primitive type, merging of redundant materials and many
289 (license license:bsd-3)))
298 "https://github.com/CGAL/cgal/releases/download/releases/"
299 "CGAL-" version "/CGAL-" version ".tar.xz"))
302 "08lrp3hfwdypggz4138bnkh6bjxn441zg2y9xnq5mrjfc5ini6w1"))))
303 (build-system cmake-build-system)
305 '(#:tests? #f)) ; no test target
310 (home-page "https://www.cgal.org/")
311 (synopsis "Computational geometry algorithms library")
313 "CGAL provides easy access to efficient and reliable geometric algorithms
314 in the form of a C++ library. CGAL is used in various areas needing geometric
315 computation, such as: computer graphics, scientific visualization, computer
316 aided design and modeling, geographic information systems, molecular biology,
317 medical imaging, robotics and motion planning, mesh generation, numerical
318 methods, etc. It provides data structures and algorithms such as
319 triangulations, Voronoi diagrams, polygons, polyhedra, mesh generation, and
322 ;; The 'LICENSE' file explains that a subset is available under more
323 ;; permissive licenses.
324 (license license:gpl3+)))
326 (define-public ilmbase
333 (url "https://github.com/openexr/openexr")
334 (commit (string-append "v" version))))
335 (file-name (git-file-name "ilmbase" version))
338 "0g3rz11cvb7gnphp2np9z7bfl7v4dprq4w5hnsvx7yrasgsdyn8s"))
339 (patches (search-patches "ilmbase-fix-tests.patch"
340 "ilmbase-openexr-pkg-config.patch"))))
341 (build-system cmake-build-system)
343 `(#:phases (modify-phases %standard-phases
344 (add-after 'unpack 'change-directory
348 (home-page "https://www.openexr.com/")
349 (synopsis "Utility C++ libraries for threads, maths, and exceptions")
351 "IlmBase provides several utility libraries for C++. Half is a class
352 that encapsulates ILM's 16-bit floating-point format. IlmThread is a thread
353 abstraction. Imath implements 2D and 3D vectors, 3x3 and 4x4 matrices,
354 quaternions and other useful 2D and 3D math functions. Iex is an
355 exception-handling library.")
356 (license license:bsd-3)))
366 (url "https://github.com/OGRECave/ogre.git")
367 (commit (string-append "v" version))))
368 (file-name (git-file-name name version))
371 "072rzw9mxymbiypgkrbkk9h10rgly6gczik4dlmssk6xkpqckaqr"))))
372 (build-system cmake-build-system)
375 (modify-phases %standard-phases
376 (add-before 'configure 'pre-configure
377 (lambda* (#:key inputs #:allow-other-keys)
378 (substitute* "Tests/CMakeLists.txt"
380 (string-append "URL " (assoc-ref inputs "googletest-source"))))
383 (list "-DOGRE_BUILD_TESTS=TRUE"
384 (string-append "-DCMAKE_INSTALL_RPATH="
385 (assoc-ref %outputs "out") "/lib:"
386 (assoc-ref %outputs "out") "/lib/OGRE:"
387 (assoc-ref %build-inputs "googletest") "/lib")
388 "-DOGRE_INSTALL_DOCS=TRUE"
389 "-DOGRE_INSTALL_SAMPLES=TRUE"
390 "-DOGRE_INSTALL_SAMPLES_SOURCE=TRUE")))
394 ("googletest-source" ,(package-source googletest))
395 ("pkg-config" ,pkg-config)))
397 `(("font-dejavu" ,font-dejavu)
398 ("freeimage" ,freeimage)
399 ("freetype" ,freetype)
401 ("googletest" ,googletest)
404 ("libxrandr" ,libxrandr)
406 ("zziplib" ,zziplib)))
407 (synopsis "Scene-oriented, flexible 3D engine written in C++")
409 "OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented,
410 flexible 3D engine written in C++ designed to make it easier and more intuitive
411 for developers to produce applications utilising hardware-accelerated 3D
413 (home-page "http://www.ogre3d.org/")
414 (license license:expat)))
416 (define-public openexr
419 (version (package-version ilmbase))
421 (inherit (package-source ilmbase))
422 (file-name (git-file-name "openexr" version))
423 (modules '((guix build utils)))
426 (substitute* (find-files "OpenEXR" "tmpDir\\.h")
430 (build-system cmake-build-system)
433 (modify-phases %standard-phases
434 (add-after 'unpack 'change-directory
438 (add-before 'check 'increase-test-timeout
440 ;; On armhf-linux, we need to override the CTest default
441 ;; timeout of 1500 seconds for the OpenEXR.IlmImf test.
442 (setenv "CTEST_TEST_TIMEOUT" "2000")
444 ,@(if (not (target-64bit?))
445 `((add-after 'change-directory 'disable-broken-test
446 ;; This test fails on i686. Upstream developers suggest that
447 ;; this test is broken on i686 and can be safely disabled:
448 ;; https://github.com/openexr/openexr/issues/67#issuecomment-21169748
450 (substitute* "IlmImfTest/main.cpp"
451 ((".*testOptimizedInterleavePatterns.*") "")
452 ;; This test is broken in 2.4.0 and will be fixed in a later
453 ;; release: <https://github.com/openexr/openexr/issues/571>.
454 ((".*testLargeDataWindowOffsets.*") ""))
458 `(("pkg-config" ,pkg-config)))
460 `(("ilmbase" ,ilmbase) ;used in public headers
461 ("zlib" ,zlib))) ;OpenEXR.pc reads "-lz"
462 (home-page "https://www.openexr.com/")
463 (synopsis "High-dynamic range file format library")
465 "OpenEXR is a high dynamic-range (HDR) image file format developed for
466 use in computer imaging applications. The IlmImf C++ libraries support
467 storage of the \"EXR\" file format for storing 16-bit floating-point images.")
468 (license license:bsd-3)))
470 (define-public openimageio
477 (url "https://github.com/OpenImageIO/oiio.git")
478 (commit (string-append "Release-" version))))
479 (file-name (git-file-name name version))
482 "0zq34szprgkrrayg5sl3whrsx2l6lr8nw4hdrnwv2qhn70jbi2w2"))))
483 (build-system cmake-build-system)
484 ;; FIXME: To run all tests successfully, test image sets from multiple
485 ;; third party sources have to be present. For details see
486 ;; https://github.com/OpenImageIO/oiio/blob/master/INSTALL
490 `(("pkg-config" ,pkg-config)))
501 (synopsis "C++ library for reading and writing images")
503 "OpenImageIO is a library for reading and writing images, and a bunch of
504 related classes, utilities, and applications. There is a particular emphasis
505 on formats and functionality used in professional, large-scale animation and
506 visual effects work for film.")
507 (home-page "http://www.openimageio.org")
508 (license license:bsd-3)))
510 ;; This older version of OpenImageIO is required for Blender 2.79.
511 (define-public openimageio-1.7
513 (inherit openimageio)
519 (url "https://github.com/OpenImageIO/oiio.git")
520 (commit (string-append "Release-" version))))
521 (file-name (git-file-name name version))
524 "0yxxy43l3lllw7maqg42dlkgqms2d4772sxzxk7kmxg4lnhsvndc"))))))
526 (define-public openscenegraph
528 (name "openscenegraph")
534 (url "https://github.com/openscenegraph/OpenSceneGraph")
535 (commit (string-append "OpenSceneGraph-" version))))
538 "0x8hdbzw0b71j91fzp9cwmy9a7ava8v8wwyj8nxijq942vdx1785"))
539 (file-name (git-file-name name version))))
541 `((upstream-name . "OpenSceneGraph")))
542 (build-system cmake-build-system)
544 `(#:tests? #f ; no test target available
545 ;; Without this flag, 'rd' will be added to the name of the
546 ;; library binaries and break linking with other programs.
547 #:build-type "Release"
549 (list (string-append "-DCMAKE_INSTALL_RPATH="
550 (assoc-ref %outputs "out") "/lib:"
551 (assoc-ref %outputs "out") "/lib64"))))
553 `(("pkg-config" ,pkg-config)
557 ("libjpeg" ,libjpeg) ; Required for the JPEG texture plugin.
560 ("libxrandr" ,libxrandr)
563 (synopsis "High performance real-time graphics toolkit")
565 "The OpenSceneGraph is a high performance 3D graphics toolkit
566 used by application developers in fields such as visual simulation, games,
567 virtual reality, scientific visualization and modeling.")
568 (home-page "http://www.openscenegraph.org")
569 ;; The 'LICENSE' file explains that the source is licensed under
570 ;; LGPL 2.1, but with 4 exceptions. This version is called OSGPL.
571 (license license:lgpl2.1)))
573 ;; We need this for simgear
574 (define-public openscenegraph-3.4
575 (package (inherit openscenegraph)
576 (name "openscenegraph")
582 (url "https://github.com/openscenegraph/OpenSceneGraph")
583 (commit (string-append "OpenSceneGraph-" version))))
584 (file-name (git-file-name name version))
587 "1fbzg1ihjpxk6smlq80p3h3ggllbr16ihd2fxpfwzam8yr8yxip9"))))
589 (substitute-keyword-arguments (package-arguments openscenegraph)
590 ((#:configure-flags flags)
592 ;; The jpeg plugin requires conversion between integers and booleans
593 "-DCMAKE_CXX_FLAGS=-fpermissive"
596 `(("libjpeg" ,libjpeg)
597 ,@(package-inputs openscenegraph)))))
600 (define-public openmw-openscenegraph
601 ;; OpenMW prefers its own fork of openscenegraph:
602 ;; https://wiki.openmw.org/index.php?title=Development_Environment_Setup#OpenSceneGraph.
603 (let ((commit "36a962845a2c87a6671fd822157e0729d164e940"))
606 (inherit openscenegraph)
607 (version (git-version "3.6" "1" commit))
612 (url "https://github.com/OpenMW/osg/")
614 (file-name (git-file-name (package-name openscenegraph) version))
617 "05yhgq3qm5q277y32n5sf36vx5nv5qd3zlhz4csgd3a6190jrnia"))))
619 (substitute-keyword-arguments (package-arguments openscenegraph)
620 ((#:configure-flags flags)
621 ;; As per the above wiki link, the following plugins are enough:
623 '("-DBUILD_OSG_PLUGINS_BY_DEFAULT=0"
624 "-DBUILD_OSG_PLUGIN_OSG=1"
625 "-DBUILD_OSG_PLUGIN_DDS=1"
626 "-DBUILD_OSG_PLUGIN_TGA=1"
627 "-DBUILD_OSG_PLUGIN_BMP=1"
628 "-DBUILD_OSG_PLUGIN_JPEG=1"
629 "-DBUILD_OSG_PLUGIN_PNG=1"
630 "-DBUILD_OSG_DEPRECATED_SERIALIZERS=0"
631 ;; The jpeg plugin requires conversion between integers and booleans
632 "-DCMAKE_CXX_FLAGS=-fpermissive")
635 (define-public povray
642 (url "https://github.com/POV-Ray/povray")
643 (commit (string-append "v" version))))
644 (file-name (git-file-name name version))
647 "1q114n4m3r7qy3yn954fq7p46rg7ypdax5fazxr9yj1jklf1lh6z"))
648 (modules '((guix build utils)))
651 ;; Delete bundled libraries.
652 (delete-file-recursively "libraries")
654 (build-system gnu-build-system)
656 `(("autoconf" ,autoconf)
657 ("automake" ,automake)
658 ("pkg-config" ,pkg-config)))
669 (list "COMPILED_BY=Guix"
670 (string-append "--with-boost-libdir="
671 (assoc-ref %build-inputs "boost") "/lib")
672 "--disable-optimiz-arch")
674 (modify-phases %standard-phases
675 (add-after 'unpack 'run-prebuild
677 (setenv "HOME" (getcwd))
678 (with-directory-excursion "unix"
679 (substitute* "prebuild.sh"
680 (("/bin/sh") (which "sh")))
681 (invoke "sh" "prebuild.sh"))
683 ;; The bootstrap script is run by the prebuild script in the
684 ;; "run-prebuild" phase.
685 (delete 'bootstrap))))
686 (synopsis "Tool for creating three-dimensional graphics")
688 "@code{POV-Ray} is short for the Persistence of Vision Raytracer, a tool
689 for producing high-quality computer graphics. @code{POV-Ray} creates
690 three-dimensional, photo-realistic images using a rendering technique called
691 ray-tracing. It reads in a text file containing information describing the
692 objects and lighting in a scene and generates an image of that scene from the
693 view point of a camera also described in the text file. Ray-tracing is not a
694 fast process by any means, but it produces very high quality images with
695 realistic reflections, shading, perspective and other effects.")
696 (home-page "http://www.povray.org/")
697 (license license:agpl3+)))
699 (define-public rapicorn
705 (uri (string-append "https://testbit.eu/pub/dists/rapicorn/"
706 "rapicorn-" version ".tar.xz"))
709 "1y51yjrpsihas1jy905m9p3r8iiyhq6bwi2690c564i5dnix1f9d"))
710 (patches (search-patches "rapicorn-isnan.patch"))))
711 (build-system gnu-build-system)
714 (modify-phases %standard-phases
715 (add-after 'unpack 'fix-tests
717 ;; Our grep does not support perl regular expressions.
718 (substitute* "taptool.sh"
719 (("grep -P") "grep -E"))
720 ;; Disable path tests because we cannot access /bin or /sbin.
721 (substitute* "rcore/tests/multitest.cc"
722 (("TCMP \\(Path::equals \\(\"/bin\"") "//"))
724 (add-before 'check 'pre-check
726 ;; The test suite requires a running X server (with DISPLAY
727 ;; number 99 or higher).
728 (system "Xvfb :99 &")
729 (setenv "DISPLAY" ":99")
731 (add-after 'unpack 'replace-fhs-paths
733 (substitute* (cons "Makefile.decl"
734 (find-files "." "^Makefile\\.in$"))
735 (("/bin/ls") (which "ls"))
736 (("/usr/bin/env") (which "env")))
738 ;; These libraries are listed in the "Required" section of the pkg-config
741 `(("librsvg" ,librsvg)
745 ("python2-enum34" ,python2-enum34)))
747 `(("gdk-pixbuf" ,gdk-pixbuf)
748 ("libpng" ,libpng-1.2)
749 ("readline" ,readline)
750 ("libcroco" ,libcroco)
752 ("cython" ,python2-cython)))
754 `(("pandoc" ,ghc-pandoc)
758 ("graphviz" ,graphviz)
759 ("intltool" ,intltool)
760 ("pkg-config" ,pkg-config)
761 ("xvfb" ,xorg-server)))
762 (home-page "https://rapicorn.testbit.org/")
763 (synopsis "Toolkit for rapid development of user interfaces")
765 "Rapicorn is a toolkit for rapid development of user interfaces in C++
766 and Python. The user interface is designed in a declarative markup language
767 and is connected to the programming logic using data bindings and commands.")
768 (license license:mpl2.0)))
776 (uri (string-append "https://github.com/ampas/CTL/archive/ctl-"
780 "1gg04pyvw0m398akn0s1l07g5b1haqv5na1wpi5dii1jjd1w3ynp"))))
781 (build-system cmake-build-system)
782 (arguments '(#:tests? #f)) ;no 'test' target
784 ;; Headers include OpenEXR and IlmBase headers.
785 (propagated-inputs `(("openexr" ,openexr)))
787 (home-page "http://ampasctl.sourceforge.net")
788 (synopsis "Color Transformation Language")
790 "The Color Transformation Language, or CTL, is a small programming
791 language that was designed to serve as a building block for digital color
792 management systems. CTL allows users to describe color transforms in a
793 concise and unambiguous way by expressing them as programs. In order to apply
794 a given transform to an image, the color management system instructs a CTL
795 interpreter to load and run the CTL program that describes the transform. The
796 original and the transformed image constitute the CTL program's input and
799 ;; The web site says it's under a BSD-3 license, but the 'LICENSE' file
800 ;; and headers use different wording.
801 (license (license:non-copyleft "file://LICENSE"))))
803 (define-public brdf-explorer
804 ;; There are no release tarballs, and not even tags in the repo,
805 ;; so use the latest revision.
806 (let ((commit "5b2cd46f38a06e47207fa7229b72d37beb945019")
809 (name "brdf-explorer")
810 (version (string-append "1.0.0-" revision "." (string-take commit 9)))
814 (url "https://github.com/wdas/brdf.git")
818 "06vzbiajzbi2xl8jlff5d45bc9wd68i3jdndfab1f3jgfrd8bsgx"))
819 (file-name (string-append name "-" version "-checkout"))))
820 (build-system gnu-build-system)
822 `(#:phases (modify-phases %standard-phases
824 (lambda* (#:key outputs #:allow-other-keys)
825 (let ((out (assoc-ref outputs "out")))
827 (string-append "prefix=" out)))))
828 (add-after 'install 'wrap-program
829 (lambda* (#:key outputs #:allow-other-keys)
830 (let* ((out (assoc-ref outputs "out"))
831 (bin (string-append out "/bin"))
834 (with-directory-excursion bin
835 (rename-file "brdf" ".brdf-real")
836 (call-with-output-file "brdf"
838 (format port "#!/bin/sh
839 # Run the thing from its home, otherwise it just bails out.
841 exec -a \"$0\" ~a/.brdf-real~%"
843 (chmod "brdf" #o555)))
846 `(("qttools" ,qttools))) ;for 'qmake'
851 ("freeglut" ,freeglut)
853 (home-page "http://www.disneyanimation.com/technology/brdf.html")
855 "Analyze bidirectional reflectance distribution functions (BRDFs)")
857 "BRDF Explorer is an application that allows the development and analysis
858 of bidirectional reflectance distribution functions (BRDFs). It can load and
859 plot analytic BRDF functions (coded as functions in OpenGL's GLSL shader
860 language), measured material data from the MERL database, and anisotropic
861 measured material data from MIT CSAIL. Graphs and visualizations update in
862 real time as parameters are changed, making it a useful tool for evaluating
863 and understanding different BRDFs (and other component functions).")
864 (license license:ms-pl))))
872 (uri (list (string-append
873 "ftp://ftp.fau.de/gentoo/distfiles/agg-"
876 "ftp://ftp.ula.ve/gentoo/distfiles/agg-"
879 ;; Site was discontinued.
880 (string-append "http://www.antigrain.com/agg-"
883 (base32 "07wii4i824vy9qsvjsgqxppgqmfdxq0xa87i5yk53fijriadq7mb"))
884 (patches (search-patches "agg-am_c_prototype.patch"))))
885 (build-system gnu-build-system)
888 (list (string-append "--x-includes=" (assoc-ref %build-inputs "libx11")
890 (string-append "--x-libraries=" (assoc-ref %build-inputs "libx11")
892 "--disable-examples")
894 (modify-phases %standard-phases
897 ;; let's call configure from configure phase and not now
898 (substitute* "autogen.sh" (("./configure") "# ./configure"))
899 (invoke "sh" "autogen.sh"))))))
901 `(("pkg-config" ,pkg-config)
903 ("autoconf" ,autoconf)
904 ("automake" ,automake)))
907 ("freetype" ,freetype)
910 ;; Antigrain.com was discontinued.
911 (home-page "http://agg.sourceforge.net/antigrain.com/index.html")
912 (synopsis "High-quality 2D graphics rendering engine for C++")
914 "Anti-Grain Geometry is a high quality rendering engine written in C++.
915 It supports sub-pixel resolutions and anti-aliasing. It is also library for
916 rendering SVG graphics.")
917 (license license:gpl2+)))
919 (define-public python-pastel
921 (name "python-pastel")
926 (uri (pypi-uri "pastel" version))
929 "1qxcrcl8pzh66l8s6hym153mijdhwna0afcsmgca0bj4n80ijfxz"))))
930 (build-system python-build-system)
932 `(#:phases (modify-phases %standard-phases
934 (lambda _ (invoke "pytest" "pastel" "tests/"))))))
936 `(("python-pytest" ,python-pytest)))
937 (home-page "https://github.com/sdispater/pastel")
938 (synopsis "Library to colorize strings in your terminal")
939 (description "Pastel is a simple library to help you colorize strings in
941 (license license:expat)))
943 (define-public python2-pastel
944 (package-with-python2 python-pastel))
946 (define-public fgallery
954 "http://www.thregr.org/~wavexx/software/fgallery/releases/"
955 "fgallery-" version ".zip"))
958 "18wlvqbxcng8pawimbc8f2422s8fnk840hfr6946lzsxr0ijakvf"))))
959 (build-system gnu-build-system)
961 `(#:tests? #f ; no tests
963 (modify-phases %standard-phases
967 (lambda* (#:key inputs outputs #:allow-other-keys)
968 (let* ((out (assoc-ref outputs "out"))
969 (bin (string-append out "/bin/"))
970 (share (string-append out "/share/fgallery"))
971 (man (string-append out "/share/man/man1"))
972 (perl5lib (getenv "PERL5LIB"))
973 (script (string-append share "/fgallery")))
974 (define (bin-directory input-name)
975 (string-append (assoc-ref inputs input-name) "/bin"))
978 (copy-file "fgallery.1" (string-append man "/fgallery.1"))
981 (copy-recursively "." share)
983 ;; fgallery copies files from store when it is run. The
984 ;; read-only permissions from the store directories will cause
985 ;; fgallery to fail. Do not preserve file attributes when
986 ;; copying files to prevent it.
989 "'cp', '--no-preserve=all'"))
992 (symlink script (string-append out "/bin/fgallery"))
996 ,(map bin-directory '("imagemagick"
1004 `("PERL5LIB" ":" prefix (,perl5lib)))
1007 `(("unzip" ,unzip)))
1008 ;; TODO: Add missing optional dependency: facedetect.
1010 `(("imagemagick" ,imagemagick)
1013 ("libjpeg" ,libjpeg)
1016 ("perl-cpanel-json-xs" ,perl-cpanel-json-xs)
1017 ("perl-image-exiftool" ,perl-image-exiftool)
1018 ("jpegoptim" ,jpegoptim)
1019 ("pngcrush" ,pngcrush)
1021 (home-page "http://www.thregr.org/~wavexx/software/fgallery/")
1022 (synopsis "Static photo gallery generator")
1024 "FGallery is a static, JavaScript photo gallery generator with minimalist
1025 look. The result can be uploaded on any web server without additional
1027 (license license:gpl2+)))
1029 (define-public opensubdiv
1036 (url "https://github.com/PixarAnimationStudios/OpenSubdiv")
1037 (commit (string-append "v" (string-join (string-split version #\.)
1039 (file-name (git-file-name name version))
1042 "0cippg6aqc5dlya1cmh3908pwssrg52fwgyylnvz5343yrxmgk12"))))
1043 (build-system cmake-build-system)
1045 `(#:phases (modify-phases %standard-phases
1046 (add-before 'configure 'set-glew-location
1047 (lambda* (#:key inputs #:allow-other-keys)
1048 (setenv "GLEW_LOCATION" (assoc-ref inputs "glew"))
1050 (add-before 'check 'start-xorg-server
1051 (lambda* (#:key inputs #:allow-other-keys)
1052 ;; The test suite requires a running X server.
1053 (system (string-append (assoc-ref inputs "xorg-server")
1055 (setenv "DISPLAY" ":1")
1058 `(("xorg-server" ,xorg-server)))
1061 ("libxrandr" ,libxrandr)
1062 ("libxcursor" ,libxcursor)
1063 ("libxinerama" ,libxinerama)
1067 (home-page "http://graphics.pixar.com/opensubdiv/")
1068 (synopsis "High performance subdivision surface evaluation")
1069 (description "OpenSubdiv is a set of libraries that implement high
1070 performance subdivision surface (subdiv) evaluation on massively parallel CPU
1071 and GPU architectures.")
1072 (license license:asl2.0)))
1074 (define-public opencsg
1075 (let ((dot-to-dash (lambda (c) (if (char=? c #\.) #\- c))))
1083 (url "https://github.com/floriankirsch/OpenCSG.git")
1084 (commit (string-append "opencsg-"
1085 (string-map dot-to-dash version)
1087 (file-name (git-file-name name version))
1090 "00m4vs6jn3scqczscc4591l1d6zg6anqp9v1ldf9ymf70rdyvm7m"))))
1091 (build-system gnu-build-system)
1094 (modify-phases %standard-phases
1096 (lambda* (#:key outputs #:allow-other-keys)
1097 (substitute* "src/Makefile"
1098 (("/usr/local") (assoc-ref outputs "out")))
1100 (add-before 'build 'skip-example
1101 (lambda _ (chdir "src") #t)))))
1104 ("freeglut" ,freeglut)))
1105 (synopsis "Library for rendering Constructive Solid Geometry (CSG)")
1107 "OpenCSG is a library for rendering Constructive Solid Geometry (CSG) using
1108 OpenGL. CSG is an approach for modeling complex 3D-shapes using simpler ones.
1109 For example, two shapes can be combined by uniting them, by intersecting them,
1110 or by subtracting one shape from the other.")
1111 (home-page "http://www.opencsg.org/")
1112 (license license:gpl2))))
1114 (define-public coin3D
1115 ;; The ‘4.0.0’ zip archive isn't stable, nor in fact a release. See:
1116 ;; https://bitbucket.org/Coin3D/coin/issues/179/coin-400-srczip-has-been-modified
1118 (changeset "ab8d0e47a4de3230a8137feb39c142d6ba45f97d"))
1122 (simple-format #f "3.1.3-~A-~A" revision (string-take changeset 7)))
1127 (url "https://bitbucket.org/Coin3D/coin")
1128 (changeset changeset)))
1129 (file-name (git-file-name name version))
1131 (base32 "1ff44jz6lg4rylljvy69n1hcjh9y6achbv9jpn1cv2sf8cxn3r2j"))
1132 (modules '((guix build utils)))
1135 (for-each delete-file
1137 "cfg/wrapmsvc.exe"))
1139 (build-system cmake-build-system)
1141 `(("doxygen" ,doxygen)
1142 ("graphviz" ,graphviz)))
1145 ("freeglut" ,freeglut)
1150 "-DCOIN_BUILD_DOCUMENTATION_MAN=ON"
1151 (string-append "-DBOOST_ROOT="
1152 (assoc-ref %build-inputs "boost")))))
1153 (home-page "https://bitbucket.org/Coin3D/coin/wiki/Home")
1155 "High-level 3D visualization library with Open Inventor 2.1 API")
1157 "Coin is a 3D graphics library with an Application Programming Interface
1158 based on the Open Inventor 2.1 API. For those who are not familiar with
1159 Open Inventor, it is a scene-graph based retain-mode rendering and model
1160 interaction library, written in C++, which has become the de facto
1161 standard graphics library for 3D visualization and visual simulation
1162 software in the scientific and engineering community.")
1163 (license license:bsd-3))))