gnu: lib2geom: Fix tests on aarch64, i686-linux architectures.
[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.83.0")
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 "07rzm4xaj94pjxy2vlqfhi1adsqpshfkrzrq8kljmcbnw22vrqhl"))))
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 ;; 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)))
414 (snippet
415 '(begin
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"))
420 #t))))
421 (build-system cmake-build-system)
422 (arguments
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")
430 #:phases
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)
435 python-version))
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
441 "/site-packages")))
442 (substitute* '("src/cython/CMakeLists.txt"
443 "src/py2geom/CMakeLists.txt")
444 (("PYTHON_LIB_INSTALL \"[^\"]*\"")
445 (format #f "PYTHON_LIB_INSTALL ~s" site-package))))
446 #t)))))
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)
453 ("glib" ,glib)
454 ("gsl" ,gsl)))
455 (propagated-inputs
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
462 basic geometries.")
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+))))
467
468 (define-public pstoedit
469 (package
470 (name "pstoedit")
471 (version "3.75")
472 (source (origin
473 (method url-fetch)
474 (uri (string-append "mirror://sourceforge/pstoedit/pstoedit/"
475 version "/pstoedit-" version ".tar.gz"))
476 (sha256
477 (base32
478 "1kv46g2wsvsvcngkavxl5gnw3l6g5xqnh4kmyx4b39a01d8xiddp"))))
479 (build-system gnu-build-system)
480 (native-inputs
481 `(("pkg-config" ,pkg-config)))
482 (inputs
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:
493 @itemize
494 @item Tgif (.obj)
495 @item gnuplot
496 @item xfig (.fig)
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
504 @end itemize")
505 (license license:gpl2+)))
506
507 (define-public ogre
508 (package
509 (name "ogre")
510 (version "1.12.5")
511 (source
512 (origin
513 (method git-fetch)
514 (uri (git-reference
515 (url "https://github.com/OGRECave/ogre.git")
516 (commit (string-append "v" version))
517 (recursive? #t))) ;for Dear ImGui submodule
518 (file-name (git-file-name name version))
519 (sha256
520 (base32 "1sx0jsw4kmb4ycf62bgx3ygwv8k1cgjx52y47d7dk07z6gk6wpyj"))))
521 (build-system cmake-build-system)
522 (arguments
523 '(#:phases
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
528 ;; it.
529 (lambda* (#:key inputs outputs #:allow-other-keys)
530 (substitute* "CMakeLists.txt"
531 (("set\\(CMAKE_INSTALL_RPATH .*") ""))
532 #t)))
533 #:configure-flags
534 (let* ((out (assoc-ref %outputs "out"))
535 (runpath
536 (string-join (list (string-append out "/lib")
537 (string-append out "/lib/OGRE"))
538 ";")))
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"))))
545 (native-inputs
546 `(("boost" ,boost)
547 ("doxygen" ,doxygen)
548 ("googletest" ,googletest-1.8)
549 ("pkg-config" ,pkg-config)))
550 (inputs
551 `(("font-dejavu" ,font-dejavu)
552 ("freeimage" ,freeimage)
553 ("freetype" ,freetype)
554 ("glu" ,glu)
555 ("libxaw" ,libxaw)
556 ("libxrandr" ,libxrandr)
557 ("pugixml" ,pugixml)
558 ("sdl2" ,sdl2)
559 ("tinyxml" ,tinyxml)
560 ("zziplib" ,zziplib)))
561 (synopsis "Scene-oriented, flexible 3D engine written in C++")
562 (description
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
566 graphics.")
567 (home-page "https://www.ogre3d.org/")
568 (license license:expat)))
569
570 (define-public openexr
571 (package
572 (name "openexr")
573 (version (package-version ilmbase))
574 (source (origin
575 (inherit (package-source ilmbase))
576 (file-name (git-file-name "openexr" version))
577 (modules '((guix build utils)))
578 (snippet
579 '(begin
580 (substitute* (find-files "OpenEXR" "tmpDir\\.h")
581 (("\"/var/tmp/\"")
582 "\"/tmp/\""))
583 #t))))
584 (build-system cmake-build-system)
585 (arguments
586 `(#:phases
587 (modify-phases %standard-phases
588 (add-after 'unpack 'change-directory
589 (lambda _
590 (chdir "OpenEXR")
591 #t))
592 (add-before 'check 'increase-test-timeout
593 (lambda _
594 ;; On armhf-linux, we need to override the CTest default
595 ;; timeout of 1500 seconds for the OpenEXR.IlmImf test.
596 (setenv "CTEST_TEST_TIMEOUT" "2000")
597 #t))
598 ,@(if (not (target-64bit?))
599 `((add-after 'change-directory 'disable-broken-test
600 ;; This test fails on i686. Upstream developers suggest that
601 ;; this test is broken on i686 and can be safely disabled:
602 ;; https://github.com/openexr/openexr/issues/67#issuecomment-21169748
603 (lambda _
604 (substitute* "IlmImfTest/main.cpp"
605 ((".*testOptimizedInterleavePatterns.*") ""))
606 #t)))
607 '()))))
608 (native-inputs
609 `(("pkg-config" ,pkg-config)))
610 (propagated-inputs
611 `(("ilmbase" ,ilmbase) ;used in public headers
612 ("zlib" ,zlib))) ;OpenEXR.pc reads "-lz"
613 (home-page "https://www.openexr.com/")
614 (synopsis "High-dynamic range file format library")
615 (description
616 "OpenEXR is a high dynamic-range (HDR) image file format developed for
617 use in computer imaging applications. The IlmImf C++ libraries support
618 storage of the \"EXR\" file format for storing 16-bit floating-point images.")
619 (license license:bsd-3)))
620
621 (define-public openimageio
622 (package
623 (name "openimageio")
624 (version "1.8.17")
625 (source (origin
626 (method git-fetch)
627 (uri (git-reference
628 (url "https://github.com/OpenImageIO/oiio.git")
629 (commit (string-append "Release-" version))))
630 (file-name (git-file-name name version))
631 (sha256
632 (base32
633 "0zq34szprgkrrayg5sl3whrsx2l6lr8nw4hdrnwv2qhn70jbi2w2"))))
634 (build-system cmake-build-system)
635 ;; FIXME: To run all tests successfully, test image sets from multiple
636 ;; third party sources have to be present. For details see
637 ;; https://github.com/OpenImageIO/oiio/blob/master/INSTALL
638 (arguments
639 `(#:tests? #f))
640 (native-inputs
641 `(("pkg-config" ,pkg-config)))
642 (inputs
643 `(("boost" ,boost)
644 ("libpng" ,libpng)
645 ("libjpeg" ,libjpeg-turbo)
646 ("libtiff" ,libtiff)
647 ("giflib" ,giflib)
648 ("openexr" ,openexr)
649 ("ilmbase" ,ilmbase)
650 ("python" ,python-2)
651 ("zlib" ,zlib)))
652 (synopsis "C++ library for reading and writing images")
653 (description
654 "OpenImageIO is a library for reading and writing images, and a bunch of
655 related classes, utilities, and applications. There is a particular emphasis
656 on formats and functionality used in professional, large-scale animation and
657 visual effects work for film.")
658 (home-page "https://www.openimageio.org")
659 (license license:bsd-3)))
660
661 (define-public openscenegraph
662 (package
663 (name "openscenegraph")
664 (version "3.6.5")
665 (source
666 (origin
667 (method git-fetch)
668 (uri (git-reference
669 (url "https://github.com/openscenegraph/OpenSceneGraph")
670 (commit (string-append "OpenSceneGraph-" version))))
671 (sha256
672 (base32 "00i14h82qg3xzcyd8p02wrarnmby3aiwmz0z43l50byc9f8i05n1"))
673 (file-name (git-file-name name version))))
674 (properties
675 `((upstream-name . "OpenSceneGraph")))
676 (build-system cmake-build-system)
677 (arguments
678 `(#:tests? #f ; no test target available
679 ;; Without this flag, 'rd' will be added to the name of the
680 ;; library binaries and break linking with other programs.
681 #:build-type "Release"
682 #:configure-flags
683 (list (string-append "-DCMAKE_INSTALL_RPATH="
684 (assoc-ref %outputs "out") "/lib:"
685 (assoc-ref %outputs "out") "/lib64"))))
686 (native-inputs
687 `(("pkg-config" ,pkg-config)
688 ("unzip" ,unzip)))
689 (inputs
690 `(("giflib" ,giflib)
691 ("libjpeg" ,libjpeg-turbo) ; required for the JPEG texture plugin.
692 ("jasper" ,jasper)
693 ("librsvg" ,librsvg)
694 ("libxrandr" ,libxrandr)
695 ("ffmpeg" ,ffmpeg)
696 ("mesa" ,mesa)))
697 (synopsis "High-performance real-time graphics toolkit")
698 (description
699 "The OpenSceneGraph is a high-performance 3D graphics toolkit
700 used by application developers in fields such as visual simulation, games,
701 virtual reality, scientific visualization and modeling.")
702 (home-page "http://www.openscenegraph.org")
703 ;; The 'LICENSE' file explains that the source is licensed under
704 ;; LGPL 2.1, but with 4 exceptions. This version is called OSGPL.
705 (license license:lgpl2.1)))
706
707 ;; We need this for simgear
708 (define-public openscenegraph-3.4
709 (package (inherit openscenegraph)
710 (name "openscenegraph")
711 (version "3.4.1")
712 (source
713 (origin
714 (method git-fetch)
715 (uri (git-reference
716 (url "https://github.com/openscenegraph/OpenSceneGraph")
717 (commit (string-append "OpenSceneGraph-" version))))
718 (file-name (git-file-name name version))
719 (sha256
720 (base32
721 "1fbzg1ihjpxk6smlq80p3h3ggllbr16ihd2fxpfwzam8yr8yxip9"))))
722 (arguments
723 (substitute-keyword-arguments (package-arguments openscenegraph)
724 ((#:configure-flags flags)
725 `(cons
726 ;; The jpeg plugin requires conversion between integers and booleans
727 "-DCMAKE_CXX_FLAGS=-fpermissive"
728 ,flags))))
729 (inputs
730 `(("libjpeg" ,libjpeg-turbo)
731 ,@(package-inputs openscenegraph)))))
732
733
734 (define-public openmw-openscenegraph
735 ;; OpenMW prefers its own fork of openscenegraph:
736 ;; https://wiki.openmw.org/index.php?title=Development_Environment_Setup#OpenSceneGraph.
737 (let ((commit "36a962845a2c87a6671fd822157e0729d164e940"))
738 (hidden-package
739 (package
740 (inherit openscenegraph)
741 (version (git-version "3.6" "1" commit))
742 (source
743 (origin
744 (method git-fetch)
745 (uri (git-reference
746 (url "https://github.com/OpenMW/osg/")
747 (commit commit)))
748 (file-name (git-file-name (package-name openscenegraph) version))
749 (sha256
750 (base32
751 "05yhgq3qm5q277y32n5sf36vx5nv5qd3zlhz4csgd3a6190jrnia"))))
752 (arguments
753 (substitute-keyword-arguments (package-arguments openscenegraph)
754 ((#:configure-flags flags)
755 ;; As per the above wiki link, the following plugins are enough:
756 `(append
757 '("-DBUILD_OSG_PLUGINS_BY_DEFAULT=0"
758 "-DBUILD_OSG_PLUGIN_OSG=1"
759 "-DBUILD_OSG_PLUGIN_DDS=1"
760 "-DBUILD_OSG_PLUGIN_TGA=1"
761 "-DBUILD_OSG_PLUGIN_BMP=1"
762 "-DBUILD_OSG_PLUGIN_JPEG=1"
763 "-DBUILD_OSG_PLUGIN_PNG=1"
764 "-DBUILD_OSG_DEPRECATED_SERIALIZERS=0"
765 ;; The jpeg plugin requires conversion between integers and booleans
766 "-DCMAKE_CXX_FLAGS=-fpermissive")
767 ,flags))))))))
768
769 (define-public povray
770 (package
771 (name "povray")
772 (version "3.7.0.8")
773 (source (origin
774 (method git-fetch)
775 (uri (git-reference
776 (url "https://github.com/POV-Ray/povray")
777 (commit (string-append "v" version))))
778 (file-name (git-file-name name version))
779 (sha256
780 (base32
781 "1q114n4m3r7qy3yn954fq7p46rg7ypdax5fazxr9yj1jklf1lh6z"))
782 (modules '((guix build utils)))
783 (snippet
784 '(begin
785 ;; Delete bundled libraries.
786 (delete-file-recursively "libraries")
787 #t))))
788 (build-system gnu-build-system)
789 (native-inputs
790 `(("autoconf" ,autoconf)
791 ("automake" ,automake)
792 ("pkg-config" ,pkg-config)))
793 (inputs
794 `(("boost" ,boost)
795 ("libjpeg" ,libjpeg-turbo)
796 ("libpng" ,libpng)
797 ("libtiff" ,libtiff)
798 ("openexr" ,openexr)
799 ("sdl" ,sdl)
800 ("zlib" ,zlib)))
801 (arguments
802 '(#:configure-flags
803 (list "COMPILED_BY=Guix"
804 (string-append "--with-boost-libdir="
805 (assoc-ref %build-inputs "boost") "/lib")
806 "--disable-optimiz-arch")
807 #:phases
808 (modify-phases %standard-phases
809 (add-after 'unpack 'run-prebuild
810 (lambda _
811 (setenv "HOME" (getcwd))
812 (with-directory-excursion "unix"
813 (substitute* "prebuild.sh"
814 (("/bin/sh") (which "sh")))
815 (invoke "sh" "prebuild.sh"))
816 #t))
817 ;; The bootstrap script is run by the prebuild script in the
818 ;; "run-prebuild" phase.
819 (delete 'bootstrap))))
820 (synopsis "Tool for creating three-dimensional graphics")
821 (description
822 "@code{POV-Ray} is short for the Persistence of Vision Raytracer, a tool
823 for producing high-quality computer graphics. @code{POV-Ray} creates
824 three-dimensional, photo-realistic images using a rendering technique called
825 ray-tracing. It reads in a text file containing information describing the
826 objects and lighting in a scene and generates an image of that scene from the
827 view point of a camera also described in the text file. Ray-tracing is not a
828 fast process by any means, but it produces very high quality images with
829 realistic reflections, shading, perspective and other effects.")
830 (home-page "http://www.povray.org/")
831 (license license:agpl3+)))
832
833 (define-public rapicorn
834 (package
835 (name "rapicorn")
836 (version "16.0.0")
837 (source (origin
838 (method url-fetch)
839 (uri (string-append "https://testbit.eu/pub/dists/rapicorn/"
840 "rapicorn-" version ".tar.xz"))
841 (sha256
842 (base32
843 "1y51yjrpsihas1jy905m9p3r8iiyhq6bwi2690c564i5dnix1f9d"))
844 (patches (search-patches "rapicorn-isnan.patch"))))
845 (build-system gnu-build-system)
846 (arguments
847 `(#:phases
848 (modify-phases %standard-phases
849 (add-after 'unpack 'fix-tests
850 (lambda _
851 ;; Our grep does not support perl regular expressions.
852 (substitute* "taptool.sh"
853 (("grep -P") "grep -E"))
854 ;; Disable path tests because we cannot access /bin or /sbin.
855 (substitute* "rcore/tests/multitest.cc"
856 (("TCMP \\(Path::equals \\(\"/bin\"") "//"))
857 #t))
858 (add-before 'check 'pre-check
859 (lambda _
860 ;; The test suite requires a running X server (with DISPLAY
861 ;; number 99 or higher).
862 (system "Xvfb :99 &")
863 (setenv "DISPLAY" ":99")
864 #t))
865 (add-after 'unpack 'replace-fhs-paths
866 (lambda _
867 (substitute* (cons "Makefile.decl"
868 (find-files "." "^Makefile\\.in$"))
869 (("/bin/ls") (which "ls"))
870 (("/usr/bin/env") (which "env")))
871 #t)))))
872 ;; These libraries are listed in the "Required" section of the pkg-config
873 ;; file.
874 (propagated-inputs
875 `(("librsvg" ,librsvg)
876 ("cairo" ,cairo)
877 ("pango" ,pango)
878 ("libxml2" ,libxml2)
879 ("python2-enum34" ,python2-enum34)))
880 (inputs
881 `(("gdk-pixbuf" ,gdk-pixbuf)
882 ("libpng" ,libpng-1.2)
883 ("readline" ,readline)
884 ("libcroco" ,libcroco)
885 ("python" ,python-2)
886 ("cython" ,python2-cython)))
887 (native-inputs
888 `(("pandoc" ,ghc-pandoc)
889 ("bison" ,bison)
890 ("flex" ,flex)
891 ("doxygen" ,doxygen)
892 ("graphviz" ,graphviz)
893 ("intltool" ,intltool)
894 ("pkg-config" ,pkg-config)
895 ("xvfb" ,xorg-server-for-tests)))
896 (home-page "https://rapicorn.testbit.org/")
897 (synopsis "Toolkit for rapid development of user interfaces")
898 (description
899 "Rapicorn is a toolkit for rapid development of user interfaces in C++
900 and Python. The user interface is designed in a declarative markup language
901 and is connected to the programming logic using data bindings and commands.")
902 (license license:mpl2.0)))
903
904 (define-public ctl
905 (package
906 (name "ctl")
907 (version "1.5.2")
908 (source (origin
909 (method url-fetch)
910 (uri (string-append "https://github.com/ampas/CTL/archive/ctl-"
911 version ".tar.gz"))
912 (sha256
913 (base32
914 "1gg04pyvw0m398akn0s1l07g5b1haqv5na1wpi5dii1jjd1w3ynp"))))
915 (build-system cmake-build-system)
916 (arguments '(#:tests? #f)) ;no 'test' target
917
918 ;; Headers include OpenEXR and IlmBase headers.
919 (propagated-inputs `(("openexr" ,openexr)))
920
921 (home-page "http://ampasctl.sourceforge.net")
922 (synopsis "Color Transformation Language")
923 (description
924 "The Color Transformation Language, or CTL, is a small programming
925 language that was designed to serve as a building block for digital color
926 management systems. CTL allows users to describe color transforms in a
927 concise and unambiguous way by expressing them as programs. In order to apply
928 a given transform to an image, the color management system instructs a CTL
929 interpreter to load and run the CTL program that describes the transform. The
930 original and the transformed image constitute the CTL program's input and
931 output.")
932
933 ;; The web site says it's under a BSD-3 license, but the 'LICENSE' file
934 ;; and headers use different wording.
935 (license (license:non-copyleft "file://LICENSE"))))
936
937 (define-public brdf-explorer
938 ;; There are no release tarballs, and not even tags in the repo,
939 ;; so use the latest revision.
940 (let ((commit "5b2cd46f38a06e47207fa7229b72d37beb945019")
941 (revision "1"))
942 (package
943 (name "brdf-explorer")
944 (version (string-append "1.0.0-" revision "." (string-take commit 9)))
945 (source (origin
946 (method git-fetch)
947 (uri (git-reference
948 (url "https://github.com/wdas/brdf.git")
949 (commit commit)))
950 (sha256
951 (base32
952 "06vzbiajzbi2xl8jlff5d45bc9wd68i3jdndfab1f3jgfrd8bsgx"))
953 (file-name (string-append name "-" version "-checkout"))))
954 (build-system gnu-build-system)
955 (arguments
956 `(#:phases (modify-phases %standard-phases
957 (replace 'configure
958 (lambda* (#:key outputs #:allow-other-keys)
959 (let ((out (assoc-ref outputs "out")))
960 (invoke "qmake"
961 (string-append "prefix=" out)))))
962 (add-after 'install 'wrap-program
963 (lambda* (#:key outputs #:allow-other-keys)
964 (let* ((out (assoc-ref outputs "out"))
965 (bin (string-append out "/bin"))
966 (data (string-append
967 out "/share/brdf")))
968 (with-directory-excursion bin
969 (rename-file "brdf" ".brdf-real")
970 (call-with-output-file "brdf"
971 (lambda (port)
972 (format port "#!/bin/sh
973 # Run the thing from its home, otherwise it just bails out.
974 cd \"~a\"
975 exec -a \"$0\" ~a/.brdf-real~%"
976 data bin)))
977 (chmod "brdf" #o555)))
978 #t)))))
979 (native-inputs
980 `(("qttools" ,qttools))) ;for 'qmake'
981 (inputs
982 `(("qtbase" ,qtbase)
983 ("mesa" ,mesa)
984 ("glew" ,glew)
985 ("freeglut" ,freeglut)
986 ("zlib" ,zlib)))
987 (home-page "https://www.disneyanimation.com/technology/brdf.html")
988 (synopsis
989 "Analyze bidirectional reflectance distribution functions (BRDFs)")
990 (description
991 "BRDF Explorer is an application that allows the development and analysis
992 of bidirectional reflectance distribution functions (BRDFs). It can load and
993 plot analytic BRDF functions (coded as functions in OpenGL's GLSL shader
994 language), measured material data from the MERL database, and anisotropic
995 measured material data from MIT CSAIL. Graphs and visualizations update in
996 real time as parameters are changed, making it a useful tool for evaluating
997 and understanding different BRDFs (and other component functions).")
998 (license license:ms-pl))))
999
1000 (define-public agg
1001 (package
1002 (name "agg")
1003 (version "2.5")
1004 (source (origin
1005 (method url-fetch)
1006 (uri (list (string-append
1007 "ftp://ftp.fau.de/gentoo/distfiles/agg-"
1008 version ".tar.gz")
1009 (string-append
1010 "ftp://ftp.ula.ve/gentoo/distfiles/agg-"
1011 version ".tar.gz")
1012
1013 ;; Site was discontinued.
1014 (string-append "http://www.antigrain.com/agg-"
1015 version ".tar.gz")))
1016 (sha256
1017 (base32 "07wii4i824vy9qsvjsgqxppgqmfdxq0xa87i5yk53fijriadq7mb"))
1018 (patches (search-patches "agg-am_c_prototype.patch"))))
1019 (build-system gnu-build-system)
1020 (arguments
1021 '(#:configure-flags
1022 (list (string-append "--x-includes=" (assoc-ref %build-inputs "libx11")
1023 "/include")
1024 (string-append "--x-libraries=" (assoc-ref %build-inputs "libx11")
1025 "/lib")
1026 "--disable-examples")
1027 #:phases
1028 (modify-phases %standard-phases
1029 (replace 'bootstrap
1030 (lambda _
1031 ;; let's call configure from configure phase and not now
1032 (substitute* "autogen.sh" (("./configure") "# ./configure"))
1033 (invoke "sh" "autogen.sh"))))))
1034 (native-inputs
1035 `(("pkg-config" ,pkg-config)
1036 ("libtool" ,libtool)
1037 ("autoconf" ,autoconf)
1038 ("automake" ,automake)))
1039 (inputs
1040 `(("libx11" ,libx11)
1041 ("freetype" ,freetype)
1042 ("sdl" ,sdl)))
1043
1044 ;; Antigrain.com was discontinued.
1045 (home-page "http://agg.sourceforge.net/antigrain.com/index.html")
1046 (synopsis "High-quality 2D graphics rendering engine for C++")
1047 (description
1048 "Anti-Grain Geometry is a high quality rendering engine written in C++.
1049 It supports sub-pixel resolutions and anti-aliasing. It is also library for
1050 rendering SVG graphics.")
1051 (license license:gpl2+)))
1052
1053 (define-public python-pastel
1054 (package
1055 (name "python-pastel")
1056 (version "0.2.0")
1057 (source
1058 (origin
1059 (method url-fetch)
1060 (uri (pypi-uri "pastel" version))
1061 (sha256
1062 (base32
1063 "0dnaw44ss10i10z4ksy0xljknvjap7rb7g0b8p6yzm5x4g2my5a6"))))
1064 (build-system python-build-system)
1065 (arguments
1066 `(#:phases (modify-phases %standard-phases
1067 (replace 'check
1068 (lambda _ (invoke "pytest" "pastel" "tests/"))))))
1069 (native-inputs
1070 `(("python-pytest" ,python-pytest)))
1071 (home-page "https://github.com/sdispater/pastel")
1072 (synopsis "Library to colorize strings in your terminal")
1073 (description "Pastel is a simple library to help you colorize strings in
1074 your terminal.")
1075 (license license:expat)))
1076
1077 (define-public python2-pastel
1078 (package-with-python2 python-pastel))
1079
1080 (define-public fgallery
1081 (package
1082 (name "fgallery")
1083 (version "1.8.2")
1084 (source (origin
1085 (method url-fetch)
1086 (uri
1087 (string-append
1088 "http://www.thregr.org/~wavexx/software/fgallery/releases/"
1089 "fgallery-" version ".zip"))
1090 (sha256
1091 (base32
1092 "18wlvqbxcng8pawimbc8f2422s8fnk840hfr6946lzsxr0ijakvf"))))
1093 (build-system gnu-build-system)
1094 (arguments
1095 `(#:tests? #f ; no tests
1096 #:phases
1097 (modify-phases %standard-phases
1098 (delete 'configure)
1099 (delete 'build)
1100 (replace 'install
1101 (lambda* (#:key inputs outputs #:allow-other-keys)
1102 (let* ((out (assoc-ref outputs "out"))
1103 (bin (string-append out "/bin/"))
1104 (share (string-append out "/share/fgallery"))
1105 (man (string-append out "/share/man/man1"))
1106 (perl5lib (getenv "PERL5LIB"))
1107 (script (string-append share "/fgallery")))
1108 (define (bin-directory input-name)
1109 (string-append (assoc-ref inputs input-name) "/bin"))
1110
1111 (mkdir-p man)
1112 (copy-file "fgallery.1" (string-append man "/fgallery.1"))
1113
1114 (mkdir-p share)
1115 (copy-recursively "." share)
1116
1117 ;; fgallery copies files from store when it is run. The
1118 ;; read-only permissions from the store directories will cause
1119 ;; fgallery to fail. Do not preserve file attributes when
1120 ;; copying files to prevent it.
1121 (substitute* script
1122 (("'cp'")
1123 "'cp', '--no-preserve=all'"))
1124
1125 (mkdir-p bin)
1126 (symlink script (string-append out "/bin/fgallery"))
1127
1128 (wrap-program script
1129 `("PATH" ":" prefix
1130 ,(map bin-directory '("imagemagick"
1131 "lcms"
1132 "fbida"
1133 "libjpeg"
1134 "zip"
1135 "jpegoptim"
1136 "pngcrush"
1137 "p7zip")))
1138 `("PERL5LIB" ":" prefix (,perl5lib)))
1139 #t))))))
1140 (native-inputs
1141 `(("unzip" ,unzip)))
1142 ;; TODO: Add missing optional dependency: facedetect.
1143 (inputs
1144 `(("imagemagick" ,imagemagick)
1145 ("lcms" ,lcms)
1146 ("fbida" ,fbida)
1147 ("libjpeg" ,libjpeg-turbo)
1148 ("zip" ,zip)
1149 ("perl" ,perl)
1150 ("perl-cpanel-json-xs" ,perl-cpanel-json-xs)
1151 ("perl-image-exiftool" ,perl-image-exiftool)
1152 ("jpegoptim" ,jpegoptim)
1153 ("pngcrush" ,pngcrush)
1154 ("p7zip" ,p7zip)))
1155 (home-page "http://www.thregr.org/~wavexx/software/fgallery/")
1156 (synopsis "Static photo gallery generator")
1157 (description
1158 "FGallery is a static, JavaScript photo gallery generator with minimalist
1159 look. The result can be uploaded on any web server without additional
1160 requirements.")
1161 (license license:gpl2+)))
1162
1163 (define-public opensubdiv
1164 (package
1165 (name "opensubdiv")
1166 (version "3.4.0")
1167 (source (origin
1168 (method git-fetch)
1169 (uri (git-reference
1170 (url "https://github.com/PixarAnimationStudios/OpenSubdiv")
1171 (commit (string-append "v" (string-join (string-split version #\.)
1172 "_")))))
1173 (file-name (git-file-name name version))
1174 (sha256
1175 (base32
1176 "0cippg6aqc5dlya1cmh3908pwssrg52fwgyylnvz5343yrxmgk12"))))
1177 (build-system cmake-build-system)
1178 (arguments
1179 `(#:phases (modify-phases %standard-phases
1180 (add-before 'configure 'set-glew-location
1181 (lambda* (#:key inputs #:allow-other-keys)
1182 (setenv "GLEW_LOCATION" (assoc-ref inputs "glew"))
1183 #t))
1184 (add-before 'check 'start-xorg-server
1185 (lambda* (#:key inputs #:allow-other-keys)
1186 ;; The test suite requires a running X server.
1187 (system (string-append (assoc-ref inputs "xorg-server")
1188 "/bin/Xvfb :1 &"))
1189 (setenv "DISPLAY" ":1")
1190 #t)))))
1191 (native-inputs
1192 `(("xorg-server" ,xorg-server-for-tests)))
1193 (inputs
1194 `(("glew" ,glew)
1195 ("libxrandr" ,libxrandr)
1196 ("libxcursor" ,libxcursor)
1197 ("libxinerama" ,libxinerama)
1198 ("libxi" ,libxi)
1199 ("zlib" ,zlib)
1200 ("glfw" ,glfw)))
1201 (home-page "https://graphics.pixar.com/opensubdiv/")
1202 (synopsis "High performance subdivision surface evaluation")
1203 (description "OpenSubdiv is a set of libraries that implement high
1204 performance subdivision surface (subdiv) evaluation on massively parallel CPU
1205 and GPU architectures.")
1206 (license license:asl2.0)))
1207
1208 (define-public opencsg
1209 (let ((dot-to-dash (lambda (c) (if (char=? c #\.) #\- c))))
1210 (package
1211 (name "opencsg")
1212 (version "1.4.2")
1213 (source
1214 (origin
1215 (method git-fetch)
1216 (uri (git-reference
1217 (url "https://github.com/floriankirsch/OpenCSG.git")
1218 (commit (string-append "opencsg-"
1219 (string-map dot-to-dash version)
1220 "-release"))))
1221 (file-name (git-file-name name version))
1222 (sha256
1223 (base32
1224 "00m4vs6jn3scqczscc4591l1d6zg6anqp9v1ldf9ymf70rdyvm7m"))))
1225 (build-system gnu-build-system)
1226 (arguments
1227 `(#:phases
1228 (modify-phases %standard-phases
1229 (replace 'configure
1230 (lambda* (#:key outputs #:allow-other-keys)
1231 (substitute* "src/Makefile"
1232 (("/usr/local") (assoc-ref outputs "out")))
1233 #t))
1234 (add-before 'build 'skip-example
1235 (lambda _ (chdir "src") #t)))))
1236 (inputs
1237 `(("glew" ,glew)
1238 ("freeglut" ,freeglut)))
1239 (synopsis "Library for rendering Constructive Solid Geometry (CSG)")
1240 (description
1241 "OpenCSG is a library for rendering Constructive Solid Geometry (CSG) using
1242 OpenGL. CSG is an approach for modeling complex 3D-shapes using simpler ones.
1243 For example, two shapes can be combined by uniting them, by intersecting them,
1244 or by subtracting one shape from the other.")
1245 (home-page "http://www.opencsg.org/")
1246 (license license:gpl2))))
1247
1248 (define-public coin3D
1249 ;; The ‘4.0.0’ zip archive isn't stable, nor in fact a release. See:
1250 ;; https://bitbucket.org/Coin3D/coin/issues/179/coin-400-srczip-has-been-modified
1251 (let ((revision 1)
1252 (changeset "ab8d0e47a4de3230a8137feb39c142d6ba45f97d"))
1253 (package
1254 (name "coin3D")
1255 (version
1256 (simple-format #f "3.1.3-~A-~A" revision (string-take changeset 7)))
1257 (source
1258 (origin
1259 (method hg-fetch)
1260 (uri (hg-reference
1261 (url "https://bitbucket.org/Coin3D/coin")
1262 (changeset changeset)))
1263 (file-name (git-file-name name version))
1264 (sha256
1265 (base32 "1ff44jz6lg4rylljvy69n1hcjh9y6achbv9jpn1cv2sf8cxn3r2j"))
1266 (modules '((guix build utils)))
1267 (snippet
1268 '(begin
1269 (for-each delete-file
1270 '("cfg/csubst.exe"
1271 "cfg/wrapmsvc.exe"))
1272 #t))))
1273 (build-system cmake-build-system)
1274 (native-inputs
1275 `(("doxygen" ,doxygen)
1276 ("graphviz" ,graphviz)))
1277 (inputs
1278 `(("boost" ,boost)
1279 ("freeglut" ,freeglut)
1280 ("glew" ,glew)))
1281 (arguments
1282 `(#:configure-flags
1283 (list
1284 "-DCOIN_BUILD_DOCUMENTATION_MAN=ON"
1285 (string-append "-DBOOST_ROOT="
1286 (assoc-ref %build-inputs "boost")))))
1287 (home-page "https://bitbucket.org/Coin3D/coin/wiki/Home")
1288 (synopsis
1289 "High-level 3D visualization library with Open Inventor 2.1 API")
1290 (description
1291 "Coin is a 3D graphics library with an Application Programming Interface
1292 based on the Open Inventor 2.1 API. For those who are not familiar with
1293 Open Inventor, it is a scene-graph based retain-mode rendering and model
1294 interaction library, written in C++, which has become the de facto
1295 standard graphics library for 3D visualization and visual simulation
1296 software in the scientific and engineering community.")
1297 (license license:bsd-3))))
1298
1299 (define-public superfamiconv
1300 (package
1301 (name "superfamiconv")
1302 (version "0.8.8")
1303 (source
1304 (origin
1305 (method git-fetch)
1306 (uri (git-reference
1307 (url "https://github.com/Optiroc/SuperFamiconv")
1308 (commit (string-append "v" version))))
1309 (file-name (git-file-name name version))
1310 (sha256
1311 (base32
1312 "0848szv6a2b8wdganh6mw5i8vn8cqvn1kbwzx7mb9wlrf5wzqn37"))))
1313 (build-system gnu-build-system)
1314 (arguments
1315 `(#:tests? #f ; no tests
1316 #:phases
1317 (modify-phases %standard-phases
1318 (delete 'configure)
1319 (replace 'install
1320 (lambda* (#:key outputs #:allow-other-keys)
1321 (let* ((outdir (assoc-ref outputs "out"))
1322 (bindir (string-append outdir "/bin")))
1323 (install-file "bin/superfamiconv" bindir)
1324 #t))))))
1325 (home-page "https://github.com/Optiroc/SuperFamiconv")
1326 (synopsis "Tile graphics converter supporting SNES, Game Boy Color
1327 and PC Engine formats")
1328 (description "SuperFamiconv is a converter for tiled graphics, supporting
1329 the graphics formats of the SNES, Game Boy Color and PC Engine game consoles.
1330 Automated palette selection is supported.")
1331 (license license:expat)))