gnu: fmt: Update to 9.1.0.
[jackhill/guix/guix.git] / gnu / packages / graphics.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2021, 2022 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, 2021 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–2021 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
12 ;;; Copyright © 2018 Alex Kost <alezost@gmail.com>
13 ;;; Copyright © 2018 Kei Kebreau <kkebreau@posteo.net>
14 ;;; Copyright © 2019, 2020 Mark H Weaver <mhw@netris.org>
15 ;;; Copyright © 2019 Carlo Zancanaro <carlo@zancanaro.id.au>
16 ;;; Copyright © 2019 Steve Sprang <scs@stevesprang.com>
17 ;;; Copyright © 2019 John Soo <jsoo1@asu.edu>
18 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
19 ;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
20 ;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
21 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
22 ;;; Copyright © 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
23 ;;; Copyright © 2020 Raghav Gururajan <raghavgururajan@disroot.org>
24 ;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
25 ;;; Copyright © 2020 Gabriel Arazas <foo.dogsquared@gmail.com>
26 ;;; Copyright © 2021 Antoine Côté <antoine.cote@posteo.net>
27 ;;; Copyright © 2021 Andy Tai <atai@atai.org>
28 ;;; Copyright © 2021 Ekaitz Zarraga <ekaitz@elenq.tech>
29 ;;; Copyright © 2021, 2022 Vinicius Monego <monego@posteo.net>
30 ;;; Copyright © 2022 Michael Rohleder <mike@rohleder.de>
31 ;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
32 ;;; Copyright © 2022 Zheng Junjie <873216071@qq.com>
33 ;;; Copyright © 2022 Tobias Kortkamp <tobias.kortkamp@gmail.com>
34 ;;; Copyright © 2022 Paul A. Patience <paul@apatience.com>
35 ;;;
36 ;;; This file is part of GNU Guix.
37 ;;;
38 ;;; GNU Guix is free software; you can redistribute it and/or modify it
39 ;;; under the terms of the GNU General Public License as published by
40 ;;; the Free Software Foundation; either version 3 of the License, or (at
41 ;;; your option) any later version.
42 ;;;
43 ;;; GNU Guix is distributed in the hope that it will be useful, but
44 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
45 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46 ;;; GNU General Public License for more details.
47 ;;;
48 ;;; You should have received a copy of the GNU General Public License
49 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
50
51 (define-module (gnu packages graphics)
52 #:use-module (gnu packages)
53 #:use-module (gnu packages algebra)
54 #:use-module (gnu packages audio)
55 #:use-module (gnu packages autotools)
56 #:use-module (gnu packages base)
57 #:use-module (gnu packages bash)
58 #:use-module (gnu packages bison)
59 #:use-module (gnu packages boost)
60 #:use-module (gnu packages build-tools)
61 #:use-module (gnu packages cdrom)
62 #:use-module (gnu packages check)
63 #:use-module (gnu packages compression)
64 #:use-module (gnu packages cpp)
65 #:use-module (gnu packages crypto)
66 #:use-module (gnu packages datastructures)
67 #:use-module (gnu packages documentation)
68 #:use-module (gnu packages flex)
69 #:use-module (gnu packages fonts)
70 #:use-module (gnu packages fontutils)
71 #:use-module (gnu packages freedesktop)
72 #:use-module (gnu packages gettext)
73 #:use-module (gnu packages ghostscript)
74 #:use-module (gnu packages gl)
75 #:use-module (gnu packages glib)
76 #:use-module (gnu packages gnome)
77 #:use-module (gnu packages gnunet)
78 #:use-module (gnu packages graphviz)
79 #:use-module (gnu packages gstreamer)
80 #:use-module (gnu packages gtk)
81 #:use-module (gnu packages haskell-xyz)
82 #:use-module (gnu packages image)
83 #:use-module (gnu packages image-processing)
84 #:use-module (gnu packages imagemagick)
85 #:use-module (gnu packages jemalloc)
86 #:use-module (gnu packages kde-frameworks)
87 #:use-module (gnu packages libusb)
88 #:use-module (gnu packages linux)
89 #:use-module (gnu packages logging)
90 #:use-module (gnu packages llvm)
91 #:use-module (gnu packages lua)
92 #:use-module (gnu packages man)
93 #:use-module (gnu packages maths)
94 #:use-module (gnu packages mp3)
95 #:use-module (gnu packages multiprecision)
96 #:use-module (gnu packages ninja)
97 #:use-module (gnu packages pciutils)
98 #:use-module (gnu packages pdf)
99 #:use-module (gnu packages perl)
100 #:use-module (gnu packages photo)
101 #:use-module (gnu packages pkg-config)
102 #:use-module (gnu packages plotutils)
103 #:use-module (gnu packages pretty-print)
104 #:use-module (gnu packages pth)
105 #:use-module (gnu packages pulseaudio) ; libsndfile, libsamplerate
106 #:use-module (gnu packages python)
107 #:use-module (gnu packages python-build)
108 #:use-module (gnu packages python-xyz)
109 #:use-module (gnu packages qt)
110 #:use-module (gnu packages readline)
111 #:use-module (gnu packages sdl)
112 #:use-module (gnu packages serialization)
113 #:use-module (gnu packages stb)
114 #:use-module (gnu packages swig)
115 #:use-module (gnu packages tbb)
116 #:use-module (gnu packages toolkits)
117 #:use-module (gnu packages upnp)
118 #:use-module (gnu packages video)
119 #:use-module (gnu packages vulkan)
120 #:use-module (gnu packages xiph)
121 #:use-module (gnu packages xml)
122 #:use-module (gnu packages xorg)
123 #:use-module (gnu packages xdisorg)
124 #:use-module (guix build-system copy)
125 #:use-module (guix build-system cmake)
126 #:use-module (guix build-system gnu)
127 #:use-module (guix build-system meson)
128 #:use-module (guix build-system python)
129 #:use-module (guix build-system qt)
130 #:use-module (guix download)
131 #:use-module (guix gexp)
132 #:use-module (guix git-download)
133 #:use-module (guix hg-download)
134 #:use-module ((guix licenses) #:prefix license:)
135 #:use-module (guix packages)
136 #:use-module (guix utils))
137
138 (define-public mmm
139 (package
140 (name "mmm")
141 (version "0.1.1")
142 (source
143 (origin
144 (method git-fetch)
145 (uri
146 (git-reference
147 (url "https://github.com/hodefoting/mmm")
148 (commit version)))
149 (file-name
150 (git-file-name name version))
151 (sha256
152 (base32 "1xmcv6rwinqsbr863rgl9005h2jlmd7k2qrwsc1h4fb8r61ykpjl"))))
153 (build-system meson-build-system)
154 (native-inputs
155 (list luajit pkg-config))
156 (inputs
157 (list alsa-lib sdl sdl2))
158 (synopsis "Memory Mapped Machine")
159 (description "MMM is a shared memory protocol for virtualising access to
160 framebuffer graphics, audio output and input event.")
161 (home-page "https://github.com/hodefoting/mrg")
162 (license license:isc)))
163
164 (define-public directfb
165 (package
166 (name "directfb")
167 (version "1.7.7")
168 (source
169 (origin
170 (method git-fetch)
171 (uri
172 (git-reference
173 (url "https://github.com/deniskropp/DirectFB")
174 (commit "DIRECTFB_1_7_7")))
175 (file-name (git-file-name name version))
176 (sha256
177 (base32 "0bs3yzb7hy3mgydrj8ycg7pllrd2b6j0gxj596inyr7ihssr3i0y"))))
178 (build-system gnu-build-system)
179 (arguments
180 `(#:phases
181 (modify-phases %standard-phases
182 (add-after 'unpack 'remove-buildtime
183 ;; Remove embedded build time for reproducible builds
184 (lambda _
185 (substitute* "src/core/core.c"
186 (("..BUILDTIME..") ""))))
187 (add-after 'unpack 'disable-configure-during-bootstrap
188 (lambda _
189 (substitute* "autogen.sh"
190 (("^.*\\$srcdir/configure.*") ""))
191 #t)))))
192 (native-inputs
193 (list autoconf automake libtool perl pkg-config))
194 (inputs
195 (list alsa-lib
196 ffmpeg
197 freetype
198 glu
199 gstreamer
200 imlib2
201 jasper
202 libjpeg-turbo
203 libcddb
204 libdrm
205 libtimidity
206 libmad
207 libmng
208 libmpeg2
209 libmpeg3
210 mesa
211 libpng
212 sdl
213 (librsvg-for-system)
214 libtiff
215 tslib
216 libvdpau
217 libvorbis
218 wayland
219 libwebp
220 libx11
221 libxcomposite
222 libxext
223 xorgproto
224 zlib))
225 (propagated-inputs
226 (list flux))
227 (synopsis "DFB Graphics Library")
228 (description "DirectFB is a graphics library which was designed with embedded
229 systems in mind. It offers maximum hardware accelerated performance at a
230 minimum of resource usage and overhead.")
231 (home-page "https://github.com/deniskropp/DirectFB")
232 (license license:lgpl2.1+)))
233
234 (define-public flux
235 (package
236 (name "flux")
237 (version "1.4.4")
238 (source
239 (origin
240 (method git-fetch)
241 (uri
242 (git-reference
243 (url "https://github.com/deniskropp/flux")
244 (commit "e45758a")))
245 (file-name (git-file-name name version))
246 (sha256
247 (base32 "11f3ypg0sdq5kj69zgz6kih1yrzgm48r16spyvzwvlswng147410"))))
248 (build-system gnu-build-system)
249 (native-inputs
250 (list autoconf automake libtool pkg-config))
251 (synopsis "Interface description language")
252 (description "Flux is an interface description language used by DirectFB.
253 Fluxcomp compiles .flux files to .cpp or .c files.")
254 (home-page "https://www.directfb.org/")
255 (license license:lgpl2.1+))) ; Same as DirectFB
256
257 (define-public fox
258 (package
259 (name "fox")
260 (version "1.6.57")
261 (source
262 (origin
263 (method url-fetch)
264 (uri
265 (string-append "https://fox-toolkit.org/ftp/fox-" version ".tar.gz"))
266 (sha256
267 (base32 "08w98m6wjadraw1pi13igzagly4b2nfa57kdqdnkjfhgkvg1bvv5"))))
268 (build-system gnu-build-system)
269 (arguments
270 `(#:phases
271 (modify-phases %standard-phases
272 (add-after 'unpack 'patch
273 (lambda _
274 (substitute* "configure"
275 (("-I/usr/include/freetype2")
276 (string-append "-I"
277 (string-append
278 (assoc-ref %build-inputs "freetype")
279 "/include/freetype2"))))
280 #t)))))
281 (native-inputs
282 (list doxygen))
283 (inputs
284 `(("bzip2" ,lbzip2)
285 ("freetype" ,freetype)
286 ("gl" ,mesa)
287 ("glu" ,glu)
288 ("jpeg" ,libjpeg-turbo)
289 ("png" ,libpng)
290 ("tiff" ,libtiff)
291 ("x11" ,libx11)
292 ("xcursor" ,libxcursor)
293 ("xext" ,libxext)
294 ("xfixes" ,libxfixes)
295 ("xft" ,libxft)
296 ("xinput" ,libxi)
297 ("xrandr" ,libxrandr)
298 ("xrender" ,libxrender)
299 ("xshm" ,libxshmfence)
300 ("zlib" ,zlib)))
301 (synopsis "Widget Toolkit for building GUI")
302 (description"FOX (Free Objects for X) is a C++ based Toolkit for developing
303 Graphical User Interfaces easily and effectively. It offers a wide, and
304 growing, collection of Controls, and provides state of the art facilities such
305 as drag and drop, selection, as well as OpenGL widgets for 3D graphical
306 manipulation. FOX also implements icons, images, and user-convenience features
307 such as status line help, and tooltips. Tooltips may even be used for 3D
308 objects!")
309 (home-page "http://www.fox-toolkit.org")
310 (license license:lgpl2.1+)))
311
312 (define-public autotrace
313 (let ((commit "travis-20190624.59")
314 (version-base "0.40.0"))
315 (package
316 (name "autotrace")
317 (version (string-append version-base "-"
318 (if (string-prefix? "travis-" commit)
319 (string-drop commit 7)
320 commit)))
321 (source (origin
322 (method git-fetch)
323 (uri (git-reference
324 (url "https://github.com/autotrace/autotrace")
325 (commit commit)))
326 (file-name (git-file-name name version))
327 (patches (search-patches "autotrace-glib-compat.patch"))
328 (sha256
329 (base32
330 "0mk4yavy42dj0pszr1ggnggpvmzs4ds46caa9wr55cqsypn7bq6s"))))
331 (build-system gnu-build-system)
332 (arguments
333 `(#:phases (modify-phases %standard-phases
334 ;; See: https://github.com/autotrace/autotrace/issues/27.
335 (add-after 'unpack 'include-spline.h-header
336 (lambda _
337 (substitute* "Makefile.am"
338 ((".*src/types.h.*" all)
339 (string-append all "\t\tsrc/spline.h \\\n")))
340 #t))
341 ;; See: https://github.com/autotrace/autotrace/issues/26.
342 (replace 'check
343 (lambda _
344 (invoke "sh" "tests/runtests.sh"))))))
345 (native-inputs
346 `(("which" ,which)
347 ("pkg-config" ,pkg-config)
348 ("autoconf" ,autoconf)
349 ("automake" ,automake)
350 ("intltool" ,intltool)
351 ("libtool" ,libtool)
352 ("gettext" ,gettext-minimal)))
353 (inputs
354 `(("glib" ,glib)
355 ("libjpeg" ,libjpeg-turbo)
356 ("libpng" ,libpng)
357 ("imagemagick" ,imagemagick)
358 ("pstoedit" ,pstoedit)))
359 (home-page "https://github.com/autotrace/autotrace")
360 (synopsis "Bitmap to vector graphics converter")
361 (description "AutoTrace is a utility for converting bitmap into vector
362 graphics. It can trace outlines and midlines, effect color reduction or
363 despeckling and has support for many input and output formats. It can be used
364 with the @command{autotrace} utility or as a C library, @code{libautotrace}.")
365 (license (list license:gpl2+ ;for the utility itself
366 license:lgpl2.1+))))) ;for use as a library
367
368 (define-public embree
369 (package
370 (name "embree")
371 (version "3.12.1")
372 (source (origin
373 (method git-fetch)
374 (uri (git-reference
375 (url "https://github.com/embree/embree")
376 (commit (string-append "v" version))))
377 (file-name (git-file-name name version))
378 (sha256
379 (base32
380 "0aznd16n7h8g3f6jcahzfp1dq4r7wayqvn03wsaskiq2dvsi4srd"))))
381 (build-system cmake-build-system)
382 (arguments
383 `(#:tests? #f ; no tests (apparently)
384 #:configure-flags
385 (list
386 "-DEMBREE_ISPC_SUPPORT=OFF")))
387 (inputs
388 (list tbb glfw))
389 (home-page "https://www.embree.org/")
390 (synopsis "High performance ray tracing kernels")
391 (description
392 "Embree is a collection of high-performance ray tracing kernels.
393 Embree is meant to increase performance of photo-realistic rendering
394 applications.")
395 (license license:asl2.0)))
396
397 (define-public openvdb
398 (package
399 (name "openvdb")
400 (version "8.2.0")
401 (source (origin
402 (method git-fetch)
403 (uri (git-reference
404 (url "https://github.com/AcademySoftwareFoundation/openvdb/")
405 (commit (string-append "v" version))
406 (recursive? #t)))
407 (file-name (git-file-name name version))
408 (sha256
409 (base32
410 "0856697hnwk8xsp29kx8y2p1kliy0bdwfsznxm38v4690vna15rk"))))
411 (build-system cmake-build-system)
412 (arguments
413 `(#:configure-flags
414 (list (string-append "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath="
415 (assoc-ref %outputs "out") "/lib"))))
416 (inputs
417 (list boost c-blosc ilmbase tbb zlib))
418 (native-inputs
419 (list pkg-config))
420 (home-page "https://www.openvdb.org/")
421 (synopsis "Sparse volume data structure and tools")
422 (description "OpenVDB is a C++ library comprising a hierarchical data
423 structure and a large suite of tools for the efficient storage and
424 manipulation of sparse volumetric data discretized on three-dimensional grids.
425 It was developed by DreamWorks Animation for use in volumetric applications
426 typically encountered in feature film production.")
427 (license license:mpl2.0)))
428
429 (define-public blender
430 (package
431 (name "blender")
432 (version "3.0.1")
433 (source (origin
434 (method url-fetch)
435 (uri (string-append "https://download.blender.org/source/"
436 "blender-" version ".tar.xz"))
437 (sha256
438 (base32
439 "0hblgls5pclqamsxk0vb14f4fm30hdiq7fb2bm5mq2ly4sb0mfqr"))))
440 (build-system cmake-build-system)
441 (arguments
442 (let ((python-version (version-major+minor (package-version python))))
443 `(;; Test files are very large and not included in the release tarball.
444 #:tests? #f
445 #:configure-flags
446 (list "-DWITH_CODEC_FFMPEG=ON"
447 "-DWITH_CODEC_SNDFILE=ON"
448 "-DWITH_CYCLES=ON"
449 "-DWITH_DOC_MANPAGE=ON"
450 "-DWITH_FFTW3=ON"
451 "-DWITH_IMAGE_OPENJPEG=ON"
452 "-DWITH_INPUT_NDOF=ON"
453 "-DWITH_INSTALL_PORTABLE=OFF"
454 "-DWITH_JACK=ON"
455 "-DWITH_MOD_OCEANSIM=ON"
456 "-DWITH_OPENVDB=ON"
457 "-DWITH_OPENSUBDIV=ON"
458 "-DWITH_PYTHON_INSTALL=OFF"
459 (string-append "-DPYTHON_LIBRARY=python" ,python-version)
460 (string-append "-DPYTHON_LIBPATH=" (assoc-ref %build-inputs "python")
461 "/lib")
462 (string-append "-DPYTHON_INCLUDE_DIR=" (assoc-ref %build-inputs "python")
463 "/include/python" ,python-version)
464 (string-append "-DPYTHON_VERSION=" ,python-version)
465 (string-append "-DPYTHON_NUMPY_INCLUDE_DIRS="
466 (assoc-ref %build-inputs "python-numpy")
467 "/lib/python" ,python-version "/site-packages/numpy/core/include/")
468 (string-append "-DPYTHON_NUMPY_PATH="
469 (assoc-ref %build-inputs "python-numpy")
470 "/lib/python" ,python-version "/site-packages/"))
471 #:phases
472 (modify-phases %standard-phases
473 ;; XXX This file doesn't exist in the Git sources but will probably
474 ;; exist in the eventual 2.80 source tarball.
475 (add-after 'unpack 'fix-broken-import
476 (lambda _
477 (substitute* "release/scripts/addons/io_scene_fbx/json2fbx.py"
478 (("import encode_bin") "from . import encode_bin"))
479 #t))
480 (add-after 'set-paths 'add-ilmbase-include-path
481 (lambda* (#:key inputs #:allow-other-keys)
482 ;; OpenEXR propagates ilmbase, but its include files do not
483 ;; appear in the C_INCLUDE_PATH, so we need to add
484 ;; "$ilmbase/include/OpenEXR/" to the C_INCLUDE_PATH to satisfy
485 ;; the dependency on "half.h" and "Iex.h".
486 (let ((headers (string-append
487 (assoc-ref inputs "ilmbase")
488 "/include/OpenEXR")))
489 (setenv "C_INCLUDE_PATH"
490 (string-append headers ":"
491 (or (getenv "C_INCLUDE_PATH") "")))
492 (setenv "CPLUS_INCLUDE_PATH"
493 (string-append headers ":"
494 (or (getenv "CPLUS_INCLUDE_PATH") ""))))))))))
495 (inputs
496 `(("boost" ,boost)
497 ("jemalloc" ,jemalloc)
498 ("libx11" ,libx11)
499 ("libxi" ,libxi)
500 ("libxrender" ,libxrender)
501 ("opencolorio" ,opencolorio)
502 ("openimageio" ,openimageio)
503 ("openexr" ,openexr-2)
504 ("opensubdiv" ,opensubdiv)
505 ("ilmbase" ,ilmbase)
506 ("openjpeg" ,openjpeg)
507 ("libjpeg" ,libjpeg-turbo)
508 ("libpng" ,libpng)
509 ("libtiff" ,libtiff)
510 ("ffmpeg" ,ffmpeg)
511 ("fftw" ,fftw)
512 ("gmp" ,gmp) ;; needed for boolean operations on meshes
513 ("jack" ,jack-1)
514 ("libsndfile" ,libsndfile)
515 ("freetype" ,freetype)
516 ("glew" ,glew)
517 ("openal" ,openal)
518 ("pugixml" ,pugixml)
519 ("python" ,python)
520 ("python-numpy" ,python-numpy)
521 ("openvdb" ,openvdb)
522 ("tbb" ,tbb)
523 ("zlib" ,zlib)
524 ("zstd" ,zstd "lib")
525 ("embree" ,embree)))
526 (home-page "https://blender.org/")
527 (synopsis "3D graphics creation suite")
528 (description
529 "Blender is a 3D graphics creation suite. It supports the entirety of
530 the 3D pipeline—modeling, rigging, animation, simulation, rendering,
531 compositing and motion tracking, even video editing and game creation. The
532 application can be customized via its API for Python scripting.")
533 (license license:gpl2+)))
534
535 (define-public goxel
536 (package
537 (name "goxel")
538 (version "0.10.8")
539 (source (origin
540 (method git-fetch)
541 (uri (git-reference
542 (url "https://github.com/guillaumechereau/goxel")
543 (commit (string-append "v" version))))
544 (file-name (git-file-name name version))
545 (sha256
546 (base32
547 "0qvz566awhp03yp696fn3c80hnky41fpbi4sqg4lx69ibx4zvl9k"))))
548 (build-system gnu-build-system)
549 (arguments
550 '(#:tests? #f
551 #:phases (modify-phases %standard-phases (delete 'configure))
552 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
553 "release")))
554 (native-inputs
555 (list pkg-config))
556 (inputs
557 `(("gtk3" ,gtk+)
558 ("glfw" ,glfw)
559 ("scons" ,scons)))
560 (home-page "https://goxel.xyz/")
561 (synopsis "Voxel editor")
562 (description
563 "Goxel is a voxel editor that features unlimited scene size, unlimited
564 history buffer, 24-bit RGB colors, layers, procedural rendering, ray tracing,
565 and export to various formats including the format used by Magicavoxel.")
566 (license license:gpl3+)))
567
568 (define-public assimp
569 (package
570 (name "assimp")
571 (version "5.2.2")
572 (source (origin
573 (method git-fetch)
574 (uri (git-reference
575 (url "https://github.com/assimp/assimp")
576 (commit (string-append "v" version))))
577 (file-name (git-file-name name version))
578 (sha256
579 (base32
580 "1kjifakjnpm89410pw27wq21fn975gfq46kn9zs3h8bryldvvlgk"))))
581 (build-system cmake-build-system)
582 (inputs
583 (list zlib))
584 (home-page "http://www.assimp.org/")
585 (synopsis "Asset import library")
586 (description
587 "The Open Asset Import Library loads more than 40 3D file formats into
588 one unified data structure. Additionally, assimp features various mesh post
589 processing tools: normals and tangent space generation, triangulation, vertex
590 cache locality optimization, removal of degenerate primitives and duplicate
591 vertices, sorting by primitive type, merging of redundant materials and many
592 more.")
593 (license license:bsd-3)))
594
595 (define-public mikktspace
596 ;; The latest commit is used as there is no release.
597 (let ((commit "3e895b49d05ea07e4c2133156cfa94369e19e409")
598 (revision "0"))
599 (package
600 (name "mikktspace")
601 (version (git-version "0.0.0" revision commit))
602 (source (origin
603 (method git-fetch)
604 (uri (git-reference
605 (url "https://github.com/mmikk/MikkTSpace")
606 (commit commit)))
607 (file-name (git-file-name name version))
608 (sha256
609 (base32
610 "1rjh9zflx51hdhnfadal87v4hhkrbprkv692hjkg9wkxx0ch39zi"))))
611 (build-system gnu-build-system)
612 (arguments
613 (list #:tests? #f
614 #:phases
615 #~(modify-phases %standard-phases
616 (delete 'configure)
617 (replace 'build
618 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
619 (invoke #$(cc-for-target) "mikktspace.c" "-O2" "-g" "-fPIC"
620 "-shared" "-o" "libmikktspace.so")))
621 (replace 'install
622 (lambda _
623 (install-file "mikktspace.h"
624 (string-append #$output "/include"))
625 (install-file "libmikktspace.so"
626 (string-append #$output "/lib")))))))
627 (home-page "http://www.mikktspace.com/")
628 (synopsis "Library for a common standard for tangent spaces")
629 (description
630 "This package provides a common standard tangent space library used in
631 baking tools to produce normal maps.")
632 (license license:zlib))))
633
634 (define-public openshadinglanguage
635 (package
636 (name "openshadinglanguage")
637 (version "1.11.16.0")
638 (source
639 (origin
640 (method git-fetch)
641 (uri (git-reference
642 (url "https://github.com/AcademySoftwareFoundation/OpenShadingLanguage")
643 (commit (string-append "v" version))))
644 (file-name (git-file-name name version))
645 (sha256
646 (base32 "0x0lc163vl2b57l75bf5zxlr6vm2y1f1izlxdnrw3vsapv3r9k9g"))))
647 (build-system cmake-build-system)
648 (arguments
649 `(#:configure-flags (list "-DUSE_PARTIO=OFF") ; TODO: not packaged
650 #:phases
651 (modify-phases %standard-phases
652 (add-after 'set-paths 'add-ilmbase-include-path
653 (lambda* (#:key inputs #:allow-other-keys)
654 ;; OpenEXR 2 propagates ilmbase, but its include files do not
655 ;; appear in the C_INCLUDE_PATH.
656 (let ((headers (string-append
657 (assoc-ref inputs "ilmbase")
658 "/include/OpenEXR")))
659 (setenv "C_INCLUDE_PATH"
660 (string-append headers ":"
661 (or (getenv "C_INCLUDE_PATH") "")))
662 (setenv "CPLUS_INCLUDE_PATH"
663 (string-append headers ":"
664 (or (getenv "CPLUS_INCLUDE_PATH") ""))))))
665 (replace 'check
666 (lambda* (#:key tests? #:allow-other-keys)
667 (when tests?
668 (invoke "ctest" "--exclude-regex"
669 (string-join
670 (list
671 "osl-imageio" ; OIIO not compiled with freetype
672 "osl-imageio.opt" ; OIIO not compiled with freetype
673 "texture-udim" ; file does not exist
674 "texture-udim.opt" ; file does not exist
675 "example-deformer" ; could not find OSLConfig
676 "python-oslquery") ; no module oslquery
677 "|"))))))))
678 (native-inputs
679 (list bison
680 clang-9
681 flex
682 llvm-9
683 pybind11
684 python-wrapper))
685 (inputs
686 (list boost
687 imath
688 openexr-2
689 openimageio
690 pugixml
691 qtbase-5
692 zlib))
693 (home-page "https://github.com/AcademySoftwareFoundation/OpenShadingLanguage")
694 (synopsis "Shading language for production GI renderers")
695 (description "Open Shading Language (OSL) is a language for programmable
696 shading in advanced renderers and other applications, ideal for describing
697 materials, lights, displacement, and pattern generation.")
698 (license license:bsd-3)))
699
700 (define-public cgal
701 (package
702 (name "cgal")
703 (version "5.2.2")
704 (source (origin
705 (method url-fetch)
706 (uri (string-append
707 "https://github.com/CGAL/cgal/releases/download/v" version
708 "/CGAL-" version ".tar.xz"))
709 (sha256
710 (base32
711 "0yjzq12ivizp23y7zqm30x20psv9gzwbcdrhyd3f7h0ds94m1c40"))))
712 (build-system cmake-build-system)
713 (arguments
714 `(#:configure-flags
715 ;; Prevent two mostly-duplicate directories. Use Guix's versioned
716 ;; default for licences instead of CGAL's unversioned one.
717 (list (string-append "-DCGAL_INSTALL_DOC_DIR=share/doc/"
718 ,name "-" ,version))
719 #:tests? #f)) ; no test target
720 (inputs
721 (list mpfr gmp boost))
722 (home-page "https://www.cgal.org/")
723 (synopsis "Computational geometry algorithms library")
724 (description
725 "CGAL provides easy access to efficient and reliable geometric algorithms
726 in the form of a C++ library. CGAL is used in various areas needing geometric
727 computation, such as: computer graphics, scientific visualization, computer
728 aided design and modeling, geographic information systems, molecular biology,
729 medical imaging, robotics and motion planning, mesh generation, numerical
730 methods, etc. It provides data structures and algorithms such as
731 triangulations, Voronoi diagrams, polygons, polyhedra, mesh generation, and
732 many more.")
733
734 ;; The 'LICENSE' file explains that a subset is available under more
735 ;; permissive licenses.
736 (license license:gpl3+)))
737
738 (define-public imath
739 (package
740 (name "imath")
741 (version "3.1.3")
742 (source
743 (origin
744 (method git-fetch)
745 (uri (git-reference
746 (url "https://github.com/AcademySoftwareFoundation/Imath")
747 (commit (string-append "v" version))))
748 (file-name (git-file-name name version))
749 (sha256
750 (base32 "1nyld18mf220ghm1vidnfnn0rdns9z5i4l9s66xgd0kfdgarb31f"))))
751 (build-system cmake-build-system)
752 (arguments
753 ;; XXX: On i686-linux, tests fail due to rounding issues (excess
754 ;; precision), as was discussed and patched long ago:
755 ;; <https://issues.guix.gnu.org/22049>. It seems the relevant fixes
756 ;; didn't make it upstream, so skip tests.
757 (list #:tests? (not (target-x86-32?))))
758 (home-page "https://github.com/AcademySoftwareFoundation/Imath")
759 (synopsis "Library of math operations for computer graphics")
760 (description
761 "Imath is a C++ representation of 2D and 3D vectors and matrices and other
762 mathematical objects, functions, and data types common in computer graphics
763 applications, including the \"half\" 16-bit floating-point type.")
764 (license license:bsd-3)))
765
766 (define-public ilmbase
767 (package
768 (name "ilmbase")
769 (version "2.5.7")
770 (source (origin
771 (method git-fetch)
772 (uri (git-reference
773 (url "https://github.com/openexr/openexr")
774 (commit (string-append "v" version))))
775 (file-name (git-file-name "ilmbase" version))
776 (sha256
777 (base32
778 "1vja0rbilcd1wn184w8nbcmck00n7bfwlddwiaxw8dhj64nx4468"))
779 (patches (search-patches "ilmbase-fix-tests.patch"))))
780 (build-system cmake-build-system)
781 (arguments
782 (list #:phases #~(modify-phases %standard-phases
783 (add-after 'unpack 'change-directory
784 (lambda _
785 (chdir "IlmBase")
786 #t))
787 #$@(if (target-x86-32?)
788 #~((add-after 'change-directory 'skip-test
789 (lambda _
790 ;; XXX: This test fails on i686,
791 ;; possibly due to excess precision when
792 ;; comparing floats. Skip it.
793 (substitute* "ImathTest/testFun.cpp"
794 (("assert \\(bit_cast<unsigned>.*" all)
795 (string-append "// " all "\n"))))))
796 #~()))))
797 (home-page "https://www.openexr.com/")
798 (synopsis "Utility C++ libraries for threads, maths, and exceptions")
799 (description
800 "IlmBase provides several utility libraries for C++. Half is a class
801 that encapsulates ILM's 16-bit floating-point format. IlmThread is a thread
802 abstraction. Imath implements 2D and 3D vectors, 3x3 and 4x4 matrices,
803 quaternions and other useful 2D and 3D math functions. Iex is an
804 exception-handling library.")
805 (license license:bsd-3)))
806
807 (define-public lib2geom
808 (package
809 (name "lib2geom")
810 (version "1.1")
811 (source (origin
812 (method git-fetch)
813 (uri (git-reference
814 (url "https://gitlab.com/inkscape/lib2geom.git")
815 (commit version)))
816 (file-name (git-file-name name version))
817 (sha256
818 (base32
819 "03bx9k1m4bfhmx0ldsg0bks6i8h7fmvl5vbg6gmpq0bk0nkmpnmv"))))
820 (build-system cmake-build-system)
821 (arguments
822 `(#:imported-modules ((guix build python-build-system)
823 ,@%cmake-build-system-modules)
824 #:configure-flags '("-D2GEOM_BUILD_SHARED=ON"
825 "-D2GEOM_BOOST_PYTHON=ON"
826 ;; Compiling the Cython bindings fail (see:
827 ;; https://gitlab.com/inkscape/lib2geom/issues/21).
828 "-D2GEOM_CYTHON_BINDINGS=OFF")
829 #:phases
830 (modify-phases %standard-phases
831 (add-after 'unpack 'patch-python-lib-install-path
832 (lambda* (#:key inputs outputs #:allow-other-keys)
833 (let* ((python-version (@ (guix build python-build-system)
834 python-version))
835 (python-maj-min-version (python-version
836 (assoc-ref inputs "python")))
837 (site-package (string-append
838 (assoc-ref outputs "out")
839 "/lib/python" python-maj-min-version
840 "/site-packages")))
841 (substitute* '("src/cython/CMakeLists.txt"
842 "src/py2geom/CMakeLists.txt")
843 (("PYTHON_LIB_INSTALL \"[^\"]*\"")
844 (format #f "PYTHON_LIB_INSTALL ~s" site-package))))))
845 ,@(if (target-x86-32?)
846 `((add-after 'unpack 'skip-faulty-test
847 (lambda _
848 ;; This test fails on i686 when comparing floating point
849 ;; values, probably due to excess precision. However,
850 ;; '-fexcess-precision' is not implemented for C++ in
851 ;; GCC 10 so just skip it.
852 (substitute* "tests/CMakeLists.txt"
853 (("bezier-test") "")))))
854 '()))))
855 (native-inputs `(("python" ,python-wrapper)
856 ("googletest" ,googletest)
857 ("pkg-config" ,pkg-config)))
858 (inputs `(("cairo" ,cairo)
859 ("pycairo" ,python-pycairo)
860 ("double-conversion" ,double-conversion)
861 ("glib" ,glib)
862 ("gsl" ,gsl)))
863 (propagated-inputs
864 (list boost)) ;referred to in 2geom/pathvector.h.
865 (home-page "https://gitlab.com/inkscape/lib2geom/")
866 (synopsis "C++ 2D graphics library")
867 (description "2geom is a C++ library of mathematics for paths, curves,
868 and other geometric calculations. Designed for vector graphics, it tackles
869 Bézier curves, conic sections, paths, intersections, transformations, and
870 basic geometries.")
871 ;; Because the library is linked with the GNU Scientific Library
872 ;; (GPLv3+), the combined work must be licensed as GPLv3+ (see:
873 ;; https://gitlab.com/inkscape/inkscape/issues/784).
874 (license license:gpl3+)))
875
876 (define-public lib2geom-1.2
877 (package
878 (inherit lib2geom)
879 (version "1.2")
880 (source (origin
881 (method git-fetch)
882 (uri (git-reference
883 (url "https://gitlab.com/inkscape/lib2geom")
884 (commit version)))
885 (file-name (git-file-name "lib2geom" version))
886 (sha256
887 (base32
888 "0dq981g894hmvhd6rmfl1w32mksg9hpvpjs1qvfxrnz87rhkknj8"))))))
889
890 (define-public python-booleanoperations
891 (package
892 (name "python-booleanoperations")
893 (version "0.9.0")
894 (source
895 (origin
896 (method url-fetch)
897 (uri (pypi-uri "booleanOperations" version ".zip"))
898 (sha256
899 (base32 "1f41lb19m8azchl1aqz6j5ycbspb8jsf1cnn42hlydxd68f85ylc"))))
900 (build-system python-build-system)
901 (propagated-inputs (list python-fonttools python-pyclipper))
902 (native-inputs
903 (list python-defcon-bootstrap
904 python-fontpens-bootstrap
905 python-setuptools-scm
906 python-pytest
907 python-wheel
908 unzip))
909 (home-page "https://github.com/typemytype/booleanOperations")
910 (synopsis "Boolean operations on paths")
911 (description "Boolean operations on paths which uses a super fast
912 @url{http://www.angusj.com/delphi/clipper.php, polygon clipper library by
913 Angus Johnson}.")
914 (license license:expat)))
915
916 (define-public pstoedit
917 (package
918 (name "pstoedit")
919 (version "3.77")
920 (source (origin
921 (method url-fetch)
922 (uri (string-append "mirror://sourceforge/pstoedit/pstoedit/"
923 version "/pstoedit-" version ".tar.gz"))
924 (sha256
925 (base32
926 "02av76j75g5sq3bg353yl6dlllda9ihmmk4c8hvgiscix816nv4s"))))
927 (build-system gnu-build-system)
928 (native-inputs
929 (list pkg-config))
930 (inputs
931 `(("ghostscript" ,ghostscript)
932 ("imagemagick" ,imagemagick)
933 ("libplot" ,plotutils)
934 ("libjpeg" ,libjpeg-turbo)
935 ("zlib" ,zlib))) ;else libp2edrvmagick++.so fails to link
936 (home-page "http://www.pstoedit.net/")
937 (synopsis "Converter for PostScript and PDF graphics")
938 (description "The @code{pstoedit} utility allows translating graphics
939 in the PostScript or PDF (Portable Document Format) formats to various
940 other vector formats such as:
941 @itemize
942 @item Tgif (.obj)
943 @item gnuplot
944 @item xfig (.fig)
945 @item Flattened PostScript
946 @item DXF, a CAD (Computed-Aided Design) exchange format
947 @item PIC (for troff/groff)
948 @item MetaPost (for usage with TeX/LaTeX)
949 @item LaTeX2e picture
950 @item GNU Metafile (for use with plotutils/libplot)
951 @item Any format supported by ImageMagick
952 @end itemize")
953 (license license:gpl2+)))
954
955 (define-public alembic
956 (package
957 (name "alembic")
958 (version "1.8.3")
959 (source
960 (origin
961 (method git-fetch)
962 (uri (git-reference
963 (url "https://github.com/alembic/alembic")
964 (commit version)))
965 (file-name (git-file-name name version))
966 (sha256
967 (base32 "0glfx3cm7r8zn3cn7j4x4ch1ab6igfis0i2lcy23jc56q87r8yj2"))))
968 (build-system cmake-build-system)
969 (arguments
970 `(#:configure-flags (list "-DUSE_HDF5=ON")))
971 (inputs
972 (list hdf5 imath zlib))
973 (home-page "http://www.alembic.io/")
974 (synopsis "Framework for storing and sharing scene data")
975 (description "Alembic is a computer graphics interchange framework. It
976 distills complex, animated scenes into a set of baked geometric results.")
977 (license license:bsd-3)))
978
979 (define-public mangohud
980 (package
981 (name "mangohud")
982 (version "0.6.7")
983 (source
984 (origin
985 (method git-fetch)
986 (uri (git-reference
987 (url "https://github.com/flightlessmango/MangoHud/")
988 (commit (string-append "v" version))))
989 (file-name (git-file-name name version))
990 (sha256
991 (base32 "0n2x6agv2j8nd6h1998dqsphb7k57zx8vsayv47dqix28kg5kixz"))))
992 (build-system meson-build-system)
993 (arguments
994 (list
995 #:build-type "release"
996 #:configure-flags
997 #~(list "-Duse_system_vulkan=enabled"
998 "-Duse_system_spdlog=enabled"
999 "-Dwith_xnvctrl=disabled"
1000 "-Dappend_libdir_mangohud=false"
1001 (string-append "-Dvulkan_datadir="
1002 #$(this-package-input "vulkan-headers") "/share"))
1003 #:phases
1004 #~(modify-phases %standard-phases
1005 ;; Mangohud tries to build the imgui library as a meson submodule,
1006 ;; so we change the dependency to the imgui input instead.
1007 (add-after 'unpack 'unbundle-imgui
1008 (lambda _
1009 (substitute* "meson.build"
1010 (("dearimgui_sp = .*")
1011 "")
1012 (("dearimgui_sp.get_variable\\('imgui_dep'\\)")
1013 (string-append
1014 "declare_dependency(dependencies: "
1015 "cpp.find_library('imgui'), include_directories: '"
1016 #$(this-package-input "imgui") "/include/imgui')")))))
1017 (add-after 'unpack 'patch-paths
1018 (lambda* (#:key inputs #:allow-other-keys)
1019 (substitute* "src/meson.build"
1020 (("\\\\\\$LIB")
1021 "lib"))
1022 (substitute* "src/overlay.cpp"
1023 (("glxinfo")
1024 (search-input-file inputs "bin/glxinfo")))
1025 (substitute* "src/loaders/loader_x11.cpp"
1026 (("libX11.so.6")
1027 (search-input-file inputs "lib/libX11.so.6")))
1028 (substitute* "src/pci_ids.cpp"
1029 (("/usr/share/hwdata/pci.ids")
1030 (search-input-file inputs "share/hwdata/pci.ids")))
1031 (substitute* "src/dbus.cpp"
1032 (("libdbus-1.so.3")
1033 (search-input-file inputs "lib/libdbus-1.so.3"))))))))
1034 (inputs
1035 (list dbus
1036 glslang
1037 `(,hwdata "pci")
1038 imgui-1.86
1039 libx11
1040 mesa
1041 mesa-utils
1042 python-mako
1043 spdlog
1044 vulkan-headers
1045 vulkan-loader))
1046 (native-inputs (list pkg-config python))
1047 (home-page "https://github.com/flightlessmango/MangoHud/")
1048 (synopsis "Vulkan and OpenGL overlay for monitoring performance and hardware")
1049 (description "MangoHud is a Vulkan and OpenGL overlay for monitoring
1050 frames per second (FPS), temperatures, CPU/GPU load and more.")
1051 (license license:expat)))
1052
1053 (define-public ogre
1054 (package
1055 (name "ogre")
1056 (version "13.3.1")
1057 (source
1058 (origin
1059 (method git-fetch)
1060 (uri (git-reference
1061 (url "https://github.com/OGRECave/ogre")
1062 (commit (string-append "v" version))))
1063 (file-name (git-file-name name version))
1064 (sha256
1065 (base32 "157vpfzivg2wf349glyd0cpbyaw1j3fm4nggban70pghql3x48kb"))))
1066 (build-system cmake-build-system)
1067 (arguments
1068 '(#:phases
1069 (modify-phases %standard-phases
1070 (add-before 'configure 'unpack-imgui
1071 (lambda* (#:key inputs #:allow-other-keys)
1072 (copy-recursively (assoc-ref inputs "imgui-source")
1073 "../imgui-source")))
1074 (add-before 'configure 'pre-configure
1075 ;; CMakeLists.txt forces a CMAKE_INSTALL_RPATH value. As
1076 ;; a consequence, we cannot suggest ours in configure flags. Fix
1077 ;; it.
1078 (lambda* (#:key inputs outputs #:allow-other-keys)
1079 (substitute* "CMakeLists.txt"
1080 (("set\\(CMAKE_INSTALL_RPATH .*") "")))))
1081 #:configure-flags
1082 (let* ((out (assoc-ref %outputs "out"))
1083 (runpath
1084 (string-join (list (string-append out "/lib")
1085 (string-append out "/lib/OGRE"))
1086 ";")))
1087 (list (string-append "-DCMAKE_INSTALL_RPATH=" runpath)
1088 "-DIMGUI_DIR=../imgui-source"
1089 "-DOGRE_BUILD_DEPENDENCIES=OFF"
1090 "-DOGRE_BUILD_TESTS=TRUE"
1091 "-DOGRE_INSTALL_DOCS=TRUE"
1092 "-DOGRE_INSTALL_SAMPLES=TRUE"
1093 "-DOGRE_INSTALL_SAMPLES_SOURCE=TRUE"))))
1094 (native-inputs `(("doxygen" ,doxygen)
1095 ("imgui-source" ,(package-source imgui-1.86))
1096 ("googletest" ,googletest)
1097 ("pkg-config" ,pkg-config)
1098 ("python" ,python)))
1099 (inputs (list freeimage
1100 freetype
1101 libxaw
1102 libxrandr
1103 libxt
1104 mesa
1105 pugixml
1106 sdl2
1107 zlib))
1108 (synopsis "Scene-oriented, flexible 3D engine written in C++")
1109 (description
1110 "OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented,
1111 flexible 3D engine written in C++ designed to make it easier and more intuitive
1112 for developers to produce applications utilising hardware-accelerated 3D
1113 graphics.")
1114 (home-page "https://www.ogre3d.org/")
1115 (license license:expat)))
1116
1117 (define-public openexr
1118 (package
1119 (name "openexr")
1120 (version "3.1.3")
1121 (source (origin
1122 (method git-fetch)
1123 (uri (git-reference
1124 (url
1125 "https://github.com/AcademySoftwareFoundation/openexr")
1126 (commit (string-append "v" version))))
1127 (file-name (git-file-name name version))
1128 (sha256
1129 (base32
1130 "0c9vla0kbsbbhkk42jlbf94nzfb1anqh7dy9b0b3nna1qr6v4bh6"))))
1131 (build-system cmake-build-system)
1132 (arguments
1133 (list #:phases
1134 #~(modify-phases %standard-phases
1135 (add-after 'unpack 'patch-test-directory
1136 (lambda _
1137 (substitute* (list
1138 "src/test/OpenEXRUtilTest/tmpDir.h"
1139 "src/test/OpenEXRFuzzTest/tmpDir.h"
1140 "src/test/OpenEXRTest/tmpDir.h"
1141 "src/test/OpenEXRCoreTest/main.cpp")
1142 (("/var/tmp")
1143 "/tmp"))))
1144 #$@(if (target-64bit?)
1145 #~()
1146 #~((add-after 'patch-test-directory 'disable-broken-tests
1147 (lambda _
1148 ;; Disable tests that fail at least on i686-linux.
1149 (substitute* '("src/test/OpenEXRCoreTest/main.cpp"
1150 "src/test/OpenEXRTest/main.cpp")
1151 (("TEST \\(testCompression, \"basic\"\\);")
1152 "")
1153 (("TEST\\( testNoCompression, \"core_compression\" \\);")
1154 "")
1155 (("TEST\\( testRLECompression, \"core_compression\" \\);")
1156 "")
1157 (("TEST\\( testZIPCompression, \"core_compression\" \\);")
1158 "")
1159 (("TEST\\( testZIPSCompression, \"core_compression\" \\);")
1160 "")
1161 (("TEST\\( testB44Compression, \"core_compression\" \\);")
1162 "")
1163 (("TEST\\( testB44ACompression, \"core_compression\" \\);")
1164 "")
1165 (("TEST \\(testOptimizedInterleavePatterns, \"basic\"\\);")
1166 "")))))))))
1167 (inputs (list imath zlib))
1168 (home-page "https://www.openexr.com/")
1169 (synopsis "High-dynamic-range file format library")
1170 (description
1171 "OpenEXR provides the specification and reference implementation of the
1172 EXR file format. The purpose of EXR format is to accurately and efficiently
1173 represent high-dynamic-range scene-linear image data and associated metadata,
1174 with strong support for multi-part, multi-channel use cases.")
1175 (license license:bsd-3)))
1176
1177 (define-public openexr-2
1178 (package
1179 (name "openexr")
1180 (version (package-version ilmbase))
1181 (source (origin
1182 (inherit (package-source ilmbase))
1183 (file-name (git-file-name "openexr" version))))
1184 (build-system cmake-build-system)
1185 (arguments
1186 `(#:phases
1187 (modify-phases %standard-phases
1188 (add-after 'unpack 'change-directory
1189 (lambda _
1190 (chdir "OpenEXR")
1191 #t))
1192 (add-after 'change-directory 'patch-test-directory
1193 (lambda _
1194 (substitute* '("IlmImfFuzzTest/tmpDir.h"
1195 "IlmImfTest/tmpDir.h"
1196 "IlmImfUtilTest/tmpDir.h")
1197 (("/var/tmp") "/tmp"))))
1198 (add-after 'change-directory 'increase-test-timeout
1199 (lambda _
1200 ;; On some architectures, we need to override the CTest default
1201 ;; timeout of 1500 seconds for the OpenEXR.IlmImf test.
1202 (substitute* "IlmImfTest/CMakeLists.txt"
1203 (("add_test\\(NAME OpenEXR\\.IlmImf.*" all)
1204 (string-append
1205 all
1206 "set_tests_properties(OpenEXR.IlmImf PROPERTIES TIMEOUT 15000)")))
1207 #t))
1208 ,@(if (not (target-64bit?))
1209 `((add-after 'change-directory 'disable-broken-test
1210 (lambda _
1211 (substitute* "IlmImfTest/main.cpp"
1212 ;; This test fails on i686. Upstream developers suggest
1213 ;; that this test is broken on i686 and can be safely
1214 ;; disabled:
1215 ;; https://github.com/openexr/openexr/issues/67#issuecomment-21169748
1216 ((".*testOptimizedInterleavePatterns.*") "")
1217 ;; This one fails similarly on i686.
1218 ((".*testCompression.*") "")))))
1219 '()))))
1220 (native-inputs
1221 (list pkg-config))
1222 (propagated-inputs
1223 (list ilmbase ;used in public headers
1224 zlib)) ;OpenEXR.pc reads "-lz"
1225 (home-page (package-home-page openexr))
1226 (synopsis (package-synopsis openexr))
1227 (description (package-description openexr))
1228 (license (package-license openexr))))
1229
1230 (define-public openimageio
1231 (package
1232 (name "openimageio")
1233 (version "2.2.11.1")
1234 (source (origin
1235 (method git-fetch)
1236 (uri (git-reference
1237 (url "https://github.com/OpenImageIO/oiio")
1238 (commit (string-append "Release-" version))))
1239 (file-name (git-file-name name version))
1240 (sha256
1241 (base32
1242 "1i9r6vgz15aj1yzbf5a9lqhlyakjs793yrw5gw720l84lcyigad7"))))
1243 (build-system cmake-build-system)
1244 ;; FIXME: To run all tests successfully, test image sets from multiple
1245 ;; third party sources have to be present. For details see
1246 ;; <https://github.com/OpenImageIO/oiio/blob/master/INSTALL.md>
1247 (arguments
1248 `(#:tests? #f
1249 #:configure-flags (list "-DUSE_EXTERNAL_PUGIXML=1")))
1250 (native-inputs
1251 (list pkg-config))
1252 (inputs
1253 `(("boost" ,boost)
1254 ("fmt" ,fmt-8)
1255 ("libheif" ,libheif)
1256 ("libpng" ,libpng)
1257 ("libjpeg" ,libjpeg-turbo)
1258 ("libtiff" ,libtiff)
1259 ("giflib" ,giflib)
1260 ("openexr" ,openexr-2)
1261 ("ilmbase" ,ilmbase)
1262 ("pugixml" ,pugixml)
1263 ("python" ,python-wrapper)
1264 ("pybind11" ,pybind11)
1265 ("robin-map" ,robin-map)
1266 ("zlib" ,zlib)))
1267 (synopsis "C++ library for reading and writing images")
1268 (description
1269 "OpenImageIO is a library for reading and writing images, and a bunch of
1270 related classes, utilities, and applications. There is a particular emphasis
1271 on formats and functionality used in professional, large-scale animation and
1272 visual effects work for film.")
1273 (home-page "https://www.openimageio.org")
1274 (license license:bsd-3)))
1275
1276 (define-public openscenegraph
1277 (package
1278 (name "openscenegraph")
1279 (version "3.6.5")
1280 (source
1281 (origin
1282 (method git-fetch)
1283 (uri (git-reference
1284 (url "https://github.com/openscenegraph/OpenSceneGraph")
1285 (commit (string-append "OpenSceneGraph-" version))))
1286 (sha256
1287 (base32 "00i14h82qg3xzcyd8p02wrarnmby3aiwmz0z43l50byc9f8i05n1"))
1288 (file-name (git-file-name name version))))
1289 (properties
1290 `((upstream-name . "OpenSceneGraph")))
1291 (build-system cmake-build-system)
1292 (arguments
1293 `(#:tests? #f ; no test target available
1294 ;; Without this flag, 'rd' will be added to the name of the
1295 ;; library binaries and break linking with other programs.
1296 #:build-type "Release"
1297 #:configure-flags
1298 (list (string-append "-DCMAKE_INSTALL_RPATH="
1299 (assoc-ref %outputs "out") "/lib:"
1300 (assoc-ref %outputs "out") "/lib64"))))
1301 (native-inputs
1302 (list pkg-config unzip))
1303 (inputs
1304 `(("giflib" ,giflib)
1305 ("libjpeg" ,libjpeg-turbo) ; required for the JPEG texture plugin.
1306 ("jasper" ,jasper)
1307 ("librsvg" ,librsvg)
1308 ("libxrandr" ,libxrandr)
1309 ("ffmpeg" ,ffmpeg)
1310 ("mesa" ,mesa)))
1311 (synopsis "High-performance real-time graphics toolkit")
1312 (description
1313 "The OpenSceneGraph is a high-performance 3D graphics toolkit
1314 used by application developers in fields such as visual simulation, games,
1315 virtual reality, scientific visualization and modeling.")
1316 (home-page "http://www.openscenegraph.org")
1317 ;; The 'LICENSE' file explains that the source is licensed under
1318 ;; LGPL 2.1, but with 4 exceptions. This version is called OSGPL.
1319 (license license:lgpl2.1)))
1320
1321 (define-public gr-framework
1322 (package
1323 (name "gr-framework")
1324 (version "0.58.1")
1325 (source
1326 (origin
1327 (method git-fetch)
1328 (uri (git-reference
1329 (url "https://github.com/sciapp/gr")
1330 (commit (string-append "v" version))))
1331 (file-name (git-file-name name version))
1332 (sha256
1333 (base32 "0q1rz4iyxbh0dc22y4w28ry3hr0yypdwdm6pw2zlwgjya7wkbvsw"))
1334 (modules '((guix build utils)))
1335 (snippet
1336 '(begin
1337 (delete-file-recursively "3rdparty")
1338 #t))))
1339 (build-system cmake-build-system)
1340 (arguments
1341 `(#:tests? #f)) ; no test target
1342 (inputs
1343 `(("bzip2" ,bzip2)
1344 ("cairo" ,cairo)
1345 ("fontconfig" ,fontconfig)
1346 ("ffmpeg" ,ffmpeg)
1347 ("freetype" ,freetype)
1348 ("ghostscript" ,ghostscript)
1349 ("glfw" ,glfw)
1350 ("libjpeg-turbo" ,libjpeg-turbo)
1351 ("libpng" ,libpng)
1352 ("libtiff" ,libtiff)
1353 ("libx11" ,libx11)
1354 ("libxft" ,libxft)
1355 ("libxt" ,libxt)
1356 ("pixman" ,pixman)
1357 ("qtbase" ,qtbase-5)
1358 ("qhull" ,qhull)
1359 ("zlib" ,zlib)))
1360 (home-page "https://gr-framework.org/")
1361 (synopsis "Graphics library for visualisation applications")
1362 (description "GR is a universal framework for cross-platform visualization
1363 applications. It offers developers a compact, portable and consistent graphics
1364 library for their programs. Applications range from publication quality 2D
1365 graphs to the representation of complex 3D scenes. GR is essentially based on
1366 an implementation of a @acronym{GKS, Graphical Kernel System}. As a
1367 self-contained system it can quickly and easily be integrated into existing
1368 applications (i.e. using the @code{ctypes} mechanism in Python or @code{ccall}
1369 in Julia).")
1370 (license license:expat)))
1371
1372 (define-public openmw-openscenegraph
1373 ;; OpenMW prefers its own fork of openscenegraph:
1374 ;; https://wiki.openmw.org/index.php?title=Development_Environment_Setup#OpenSceneGraph.
1375 (let ((commit "36a962845a2c87a6671fd822157e0729d164e940"))
1376 (hidden-package
1377 (package
1378 (inherit openscenegraph)
1379 (version (git-version "3.6" "1" commit))
1380 (source
1381 (origin
1382 (method git-fetch)
1383 (uri (git-reference
1384 (url "https://github.com/OpenMW/osg/")
1385 (commit commit)))
1386 (file-name (git-file-name (package-name openscenegraph) version))
1387 (sha256
1388 (base32
1389 "05yhgq3qm5q277y32n5sf36vx5nv5qd3zlhz4csgd3a6190jrnia"))))
1390 (arguments
1391 (substitute-keyword-arguments (package-arguments openscenegraph)
1392 ((#:configure-flags flags)
1393 ;; As per the above wiki link, the following plugins are enough:
1394 `(append
1395 '("-DBUILD_OSG_PLUGINS_BY_DEFAULT=0"
1396 "-DBUILD_OSG_PLUGIN_OSG=1"
1397 "-DBUILD_OSG_PLUGIN_DDS=1"
1398 "-DBUILD_OSG_PLUGIN_TGA=1"
1399 "-DBUILD_OSG_PLUGIN_BMP=1"
1400 "-DBUILD_OSG_PLUGIN_JPEG=1"
1401 "-DBUILD_OSG_PLUGIN_PNG=1"
1402 "-DBUILD_OSG_DEPRECATED_SERIALIZERS=0"
1403 ;; The jpeg plugin requires conversion between integers and booleans
1404 "-DCMAKE_CXX_FLAGS=-fpermissive")
1405 ,flags))))))))
1406
1407 (define-public povray
1408 (package
1409 (name "povray")
1410 (version "3.7.0.8")
1411 (source (origin
1412 (method git-fetch)
1413 (uri (git-reference
1414 (url "https://github.com/POV-Ray/povray")
1415 (commit (string-append "v" version))))
1416 (file-name (git-file-name name version))
1417 (sha256
1418 (base32
1419 "1q114n4m3r7qy3yn954fq7p46rg7ypdax5fazxr9yj1jklf1lh6z"))
1420 (modules '((guix build utils)))
1421 (snippet
1422 '(begin
1423 ;; Delete bundled libraries.
1424 (delete-file-recursively "libraries")
1425 #t))))
1426 (build-system gnu-build-system)
1427 (native-inputs
1428 (list autoconf automake pkg-config))
1429 (inputs
1430 `(("boost" ,boost)
1431 ("libjpeg" ,libjpeg-turbo)
1432 ("libpng" ,libpng)
1433 ("libtiff" ,libtiff)
1434 ("openexr" ,openexr-2)
1435 ("sdl" ,sdl)
1436 ("zlib" ,zlib)))
1437 (arguments
1438 '(#:configure-flags
1439 (list "COMPILED_BY=Guix"
1440 (string-append "--with-boost-libdir="
1441 (assoc-ref %build-inputs "boost") "/lib")
1442 "--disable-optimiz-arch")
1443 #:phases
1444 (modify-phases %standard-phases
1445 (add-after 'unpack 'run-prebuild
1446 (lambda _
1447 (setenv "HOME" (getcwd))
1448 (with-directory-excursion "unix"
1449 (substitute* "prebuild.sh"
1450 (("/bin/sh") (which "sh")))
1451 (invoke "sh" "prebuild.sh"))
1452 #t))
1453 ;; The bootstrap script is run by the prebuild script in the
1454 ;; "run-prebuild" phase.
1455 (delete 'bootstrap))))
1456 (synopsis "Tool for creating three-dimensional graphics")
1457 (description
1458 "@code{POV-Ray} is short for the Persistence of Vision Raytracer, a tool
1459 for producing high-quality computer graphics. @code{POV-Ray} creates
1460 three-dimensional, photo-realistic images using a rendering technique called
1461 ray-tracing. It reads in a text file containing information describing the
1462 objects and lighting in a scene and generates an image of that scene from the
1463 view point of a camera also described in the text file. Ray-tracing is not a
1464 fast process by any means, but it produces very high quality images with
1465 realistic reflections, shading, perspective and other effects.")
1466 (home-page "http://www.povray.org/")
1467 (license license:agpl3+)))
1468
1469 (define-public ctl
1470 (package
1471 (name "ctl")
1472 (version "1.5.2")
1473 (source (origin
1474 (method url-fetch)
1475 (uri (string-append "https://github.com/ampas/CTL/archive/ctl-"
1476 version ".tar.gz"))
1477 (sha256
1478 (base32
1479 "1gg04pyvw0m398akn0s1l07g5b1haqv5na1wpi5dii1jjd1w3ynp"))))
1480 (build-system cmake-build-system)
1481 (arguments '(#:tests? #f)) ;no 'test' target
1482
1483 ;; Headers include OpenEXR and IlmBase headers.
1484 (propagated-inputs (list openexr-2))
1485
1486 (home-page "http://ampasctl.sourceforge.net")
1487 (synopsis "Color Transformation Language")
1488 (description
1489 "The Color Transformation Language, or CTL, is a small programming
1490 language that was designed to serve as a building block for digital color
1491 management systems. CTL allows users to describe color transforms in a
1492 concise and unambiguous way by expressing them as programs. In order to apply
1493 a given transform to an image, the color management system instructs a CTL
1494 interpreter to load and run the CTL program that describes the transform. The
1495 original and the transformed image constitute the CTL program's input and
1496 output.")
1497
1498 ;; The web site says it's under a BSD-3 license, but the 'LICENSE' file
1499 ;; and headers use different wording.
1500 (license (license:non-copyleft "file://LICENSE"))))
1501
1502 (define-public brdf-explorer
1503 ;; There are no release tarballs, and not even tags in the repo,
1504 ;; so use the latest revision.
1505 (let ((commit "5b2cd46f38a06e47207fa7229b72d37beb945019")
1506 (revision "1"))
1507 (package
1508 (name "brdf-explorer")
1509 (version (string-append "1.0.0-" revision "." (string-take commit 9)))
1510 (source (origin
1511 (method git-fetch)
1512 (uri (git-reference
1513 (url "https://github.com/wdas/brdf")
1514 (commit commit)))
1515 (sha256
1516 (base32
1517 "06vzbiajzbi2xl8jlff5d45bc9wd68i3jdndfab1f3jgfrd8bsgx"))
1518 (file-name (string-append name "-" version "-checkout"))))
1519 (build-system gnu-build-system)
1520 (arguments
1521 `(#:phases (modify-phases %standard-phases
1522 (replace 'configure
1523 (lambda* (#:key outputs #:allow-other-keys)
1524 (let ((out (assoc-ref outputs "out")))
1525 (invoke "qmake"
1526 (string-append "prefix=" out)))))
1527 (add-after 'install 'wrap-program
1528 (lambda* (#:key outputs #:allow-other-keys)
1529 (let* ((out (assoc-ref outputs "out"))
1530 (bin (string-append out "/bin"))
1531 (data (string-append
1532 out "/share/brdf")))
1533 (with-directory-excursion bin
1534 (rename-file "brdf" ".brdf-real")
1535 (call-with-output-file "brdf"
1536 (lambda (port)
1537 (format port "#!/bin/sh
1538 # Run the thing from its home, otherwise it just bails out.
1539 cd \"~a\"
1540 exec -a \"$0\" ~a/.brdf-real~%"
1541 data bin)))
1542 (chmod "brdf" #o555)))
1543 #t)))))
1544 (native-inputs
1545 (list qttools-5)) ;for 'qmake'
1546 (inputs
1547 (list qtbase-5 mesa glew freeglut zlib))
1548 (home-page "https://www.disneyanimation.com/technology/brdf.html")
1549 (synopsis
1550 "Analyze bidirectional reflectance distribution functions (BRDFs)")
1551 (description
1552 "BRDF Explorer is an application that allows the development and analysis
1553 of bidirectional reflectance distribution functions (BRDFs). It can load and
1554 plot analytic BRDF functions (coded as functions in OpenGL's GLSL shader
1555 language), measured material data from the MERL database, and anisotropic
1556 measured material data from MIT CSAIL. Graphs and visualizations update in
1557 real time as parameters are changed, making it a useful tool for evaluating
1558 and understanding different BRDFs (and other component functions).")
1559 (license license:ms-pl))))
1560
1561 (define-public agg
1562 (package
1563 (name "agg")
1564 (version "2.5")
1565 (source (origin
1566 (method url-fetch)
1567 (uri (list (string-append
1568 "ftp://ftp.fau.de/gentoo/distfiles/agg-"
1569 version ".tar.gz")
1570 (string-append
1571 "ftp://ftp.ula.ve/gentoo/distfiles/agg-"
1572 version ".tar.gz")
1573
1574 ;; Site was discontinued.
1575 (string-append "http://www.antigrain.com/agg-"
1576 version ".tar.gz")))
1577 (sha256
1578 (base32 "07wii4i824vy9qsvjsgqxppgqmfdxq0xa87i5yk53fijriadq7mb"))
1579 (patches (search-patches "agg-am_c_prototype.patch"
1580 "agg-2.5-gcc8.patch"))))
1581 (build-system gnu-build-system)
1582 (arguments
1583 '(#:configure-flags
1584 (list (string-append "--x-includes=" (assoc-ref %build-inputs "libx11")
1585 "/include")
1586 (string-append "--x-libraries=" (assoc-ref %build-inputs "libx11")
1587 "/lib")
1588 "--disable-examples")
1589 #:phases
1590 (modify-phases %standard-phases
1591 (replace 'bootstrap
1592 (lambda _
1593 ;; let's call configure from configure phase and not now
1594 (substitute* "autogen.sh" (("./configure") "# ./configure"))
1595 (invoke "sh" "autogen.sh"))))))
1596 (native-inputs
1597 (list pkg-config libtool autoconf automake))
1598 (inputs
1599 (list libx11 freetype sdl))
1600
1601 ;; Antigrain.com was discontinued.
1602 (home-page "http://agg.sourceforge.net/antigrain.com/index.html")
1603 (synopsis "High-quality 2D graphics rendering engine for C++")
1604 (description
1605 "Anti-Grain Geometry is a high quality rendering engine written in C++.
1606 It supports sub-pixel resolutions and anti-aliasing. It is also a library for
1607 rendering @acronym{SVG, Scalable Vector Graphics}.")
1608 (license license:gpl2+)))
1609
1610 (define-public python-pastel
1611 (package
1612 (name "python-pastel")
1613 (version "0.2.0")
1614 (source
1615 (origin
1616 (method url-fetch)
1617 (uri (pypi-uri "pastel" version))
1618 (sha256
1619 (base32
1620 "0dnaw44ss10i10z4ksy0xljknvjap7rb7g0b8p6yzm5x4g2my5a6"))))
1621 (build-system python-build-system)
1622 (arguments
1623 `(#:phases (modify-phases %standard-phases
1624 (replace 'check
1625 (lambda _ (invoke "pytest" "pastel" "tests/"))))))
1626 (native-inputs
1627 (list python-pytest))
1628 (home-page "https://github.com/sdispater/pastel")
1629 (synopsis "Library to colorize strings in your terminal")
1630 (description "Pastel is a simple library to help you colorize strings in
1631 your terminal.")
1632 (license license:expat)))
1633
1634 (define-public fgallery
1635 (package
1636 (name "fgallery")
1637 (version "1.8.2")
1638 (source (origin
1639 (method url-fetch)
1640 (uri
1641 (string-append
1642 "http://www.thregr.org/~wavexx/software/fgallery/releases/"
1643 "fgallery-" version ".zip"))
1644 (sha256
1645 (base32
1646 "18wlvqbxcng8pawimbc8f2422s8fnk840hfr6946lzsxr0ijakvf"))))
1647 (build-system gnu-build-system)
1648 (arguments
1649 `(#:tests? #f ; no tests
1650 #:phases
1651 (modify-phases %standard-phases
1652 (delete 'configure)
1653 (delete 'build)
1654 (replace 'install
1655 (lambda* (#:key inputs outputs #:allow-other-keys)
1656 (let* ((out (assoc-ref outputs "out"))
1657 (bin (string-append out "/bin/"))
1658 (share (string-append out "/share/fgallery"))
1659 (man (string-append out "/share/man/man1"))
1660 (perl5lib (getenv "PERL5LIB"))
1661 (script (string-append share "/fgallery")))
1662 (define (bin-directory input-name)
1663 (string-append (assoc-ref inputs input-name) "/bin"))
1664
1665 (mkdir-p man)
1666 (copy-file "fgallery.1" (string-append man "/fgallery.1"))
1667
1668 (mkdir-p share)
1669 (copy-recursively "." share)
1670
1671 ;; fgallery copies files from store when it is run. The
1672 ;; read-only permissions from the store directories will cause
1673 ;; fgallery to fail. Do not preserve file attributes when
1674 ;; copying files to prevent it.
1675 (substitute* script
1676 (("'cp'")
1677 "'cp', '--no-preserve=all'"))
1678
1679 (mkdir-p bin)
1680 (symlink script (string-append out "/bin/fgallery"))
1681
1682 (wrap-program script
1683 `("PATH" ":" prefix
1684 ,(map bin-directory '("imagemagick"
1685 "lcms"
1686 "fbida"
1687 "libjpeg"
1688 "zip"
1689 "jpegoptim"
1690 "pngcrush"
1691 "p7zip")))
1692 `("PERL5LIB" ":" prefix (,perl5lib)))
1693 #t))))))
1694 (native-inputs
1695 (list unzip))
1696 ;; TODO: Add missing optional dependency: facedetect.
1697 (inputs
1698 `(("imagemagick" ,imagemagick)
1699 ("lcms" ,lcms)
1700 ("fbida" ,fbida)
1701 ("libjpeg" ,libjpeg-turbo)
1702 ("zip" ,zip)
1703 ("perl" ,perl)
1704 ("perl-cpanel-json-xs" ,perl-cpanel-json-xs)
1705 ("perl-image-exiftool" ,perl-image-exiftool)
1706 ("jpegoptim" ,jpegoptim)
1707 ("pngcrush" ,pngcrush)
1708 ("p7zip" ,p7zip)))
1709 (home-page "http://www.thregr.org/~wavexx/software/fgallery/")
1710 (synopsis "Static photo gallery generator")
1711 (description
1712 "FGallery is a static, JavaScript photo gallery generator with minimalist
1713 look. The result can be uploaded on any web server without additional
1714 requirements.")
1715 (license license:gpl2+)))
1716
1717 (define-public opensubdiv
1718 (package
1719 (name "opensubdiv")
1720 (version "3.4.0")
1721 (source (origin
1722 (method git-fetch)
1723 (uri (git-reference
1724 (url "https://github.com/PixarAnimationStudios/OpenSubdiv")
1725 (commit (string-append "v" (string-join (string-split version #\.)
1726 "_")))))
1727 (file-name (git-file-name name version))
1728 (sha256
1729 (base32
1730 "0cippg6aqc5dlya1cmh3908pwssrg52fwgyylnvz5343yrxmgk12"))))
1731 (build-system cmake-build-system)
1732 (arguments
1733 `(#:phases (modify-phases %standard-phases
1734 (add-before 'configure 'set-glew-location
1735 (lambda* (#:key inputs #:allow-other-keys)
1736 (setenv "GLEW_LOCATION" (assoc-ref inputs "glew"))
1737 #t))
1738 (add-before 'check 'start-xorg-server
1739 (lambda* (#:key inputs #:allow-other-keys)
1740 ;; The test suite requires a running X server.
1741 (system "Xvfb :1 &")
1742 (setenv "DISPLAY" ":1")
1743 #t)))))
1744 (native-inputs
1745 (list xorg-server-for-tests))
1746 (inputs
1747 (list glew
1748 libxrandr
1749 libxcursor
1750 libxinerama
1751 libxi
1752 zlib
1753 glfw))
1754 (home-page "https://graphics.pixar.com/opensubdiv/")
1755 (synopsis "High performance subdivision surface evaluation")
1756 (description "OpenSubdiv is a set of libraries that implement high
1757 performance subdivision surface (subdiv) evaluation on massively parallel CPU
1758 and GPU architectures.")
1759 (license license:asl2.0)))
1760
1761 (define-public opencsg
1762 (let ((dot-to-dash (lambda (c) (if (char=? c #\.) #\- c))))
1763 (package
1764 (name "opencsg")
1765 (version "1.4.2")
1766 (source
1767 (origin
1768 (method git-fetch)
1769 (uri (git-reference
1770 (url "https://github.com/floriankirsch/OpenCSG")
1771 (commit (string-append "opencsg-"
1772 (string-map dot-to-dash version)
1773 "-release"))))
1774 (file-name (git-file-name name version))
1775 (sha256
1776 (base32
1777 "00m4vs6jn3scqczscc4591l1d6zg6anqp9v1ldf9ymf70rdyvm7m"))))
1778 (build-system gnu-build-system)
1779 (arguments
1780 `(#:phases
1781 (modify-phases %standard-phases
1782 (replace 'configure
1783 (lambda* (#:key outputs #:allow-other-keys)
1784 (substitute* "src/Makefile"
1785 (("/usr/local") (assoc-ref outputs "out")))
1786 #t))
1787 (add-before 'build 'skip-example
1788 (lambda _ (chdir "src") #t)))))
1789 (inputs
1790 (list glew freeglut))
1791 (synopsis "Library for rendering Constructive Solid Geometry (CSG)")
1792 (description
1793 "OpenCSG is a library for rendering Constructive Solid Geometry (CSG) using
1794 OpenGL. CSG is an approach for modeling complex 3D-shapes using simpler ones.
1795 For example, two shapes can be combined by uniting them, by intersecting them,
1796 or by subtracting one shape from the other.")
1797 (home-page "http://www.opencsg.org/")
1798 (license license:gpl2))))
1799
1800 (define-public coin3D
1801 ;; The ‘4.0.0’ zip archive isn't stable, nor in fact a release. See:
1802 ;; https://bitbucket.org/Coin3D/coin/issues/179/coin-400-srczip-has-been-modified
1803 (let ((revision 1)
1804 (changeset "ab8d0e47a4de3230a8137feb39c142d6ba45f97d"))
1805 (package
1806 (name "coin3D")
1807 (version
1808 (simple-format #f "3.1.3-~A-~A" revision (string-take changeset 7)))
1809 (source
1810 (origin
1811 (method hg-fetch)
1812 (uri (hg-reference
1813 (url "https://bitbucket.org/Coin3D/coin")
1814 (changeset changeset)))
1815 (file-name (git-file-name name version))
1816 (sha256
1817 (base32 "1ff44jz6lg4rylljvy69n1hcjh9y6achbv9jpn1cv2sf8cxn3r2j"))
1818 (modules '((guix build utils)))
1819 (snippet
1820 '(begin
1821 (for-each delete-file
1822 '("cfg/csubst.exe"
1823 "cfg/wrapmsvc.exe"))
1824 #t))))
1825 (build-system cmake-build-system)
1826 (native-inputs
1827 (list doxygen graphviz))
1828 (inputs
1829 (list boost freeglut glew))
1830 (arguments
1831 `(#:configure-flags
1832 (list
1833 "-DCOIN_BUILD_DOCUMENTATION_MAN=ON"
1834 (string-append "-DBOOST_ROOT="
1835 (assoc-ref %build-inputs "boost")))))
1836 (home-page "https://bitbucket.org/Coin3D/coin/wiki/Home")
1837 (synopsis
1838 "High-level 3D visualization library with Open Inventor 2.1 API")
1839 (description
1840 "Coin is a 3D graphics library with an Application Programming Interface
1841 based on the Open Inventor 2.1 API. For those who are not familiar with
1842 Open Inventor, it is a scene-graph based retain-mode rendering and model
1843 interaction library, written in C++, which has become the de facto
1844 standard graphics library for 3D visualization and visual simulation
1845 software in the scientific and engineering community.")
1846 (license license:bsd-3))))
1847
1848 (define-public coin3D-4
1849 (package
1850 (name "coin3D")
1851 (version "4.0.0")
1852 (source
1853 (origin
1854 (method git-fetch)
1855 (uri (git-reference
1856 (url "https://github.com/coin3d/coin")
1857 (commit (string-append "Coin-" version))
1858 (recursive? #t)))
1859 (file-name (git-file-name name version))
1860 (sha256
1861 (base32 "1ayg0hl8wanhadahm5xbghghxw1qjwqbrs3dl3ngnff027hsyf8p"))
1862 (modules '((guix build utils)))
1863 (snippet
1864 '(begin
1865 ;; Delete binaries
1866 (for-each delete-file
1867 '("cfg/csubst.exe"
1868 "cfg/wrapmsvc.exe"))
1869 ;; Delete references to packaging tool cpack. Otherwise the build
1870 ;; fails with "add_subdirectory given source "cpack.d" which is not
1871 ;; an existing directory."
1872 (substitute* "CMakeLists.txt"
1873 ((".*cpack.d.*") ""))
1874 #t))))
1875 (build-system cmake-build-system)
1876 (native-inputs
1877 (list doxygen graphviz))
1878 (inputs
1879 (list boost freeglut glew))
1880 (arguments
1881 `(#:configure-flags
1882 (list
1883 "-DCOIN_BUILD_DOCUMENTATION_MAN=ON"
1884 (string-append "-DBOOST_ROOT="
1885 (assoc-ref %build-inputs "boost")))))
1886 (home-page "https://github.com/coin3d/coin")
1887 (synopsis
1888 "High-level 3D visualization library with Open Inventor 2.1 API")
1889 (description
1890 "Coin is a 3D graphics library with an Application Programming Interface
1891 based on the Open Inventor 2.1 API. For those who are not familiar with Open
1892 Inventor, it is a scene-graph based retain-mode rendering and model interaction
1893 library, written in C++, which has become the de facto standard graphics
1894 library for 3D visualization and visual simulation software in the scientific
1895 and engineering community.")
1896 (license license:bsd-3)))
1897
1898 (define-public skia
1899 ;; Releases follow those of Chromium, about every 6 weeks. The release
1900 ;; version can be found on this page:
1901 ;; https://skia.org/docs/user/release/release_notes/. The commit used
1902 ;; should be the last commit, as recommended at
1903 ;; https://skia.org/docs/user/release/.
1904 (let ((version "98")
1905 (revision "0")
1906 (commit "55c56abac381e1ae3f0116c410bed81b05e0a38a"))
1907 (package
1908 (name "skia")
1909 (version (git-version version revision commit))
1910 (source (origin
1911 (method git-fetch)
1912 (uri (git-reference
1913 (url "https://skia.googlesource.com/skia.git")
1914 (commit commit)))
1915 (file-name (git-file-name name version))
1916 (sha256
1917 (base32
1918 "1ldns2j1g2wj2phlxr9zqkdgs5g64pisxhwxcrq9ijn8a3jhafr2"))))
1919 (build-system gnu-build-system) ;actually GN + Ninja
1920 (arguments
1921 (list
1922 ;; Running the test suite would require 'dm'; unfortunately the tool
1923 ;; can only be built for debug builds, which require fetching third
1924 ;; party sources.
1925 #:tests? #f
1926 #:phases
1927 #~(modify-phases %standard-phases
1928 (replace 'configure
1929 (lambda* (#:key inputs #:allow-other-keys)
1930 (substitute* "BUILD.gn"
1931 ;; Workaround a bug in the zlib third_party definition, that
1932 ;; fails the build even when zlib is found from the system.
1933 (("deps = \\[ \"//third_party/zlib\" ]")
1934 "deps = []"))
1935 (invoke "gn" "gen" "build"
1936 (string-append
1937 ;;
1938 "--args="
1939 "cc=\"gcc\" " ;defaults to 'cc'
1940 "is_official_build=true " ;to use system libraries
1941 "is_component_build=true " ;build as a shared library
1942 ;; Specify where locate the harfbuzz and freetype
1943 ;; includes.
1944 (format #f "extra_cflags=[\"-I~a\",\"-I~a\"] "
1945 (search-input-directory inputs
1946 "include/harfbuzz")
1947 (search-input-directory inputs
1948 "include/freetype2"))
1949 ;; Otherwise the validate-runpath phase fails.
1950 "extra_ldflags=[\"-Wl,-rpath=" #$output "/lib\"] "
1951 ;; Disabled, otherwise the build system attempts to
1952 ;; download the SDK at build time.
1953 "skia_use_dng_sdk=false "))))
1954 (replace 'build
1955 (lambda* (#:key parallel-build? #:allow-other-keys)
1956 (let ((job-count (if parallel-build?
1957 (number->string (parallel-job-count))
1958 "1")))
1959 (invoke "ninja" "-j" job-count "-C" "build"))))
1960 (replace 'install
1961 (lambda _
1962 ;; Install headers.
1963 (for-each (lambda (h)
1964 (install-file h (string-append
1965 #$output "/include/skia/"
1966 (dirname h))))
1967 (find-files "." "\\.h$"))
1968 ;; Install libraries.
1969 (for-each (lambda (lib)
1970 (install-file lib (string-append #$output "/lib")))
1971 (find-files "build" "^lib.*\\.(a|so)"))
1972 ;; This pkgconfig file is useful at least to the
1973 ;; python-skia-pathops package.
1974 (define skia.pc (string-append #$output
1975 "/lib/pkgconfig/skia.pc"))
1976 (mkdir-p (dirname skia.pc))
1977 (call-with-output-file skia.pc
1978 (lambda (port)
1979 (format port "\
1980 prefix=~a
1981 exec_prefix=${prefix}
1982 libdir=${prefix}/lib
1983 includedir=${prefix}/include/skia
1984
1985 Name: skia
1986 Description: 2D graphic library for drawing text, geometries and images.
1987 URL: https://skia.org/
1988 Version: ~a
1989 Libs: -L${libdir} -lskia
1990 Cflags: -I${includedir}~%" #$output #$version))))))))
1991 (native-inputs (list gn libjpeg-turbo ninja pkg-config python-wrapper))
1992 (inputs (list expat fontconfig freetype harfbuzz mesa libwebp zlib))
1993 (home-page "https://skia.org/")
1994 (synopsis "2D graphics library")
1995 (description
1996 "Skia is a 2D graphics library for drawing text, geometries, and images.
1997 It supports:
1998 @itemize
1999 @item 3x3 matrices with perspective
2000 @item antialiasing, transparency, filters
2001 @item shaders, xfermodes, maskfilters, patheffects
2002 @item subpixel text
2003 @end itemize")
2004 (license license:bsd-3))))
2005
2006 (define-public superfamiconv
2007 (package
2008 (name "superfamiconv")
2009 (version "0.8.8")
2010 (source
2011 (origin
2012 (method git-fetch)
2013 (uri (git-reference
2014 (url "https://github.com/Optiroc/SuperFamiconv")
2015 (commit (string-append "v" version))))
2016 (file-name (git-file-name name version))
2017 (sha256
2018 (base32
2019 "0848szv6a2b8wdganh6mw5i8vn8cqvn1kbwzx7mb9wlrf5wzqn37"))))
2020 (build-system gnu-build-system)
2021 (arguments
2022 `(#:tests? #f ; no tests
2023 #:phases
2024 (modify-phases %standard-phases
2025 (delete 'configure)
2026 (replace 'install
2027 (lambda* (#:key outputs #:allow-other-keys)
2028 (let* ((outdir (assoc-ref outputs "out"))
2029 (bindir (string-append outdir "/bin")))
2030 (install-file "bin/superfamiconv" bindir)
2031 #t))))))
2032 (home-page "https://github.com/Optiroc/SuperFamiconv")
2033 (synopsis "Tile graphics converter supporting SNES, Game Boy Color
2034 and PC Engine formats")
2035 (description "SuperFamiconv is a converter for tiled graphics, supporting
2036 the graphics formats of the SNES, Game Boy Color and PC Engine game consoles.
2037 Automated palette selection is supported.")
2038 (license license:expat)))
2039
2040 (define-public drawpile
2041 ;; This commit fix building with libmicrohttpd>=0.71.
2042 (let ((commit "ed1a75deb113da2d1df91a28f557509c4897130e")
2043 (revision "1"))
2044 (package
2045 (name "drawpile")
2046 (version (string-append "2.1.17-" revision "." (string-take commit 9)))
2047 (source (origin
2048 (method git-fetch)
2049 (uri (git-reference
2050 (url "https://github.com/drawpile/Drawpile")
2051 (commit commit)))
2052 (file-name (git-file-name name version))
2053 (sha256
2054 (base32
2055 "1y21h1hk9ipkjvhjgas0c5hkjyan92vsxbxrn60c906hzqln2fr1"))))
2056 (build-system qt-build-system)
2057 (arguments
2058 '(#:configure-flags
2059 (list "-DTESTS=ON" "-DTOOLS=ON" "-DKIS_TABLET=ON")))
2060 (native-inputs
2061 (list extra-cmake-modules pkg-config))
2062 (inputs
2063 (list giflib
2064 karchive
2065 kdnssd
2066 libmicrohttpd
2067 libsodium
2068 libvpx
2069 libxi
2070 ;; ("miniupnpc" ,miniupnpc) ;segfaults for some reason
2071 qtbase-5
2072 qtkeychain
2073 qtmultimedia-5
2074 qtsvg-5
2075 qtx11extras))
2076 (home-page "https://drawpile.net")
2077 (synopsis "Collaborative drawing program")
2078 (description "Drawpile is a drawing program that allows share the canvas
2079 with other users in real time.
2080
2081 Some feature highlights:
2082 @itemize
2083 @item Shared canvas using the built-in server or a dedicated server
2084 @item Record, play back and export drawing sessions
2085 @item Simple animation support
2086 @item Layers and blending modes
2087 @item Text layers
2088 @item Supports pressure sensitive Wacom tablets
2089 @item Built-in chat
2090 @item Supports OpenRaster file format
2091 @item Encrypted connections using SSL
2092 @item Automatic port forwarding with UPnP
2093 @end itemize\n")
2094 (license license:gpl3+))))
2095
2096 (define-public openxr
2097 (package
2098 (name "openxr")
2099 (version "1.0.25")
2100 (source
2101 (origin
2102 (method git-fetch)
2103 (uri (git-reference
2104 (url "https://github.com/KhronosGroup/OpenXR-SDK")
2105 (commit (string-append "release-" version))))
2106 (file-name (git-file-name name version))
2107 (modules '((guix build utils)))
2108 (snippet
2109 '(begin
2110 ;; Delete bundled jsoncpp.
2111 (delete-file-recursively "src/external/jsoncpp")))
2112 (sha256
2113 (base32 "1p8nfxswgy40zxizh925a477jcsfngbwns65qzaid5rmrvvk8c45"))))
2114 (build-system cmake-build-system)
2115 (arguments
2116 `(#:tests? #f)) ; there are no tests
2117 (native-inputs
2118 (list pkg-config python shaderc vulkan-headers))
2119 (inputs
2120 (list jsoncpp mesa vulkan-loader wayland))
2121 (home-page "https://www.khronos.org/openxr/")
2122 (synopsis "Generated headers and sources for OpenXR loader")
2123 (description "This package contains OpenXR headers, as well as source code
2124 and build scripts for the OpenXR loader.")
2125 ;; Dual licensed. Either license applies.
2126 (license (list license:asl2.0 license:expat))))
2127
2128 (define-public monado
2129 (package
2130 (name "monado")
2131 (version "21.0.0")
2132 (source (origin
2133 (method url-fetch)
2134 (uri (string-append "https://gitlab.freedesktop.org/" name "/"
2135 name "/-/archive/v" version "/"
2136 name "-v" version ".tar.bz2"))
2137 (sha256
2138 (base32
2139 "0n04k7a8b0i8ga0kbzh7qxmvni1ijawgk98s83519vxg4d0yyjbq"))))
2140 (build-system meson-build-system)
2141 (inputs
2142 (list ffmpeg
2143 glslang
2144 eudev
2145 libusb
2146 libxcb
2147 libxrandr
2148 mesa
2149 python
2150 v4l-utils
2151 vulkan-loader))
2152 (native-inputs
2153 (list eigen pkg-config vulkan-headers))
2154 (arguments
2155 `(#:configure-flags
2156 (list "-Dinstall-active-runtime=false")))
2157 (home-page "https://monado.freedesktop.org/")
2158 (synopsis "OpenXR runtime")
2159 (description "Monado is an OpenXR runtime delivering immersive experiences
2160 such as VR and AR on mobile, PC/desktop, and any other device. Monado aims to be
2161 a complete and conforming implementation of the OpenXR API made by Khronos.")
2162 (license license:boost1.0)))
2163
2164 (define-public azpainter
2165 (package
2166 (name "azpainter")
2167 (version "3.0.5")
2168 (source (origin
2169 (method git-fetch)
2170 (uri (git-reference
2171 (url "https://gitlab.com/azelpg/azpainter")
2172 (commit (string-append "v" version))))
2173 (file-name (git-file-name name version))
2174 (sha256
2175 (base32
2176 "1iplp3p8pw9q44kb43hrk89sv2aff6bdy9fk58j2v6k5lqbk6kvf"))))
2177 (build-system gnu-build-system) ;actually a home grown build system
2178 (arguments
2179 (list #:tests? #f
2180 #:phases
2181 #~(modify-phases %standard-phases
2182 (replace 'configure
2183 (lambda _
2184 (invoke "./configure"
2185 (string-append "--prefix="
2186 #$output))))
2187 (replace 'build
2188 (lambda* (#:key parallel-build? #:allow-other-keys)
2189 (let ((job-count (if parallel-build?
2190 (number->string (parallel-job-count))
2191 "1")))
2192 (invoke "ninja" "-j" job-count "-C" "build"))))
2193 (add-before 'install 'disable-cache-generation
2194 (lambda _
2195 (setenv "DESTDIR" "/") #t))
2196 (replace 'install
2197 (lambda _
2198 (invoke "ninja" "-C" "build" "install"))))))
2199 (inputs (list fontconfig
2200 freetype
2201 libjpeg-turbo
2202 libpng
2203 libtiff
2204 libwebp
2205 libx11
2206 libxcursor
2207 libxext
2208 libxi
2209 zlib))
2210 (native-inputs (list ninja pkg-config))
2211 (home-page "http://azsky2.html.xdomain.jp/soft/azpainter.html")
2212 (synopsis "Paint software for editing illustrations and images")
2213 (description
2214 "AzPainter is a lightweight full color painting application for editing
2215 illustrations and images.
2216
2217 Features include:
2218 @itemize
2219 @item Layers
2220 @item Many artistic filters
2221 @item Good range of selection tools
2222 @item Pen pressure support with automatic brush size adjustment
2223 @item Support for 16-bit color images with transparency (RGBA)
2224 @item Support for image formats like PSD, PNG, JPEG, TIFF, WebP
2225 @end itemize
2226 ")
2227 (license license:gpl3+)))
2228
2229 (define-public discregrid
2230 (let ((commit "4c27e1cc88be828c6ac5b8a05759ac7e01cf79e9")
2231 (revision "0"))
2232 (package
2233 (name "discregrid")
2234 (version (git-version "0.0.0" revision commit))
2235 (source
2236 (origin
2237 (method git-fetch)
2238 (uri (git-reference
2239 (url "https://github.com/InteractiveComputerGraphics/Discregrid")
2240 (commit commit)))
2241 (file-name (git-file-name name version))
2242 (sha256
2243 (base32 "01cwfpw19rc9k5glx9dhnqpihd0is28a9b53qvzp5kgjmdq2v1p0"))
2244 (modules '((guix build utils)))
2245 (snippet
2246 #~(begin
2247 (delete-file-recursively "extern/cxxopts")
2248 (substitute* '("cmd/discrete_field_to_bitmap/main.cpp"
2249 "cmd/generate_density_map/main.cpp"
2250 "cmd/generate_sdf/main.cpp")
2251 (("^#include <cxxopts/cxxopts\\.hpp>")
2252 "#include <cxxopts.hpp>"))))))
2253 (build-system cmake-build-system)
2254 (outputs '("out" "bin"))
2255 (arguments
2256 (list #:tests? #f ; No tests
2257 #:configure-flags
2258 #~(list (string-append "-DCMAKE_INSTALL_BINDIR="
2259 #$output:bin "/bin")
2260 ;; Bespoke version of BUILD_SHARED_LIBS.
2261 "-DBUILD_AS_SHARED_LIBS=ON")
2262 #:phases
2263 #~(modify-phases %standard-phases
2264 (add-after 'unpack 'patch-cmake
2265 (lambda _
2266 (let ((port (open-file "cmd/CMakeLists.txt" "a")))
2267 (display "install(TARGETS
2268 DiscreteFieldToBitmap
2269 GenerateDensityMap
2270 GenerateSDF)
2271 "
2272 port)
2273 (close-port port)))))))
2274 (inputs
2275 (list cxxopts eigen))
2276 (home-page "https://github.com/InteractiveComputerGraphics/Discregrid")
2277 (synopsis "Discretize functions on regular grids")
2278 (description "Discregrid is a C++ library for the parallel discretization
2279 of (preferably smooth) functions on regular grids. It generates a (cubic)
2280 polynomial discretization given a box-shaped domain, a grid resolution, and a
2281 3D scalar field. The library can also serialize and deserialize the generated
2282 discrete grid, and compute and discretize the signed distance field
2283 corresponding to a triangle mesh. The following programs are included with
2284 Discregrid:
2285
2286 @itemize
2287 @item @code{GenerateSDF}: Computes a discrete (cubic) signed distance field
2288 from a triangle mesh in OBJ format.
2289
2290 @item @code{DiscreteFieldToBitmap}: Generates an image in bitmap format of a
2291 two-dimensional slice of a previously computed discretization.
2292
2293 @item @code{GenerateDensityMap}: Generates a density map from a previously
2294 generated discrete signed distance field using the cubic spline kernel.
2295 @end itemize")
2296 (license license:expat))))
2297
2298 (define-public mmg
2299 (package
2300 (name "mmg")
2301 (version "5.6.0")
2302 (source
2303 (origin
2304 (method git-fetch)
2305 (uri (git-reference
2306 (url "https://github.com/MmgTools/mmg")
2307 (commit (string-append "v" version))))
2308 (file-name (git-file-name name version))
2309 (sha256
2310 (base32 "173biz5skbwg27i5w6layg7mydjzv3rmi1ywhra4rx9rjf5c0cc5"))))
2311 (build-system cmake-build-system)
2312 (outputs '("out" "lib" "doc"))
2313 (arguments
2314 (list #:configure-flags
2315 #~(list (string-append "-DCMAKE_INSTALL_PREFIX=" #$output:lib)
2316 (string-append "-DCMAKE_INSTALL_RPATH=" #$output:lib "/lib")
2317 ;; The build doesn't honor -DCMAKE_INSTALL_BINDIR, hence
2318 ;; the adjust-bindir phase.
2319 ;;(string-append "-DCMAKE_INSTALL_BINDIR=" #$output "/bin")
2320 "-DBUILD_SHARED_LIBS=ON"
2321 "-DBUILD_TESTING=ON"
2322 ;; The longer tests are for continuous integration and
2323 ;; depend on input data which must be downloaded.
2324 "-DONLY_VERY_SHORT_TESTS=ON"
2325 ;; TODO: Add Elas (from
2326 ;; https://github.com/ISCDtoolbox/LinearElasticity).
2327 "-DUSE_ELAS=OFF"
2328 ;; TODO: Figure out how to add VTK to inputs without
2329 ;; causing linking errors in ASLI of the form:
2330 ;;
2331 ;; ld: /gnu/store/…-vtk-9.0.1/lib/libvtkWrappingPythonCore-9.0.so.1:
2332 ;; undefined reference to `PyUnicode_InternFromString'
2333 ;;
2334 ;; Also, adding VTK to inputs requires adding these as well:
2335 ;;
2336 ;; double-conversion eigen expat freetype gl2ps glew hdf5
2337 ;; jsoncpp libjpeg-turbo libpng libtheora libtiff libx11
2338 ;; libxml2 lz4 netcdf proj python sqlite zlib
2339 "-DUSE_VTK=OFF")
2340 #:phases
2341 #~(modify-phases %standard-phases
2342 (add-after 'build 'build-doc
2343 (lambda _
2344 ;; Fontconfig wants to write to a cache directory.
2345 (setenv "HOME" "/tmp")
2346 (invoke "make" "doc")))
2347 (add-after 'install 'install-doc
2348 (lambda _
2349 (copy-recursively
2350 "../source/doc/man" (string-append #$output
2351 "/share/man/man1"))
2352 (copy-recursively
2353 "doc" (string-append #$output:doc "/share/doc/"
2354 #$name "-" #$version))))
2355 (add-after 'install 'adjust-bindir
2356 (lambda _
2357 (let ((src (string-append #$output:lib "/bin"))
2358 (dst (string-append #$output "/bin")))
2359 (copy-recursively src dst)
2360 (delete-file-recursively src))))
2361 ;; Suffixing program names with build information, i.e.,
2362 ;; optimization flags and whether debug symbols were generated,
2363 ;; is unusual and fragilizes scripts calling these programs.
2364 (add-after 'adjust-bindir 'fix-program-names
2365 (lambda _
2366 (with-directory-excursion (string-append #$output "/bin")
2367 (rename-file "mmg2d_O3d" "mmg2d")
2368 (rename-file "mmg3d_O3d" "mmg3d")
2369 (rename-file "mmgs_O3d" "mmgs")))))))
2370 (native-inputs
2371 ;; For the documentation
2372 (list doxygen graphviz
2373 ;; TODO: Fix failing LaTeX invocation (which results in equations
2374 ;; being inserted literally into PNGs rather than being typeset).
2375 ;;texlive-tiny
2376
2377 perl)) ;used to generate Fortran headers
2378 (inputs
2379 (list scotch))
2380 (home-page "http://www.mmgtools.org/")
2381 (synopsis "Surface and volume remeshers")
2382 (description "Mmg is a collection of applications and libraries for
2383 bidimensional and tridimensional surface and volume remeshing. It consists
2384 of:
2385
2386 @itemize
2387 @item the @code{mmg2d} application and library: mesh generation from a set of
2388 edges, adaptation and optimization of a bidimensional triangulation and
2389 isovalue discretization;
2390
2391 @item the @code{mmgs} application and library: adaptation and optimization of
2392 a surface triangulation and isovalue discretization;
2393
2394 @item the @code{mmg3d} application and library: adaptation and optimization of
2395 a tetrahedral mesh, isovalue discretization and Lagrangian movement;
2396
2397 @item the @code{mmg} library gathering the @code{mmg2d}, @code{mmgs} and
2398 @code{mmg3d} libraries.
2399 @end itemize")
2400 (license license:lgpl3+)))
2401
2402 (define-public f3d
2403 (package
2404 (name "f3d")
2405 (version "1.3.1")
2406 (source
2407 (origin
2408 (method git-fetch)
2409 (uri (git-reference
2410 (url "https://github.com/f3d-app/f3d")
2411 (commit (string-append "v" version))))
2412 (file-name (git-file-name name version))
2413 (sha256
2414 (base32 "0hdfgwf5d24ykab634xg4vv9r09nh96ss7hhnqnh5nmw4abhxzg7"))
2415 (modules '((guix build utils)))
2416 (snippet
2417 #~(begin
2418 (delete-file "application/cxxopts.hpp")
2419 (delete-file "application/json.hpp")
2420 (substitute* "application/F3DOptionsParser.cxx"
2421 (("^#include \"cxxopts\\.hpp\"")
2422 "#include <cxxopts.hpp>")
2423 (("^#include \"json\\.hpp\"")
2424 "#include <nlohmann/json.hpp>"))))))
2425 (build-system cmake-build-system)
2426 ;; The package cannot easily be split into out and lib outputs because
2427 ;; VTK's vtkModule.cmake complains, and also the CMake files in
2428 ;; /lib/cmake/f3d expect the f3d executable and library to be available,
2429 ;; as they set up targets for both of them.
2430 (arguments
2431 (list
2432 ;; Many tests require files supplied by git-lfs.
2433 ;; Also, some tests segfault (after an exception?) but the tested
2434 ;; behavior, i.e., when the program is run manually, does not (for
2435 ;; example, TestNonExistentConfigFile and TestInvalidConfigFile).
2436 ;; Upstream is aware of occasionally flaky tests [1], but the tests
2437 ;; run in CI seem to be passing.
2438 ;; Anyway, the program runs and is able to open at least STL files
2439 ;; without issue.
2440 ;;
2441 ;; [1]: https://github.com/f3d-app/f3d/issues/92
2442 #:tests? #f
2443 #:configure-flags
2444 #~(list (string-append "-DCMAKE_INSTALL_DOCDIR=" #$output
2445 "/share/doc/" #$name "-" #$version)
2446 "-DBUILD_TESTING=OFF"
2447 "-DF3D_GENERATE_MAN=ON"
2448 "-DF3D_INSTALL_DEFAULT_CONFIGURATION_FILE=ON"
2449 "-DF3D_INSTALL_DEFAULT_CONFIGURATION_FILE_IN_PREFIX=ON"
2450 "-DF3D_INSTALL_MIME_TYPES_FILES=ON"
2451 "-DF3D_INSTALL_THUMBNAILER_FILES=ON"
2452 "-DF3D_MODULE_ALEMBIC=ON"
2453 "-DF3D_MODULE_ASSIMP=ON"
2454 "-DF3D_MODULE_EXTERNAL_RENDERING=ON"
2455 "-DF3D_MODULE_OCCT=ON")))
2456 (native-inputs
2457 (list cxxopts
2458 help2man
2459 json-modern-cxx))
2460 (inputs
2461 (list alembic
2462 assimp
2463 double-conversion
2464 eigen
2465 expat
2466 fontconfig
2467 freetype
2468 glew
2469 hdf5
2470 imath
2471 jsoncpp
2472 libjpeg-turbo
2473 libpng
2474 libtiff
2475 libx11
2476 lz4
2477 netcdf
2478 opencascade-occt
2479 vtk
2480 zlib))
2481 (home-page "https://f3d-app.github.io/f3d/")
2482 (synopsis "VTK-based 3D viewer")
2483 (description "F3D (pronounced @samp{/fɛd/}) is a VTK-based 3D viewer with
2484 simple interaction mechanisms and which is fully controllable using arguments
2485 on the command line. It supports a range of file formats (including animated
2486 glTF, STL, STEP, PLY, OBJ, FBX), and provides numerous rendering and texturing
2487 options.")
2488 (license license:bsd-3)))