gnu: Add autotrace.
[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, 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 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>
25 ;;;
26 ;;; This file is part of GNU Guix.
27 ;;;
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.
32 ;;;
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.
37 ;;;
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/>.
40
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 documentation)
53 #:use-module (gnu packages flex)
54 #:use-module (gnu packages fonts)
55 #:use-module (gnu packages fontutils)
56 #:use-module (gnu packages gettext)
57 #:use-module (gnu packages ghostscript)
58 #:use-module (gnu packages gl)
59 #:use-module (gnu packages glib)
60 #:use-module (gnu packages gnome)
61 #:use-module (gnu packages graphviz)
62 #:use-module (gnu packages gtk)
63 #:use-module (gnu packages haskell-xyz)
64 #:use-module (gnu packages image)
65 #:use-module (gnu packages imagemagick)
66 #:use-module (gnu packages jemalloc)
67 #:use-module (gnu packages maths)
68 #:use-module (gnu packages multiprecision)
69 #:use-module (gnu packages pdf)
70 #:use-module (gnu packages perl)
71 #:use-module (gnu packages photo)
72 #:use-module (gnu packages pkg-config)
73 #:use-module (gnu packages plotutils)
74 #:use-module (gnu packages pth)
75 #:use-module (gnu packages pulseaudio) ; libsndfile, libsamplerate
76 #:use-module (gnu packages python)
77 #:use-module (gnu packages python-xyz)
78 #:use-module (gnu packages qt)
79 #:use-module (gnu packages readline)
80 #:use-module (gnu packages sdl)
81 #:use-module (gnu packages swig)
82 #:use-module (gnu packages tbb)
83 #:use-module (gnu packages video)
84 #:use-module (gnu packages xml)
85 #:use-module (gnu packages xorg)
86 #:use-module (guix build-system cmake)
87 #:use-module (guix build-system gnu)
88 #:use-module (guix build-system python)
89 #:use-module (guix download)
90 #:use-module (guix git-download)
91 #:use-module (guix hg-download)
92 #:use-module ((guix licenses) #:prefix license:)
93 #:use-module (guix packages)
94 #:use-module (guix utils))
95
96 (define-public fox
97 (package
98 (name "fox")
99 (version "1.6.57")
100 (source
101 (origin
102 (method url-fetch)
103 (uri
104 (string-append "https://fox-toolkit.org/ftp/fox-" version ".tar.gz"))
105 (sha256
106 (base32 "08w98m6wjadraw1pi13igzagly4b2nfa57kdqdnkjfhgkvg1bvv5"))))
107 (build-system gnu-build-system)
108 (arguments
109 `(#:phases
110 (modify-phases %standard-phases
111 (add-after 'unpack 'patch
112 (lambda _
113 (substitute* "configure"
114 (("-I/usr/include/freetype2")
115 (string-append "-I"
116 (string-append
117 (assoc-ref %build-inputs "freetype")
118 "/include/freetype2"))))
119 #t)))))
120 (native-inputs
121 `(("doxygen" ,doxygen)))
122 (inputs
123 `(("bzip2" ,lbzip2)
124 ("freetype" ,freetype)
125 ("gl" ,mesa)
126 ("glu" ,glu)
127 ("jpeg" ,libjpeg-turbo)
128 ("png" ,libpng)
129 ("tiff" ,libtiff)
130 ("x11" ,libx11)
131 ("xcursor" ,libxcursor)
132 ("xext" ,libxext)
133 ("xfixes" ,libxfixes)
134 ("xft" ,libxft)
135 ("xinput" ,libxi)
136 ("xrandr" ,libxrandr)
137 ("xrender" ,libxrender)
138 ("xshm" ,libxshmfence)
139 ("zlib" ,zlib)))
140 (synopsis "Widget Toolkit for building GUI")
141 (description"FOX (Free Objects for X) is a C++ based Toolkit for developing
142 Graphical User Interfaces easily and effectively. It offers a wide, and
143 growing, collection of Controls, and provides state of the art facilities such
144 as drag and drop, selection, as well as OpenGL widgets for 3D graphical
145 manipulation. FOX also implements icons, images, and user-convenience features
146 such as status line help, and tooltips. Tooltips may even be used for 3D
147 objects!")
148 (home-page "http://www.fox-toolkit.org")
149 (license license:lgpl2.1+)))
150
151 (define-public autotrace
152 (let ((commit "travis-20190624.59")
153 (version-base "0.40.0"))
154 (package
155 (name "autotrace")
156 (version (string-append version-base "-"
157 (if (string-prefix? "travis-" commit)
158 (string-drop commit 7)
159 commit)))
160 (source (origin
161 (method git-fetch)
162 (uri (git-reference
163 (url "https://github.com/autotrace/autotrace.git")
164 (commit commit)))
165 (file-name (git-file-name name version))
166 (sha256
167 (base32
168 "0mk4yavy42dj0pszr1ggnggpvmzs4ds46caa9wr55cqsypn7bq6s"))))
169 (build-system gnu-build-system)
170 (arguments
171 `(#:phases (modify-phases %standard-phases
172 ;; See: https://github.com/autotrace/autotrace/issues/27.
173 (add-after 'unpack 'include-spline.h-header
174 (lambda _
175 (substitute* "Makefile.am"
176 ((".*src/types.h.*" all)
177 (string-append all "\t\tsrc/spline.h \\\n")))
178 #t))
179 ;; See: https://github.com/autotrace/autotrace/issues/26.
180 (replace 'check
181 (lambda _
182 (invoke "sh" "tests/runtests.sh"))))))
183 (native-inputs
184 `(("which" ,which)
185 ("pkg-config" ,pkg-config)
186 ("autoconf" ,autoconf)
187 ("automake" ,automake)
188 ("intltool" ,intltool)
189 ("libtool" ,libtool)
190 ("gettext" ,gettext-minimal)))
191 (inputs
192 `(("glib" ,glib)
193 ("libjpeg" ,libjpeg-turbo)
194 ("libpng" ,libpng)
195 ("imagemagick" ,imagemagick)
196 ("pstoedit" ,pstoedit)))
197 (home-page "https://github.com/autotrace/autotrace")
198 (synopsis "Bitmap to vector graphics converter")
199 (description "AutoTrace is a utility for converting bitmap into vector
200 graphics. It can trace outlines and midlines, effect color reduction or
201 despeckling and has support for many input and output formats. It can be used
202 with the @command{autotrace} utility or as a C library, @code{libautotrace}.")
203 (license (list license:gpl2+ ;for the utility itself
204 license:lgpl2.1+))))) ;for use as a library
205
206 (define-public blender
207 (package
208 (name "blender")
209 (version "2.82a")
210 (source (origin
211 (method url-fetch)
212 (uri (string-append "https://download.blender.org/source/"
213 "blender-" version ".tar.xz"))
214 (sha256
215 (base32
216 "18zbdgas6qf2kmvvlimxgnq7y9kj7hdxcgixrs6fj50x40q01q2d"))))
217 (build-system cmake-build-system)
218 (arguments
219 (let ((python-version (version-major+minor (package-version python))))
220 `(;; Test files are very large and not included in the release tarball.
221 #:tests? #f
222 #:configure-flags
223 (list "-DWITH_CODEC_FFMPEG=ON"
224 "-DWITH_CODEC_SNDFILE=ON"
225 "-DWITH_CYCLES=ON"
226 "-DWITH_DOC_MANPAGE=ON"
227 "-DWITH_FFTW3=ON"
228 "-DWITH_IMAGE_OPENJPEG=ON"
229 "-DWITH_INPUT_NDOF=ON"
230 "-DWITH_INSTALL_PORTABLE=OFF"
231 "-DWITH_JACK=ON"
232 "-DWITH_MOD_OCEANSIM=ON"
233 "-DWITH_OPENSUBDIV=ON"
234 "-DWITH_PYTHON_INSTALL=OFF"
235 (string-append "-DPYTHON_LIBRARY=python" ,python-version)
236 (string-append "-DPYTHON_LIBPATH=" (assoc-ref %build-inputs "python")
237 "/lib")
238 (string-append "-DPYTHON_INCLUDE_DIR=" (assoc-ref %build-inputs "python")
239 "/include/python" ,python-version)
240 (string-append "-DPYTHON_VERSION=" ,python-version)
241 (string-append "-DPYTHON_NUMPY_PATH="
242 (assoc-ref %build-inputs "python-numpy")
243 "/lib/python" ,python-version "/site-packages/"))
244 #:phases
245 (modify-phases %standard-phases
246 ;; XXX This file doesn't exist in the Git sources but will probably
247 ;; exist in the eventual 2.80 source tarball.
248 (add-after 'unpack 'fix-broken-import
249 (lambda _
250 (substitute* "release/scripts/addons/io_scene_fbx/json2fbx.py"
251 (("import encode_bin") "from . import encode_bin"))
252 #t))
253 (add-after 'set-paths 'add-ilmbase-include-path
254 (lambda* (#:key inputs #:allow-other-keys)
255 ;; OpenEXR propagates ilmbase, but its include files do not appear
256 ;; in the CPATH, so we need to add "$ilmbase/include/OpenEXR/" to
257 ;; the CPATH to satisfy the dependency on "half.h".
258 (setenv "CPATH"
259 (string-append (assoc-ref inputs "ilmbase")
260 "/include/OpenEXR"
261 ":" (or (getenv "CPATH") "")))
262 #t))))))
263 (inputs
264 `(("boost" ,boost)
265 ("jemalloc" ,jemalloc)
266 ("libx11" ,libx11)
267 ("libxi" ,libxi)
268 ("libxrender" ,libxrender)
269 ("openimageio" ,openimageio)
270 ("openexr" ,openexr)
271 ("opensubdiv" ,opensubdiv)
272 ("ilmbase" ,ilmbase)
273 ("openjpeg" ,openjpeg)
274 ("libjpeg" ,libjpeg-turbo)
275 ("libpng" ,libpng)
276 ("libtiff" ,libtiff)
277 ("ffmpeg" ,ffmpeg)
278 ("fftw" ,fftw)
279 ("jack" ,jack-1)
280 ("libsndfile" ,libsndfile)
281 ("freetype" ,freetype)
282 ("glew" ,glew)
283 ("openal" ,openal)
284 ("python" ,python)
285 ("python-numpy" ,python-numpy)
286 ("tbb" ,tbb)
287 ("zlib" ,zlib)))
288 (home-page "https://blender.org/")
289 (synopsis "3D graphics creation suite")
290 (description
291 "Blender is a 3D graphics creation suite. It supports the entirety of
292 the 3D pipeline—modeling, rigging, animation, simulation, rendering,
293 compositing and motion tracking, even video editing and game creation. The
294 application can be customized via its API for Python scripting.")
295 (license license:gpl2+)))
296
297 (define-public assimp
298 (package
299 (name "assimp")
300 (version "4.1.0")
301 (source (origin
302 (method git-fetch)
303 (uri (git-reference
304 (url "https://github.com/assimp/assimp.git")
305 (commit (string-append "v" version))))
306 (file-name (git-file-name name version))
307 (sha256
308 (base32
309 "1rhyqfhzifdj7yibyanph3rh13ykw3i98dnn8mz65j780472hw28"))))
310 (build-system cmake-build-system)
311 (inputs
312 `(("zlib" ,zlib)))
313 (home-page "http://www.assimp.org/")
314 (synopsis "Asset import library")
315 (description
316 "The Open Asset Import Library loads more than 40 3D file formats into
317 one unified data structure. Additionally, assimp features various mesh post
318 processing tools: normals and tangent space generation, triangulation, vertex
319 cache locality optimization, removal of degenerate primitives and duplicate
320 vertices, sorting by primitive type, merging of redundant materials and many
321 more.")
322 (license license:bsd-3)))
323
324 (define-public cgal
325 (package
326 (name "cgal")
327 (version "4.14.2")
328 (source (origin
329 (method url-fetch)
330 (uri (string-append
331 "https://github.com/CGAL/cgal/releases/download/releases/"
332 "CGAL-" version "/CGAL-" version ".tar.xz"))
333 (sha256
334 (base32
335 "08lrp3hfwdypggz4138bnkh6bjxn441zg2y9xnq5mrjfc5ini6w1"))))
336 (build-system cmake-build-system)
337 (arguments
338 '(#:tests? #f)) ; no test target
339 (inputs
340 `(("mpfr" ,mpfr)
341 ("gmp" ,gmp)
342 ("boost" ,boost)))
343 (home-page "https://www.cgal.org/")
344 (synopsis "Computational geometry algorithms library")
345 (description
346 "CGAL provides easy access to efficient and reliable geometric algorithms
347 in the form of a C++ library. CGAL is used in various areas needing geometric
348 computation, such as: computer graphics, scientific visualization, computer
349 aided design and modeling, geographic information systems, molecular biology,
350 medical imaging, robotics and motion planning, mesh generation, numerical
351 methods, etc. It provides data structures and algorithms such as
352 triangulations, Voronoi diagrams, polygons, polyhedra, mesh generation, and
353 many more.")
354
355 ;; The 'LICENSE' file explains that a subset is available under more
356 ;; permissive licenses.
357 (license license:gpl3+)))
358
359 (define-public ilmbase
360 (package
361 (name "ilmbase")
362 (version "2.5.0")
363 (source (origin
364 (method git-fetch)
365 (uri (git-reference
366 (url "https://github.com/openexr/openexr")
367 (commit (string-append "v" version))))
368 (file-name (git-file-name "ilmbase" version))
369 (sha256
370 (base32
371 "1k50cvi3sk6gf6w713lkk2gv5cvs74vkc7s7k4z6nmyhi4g89w4y"))
372 (patches (search-patches "ilmbase-fix-tests.patch"
373 "ilmbase-fix-test-arm.patch"))))
374 (build-system cmake-build-system)
375 (arguments
376 `(#:phases (modify-phases %standard-phases
377 (add-after 'unpack 'change-directory
378 (lambda _
379 (chdir "IlmBase")
380 #t)))))
381 (home-page "https://www.openexr.com/")
382 (synopsis "Utility C++ libraries for threads, maths, and exceptions")
383 (description
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)))
390
391 (define-public lib2geom
392 ;; Use the latest master commit, as the 1.0 release suffer build problems.
393 (let ((revision "1")
394 (commit "42e119d94934a9514c61571cfb6b4af503ece082"))
395 (package
396 (name "lib2geom")
397 (version (git-version "1.0" revision commit))
398 (source (origin
399 (method git-fetch)
400 (uri (git-reference
401 (url "https://gitlab.com/inkscape/lib2geom.git")
402 (commit commit)))
403 (file-name (git-file-name name version))
404 (sha256
405 (base32
406 "195rs0kdbs8w62irha1nwy83bccz04wglmk578qrj1mky7fc4rjv"))
407 (patches
408 ;; Patch submitted to upstream (see:
409 ;; https://gitlab.com/inkscape/lib2geom/merge_requests/17).
410 (search-patches "lib2geom-enable-assertions.patch"))
411 (modules '((guix build utils)))
412 (snippet
413 '(begin
414 ;; Fix py2geom module initialization (see:
415 ;; https://gitlab.com/inkscape/lib2geom/merge_requests/18).
416 (substitute* "src/py2geom/__init__.py"
417 (("_py2geom") "py2geom._py2geom"))
418 #t))))
419 (build-system cmake-build-system)
420 (arguments
421 `(#:imported-modules ((guix build python-build-system)
422 ,@%cmake-build-system-modules)
423 #:configure-flags '("-D2GEOM_BUILD_SHARED=ON"
424 "-D2GEOM_BOOST_PYTHON=ON"
425 ;; Compiling the Cython bindings fail (see:
426 ;; https://gitlab.com/inkscape/lib2geom/issues/21).
427 "-D2GEOM_CYTHON_BINDINGS=OFF")
428 #:phases
429 (modify-phases %standard-phases
430 (add-after 'unpack 'patch-python-lib-install-path
431 (lambda* (#:key inputs outputs #:allow-other-keys)
432 (let* ((python-version (@ (guix build python-build-system)
433 python-version))
434 (python-maj-min-version (python-version
435 (assoc-ref inputs "python")))
436 (site-package (string-append
437 (assoc-ref outputs "out")
438 "/lib/python" python-maj-min-version
439 "/site-packages")))
440 (substitute* '("src/cython/CMakeLists.txt"
441 "src/py2geom/CMakeLists.txt")
442 (("PYTHON_LIB_INSTALL \"[^\"]*\"")
443 (format #f "PYTHON_LIB_INSTALL ~s" site-package))))
444 #t)))))
445 (native-inputs `(("python" ,python-wrapper)
446 ("googletest" ,googletest)
447 ("pkg-config" ,pkg-config)))
448 (inputs `(("cairo" ,cairo)
449 ("pycairo" ,python-pycairo)
450 ("double-conversion" ,double-conversion)
451 ("glib" ,glib)
452 ("gsl" ,gsl)))
453 (propagated-inputs
454 `(("boost" ,boost))) ;referred to in 2geom/pathvector.h.
455 (home-page "https://gitlab.com/inkscape/lib2geom/")
456 (synopsis "C++ 2D graphics library")
457 (description "2geom is a C++ library of mathematics for paths, curves,
458 and other geometric calculations. Designed for vector graphics, it tackles
459 Bézier curves, conic sections, paths, intersections, transformations, and
460 basic geometries.")
461 ;; Because the library is linked with the GNU Scientific Library
462 ;; (GPLv3+), the combined work must be licensed as GPLv3+ (see:
463 ;; https://gitlab.com/inkscape/inkscape/issues/784).
464 (license license:gpl3+))))
465
466 (define-public pstoedit
467 (package
468 (name "pstoedit")
469 (version "3.75")
470 (source (origin
471 (method url-fetch)
472 (uri (string-append "mirror://sourceforge/pstoedit/pstoedit/"
473 version "/pstoedit-" version ".tar.gz"))
474 (sha256
475 (base32
476 "1kv46g2wsvsvcngkavxl5gnw3l6g5xqnh4kmyx4b39a01d8xiddp"))))
477 (build-system gnu-build-system)
478 (native-inputs
479 `(("pkg-config" ,pkg-config)))
480 (inputs
481 `(("ghostscript" ,ghostscript)
482 ("imagemagick" ,imagemagick)
483 ("libplot" ,plotutils)
484 ("libjpeg" ,libjpeg-turbo)
485 ("zlib" ,zlib))) ;else libp2edrvmagick++.so fails to link
486 (home-page "http://www.pstoedit.net/")
487 (synopsis "Converter for PostScript and PDF graphics")
488 (description "The @code{pstoedit} utility allows translating graphics
489 in the PostScript or PDF (Portable Document Format) formats to various
490 other vector formats such as:
491 @itemize
492 @item Tgif (.obj)
493 @item gnuplot
494 @item xfig (.fig)
495 @item Flattened PostScript
496 @item DXF, a CAD (Computed-Aided Design) exchange format
497 @item PIC (for troff/groff)
498 @item MetaPost (for usage with TeX/LaTeX)
499 @item LaTeX2e picture
500 @item GNU Metafile (for use with plotutils/libplot)
501 @item Any format supported by ImageMagick
502 @end itemize")
503 (license license:gpl2+)))
504
505 (define-public ogre
506 (package
507 (name "ogre")
508 (version "1.12.5")
509 (source
510 (origin
511 (method git-fetch)
512 (uri (git-reference
513 (url "https://github.com/OGRECave/ogre.git")
514 (commit (string-append "v" version))
515 (recursive? #t))) ;for Dear ImGui submodule
516 (file-name (git-file-name name version))
517 (sha256
518 (base32 "1sx0jsw4kmb4ycf62bgx3ygwv8k1cgjx52y47d7dk07z6gk6wpyj"))))
519 (build-system cmake-build-system)
520 (arguments
521 '(#:phases
522 (modify-phases %standard-phases
523 (add-before 'configure 'pre-configure
524 ;; CMakeLists.txt forces CMAKE_INSTALL_RPATH value. As
525 ;; a consequence, we cannot suggest ours in configure flags. Fix
526 ;; it.
527 (lambda* (#:key inputs outputs #:allow-other-keys)
528 (substitute* "CMakeLists.txt"
529 (("set\\(CMAKE_INSTALL_RPATH .*") ""))
530 #t)))
531 #:configure-flags
532 (let* ((out (assoc-ref %outputs "out"))
533 (runpath
534 (string-join (list (string-append out "/lib")
535 (string-append out "/lib/OGRE"))
536 ";")))
537 (list (string-append "-DCMAKE_INSTALL_RPATH=" runpath)
538 "-DOGRE_BUILD_DEPENDENCIES=OFF"
539 "-DOGRE_BUILD_TESTS=TRUE"
540 "-DOGRE_INSTALL_DOCS=TRUE"
541 "-DOGRE_INSTALL_SAMPLES=TRUE"
542 "-DOGRE_INSTALL_SAMPLES_SOURCE=TRUE"))))
543 (native-inputs
544 `(("boost" ,boost)
545 ("doxygen" ,doxygen)
546 ("googletest" ,googletest-1.8)
547 ("pkg-config" ,pkg-config)))
548 (inputs
549 `(("font-dejavu" ,font-dejavu)
550 ("freeimage" ,freeimage)
551 ("freetype" ,freetype)
552 ("glu" ,glu)
553 ("libxaw" ,libxaw)
554 ("libxrandr" ,libxrandr)
555 ("pugixml" ,pugixml)
556 ("sdl2" ,sdl2)
557 ("tinyxml" ,tinyxml)
558 ("zziplib" ,zziplib)))
559 (synopsis "Scene-oriented, flexible 3D engine written in C++")
560 (description
561 "OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented,
562 flexible 3D engine written in C++ designed to make it easier and more intuitive
563 for developers to produce applications utilising hardware-accelerated 3D
564 graphics.")
565 (home-page "https://www.ogre3d.org/")
566 (license license:expat)))
567
568 (define-public openexr
569 (package
570 (name "openexr")
571 (version (package-version ilmbase))
572 (source (origin
573 (inherit (package-source ilmbase))
574 (file-name (git-file-name "openexr" version))
575 (modules '((guix build utils)))
576 (snippet
577 '(begin
578 (substitute* (find-files "OpenEXR" "tmpDir\\.h")
579 (("\"/var/tmp/\"")
580 "\"/tmp/\""))
581 #t))))
582 (build-system cmake-build-system)
583 (arguments
584 `(#:phases
585 (modify-phases %standard-phases
586 (add-after 'unpack 'change-directory
587 (lambda _
588 (chdir "OpenEXR")
589 #t))
590 (add-before 'check 'increase-test-timeout
591 (lambda _
592 ;; On armhf-linux, we need to override the CTest default
593 ;; timeout of 1500 seconds for the OpenEXR.IlmImf test.
594 (setenv "CTEST_TEST_TIMEOUT" "2000")
595 #t))
596 ,@(if (not (target-64bit?))
597 `((add-after 'change-directory 'disable-broken-test
598 ;; This test fails on i686. Upstream developers suggest that
599 ;; this test is broken on i686 and can be safely disabled:
600 ;; https://github.com/openexr/openexr/issues/67#issuecomment-21169748
601 (lambda _
602 (substitute* "IlmImfTest/main.cpp"
603 ((".*testOptimizedInterleavePatterns.*") ""))
604 #t)))
605 '()))))
606 (native-inputs
607 `(("pkg-config" ,pkg-config)))
608 (propagated-inputs
609 `(("ilmbase" ,ilmbase) ;used in public headers
610 ("zlib" ,zlib))) ;OpenEXR.pc reads "-lz"
611 (home-page "https://www.openexr.com/")
612 (synopsis "High-dynamic range file format library")
613 (description
614 "OpenEXR is a high dynamic-range (HDR) image file format developed for
615 use in computer imaging applications. The IlmImf C++ libraries support
616 storage of the \"EXR\" file format for storing 16-bit floating-point images.")
617 (license license:bsd-3)))
618
619 (define-public openimageio
620 (package
621 (name "openimageio")
622 (version "1.8.17")
623 (source (origin
624 (method git-fetch)
625 (uri (git-reference
626 (url "https://github.com/OpenImageIO/oiio.git")
627 (commit (string-append "Release-" version))))
628 (file-name (git-file-name name version))
629 (sha256
630 (base32
631 "0zq34szprgkrrayg5sl3whrsx2l6lr8nw4hdrnwv2qhn70jbi2w2"))))
632 (build-system cmake-build-system)
633 ;; FIXME: To run all tests successfully, test image sets from multiple
634 ;; third party sources have to be present. For details see
635 ;; https://github.com/OpenImageIO/oiio/blob/master/INSTALL
636 (arguments
637 `(#:tests? #f))
638 (native-inputs
639 `(("pkg-config" ,pkg-config)))
640 (inputs
641 `(("boost" ,boost)
642 ("libpng" ,libpng)
643 ("libjpeg" ,libjpeg-turbo)
644 ("libtiff" ,libtiff)
645 ("giflib" ,giflib)
646 ("openexr" ,openexr)
647 ("ilmbase" ,ilmbase)
648 ("python" ,python-2)
649 ("zlib" ,zlib)))
650 (synopsis "C++ library for reading and writing images")
651 (description
652 "OpenImageIO is a library for reading and writing images, and a bunch of
653 related classes, utilities, and applications. There is a particular emphasis
654 on formats and functionality used in professional, large-scale animation and
655 visual effects work for film.")
656 (home-page "https://www.openimageio.org")
657 (license license:bsd-3)))
658
659 (define-public openscenegraph
660 (package
661 (name "openscenegraph")
662 (version "3.6.5")
663 (source
664 (origin
665 (method git-fetch)
666 (uri (git-reference
667 (url "https://github.com/openscenegraph/OpenSceneGraph")
668 (commit (string-append "OpenSceneGraph-" version))))
669 (sha256
670 (base32 "00i14h82qg3xzcyd8p02wrarnmby3aiwmz0z43l50byc9f8i05n1"))
671 (file-name (git-file-name name version))))
672 (properties
673 `((upstream-name . "OpenSceneGraph")))
674 (build-system cmake-build-system)
675 (arguments
676 `(#:tests? #f ; no test target available
677 ;; Without this flag, 'rd' will be added to the name of the
678 ;; library binaries and break linking with other programs.
679 #:build-type "Release"
680 #:configure-flags
681 (list (string-append "-DCMAKE_INSTALL_RPATH="
682 (assoc-ref %outputs "out") "/lib:"
683 (assoc-ref %outputs "out") "/lib64"))))
684 (native-inputs
685 `(("pkg-config" ,pkg-config)
686 ("unzip" ,unzip)))
687 (inputs
688 `(("giflib" ,giflib)
689 ("libjpeg" ,libjpeg-turbo) ; required for the JPEG texture plugin.
690 ("jasper" ,jasper)
691 ("librsvg" ,librsvg)
692 ("libxrandr" ,libxrandr)
693 ("ffmpeg" ,ffmpeg)
694 ("mesa" ,mesa)))
695 (synopsis "High-performance real-time graphics toolkit")
696 (description
697 "The OpenSceneGraph is a high-performance 3D graphics toolkit
698 used by application developers in fields such as visual simulation, games,
699 virtual reality, scientific visualization and modeling.")
700 (home-page "http://www.openscenegraph.org")
701 ;; The 'LICENSE' file explains that the source is licensed under
702 ;; LGPL 2.1, but with 4 exceptions. This version is called OSGPL.
703 (license license:lgpl2.1)))
704
705 ;; We need this for simgear
706 (define-public openscenegraph-3.4
707 (package (inherit openscenegraph)
708 (name "openscenegraph")
709 (version "3.4.1")
710 (source
711 (origin
712 (method git-fetch)
713 (uri (git-reference
714 (url "https://github.com/openscenegraph/OpenSceneGraph")
715 (commit (string-append "OpenSceneGraph-" version))))
716 (file-name (git-file-name name version))
717 (sha256
718 (base32
719 "1fbzg1ihjpxk6smlq80p3h3ggllbr16ihd2fxpfwzam8yr8yxip9"))))
720 (arguments
721 (substitute-keyword-arguments (package-arguments openscenegraph)
722 ((#:configure-flags flags)
723 `(cons
724 ;; The jpeg plugin requires conversion between integers and booleans
725 "-DCMAKE_CXX_FLAGS=-fpermissive"
726 ,flags))))
727 (inputs
728 `(("libjpeg" ,libjpeg-turbo)
729 ,@(package-inputs openscenegraph)))))
730
731
732 (define-public openmw-openscenegraph
733 ;; OpenMW prefers its own fork of openscenegraph:
734 ;; https://wiki.openmw.org/index.php?title=Development_Environment_Setup#OpenSceneGraph.
735 (let ((commit "36a962845a2c87a6671fd822157e0729d164e940"))
736 (hidden-package
737 (package
738 (inherit openscenegraph)
739 (version (git-version "3.6" "1" commit))
740 (source
741 (origin
742 (method git-fetch)
743 (uri (git-reference
744 (url "https://github.com/OpenMW/osg/")
745 (commit commit)))
746 (file-name (git-file-name (package-name openscenegraph) version))
747 (sha256
748 (base32
749 "05yhgq3qm5q277y32n5sf36vx5nv5qd3zlhz4csgd3a6190jrnia"))))
750 (arguments
751 (substitute-keyword-arguments (package-arguments openscenegraph)
752 ((#:configure-flags flags)
753 ;; As per the above wiki link, the following plugins are enough:
754 `(append
755 '("-DBUILD_OSG_PLUGINS_BY_DEFAULT=0"
756 "-DBUILD_OSG_PLUGIN_OSG=1"
757 "-DBUILD_OSG_PLUGIN_DDS=1"
758 "-DBUILD_OSG_PLUGIN_TGA=1"
759 "-DBUILD_OSG_PLUGIN_BMP=1"
760 "-DBUILD_OSG_PLUGIN_JPEG=1"
761 "-DBUILD_OSG_PLUGIN_PNG=1"
762 "-DBUILD_OSG_DEPRECATED_SERIALIZERS=0"
763 ;; The jpeg plugin requires conversion between integers and booleans
764 "-DCMAKE_CXX_FLAGS=-fpermissive")
765 ,flags))))))))
766
767 (define-public povray
768 (package
769 (name "povray")
770 (version "3.7.0.8")
771 (source (origin
772 (method git-fetch)
773 (uri (git-reference
774 (url "https://github.com/POV-Ray/povray")
775 (commit (string-append "v" version))))
776 (file-name (git-file-name name version))
777 (sha256
778 (base32
779 "1q114n4m3r7qy3yn954fq7p46rg7ypdax5fazxr9yj1jklf1lh6z"))
780 (modules '((guix build utils)))
781 (snippet
782 '(begin
783 ;; Delete bundled libraries.
784 (delete-file-recursively "libraries")
785 #t))))
786 (build-system gnu-build-system)
787 (native-inputs
788 `(("autoconf" ,autoconf)
789 ("automake" ,automake)
790 ("pkg-config" ,pkg-config)))
791 (inputs
792 `(("boost" ,boost)
793 ("libjpeg" ,libjpeg-turbo)
794 ("libpng" ,libpng)
795 ("libtiff" ,libtiff)
796 ("openexr" ,openexr)
797 ("sdl" ,sdl)
798 ("zlib" ,zlib)))
799 (arguments
800 '(#:configure-flags
801 (list "COMPILED_BY=Guix"
802 (string-append "--with-boost-libdir="
803 (assoc-ref %build-inputs "boost") "/lib")
804 "--disable-optimiz-arch")
805 #:phases
806 (modify-phases %standard-phases
807 (add-after 'unpack 'run-prebuild
808 (lambda _
809 (setenv "HOME" (getcwd))
810 (with-directory-excursion "unix"
811 (substitute* "prebuild.sh"
812 (("/bin/sh") (which "sh")))
813 (invoke "sh" "prebuild.sh"))
814 #t))
815 ;; The bootstrap script is run by the prebuild script in the
816 ;; "run-prebuild" phase.
817 (delete 'bootstrap))))
818 (synopsis "Tool for creating three-dimensional graphics")
819 (description
820 "@code{POV-Ray} is short for the Persistence of Vision Raytracer, a tool
821 for producing high-quality computer graphics. @code{POV-Ray} creates
822 three-dimensional, photo-realistic images using a rendering technique called
823 ray-tracing. It reads in a text file containing information describing the
824 objects and lighting in a scene and generates an image of that scene from the
825 view point of a camera also described in the text file. Ray-tracing is not a
826 fast process by any means, but it produces very high quality images with
827 realistic reflections, shading, perspective and other effects.")
828 (home-page "http://www.povray.org/")
829 (license license:agpl3+)))
830
831 (define-public rapicorn
832 (package
833 (name "rapicorn")
834 (version "16.0.0")
835 (source (origin
836 (method url-fetch)
837 (uri (string-append "https://testbit.eu/pub/dists/rapicorn/"
838 "rapicorn-" version ".tar.xz"))
839 (sha256
840 (base32
841 "1y51yjrpsihas1jy905m9p3r8iiyhq6bwi2690c564i5dnix1f9d"))
842 (patches (search-patches "rapicorn-isnan.patch"))))
843 (build-system gnu-build-system)
844 (arguments
845 `(#:phases
846 (modify-phases %standard-phases
847 (add-after 'unpack 'fix-tests
848 (lambda _
849 ;; Our grep does not support perl regular expressions.
850 (substitute* "taptool.sh"
851 (("grep -P") "grep -E"))
852 ;; Disable path tests because we cannot access /bin or /sbin.
853 (substitute* "rcore/tests/multitest.cc"
854 (("TCMP \\(Path::equals \\(\"/bin\"") "//"))
855 #t))
856 (add-before 'check 'pre-check
857 (lambda _
858 ;; The test suite requires a running X server (with DISPLAY
859 ;; number 99 or higher).
860 (system "Xvfb :99 &")
861 (setenv "DISPLAY" ":99")
862 #t))
863 (add-after 'unpack 'replace-fhs-paths
864 (lambda _
865 (substitute* (cons "Makefile.decl"
866 (find-files "." "^Makefile\\.in$"))
867 (("/bin/ls") (which "ls"))
868 (("/usr/bin/env") (which "env")))
869 #t)))))
870 ;; These libraries are listed in the "Required" section of the pkg-config
871 ;; file.
872 (propagated-inputs
873 `(("librsvg" ,librsvg)
874 ("cairo" ,cairo)
875 ("pango" ,pango)
876 ("libxml2" ,libxml2)
877 ("python2-enum34" ,python2-enum34)))
878 (inputs
879 `(("gdk-pixbuf" ,gdk-pixbuf)
880 ("libpng" ,libpng-1.2)
881 ("readline" ,readline)
882 ("libcroco" ,libcroco)
883 ("python" ,python-2)
884 ("cython" ,python2-cython)))
885 (native-inputs
886 `(("pandoc" ,ghc-pandoc)
887 ("bison" ,bison)
888 ("flex" ,flex)
889 ("doxygen" ,doxygen)
890 ("graphviz" ,graphviz)
891 ("intltool" ,intltool)
892 ("pkg-config" ,pkg-config)
893 ("xvfb" ,xorg-server-for-tests)))
894 (home-page "https://rapicorn.testbit.org/")
895 (synopsis "Toolkit for rapid development of user interfaces")
896 (description
897 "Rapicorn is a toolkit for rapid development of user interfaces in C++
898 and Python. The user interface is designed in a declarative markup language
899 and is connected to the programming logic using data bindings and commands.")
900 (license license:mpl2.0)))
901
902 (define-public ctl
903 (package
904 (name "ctl")
905 (version "1.5.2")
906 (source (origin
907 (method url-fetch)
908 (uri (string-append "https://github.com/ampas/CTL/archive/ctl-"
909 version ".tar.gz"))
910 (sha256
911 (base32
912 "1gg04pyvw0m398akn0s1l07g5b1haqv5na1wpi5dii1jjd1w3ynp"))))
913 (build-system cmake-build-system)
914 (arguments '(#:tests? #f)) ;no 'test' target
915
916 ;; Headers include OpenEXR and IlmBase headers.
917 (propagated-inputs `(("openexr" ,openexr)))
918
919 (home-page "http://ampasctl.sourceforge.net")
920 (synopsis "Color Transformation Language")
921 (description
922 "The Color Transformation Language, or CTL, is a small programming
923 language that was designed to serve as a building block for digital color
924 management systems. CTL allows users to describe color transforms in a
925 concise and unambiguous way by expressing them as programs. In order to apply
926 a given transform to an image, the color management system instructs a CTL
927 interpreter to load and run the CTL program that describes the transform. The
928 original and the transformed image constitute the CTL program's input and
929 output.")
930
931 ;; The web site says it's under a BSD-3 license, but the 'LICENSE' file
932 ;; and headers use different wording.
933 (license (license:non-copyleft "file://LICENSE"))))
934
935 (define-public brdf-explorer
936 ;; There are no release tarballs, and not even tags in the repo,
937 ;; so use the latest revision.
938 (let ((commit "5b2cd46f38a06e47207fa7229b72d37beb945019")
939 (revision "1"))
940 (package
941 (name "brdf-explorer")
942 (version (string-append "1.0.0-" revision "." (string-take commit 9)))
943 (source (origin
944 (method git-fetch)
945 (uri (git-reference
946 (url "https://github.com/wdas/brdf.git")
947 (commit commit)))
948 (sha256
949 (base32
950 "06vzbiajzbi2xl8jlff5d45bc9wd68i3jdndfab1f3jgfrd8bsgx"))
951 (file-name (string-append name "-" version "-checkout"))))
952 (build-system gnu-build-system)
953 (arguments
954 `(#:phases (modify-phases %standard-phases
955 (replace 'configure
956 (lambda* (#:key outputs #:allow-other-keys)
957 (let ((out (assoc-ref outputs "out")))
958 (invoke "qmake"
959 (string-append "prefix=" out)))))
960 (add-after 'install 'wrap-program
961 (lambda* (#:key outputs #:allow-other-keys)
962 (let* ((out (assoc-ref outputs "out"))
963 (bin (string-append out "/bin"))
964 (data (string-append
965 out "/share/brdf")))
966 (with-directory-excursion bin
967 (rename-file "brdf" ".brdf-real")
968 (call-with-output-file "brdf"
969 (lambda (port)
970 (format port "#!/bin/sh
971 # Run the thing from its home, otherwise it just bails out.
972 cd \"~a\"
973 exec -a \"$0\" ~a/.brdf-real~%"
974 data bin)))
975 (chmod "brdf" #o555)))
976 #t)))))
977 (native-inputs
978 `(("qttools" ,qttools))) ;for 'qmake'
979 (inputs
980 `(("qtbase" ,qtbase)
981 ("mesa" ,mesa)
982 ("glew" ,glew)
983 ("freeglut" ,freeglut)
984 ("zlib" ,zlib)))
985 (home-page "https://www.disneyanimation.com/technology/brdf.html")
986 (synopsis
987 "Analyze bidirectional reflectance distribution functions (BRDFs)")
988 (description
989 "BRDF Explorer is an application that allows the development and analysis
990 of bidirectional reflectance distribution functions (BRDFs). It can load and
991 plot analytic BRDF functions (coded as functions in OpenGL's GLSL shader
992 language), measured material data from the MERL database, and anisotropic
993 measured material data from MIT CSAIL. Graphs and visualizations update in
994 real time as parameters are changed, making it a useful tool for evaluating
995 and understanding different BRDFs (and other component functions).")
996 (license license:ms-pl))))
997
998 (define-public agg
999 (package
1000 (name "agg")
1001 (version "2.5")
1002 (source (origin
1003 (method url-fetch)
1004 (uri (list (string-append
1005 "ftp://ftp.fau.de/gentoo/distfiles/agg-"
1006 version ".tar.gz")
1007 (string-append
1008 "ftp://ftp.ula.ve/gentoo/distfiles/agg-"
1009 version ".tar.gz")
1010
1011 ;; Site was discontinued.
1012 (string-append "http://www.antigrain.com/agg-"
1013 version ".tar.gz")))
1014 (sha256
1015 (base32 "07wii4i824vy9qsvjsgqxppgqmfdxq0xa87i5yk53fijriadq7mb"))
1016 (patches (search-patches "agg-am_c_prototype.patch"))))
1017 (build-system gnu-build-system)
1018 (arguments
1019 '(#:configure-flags
1020 (list (string-append "--x-includes=" (assoc-ref %build-inputs "libx11")
1021 "/include")
1022 (string-append "--x-libraries=" (assoc-ref %build-inputs "libx11")
1023 "/lib")
1024 "--disable-examples")
1025 #:phases
1026 (modify-phases %standard-phases
1027 (replace 'bootstrap
1028 (lambda _
1029 ;; let's call configure from configure phase and not now
1030 (substitute* "autogen.sh" (("./configure") "# ./configure"))
1031 (invoke "sh" "autogen.sh"))))))
1032 (native-inputs
1033 `(("pkg-config" ,pkg-config)
1034 ("libtool" ,libtool)
1035 ("autoconf" ,autoconf)
1036 ("automake" ,automake)))
1037 (inputs
1038 `(("libx11" ,libx11)
1039 ("freetype" ,freetype)
1040 ("sdl" ,sdl)))
1041
1042 ;; Antigrain.com was discontinued.
1043 (home-page "http://agg.sourceforge.net/antigrain.com/index.html")
1044 (synopsis "High-quality 2D graphics rendering engine for C++")
1045 (description
1046 "Anti-Grain Geometry is a high quality rendering engine written in C++.
1047 It supports sub-pixel resolutions and anti-aliasing. It is also library for
1048 rendering SVG graphics.")
1049 (license license:gpl2+)))
1050
1051 (define-public python-pastel
1052 (package
1053 (name "python-pastel")
1054 (version "0.2.0")
1055 (source
1056 (origin
1057 (method url-fetch)
1058 (uri (pypi-uri "pastel" version))
1059 (sha256
1060 (base32
1061 "0dnaw44ss10i10z4ksy0xljknvjap7rb7g0b8p6yzm5x4g2my5a6"))))
1062 (build-system python-build-system)
1063 (arguments
1064 `(#:phases (modify-phases %standard-phases
1065 (replace 'check
1066 (lambda _ (invoke "pytest" "pastel" "tests/"))))))
1067 (native-inputs
1068 `(("python-pytest" ,python-pytest)))
1069 (home-page "https://github.com/sdispater/pastel")
1070 (synopsis "Library to colorize strings in your terminal")
1071 (description "Pastel is a simple library to help you colorize strings in
1072 your terminal.")
1073 (license license:expat)))
1074
1075 (define-public python2-pastel
1076 (package-with-python2 python-pastel))
1077
1078 (define-public fgallery
1079 (package
1080 (name "fgallery")
1081 (version "1.8.2")
1082 (source (origin
1083 (method url-fetch)
1084 (uri
1085 (string-append
1086 "http://www.thregr.org/~wavexx/software/fgallery/releases/"
1087 "fgallery-" version ".zip"))
1088 (sha256
1089 (base32
1090 "18wlvqbxcng8pawimbc8f2422s8fnk840hfr6946lzsxr0ijakvf"))))
1091 (build-system gnu-build-system)
1092 (arguments
1093 `(#:tests? #f ; no tests
1094 #:phases
1095 (modify-phases %standard-phases
1096 (delete 'configure)
1097 (delete 'build)
1098 (replace 'install
1099 (lambda* (#:key inputs outputs #:allow-other-keys)
1100 (let* ((out (assoc-ref outputs "out"))
1101 (bin (string-append out "/bin/"))
1102 (share (string-append out "/share/fgallery"))
1103 (man (string-append out "/share/man/man1"))
1104 (perl5lib (getenv "PERL5LIB"))
1105 (script (string-append share "/fgallery")))
1106 (define (bin-directory input-name)
1107 (string-append (assoc-ref inputs input-name) "/bin"))
1108
1109 (mkdir-p man)
1110 (copy-file "fgallery.1" (string-append man "/fgallery.1"))
1111
1112 (mkdir-p share)
1113 (copy-recursively "." share)
1114
1115 ;; fgallery copies files from store when it is run. The
1116 ;; read-only permissions from the store directories will cause
1117 ;; fgallery to fail. Do not preserve file attributes when
1118 ;; copying files to prevent it.
1119 (substitute* script
1120 (("'cp'")
1121 "'cp', '--no-preserve=all'"))
1122
1123 (mkdir-p bin)
1124 (symlink script (string-append out "/bin/fgallery"))
1125
1126 (wrap-program script
1127 `("PATH" ":" prefix
1128 ,(map bin-directory '("imagemagick"
1129 "lcms"
1130 "fbida"
1131 "libjpeg"
1132 "zip"
1133 "jpegoptim"
1134 "pngcrush"
1135 "p7zip")))
1136 `("PERL5LIB" ":" prefix (,perl5lib)))
1137 #t))))))
1138 (native-inputs
1139 `(("unzip" ,unzip)))
1140 ;; TODO: Add missing optional dependency: facedetect.
1141 (inputs
1142 `(("imagemagick" ,imagemagick)
1143 ("lcms" ,lcms)
1144 ("fbida" ,fbida)
1145 ("libjpeg" ,libjpeg-turbo)
1146 ("zip" ,zip)
1147 ("perl" ,perl)
1148 ("perl-cpanel-json-xs" ,perl-cpanel-json-xs)
1149 ("perl-image-exiftool" ,perl-image-exiftool)
1150 ("jpegoptim" ,jpegoptim)
1151 ("pngcrush" ,pngcrush)
1152 ("p7zip" ,p7zip)))
1153 (home-page "http://www.thregr.org/~wavexx/software/fgallery/")
1154 (synopsis "Static photo gallery generator")
1155 (description
1156 "FGallery is a static, JavaScript photo gallery generator with minimalist
1157 look. The result can be uploaded on any web server without additional
1158 requirements.")
1159 (license license:gpl2+)))
1160
1161 (define-public opensubdiv
1162 (package
1163 (name "opensubdiv")
1164 (version "3.4.0")
1165 (source (origin
1166 (method git-fetch)
1167 (uri (git-reference
1168 (url "https://github.com/PixarAnimationStudios/OpenSubdiv")
1169 (commit (string-append "v" (string-join (string-split version #\.)
1170 "_")))))
1171 (file-name (git-file-name name version))
1172 (sha256
1173 (base32
1174 "0cippg6aqc5dlya1cmh3908pwssrg52fwgyylnvz5343yrxmgk12"))))
1175 (build-system cmake-build-system)
1176 (arguments
1177 `(#:phases (modify-phases %standard-phases
1178 (add-before 'configure 'set-glew-location
1179 (lambda* (#:key inputs #:allow-other-keys)
1180 (setenv "GLEW_LOCATION" (assoc-ref inputs "glew"))
1181 #t))
1182 (add-before 'check 'start-xorg-server
1183 (lambda* (#:key inputs #:allow-other-keys)
1184 ;; The test suite requires a running X server.
1185 (system (string-append (assoc-ref inputs "xorg-server")
1186 "/bin/Xvfb :1 &"))
1187 (setenv "DISPLAY" ":1")
1188 #t)))))
1189 (native-inputs
1190 `(("xorg-server" ,xorg-server-for-tests)))
1191 (inputs
1192 `(("glew" ,glew)
1193 ("libxrandr" ,libxrandr)
1194 ("libxcursor" ,libxcursor)
1195 ("libxinerama" ,libxinerama)
1196 ("libxi" ,libxi)
1197 ("zlib" ,zlib)
1198 ("glfw" ,glfw)))
1199 (home-page "https://graphics.pixar.com/opensubdiv/")
1200 (synopsis "High performance subdivision surface evaluation")
1201 (description "OpenSubdiv is a set of libraries that implement high
1202 performance subdivision surface (subdiv) evaluation on massively parallel CPU
1203 and GPU architectures.")
1204 (license license:asl2.0)))
1205
1206 (define-public opencsg
1207 (let ((dot-to-dash (lambda (c) (if (char=? c #\.) #\- c))))
1208 (package
1209 (name "opencsg")
1210 (version "1.4.2")
1211 (source
1212 (origin
1213 (method git-fetch)
1214 (uri (git-reference
1215 (url "https://github.com/floriankirsch/OpenCSG.git")
1216 (commit (string-append "opencsg-"
1217 (string-map dot-to-dash version)
1218 "-release"))))
1219 (file-name (git-file-name name version))
1220 (sha256
1221 (base32
1222 "00m4vs6jn3scqczscc4591l1d6zg6anqp9v1ldf9ymf70rdyvm7m"))))
1223 (build-system gnu-build-system)
1224 (arguments
1225 `(#:phases
1226 (modify-phases %standard-phases
1227 (replace 'configure
1228 (lambda* (#:key outputs #:allow-other-keys)
1229 (substitute* "src/Makefile"
1230 (("/usr/local") (assoc-ref outputs "out")))
1231 #t))
1232 (add-before 'build 'skip-example
1233 (lambda _ (chdir "src") #t)))))
1234 (inputs
1235 `(("glew" ,glew)
1236 ("freeglut" ,freeglut)))
1237 (synopsis "Library for rendering Constructive Solid Geometry (CSG)")
1238 (description
1239 "OpenCSG is a library for rendering Constructive Solid Geometry (CSG) using
1240 OpenGL. CSG is an approach for modeling complex 3D-shapes using simpler ones.
1241 For example, two shapes can be combined by uniting them, by intersecting them,
1242 or by subtracting one shape from the other.")
1243 (home-page "http://www.opencsg.org/")
1244 (license license:gpl2))))
1245
1246 (define-public coin3D
1247 ;; The ‘4.0.0’ zip archive isn't stable, nor in fact a release. See:
1248 ;; https://bitbucket.org/Coin3D/coin/issues/179/coin-400-srczip-has-been-modified
1249 (let ((revision 1)
1250 (changeset "ab8d0e47a4de3230a8137feb39c142d6ba45f97d"))
1251 (package
1252 (name "coin3D")
1253 (version
1254 (simple-format #f "3.1.3-~A-~A" revision (string-take changeset 7)))
1255 (source
1256 (origin
1257 (method hg-fetch)
1258 (uri (hg-reference
1259 (url "https://bitbucket.org/Coin3D/coin")
1260 (changeset changeset)))
1261 (file-name (git-file-name name version))
1262 (sha256
1263 (base32 "1ff44jz6lg4rylljvy69n1hcjh9y6achbv9jpn1cv2sf8cxn3r2j"))
1264 (modules '((guix build utils)))
1265 (snippet
1266 '(begin
1267 (for-each delete-file
1268 '("cfg/csubst.exe"
1269 "cfg/wrapmsvc.exe"))
1270 #t))))
1271 (build-system cmake-build-system)
1272 (native-inputs
1273 `(("doxygen" ,doxygen)
1274 ("graphviz" ,graphviz)))
1275 (inputs
1276 `(("boost" ,boost)
1277 ("freeglut" ,freeglut)
1278 ("glew" ,glew)))
1279 (arguments
1280 `(#:configure-flags
1281 (list
1282 "-DCOIN_BUILD_DOCUMENTATION_MAN=ON"
1283 (string-append "-DBOOST_ROOT="
1284 (assoc-ref %build-inputs "boost")))))
1285 (home-page "https://bitbucket.org/Coin3D/coin/wiki/Home")
1286 (synopsis
1287 "High-level 3D visualization library with Open Inventor 2.1 API")
1288 (description
1289 "Coin is a 3D graphics library with an Application Programming Interface
1290 based on the Open Inventor 2.1 API. For those who are not familiar with
1291 Open Inventor, it is a scene-graph based retain-mode rendering and model
1292 interaction library, written in C++, which has become the de facto
1293 standard graphics library for 3D visualization and visual simulation
1294 software in the scientific and engineering community.")
1295 (license license:bsd-3))))
1296
1297 (define-public superfamiconv
1298 (package
1299 (name "superfamiconv")
1300 (version "0.8.8")
1301 (source
1302 (origin
1303 (method git-fetch)
1304 (uri (git-reference
1305 (url "https://github.com/Optiroc/SuperFamiconv")
1306 (commit (string-append "v" version))))
1307 (file-name (git-file-name name version))
1308 (sha256
1309 (base32
1310 "0848szv6a2b8wdganh6mw5i8vn8cqvn1kbwzx7mb9wlrf5wzqn37"))))
1311 (build-system gnu-build-system)
1312 (arguments
1313 `(#:tests? #f ; no tests
1314 #:phases
1315 (modify-phases %standard-phases
1316 (delete 'configure)
1317 (replace 'install
1318 (lambda* (#:key outputs #:allow-other-keys)
1319 (let* ((outdir (assoc-ref outputs "out"))
1320 (bindir (string-append outdir "/bin")))
1321 (install-file "bin/superfamiconv" bindir)
1322 #t))))))
1323 (home-page "https://github.com/Optiroc/SuperFamiconv")
1324 (synopsis "Tile graphics converter supporting SNES, Game Boy Color
1325 and PC Engine formats")
1326 (description "SuperFamiconv is a converter for tiled graphics, supporting
1327 the graphics formats of the SNES, Game Boy Color and PC Engine game consoles.
1328 Automated palette selection is supported.")
1329 (license license:expat)))