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, 2020 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, 2020 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, 2020 Marius Bakke <mbakke@fastmail.com>
20 ;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
21 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
22 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
23 ;;; Copyright © 2020 Raghav Gururajan <raghavgururajan@disroot.org>
24 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
26 ;;; This file is part of GNU Guix.
28 ;;; GNU Guix is free software; you can redistribute it and/or modify it
29 ;;; under the terms of the GNU General Public License as published by
30 ;;; the Free Software Foundation; either version 3 of the License, or (at
31 ;;; your option) any later version.
33 ;;; GNU Guix is distributed in the hope that it will be useful, but
34 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
35 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 ;;; GNU General Public License for more details.
38 ;;; You should have received a copy of the GNU General Public License
39 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
41 (define-module (gnu packages graphics)
42 #:use-module (gnu packages)
43 #:use-module (gnu packages algebra)
44 #:use-module (gnu packages audio)
45 #:use-module (gnu packages autotools)
46 #:use-module (gnu packages base)
47 #:use-module (gnu packages bash)
48 #:use-module (gnu packages bison)
49 #:use-module (gnu packages boost)
50 #:use-module (gnu packages check)
51 #:use-module (gnu packages compression)
52 #:use-module (gnu packages datastructures)
53 #:use-module (gnu packages documentation)
54 #:use-module (gnu packages flex)
55 #:use-module (gnu packages fonts)
56 #:use-module (gnu packages fontutils)
57 #:use-module (gnu packages gettext)
58 #:use-module (gnu packages ghostscript)
59 #:use-module (gnu packages gl)
60 #:use-module (gnu packages glib)
61 #:use-module (gnu packages gnome)
62 #:use-module (gnu packages graphviz)
63 #:use-module (gnu packages gtk)
64 #:use-module (gnu packages haskell-xyz)
65 #:use-module (gnu packages image)
66 #:use-module (gnu packages imagemagick)
67 #:use-module (gnu packages jemalloc)
68 #:use-module (gnu packages maths)
69 #:use-module (gnu packages multiprecision)
70 #:use-module (gnu packages pdf)
71 #:use-module (gnu packages perl)
72 #:use-module (gnu packages photo)
73 #:use-module (gnu packages pkg-config)
74 #:use-module (gnu packages plotutils)
75 #:use-module (gnu packages pth)
76 #:use-module (gnu packages pulseaudio) ; libsndfile, libsamplerate
77 #:use-module (gnu packages python)
78 #:use-module (gnu packages python-xyz)
79 #:use-module (gnu packages qt)
80 #:use-module (gnu packages readline)
81 #:use-module (gnu packages sdl)
82 #:use-module (gnu packages swig)
83 #:use-module (gnu packages tbb)
84 #:use-module (gnu packages video)
85 #:use-module (gnu packages xml)
86 #:use-module (gnu packages xorg)
87 #:use-module (guix build-system cmake)
88 #:use-module (guix build-system gnu)
89 #:use-module (guix build-system python)
90 #:use-module (guix download)
91 #:use-module (guix git-download)
92 #:use-module (guix hg-download)
93 #:use-module ((guix licenses) #:prefix license:)
94 #:use-module (guix packages)
95 #:use-module (guix utils))
105 (string-append "https://fox-toolkit.org/ftp/fox-" version ".tar.gz"))
107 (base32 "08w98m6wjadraw1pi13igzagly4b2nfa57kdqdnkjfhgkvg1bvv5"))))
108 (build-system gnu-build-system)
111 (modify-phases %standard-phases
112 (add-after 'unpack 'patch
114 (substitute* "configure"
115 (("-I/usr/include/freetype2")
118 (assoc-ref %build-inputs "freetype")
119 "/include/freetype2"))))
122 `(("doxygen" ,doxygen)))
125 ("freetype" ,freetype)
128 ("jpeg" ,libjpeg-turbo)
132 ("xcursor" ,libxcursor)
134 ("xfixes" ,libxfixes)
137 ("xrandr" ,libxrandr)
138 ("xrender" ,libxrender)
139 ("xshm" ,libxshmfence)
141 (synopsis "Widget Toolkit for building GUI")
142 (description"FOX (Free Objects for X) is a C++ based Toolkit for developing
143 Graphical User Interfaces easily and effectively. It offers a wide, and
144 growing, collection of Controls, and provides state of the art facilities such
145 as drag and drop, selection, as well as OpenGL widgets for 3D graphical
146 manipulation. FOX also implements icons, images, and user-convenience features
147 such as status line help, and tooltips. Tooltips may even be used for 3D
149 (home-page "http://www.fox-toolkit.org")
150 (license license:lgpl2.1+)))
152 (define-public autotrace
153 (let ((commit "travis-20190624.59")
154 (version-base "0.40.0"))
157 (version (string-append version-base "-"
158 (if (string-prefix? "travis-" commit)
159 (string-drop commit 7)
164 (url "https://github.com/autotrace/autotrace")
166 (file-name (git-file-name name version))
169 "0mk4yavy42dj0pszr1ggnggpvmzs4ds46caa9wr55cqsypn7bq6s"))))
170 (build-system gnu-build-system)
172 `(#:phases (modify-phases %standard-phases
173 ;; See: https://github.com/autotrace/autotrace/issues/27.
174 (add-after 'unpack 'include-spline.h-header
176 (substitute* "Makefile.am"
177 ((".*src/types.h.*" all)
178 (string-append all "\t\tsrc/spline.h \\\n")))
180 ;; See: https://github.com/autotrace/autotrace/issues/26.
183 (invoke "sh" "tests/runtests.sh"))))))
186 ("pkg-config" ,pkg-config)
187 ("autoconf" ,autoconf)
188 ("automake" ,automake)
189 ("intltool" ,intltool)
191 ("gettext" ,gettext-minimal)))
194 ("libjpeg" ,libjpeg-turbo)
196 ("imagemagick" ,imagemagick)
197 ("pstoedit" ,pstoedit)))
198 (home-page "https://github.com/autotrace/autotrace")
199 (synopsis "Bitmap to vector graphics converter")
200 (description "AutoTrace is a utility for converting bitmap into vector
201 graphics. It can trace outlines and midlines, effect color reduction or
202 despeckling and has support for many input and output formats. It can be used
203 with the @command{autotrace} utility or as a C library, @code{libautotrace}.")
204 (license (list license:gpl2+ ;for the utility itself
205 license:lgpl2.1+))))) ;for use as a library
207 (define-public blender
213 (uri (string-append "https://download.blender.org/source/"
214 "blender-" version ".tar.xz"))
217 "18m27abp4j3xv48dr6ddr2mqcvx2vkjffr487z90059yv9k0yh2p"))))
218 (build-system cmake-build-system)
220 (let ((python-version (version-major+minor (package-version python))))
221 `(;; Test files are very large and not included in the release tarball.
224 (list "-DWITH_CODEC_FFMPEG=ON"
225 "-DWITH_CODEC_SNDFILE=ON"
227 "-DWITH_DOC_MANPAGE=ON"
229 "-DWITH_IMAGE_OPENJPEG=ON"
230 "-DWITH_INPUT_NDOF=ON"
231 "-DWITH_INSTALL_PORTABLE=OFF"
233 "-DWITH_MOD_OCEANSIM=ON"
234 "-DWITH_OPENSUBDIV=ON"
235 "-DWITH_PYTHON_INSTALL=OFF"
236 (string-append "-DPYTHON_LIBRARY=python" ,python-version)
237 (string-append "-DPYTHON_LIBPATH=" (assoc-ref %build-inputs "python")
239 (string-append "-DPYTHON_INCLUDE_DIR=" (assoc-ref %build-inputs "python")
240 "/include/python" ,python-version)
241 (string-append "-DPYTHON_VERSION=" ,python-version)
242 (string-append "-DPYTHON_NUMPY_PATH="
243 (assoc-ref %build-inputs "python-numpy")
244 "/lib/python" ,python-version "/site-packages/"))
246 (modify-phases %standard-phases
247 ;; XXX This file doesn't exist in the Git sources but will probably
248 ;; exist in the eventual 2.80 source tarball.
249 (add-after 'unpack 'fix-broken-import
251 (substitute* "release/scripts/addons/io_scene_fbx/json2fbx.py"
252 (("import encode_bin") "from . import encode_bin"))
254 (add-after 'set-paths 'add-ilmbase-include-path
255 (lambda* (#:key inputs #:allow-other-keys)
256 ;; OpenEXR propagates ilmbase, but its include files do not appear
257 ;; in the CPATH, so we need to add "$ilmbase/include/OpenEXR/" to
258 ;; the CPATH to satisfy the dependency on "half.h".
260 (string-append (assoc-ref inputs "ilmbase")
262 ":" (or (getenv "CPATH") "")))
266 ("jemalloc" ,jemalloc)
269 ("libxrender" ,libxrender)
270 ("openimageio" ,openimageio)
272 ("opensubdiv" ,opensubdiv)
274 ("openjpeg" ,openjpeg)
275 ("libjpeg" ,libjpeg-turbo)
281 ("libsndfile" ,libsndfile)
282 ("freetype" ,freetype)
286 ("python-numpy" ,python-numpy)
289 (home-page "https://blender.org/")
290 (synopsis "3D graphics creation suite")
292 "Blender is a 3D graphics creation suite. It supports the entirety of
293 the 3D pipeline—modeling, rigging, animation, simulation, rendering,
294 compositing and motion tracking, even video editing and game creation. The
295 application can be customized via its API for Python scripting.")
296 (license license:gpl2+)))
298 (define-public assimp
305 (url "https://github.com/assimp/assimp")
306 (commit (string-append "v" version))))
307 (file-name (git-file-name name version))
310 "1rhyqfhzifdj7yibyanph3rh13ykw3i98dnn8mz65j780472hw28"))))
311 (build-system cmake-build-system)
314 (home-page "http://www.assimp.org/")
315 (synopsis "Asset import library")
317 "The Open Asset Import Library loads more than 40 3D file formats into
318 one unified data structure. Additionally, assimp features various mesh post
319 processing tools: normals and tangent space generation, triangulation, vertex
320 cache locality optimization, removal of degenerate primitives and duplicate
321 vertices, sorting by primitive type, merging of redundant materials and many
323 (license license:bsd-3)))
332 "https://github.com/CGAL/cgal/releases/download/releases/"
333 "CGAL-" version "/CGAL-" version ".tar.xz"))
336 "08lrp3hfwdypggz4138bnkh6bjxn441zg2y9xnq5mrjfc5ini6w1"))))
337 (build-system cmake-build-system)
339 '(#:tests? #f)) ; no test target
344 (home-page "https://www.cgal.org/")
345 (synopsis "Computational geometry algorithms library")
347 "CGAL provides easy access to efficient and reliable geometric algorithms
348 in the form of a C++ library. CGAL is used in various areas needing geometric
349 computation, such as: computer graphics, scientific visualization, computer
350 aided design and modeling, geographic information systems, molecular biology,
351 medical imaging, robotics and motion planning, mesh generation, numerical
352 methods, etc. It provides data structures and algorithms such as
353 triangulations, Voronoi diagrams, polygons, polyhedra, mesh generation, and
356 ;; The 'LICENSE' file explains that a subset is available under more
357 ;; permissive licenses.
358 (license license:gpl3+)))
360 (define-public ilmbase
367 (url "https://github.com/openexr/openexr")
368 (commit (string-append "v" version))))
369 (file-name (git-file-name "ilmbase" version))
372 "1vf8bqld2bpcdi99jbr043y6vp01cp3fvbiasrn66xn91mf6imbn"))
373 (patches (search-patches "ilmbase-fix-tests.patch"))))
374 (build-system cmake-build-system)
376 `(#:phases (modify-phases %standard-phases
377 (add-after 'unpack 'change-directory
381 (home-page "https://www.openexr.com/")
382 (synopsis "Utility C++ libraries for threads, maths, and exceptions")
384 "IlmBase provides several utility libraries for C++. Half is a class
385 that encapsulates ILM's 16-bit floating-point format. IlmThread is a thread
386 abstraction. Imath implements 2D and 3D vectors, 3x3 and 4x4 matrices,
387 quaternions and other useful 2D and 3D math functions. Iex is an
388 exception-handling library.")
389 (license license:bsd-3)))
391 (define-public lib2geom
392 ;; Use the latest master commit, as the 1.0 release suffer build problems.
394 (commit "f98256d2a923955af74b8cff3d456f0df1ee4b59"))
397 (version (git-version "1.0" revision commit))
401 (url "https://gitlab.com/inkscape/lib2geom.git")
403 (file-name (git-file-name name version))
406 "0w6ijaai8i80d0f35c0shgdspqlsdhw3cvz106k1gm7bmnz1wzpq"))
408 ;; Patches submitted to upstream (see:
409 ;; https://gitlab.com/inkscape/lib2geom/merge_requests/17,
410 ;; https://gitlab.com/inkscape/lib2geom/-/merge_requests/32).
411 (search-patches "lib2geom-enable-assertions.patch"
412 "lib2geom-fix-tests.patch"))
413 (modules '((guix build utils)))
416 ;; Fix py2geom module initialization (see:
417 ;; https://gitlab.com/inkscape/lib2geom/merge_requests/18).
418 (substitute* "src/py2geom/__init__.py"
419 (("_py2geom") "py2geom._py2geom"))
421 (build-system cmake-build-system)
423 `(#:imported-modules ((guix build python-build-system)
424 ,@%cmake-build-system-modules)
425 #:configure-flags '("-D2GEOM_BUILD_SHARED=ON"
426 "-D2GEOM_BOOST_PYTHON=ON"
427 ;; Compiling the Cython bindings fail (see:
428 ;; https://gitlab.com/inkscape/lib2geom/issues/21).
429 "-D2GEOM_CYTHON_BINDINGS=OFF")
431 (modify-phases %standard-phases
432 (add-after 'unpack 'patch-python-lib-install-path
433 (lambda* (#:key inputs outputs #:allow-other-keys)
434 (let* ((python-version (@ (guix build python-build-system)
436 (python-maj-min-version (python-version
437 (assoc-ref inputs "python")))
438 (site-package (string-append
439 (assoc-ref outputs "out")
440 "/lib/python" python-maj-min-version
442 (substitute* '("src/cython/CMakeLists.txt"
443 "src/py2geom/CMakeLists.txt")
444 (("PYTHON_LIB_INSTALL \"[^\"]*\"")
445 (format #f "PYTHON_LIB_INSTALL ~s" site-package))))
447 (native-inputs `(("python" ,python-wrapper)
448 ("googletest" ,googletest)
449 ("pkg-config" ,pkg-config)))
450 (inputs `(("cairo" ,cairo)
451 ("pycairo" ,python-pycairo)
452 ("double-conversion" ,double-conversion)
456 `(("boost" ,boost))) ;referred to in 2geom/pathvector.h.
457 (home-page "https://gitlab.com/inkscape/lib2geom/")
458 (synopsis "C++ 2D graphics library")
459 (description "2geom is a C++ library of mathematics for paths, curves,
460 and other geometric calculations. Designed for vector graphics, it tackles
461 Bézier curves, conic sections, paths, intersections, transformations, and
463 ;; Because the library is linked with the GNU Scientific Library
464 ;; (GPLv3+), the combined work must be licensed as GPLv3+ (see:
465 ;; https://gitlab.com/inkscape/inkscape/issues/784).
466 (license license:gpl3+))))
468 (define-public pstoedit
474 (uri (string-append "mirror://sourceforge/pstoedit/pstoedit/"
475 version "/pstoedit-" version ".tar.gz"))
478 "1kv46g2wsvsvcngkavxl5gnw3l6g5xqnh4kmyx4b39a01d8xiddp"))))
479 (build-system gnu-build-system)
481 `(("pkg-config" ,pkg-config)))
483 `(("ghostscript" ,ghostscript)
484 ("imagemagick" ,imagemagick)
485 ("libplot" ,plotutils)
486 ("libjpeg" ,libjpeg-turbo)
487 ("zlib" ,zlib))) ;else libp2edrvmagick++.so fails to link
488 (home-page "http://www.pstoedit.net/")
489 (synopsis "Converter for PostScript and PDF graphics")
490 (description "The @code{pstoedit} utility allows translating graphics
491 in the PostScript or PDF (Portable Document Format) formats to various
492 other vector formats such as:
497 @item Flattened PostScript
498 @item DXF, a CAD (Computed-Aided Design) exchange format
499 @item PIC (for troff/groff)
500 @item MetaPost (for usage with TeX/LaTeX)
501 @item LaTeX2e picture
502 @item GNU Metafile (for use with plotutils/libplot)
503 @item Any format supported by ImageMagick
505 (license license:gpl2+)))
515 (url "https://github.com/OGRECave/ogre")
516 (commit (string-append "v" version))
517 (recursive? #t))) ;for Dear ImGui submodule
518 (file-name (git-file-name name version))
520 (base32 "1sx0jsw4kmb4ycf62bgx3ygwv8k1cgjx52y47d7dk07z6gk6wpyj"))))
521 (build-system cmake-build-system)
524 (modify-phases %standard-phases
525 (add-before 'configure 'pre-configure
526 ;; CMakeLists.txt forces CMAKE_INSTALL_RPATH value. As
527 ;; a consequence, we cannot suggest ours in configure flags. Fix
529 (lambda* (#:key inputs outputs #:allow-other-keys)
530 (substitute* "CMakeLists.txt"
531 (("set\\(CMAKE_INSTALL_RPATH .*") ""))
534 (let* ((out (assoc-ref %outputs "out"))
536 (string-join (list (string-append out "/lib")
537 (string-append out "/lib/OGRE"))
539 (list (string-append "-DCMAKE_INSTALL_RPATH=" runpath)
540 "-DOGRE_BUILD_DEPENDENCIES=OFF"
541 "-DOGRE_BUILD_TESTS=TRUE"
542 "-DOGRE_INSTALL_DOCS=TRUE"
543 "-DOGRE_INSTALL_SAMPLES=TRUE"
544 "-DOGRE_INSTALL_SAMPLES_SOURCE=TRUE"))))
548 ("googletest" ,googletest-1.8)
549 ("pkg-config" ,pkg-config)))
551 `(("font-dejavu" ,font-dejavu)
552 ("freeimage" ,freeimage)
553 ("freetype" ,freetype)
556 ("libxrandr" ,libxrandr)
560 ("zziplib" ,zziplib)))
561 (synopsis "Scene-oriented, flexible 3D engine written in C++")
563 "OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented,
564 flexible 3D engine written in C++ designed to make it easier and more intuitive
565 for developers to produce applications utilising hardware-accelerated 3D
567 (home-page "https://www.ogre3d.org/")
568 (license license:expat)))
570 (define-public openexr
573 (version (package-version ilmbase))
575 (inherit (package-source ilmbase))
576 (file-name (git-file-name "openexr" version))
577 (modules '((guix build utils)))
580 (substitute* (find-files "OpenEXR" "tmpDir\\.h")
584 (build-system cmake-build-system)
587 (modify-phases %standard-phases
588 (add-after 'unpack 'change-directory
592 (add-after 'change-directory 'increase-test-timeout
594 ;; On armhf-linux, we need to override the CTest default
595 ;; timeout of 1500 seconds for the OpenEXR.IlmImf test.
596 (substitute* "IlmImfTest/CMakeLists.txt"
597 (("add_test\\(NAME OpenEXR\\.IlmImf.*" all)
600 "set_tests_properties(OpenEXR.IlmImf PROPERTIES TIMEOUT 2000)")))
602 ,@(if (not (target-64bit?))
603 `((add-after 'change-directory 'disable-broken-test
604 ;; This test fails on i686. Upstream developers suggest that
605 ;; this test is broken on i686 and can be safely disabled:
606 ;; https://github.com/openexr/openexr/issues/67#issuecomment-21169748
608 (substitute* "IlmImfTest/main.cpp"
609 ((".*testOptimizedInterleavePatterns.*") ""))
613 `(("pkg-config" ,pkg-config)))
615 `(("ilmbase" ,ilmbase) ;used in public headers
616 ("zlib" ,zlib))) ;OpenEXR.pc reads "-lz"
617 (home-page "https://www.openexr.com/")
618 (synopsis "High-dynamic range file format library")
620 "OpenEXR is a high dynamic-range (HDR) image file format developed for
621 use in computer imaging applications. The IlmImf C++ libraries support
622 storage of the \"EXR\" file format for storing 16-bit floating-point images.")
623 (license license:bsd-3)))
625 (define-public openimageio
632 (url "https://github.com/OpenImageIO/oiio")
633 (commit (string-append "Release-" version))))
634 (file-name (git-file-name name version))
637 "0czcls82v71wkw1syib16ncg7463hx0py0xclycsiv4w6i3wlkzz"))))
638 (build-system cmake-build-system)
639 ;; FIXME: To run all tests successfully, test image sets from multiple
640 ;; third party sources have to be present. For details see
641 ;; https://github.com/OpenImageIO/oiio/blob/master/INSTALL
645 `(("pkg-config" ,pkg-config)))
649 ("libjpeg" ,libjpeg-turbo)
654 ("python" ,python-wrapper)
655 ("pybind11" ,pybind11)
656 ("robin-map" ,robin-map)
658 (synopsis "C++ library for reading and writing images")
660 "OpenImageIO is a library for reading and writing images, and a bunch of
661 related classes, utilities, and applications. There is a particular emphasis
662 on formats and functionality used in professional, large-scale animation and
663 visual effects work for film.")
664 (home-page "https://www.openimageio.org")
665 (license license:bsd-3)))
667 (define-public openscenegraph
669 (name "openscenegraph")
675 (url "https://github.com/openscenegraph/OpenSceneGraph")
676 (commit (string-append "OpenSceneGraph-" version))))
678 (base32 "00i14h82qg3xzcyd8p02wrarnmby3aiwmz0z43l50byc9f8i05n1"))
679 (file-name (git-file-name name version))))
681 `((upstream-name . "OpenSceneGraph")))
682 (build-system cmake-build-system)
684 `(#:tests? #f ; no test target available
685 ;; Without this flag, 'rd' will be added to the name of the
686 ;; library binaries and break linking with other programs.
687 #:build-type "Release"
689 (list (string-append "-DCMAKE_INSTALL_RPATH="
690 (assoc-ref %outputs "out") "/lib:"
691 (assoc-ref %outputs "out") "/lib64"))))
693 `(("pkg-config" ,pkg-config)
697 ("libjpeg" ,libjpeg-turbo) ; required for the JPEG texture plugin.
700 ("libxrandr" ,libxrandr)
703 (synopsis "High-performance real-time graphics toolkit")
705 "The OpenSceneGraph is a high-performance 3D graphics toolkit
706 used by application developers in fields such as visual simulation, games,
707 virtual reality, scientific visualization and modeling.")
708 (home-page "http://www.openscenegraph.org")
709 ;; The 'LICENSE' file explains that the source is licensed under
710 ;; LGPL 2.1, but with 4 exceptions. This version is called OSGPL.
711 (license license:lgpl2.1)))
713 ;; We need this for simgear
714 (define-public openscenegraph-3.4
715 (package (inherit openscenegraph)
716 (name "openscenegraph")
722 (url "https://github.com/openscenegraph/OpenSceneGraph")
723 (commit (string-append "OpenSceneGraph-" version))))
724 (file-name (git-file-name name version))
727 "1fbzg1ihjpxk6smlq80p3h3ggllbr16ihd2fxpfwzam8yr8yxip9"))))
729 (substitute-keyword-arguments (package-arguments openscenegraph)
730 ((#:configure-flags flags)
732 ;; The jpeg plugin requires conversion between integers and booleans
733 "-DCMAKE_CXX_FLAGS=-fpermissive"
736 `(("libjpeg" ,libjpeg-turbo)
737 ,@(package-inputs openscenegraph)))))
740 (define-public openmw-openscenegraph
741 ;; OpenMW prefers its own fork of openscenegraph:
742 ;; https://wiki.openmw.org/index.php?title=Development_Environment_Setup#OpenSceneGraph.
743 (let ((commit "36a962845a2c87a6671fd822157e0729d164e940"))
746 (inherit openscenegraph)
747 (version (git-version "3.6" "1" commit))
752 (url "https://github.com/OpenMW/osg/")
754 (file-name (git-file-name (package-name openscenegraph) version))
757 "05yhgq3qm5q277y32n5sf36vx5nv5qd3zlhz4csgd3a6190jrnia"))))
759 (substitute-keyword-arguments (package-arguments openscenegraph)
760 ((#:configure-flags flags)
761 ;; As per the above wiki link, the following plugins are enough:
763 '("-DBUILD_OSG_PLUGINS_BY_DEFAULT=0"
764 "-DBUILD_OSG_PLUGIN_OSG=1"
765 "-DBUILD_OSG_PLUGIN_DDS=1"
766 "-DBUILD_OSG_PLUGIN_TGA=1"
767 "-DBUILD_OSG_PLUGIN_BMP=1"
768 "-DBUILD_OSG_PLUGIN_JPEG=1"
769 "-DBUILD_OSG_PLUGIN_PNG=1"
770 "-DBUILD_OSG_DEPRECATED_SERIALIZERS=0"
771 ;; The jpeg plugin requires conversion between integers and booleans
772 "-DCMAKE_CXX_FLAGS=-fpermissive")
775 (define-public povray
782 (url "https://github.com/POV-Ray/povray")
783 (commit (string-append "v" version))))
784 (file-name (git-file-name name version))
787 "1q114n4m3r7qy3yn954fq7p46rg7ypdax5fazxr9yj1jklf1lh6z"))
788 (modules '((guix build utils)))
791 ;; Delete bundled libraries.
792 (delete-file-recursively "libraries")
794 (build-system gnu-build-system)
796 `(("autoconf" ,autoconf)
797 ("automake" ,automake)
798 ("pkg-config" ,pkg-config)))
801 ("libjpeg" ,libjpeg-turbo)
809 (list "COMPILED_BY=Guix"
810 (string-append "--with-boost-libdir="
811 (assoc-ref %build-inputs "boost") "/lib")
812 "--disable-optimiz-arch")
814 (modify-phases %standard-phases
815 (add-after 'unpack 'run-prebuild
817 (setenv "HOME" (getcwd))
818 (with-directory-excursion "unix"
819 (substitute* "prebuild.sh"
820 (("/bin/sh") (which "sh")))
821 (invoke "sh" "prebuild.sh"))
823 ;; The bootstrap script is run by the prebuild script in the
824 ;; "run-prebuild" phase.
825 (delete 'bootstrap))))
826 (synopsis "Tool for creating three-dimensional graphics")
828 "@code{POV-Ray} is short for the Persistence of Vision Raytracer, a tool
829 for producing high-quality computer graphics. @code{POV-Ray} creates
830 three-dimensional, photo-realistic images using a rendering technique called
831 ray-tracing. It reads in a text file containing information describing the
832 objects and lighting in a scene and generates an image of that scene from the
833 view point of a camera also described in the text file. Ray-tracing is not a
834 fast process by any means, but it produces very high quality images with
835 realistic reflections, shading, perspective and other effects.")
836 (home-page "http://www.povray.org/")
837 (license license:agpl3+)))
839 (define-public rapicorn
845 (uri (string-append "https://testbit.eu/pub/dists/rapicorn/"
846 "rapicorn-" version ".tar.xz"))
849 "1y51yjrpsihas1jy905m9p3r8iiyhq6bwi2690c564i5dnix1f9d"))
850 (patches (search-patches "rapicorn-isnan.patch"))))
851 (build-system gnu-build-system)
854 (modify-phases %standard-phases
855 (add-after 'unpack 'fix-tests
857 ;; Our grep does not support perl regular expressions.
858 (substitute* "taptool.sh"
859 (("grep -P") "grep -E"))
860 ;; Disable path tests because we cannot access /bin or /sbin.
861 (substitute* "rcore/tests/multitest.cc"
862 (("TCMP \\(Path::equals \\(\"/bin\"") "//"))
864 (add-before 'check 'pre-check
866 ;; The test suite requires a running X server (with DISPLAY
867 ;; number 99 or higher).
868 (system "Xvfb :99 &")
869 (setenv "DISPLAY" ":99")
871 (add-after 'unpack 'replace-fhs-paths
873 (substitute* (cons "Makefile.decl"
874 (find-files "." "^Makefile\\.in$"))
875 (("/bin/ls") (which "ls"))
876 (("/usr/bin/env") (which "env")))
878 ;; These libraries are listed in the "Required" section of the pkg-config
881 `(("librsvg" ,librsvg)
885 ("python2-enum34" ,python2-enum34)))
887 `(("gdk-pixbuf" ,gdk-pixbuf)
888 ("libpng" ,libpng-1.2)
889 ("readline" ,readline)
890 ("libcroco" ,libcroco)
892 ("cython" ,python2-cython)))
894 `(("pandoc" ,ghc-pandoc)
898 ("graphviz" ,graphviz)
899 ("intltool" ,intltool)
900 ("pkg-config" ,pkg-config)
901 ("xvfb" ,xorg-server-for-tests)))
902 (home-page "https://rapicorn.testbit.org/")
903 (synopsis "Toolkit for rapid development of user interfaces")
905 "Rapicorn is a toolkit for rapid development of user interfaces in C++
906 and Python. The user interface is designed in a declarative markup language
907 and is connected to the programming logic using data bindings and commands.")
908 (license license:mpl2.0)))
916 (uri (string-append "https://github.com/ampas/CTL/archive/ctl-"
920 "1gg04pyvw0m398akn0s1l07g5b1haqv5na1wpi5dii1jjd1w3ynp"))))
921 (build-system cmake-build-system)
922 (arguments '(#:tests? #f)) ;no 'test' target
924 ;; Headers include OpenEXR and IlmBase headers.
925 (propagated-inputs `(("openexr" ,openexr)))
927 (home-page "http://ampasctl.sourceforge.net")
928 (synopsis "Color Transformation Language")
930 "The Color Transformation Language, or CTL, is a small programming
931 language that was designed to serve as a building block for digital color
932 management systems. CTL allows users to describe color transforms in a
933 concise and unambiguous way by expressing them as programs. In order to apply
934 a given transform to an image, the color management system instructs a CTL
935 interpreter to load and run the CTL program that describes the transform. The
936 original and the transformed image constitute the CTL program's input and
939 ;; The web site says it's under a BSD-3 license, but the 'LICENSE' file
940 ;; and headers use different wording.
941 (license (license:non-copyleft "file://LICENSE"))))
943 (define-public brdf-explorer
944 ;; There are no release tarballs, and not even tags in the repo,
945 ;; so use the latest revision.
946 (let ((commit "5b2cd46f38a06e47207fa7229b72d37beb945019")
949 (name "brdf-explorer")
950 (version (string-append "1.0.0-" revision "." (string-take commit 9)))
954 (url "https://github.com/wdas/brdf")
958 "06vzbiajzbi2xl8jlff5d45bc9wd68i3jdndfab1f3jgfrd8bsgx"))
959 (file-name (string-append name "-" version "-checkout"))))
960 (build-system gnu-build-system)
962 `(#:phases (modify-phases %standard-phases
964 (lambda* (#:key outputs #:allow-other-keys)
965 (let ((out (assoc-ref outputs "out")))
967 (string-append "prefix=" out)))))
968 (add-after 'install 'wrap-program
969 (lambda* (#:key outputs #:allow-other-keys)
970 (let* ((out (assoc-ref outputs "out"))
971 (bin (string-append out "/bin"))
974 (with-directory-excursion bin
975 (rename-file "brdf" ".brdf-real")
976 (call-with-output-file "brdf"
978 (format port "#!/bin/sh
979 # Run the thing from its home, otherwise it just bails out.
981 exec -a \"$0\" ~a/.brdf-real~%"
983 (chmod "brdf" #o555)))
986 `(("qttools" ,qttools))) ;for 'qmake'
991 ("freeglut" ,freeglut)
993 (home-page "https://www.disneyanimation.com/technology/brdf.html")
995 "Analyze bidirectional reflectance distribution functions (BRDFs)")
997 "BRDF Explorer is an application that allows the development and analysis
998 of bidirectional reflectance distribution functions (BRDFs). It can load and
999 plot analytic BRDF functions (coded as functions in OpenGL's GLSL shader
1000 language), measured material data from the MERL database, and anisotropic
1001 measured material data from MIT CSAIL. Graphs and visualizations update in
1002 real time as parameters are changed, making it a useful tool for evaluating
1003 and understanding different BRDFs (and other component functions).")
1004 (license license:ms-pl))))
1012 (uri (list (string-append
1013 "ftp://ftp.fau.de/gentoo/distfiles/agg-"
1016 "ftp://ftp.ula.ve/gentoo/distfiles/agg-"
1019 ;; Site was discontinued.
1020 (string-append "http://www.antigrain.com/agg-"
1021 version ".tar.gz")))
1023 (base32 "07wii4i824vy9qsvjsgqxppgqmfdxq0xa87i5yk53fijriadq7mb"))
1024 (patches (search-patches "agg-am_c_prototype.patch"))))
1025 (build-system gnu-build-system)
1028 (list (string-append "--x-includes=" (assoc-ref %build-inputs "libx11")
1030 (string-append "--x-libraries=" (assoc-ref %build-inputs "libx11")
1032 "--disable-examples")
1034 (modify-phases %standard-phases
1037 ;; let's call configure from configure phase and not now
1038 (substitute* "autogen.sh" (("./configure") "# ./configure"))
1039 (invoke "sh" "autogen.sh"))))))
1041 `(("pkg-config" ,pkg-config)
1042 ("libtool" ,libtool)
1043 ("autoconf" ,autoconf)
1044 ("automake" ,automake)))
1046 `(("libx11" ,libx11)
1047 ("freetype" ,freetype)
1050 ;; Antigrain.com was discontinued.
1051 (home-page "http://agg.sourceforge.net/antigrain.com/index.html")
1052 (synopsis "High-quality 2D graphics rendering engine for C++")
1054 "Anti-Grain Geometry is a high quality rendering engine written in C++.
1055 It supports sub-pixel resolutions and anti-aliasing. It is also library for
1056 rendering SVG graphics.")
1057 (license license:gpl2+)))
1059 (define-public python-pastel
1061 (name "python-pastel")
1066 (uri (pypi-uri "pastel" version))
1069 "0dnaw44ss10i10z4ksy0xljknvjap7rb7g0b8p6yzm5x4g2my5a6"))))
1070 (build-system python-build-system)
1072 `(#:phases (modify-phases %standard-phases
1074 (lambda _ (invoke "pytest" "pastel" "tests/"))))))
1076 `(("python-pytest" ,python-pytest)))
1077 (home-page "https://github.com/sdispater/pastel")
1078 (synopsis "Library to colorize strings in your terminal")
1079 (description "Pastel is a simple library to help you colorize strings in
1081 (license license:expat)))
1083 (define-public python2-pastel
1084 (package-with-python2 python-pastel))
1086 (define-public fgallery
1094 "http://www.thregr.org/~wavexx/software/fgallery/releases/"
1095 "fgallery-" version ".zip"))
1098 "18wlvqbxcng8pawimbc8f2422s8fnk840hfr6946lzsxr0ijakvf"))))
1099 (build-system gnu-build-system)
1101 `(#:tests? #f ; no tests
1103 (modify-phases %standard-phases
1107 (lambda* (#:key inputs outputs #:allow-other-keys)
1108 (let* ((out (assoc-ref outputs "out"))
1109 (bin (string-append out "/bin/"))
1110 (share (string-append out "/share/fgallery"))
1111 (man (string-append out "/share/man/man1"))
1112 (perl5lib (getenv "PERL5LIB"))
1113 (script (string-append share "/fgallery")))
1114 (define (bin-directory input-name)
1115 (string-append (assoc-ref inputs input-name) "/bin"))
1118 (copy-file "fgallery.1" (string-append man "/fgallery.1"))
1121 (copy-recursively "." share)
1123 ;; fgallery copies files from store when it is run. The
1124 ;; read-only permissions from the store directories will cause
1125 ;; fgallery to fail. Do not preserve file attributes when
1126 ;; copying files to prevent it.
1129 "'cp', '--no-preserve=all'"))
1132 (symlink script (string-append out "/bin/fgallery"))
1134 (wrap-program script
1136 ,(map bin-directory '("imagemagick"
1144 `("PERL5LIB" ":" prefix (,perl5lib)))
1147 `(("unzip" ,unzip)))
1148 ;; TODO: Add missing optional dependency: facedetect.
1150 `(("imagemagick" ,imagemagick)
1153 ("libjpeg" ,libjpeg-turbo)
1156 ("perl-cpanel-json-xs" ,perl-cpanel-json-xs)
1157 ("perl-image-exiftool" ,perl-image-exiftool)
1158 ("jpegoptim" ,jpegoptim)
1159 ("pngcrush" ,pngcrush)
1161 (home-page "http://www.thregr.org/~wavexx/software/fgallery/")
1162 (synopsis "Static photo gallery generator")
1164 "FGallery is a static, JavaScript photo gallery generator with minimalist
1165 look. The result can be uploaded on any web server without additional
1167 (license license:gpl2+)))
1169 (define-public opensubdiv
1176 (url "https://github.com/PixarAnimationStudios/OpenSubdiv")
1177 (commit (string-append "v" (string-join (string-split version #\.)
1179 (file-name (git-file-name name version))
1182 "0cippg6aqc5dlya1cmh3908pwssrg52fwgyylnvz5343yrxmgk12"))))
1183 (build-system cmake-build-system)
1185 `(#:phases (modify-phases %standard-phases
1186 (add-before 'configure 'set-glew-location
1187 (lambda* (#:key inputs #:allow-other-keys)
1188 (setenv "GLEW_LOCATION" (assoc-ref inputs "glew"))
1190 (add-before 'check 'start-xorg-server
1191 (lambda* (#:key inputs #:allow-other-keys)
1192 ;; The test suite requires a running X server.
1193 (system (string-append (assoc-ref inputs "xorg-server")
1195 (setenv "DISPLAY" ":1")
1198 `(("xorg-server" ,xorg-server-for-tests)))
1201 ("libxrandr" ,libxrandr)
1202 ("libxcursor" ,libxcursor)
1203 ("libxinerama" ,libxinerama)
1207 (home-page "https://graphics.pixar.com/opensubdiv/")
1208 (synopsis "High performance subdivision surface evaluation")
1209 (description "OpenSubdiv is a set of libraries that implement high
1210 performance subdivision surface (subdiv) evaluation on massively parallel CPU
1211 and GPU architectures.")
1212 (license license:asl2.0)))
1214 (define-public opencsg
1215 (let ((dot-to-dash (lambda (c) (if (char=? c #\.) #\- c))))
1223 (url "https://github.com/floriankirsch/OpenCSG")
1224 (commit (string-append "opencsg-"
1225 (string-map dot-to-dash version)
1227 (file-name (git-file-name name version))
1230 "00m4vs6jn3scqczscc4591l1d6zg6anqp9v1ldf9ymf70rdyvm7m"))))
1231 (build-system gnu-build-system)
1234 (modify-phases %standard-phases
1236 (lambda* (#:key outputs #:allow-other-keys)
1237 (substitute* "src/Makefile"
1238 (("/usr/local") (assoc-ref outputs "out")))
1240 (add-before 'build 'skip-example
1241 (lambda _ (chdir "src") #t)))))
1244 ("freeglut" ,freeglut)))
1245 (synopsis "Library for rendering Constructive Solid Geometry (CSG)")
1247 "OpenCSG is a library for rendering Constructive Solid Geometry (CSG) using
1248 OpenGL. CSG is an approach for modeling complex 3D-shapes using simpler ones.
1249 For example, two shapes can be combined by uniting them, by intersecting them,
1250 or by subtracting one shape from the other.")
1251 (home-page "http://www.opencsg.org/")
1252 (license license:gpl2))))
1254 (define-public coin3D
1255 ;; The ‘4.0.0’ zip archive isn't stable, nor in fact a release. See:
1256 ;; https://bitbucket.org/Coin3D/coin/issues/179/coin-400-srczip-has-been-modified
1258 (changeset "ab8d0e47a4de3230a8137feb39c142d6ba45f97d"))
1262 (simple-format #f "3.1.3-~A-~A" revision (string-take changeset 7)))
1267 (url "https://bitbucket.org/Coin3D/coin")
1268 (changeset changeset)))
1269 (file-name (git-file-name name version))
1271 (base32 "1ff44jz6lg4rylljvy69n1hcjh9y6achbv9jpn1cv2sf8cxn3r2j"))
1272 (modules '((guix build utils)))
1275 (for-each delete-file
1277 "cfg/wrapmsvc.exe"))
1279 (build-system cmake-build-system)
1281 `(("doxygen" ,doxygen)
1282 ("graphviz" ,graphviz)))
1285 ("freeglut" ,freeglut)
1290 "-DCOIN_BUILD_DOCUMENTATION_MAN=ON"
1291 (string-append "-DBOOST_ROOT="
1292 (assoc-ref %build-inputs "boost")))))
1293 (home-page "https://bitbucket.org/Coin3D/coin/wiki/Home")
1295 "High-level 3D visualization library with Open Inventor 2.1 API")
1297 "Coin is a 3D graphics library with an Application Programming Interface
1298 based on the Open Inventor 2.1 API. For those who are not familiar with
1299 Open Inventor, it is a scene-graph based retain-mode rendering and model
1300 interaction library, written in C++, which has become the de facto
1301 standard graphics library for 3D visualization and visual simulation
1302 software in the scientific and engineering community.")
1303 (license license:bsd-3))))
1305 (define-public superfamiconv
1307 (name "superfamiconv")
1313 (url "https://github.com/Optiroc/SuperFamiconv")
1314 (commit (string-append "v" version))))
1315 (file-name (git-file-name name version))
1318 "0848szv6a2b8wdganh6mw5i8vn8cqvn1kbwzx7mb9wlrf5wzqn37"))))
1319 (build-system gnu-build-system)
1321 `(#:tests? #f ; no tests
1323 (modify-phases %standard-phases
1326 (lambda* (#:key outputs #:allow-other-keys)
1327 (let* ((outdir (assoc-ref outputs "out"))
1328 (bindir (string-append outdir "/bin")))
1329 (install-file "bin/superfamiconv" bindir)
1331 (home-page "https://github.com/Optiroc/SuperFamiconv")
1332 (synopsis "Tile graphics converter supporting SNES, Game Boy Color
1333 and PC Engine formats")
1334 (description "SuperFamiconv is a converter for tiled graphics, supporting
1335 the graphics formats of the SNES, Game Boy Color and PC Engine game consoles.
1336 Automated palette selection is supported.")
1337 (license license:expat)))