projects/guix·blob ruby-team · refs

3665 lines · 148.1 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015, 2016, 2021, 2022 Ludovic Courtès <[email protected]>
3;;; Copyright © 2015 Tomáš Čech <[email protected]>
4;;; Copyright © 2016, 2019 Leo Famulari <[email protected]>
5;;; Copyright © 2016, 2017, 2019, 2023, 2025 Ricardo Wurmus <[email protected]>
6;;; Copyright © 2016, 2018, 2021, 2023-2025 Efraim Flashner <[email protected]>
7;;; Copyright © 2016, 2026 Andreas Enge <[email protected]>
8;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <[email protected]>
9;;; Copyright © 2017, 2018 Ben Woodcroft <[email protected]>
10;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <[email protected]>
11;;; Copyright © 2018 Mathieu Othacehe <[email protected]>
12;;; Copyright © 2018 Alex Kost <[email protected]>
13;;; Copyright © 2018 Kei Kebreau <[email protected]>
14;;; Copyright © 2019, 2020 Mark H Weaver <[email protected]>
15;;; Copyright © 2019 Carlo Zancanaro <[email protected]>
16;;; Copyright © 2019 Steve Sprang <[email protected]>
17;;; Copyright © 2019 John Soo <[email protected]>
18;;; Copyright © 2019 Pierre Neidhardt <[email protected]>
19;;; Copyright © 2019, 2020 Marius Bakke <[email protected]>
20;;; Copyright © 2019 Tanguy Le Carrour <[email protected]>
21;;; Copyright © 2020 Jakub Kądziołka <[email protected]>
22;;; Copyright © 2020, 2021, 2025 Nicolas Goaziou <[email protected]>
23;;; Copyright © 2020 Raghav Gururajan <[email protected]>
24;;; Copyright © 2020-2026 Maxim Cournoyer <[email protected]>
25;;; Copyright © 2020 Gabriel Arazas <[email protected]>
26;;; Copyright © 2021 Antoine Côté <[email protected]>
27;;; Copyright © 2021 Andy Tai <[email protected]>
28;;; Copyright © 2021 Ekaitz Zarraga <[email protected]>
29;;; Copyright © 2021, 2022 Vinicius Monego <[email protected]>
30;;; Copyright © 2022 Michael Rohleder <[email protected]>
31;;; Copyright © 2022, 2023, 2024 John Kehayias <[email protected]>
32;;; Copyright © 2022, 2024, 2025 Zheng Junjie <[email protected]>
33;;; Copyright © 2022 Tobias Kortkamp <[email protected]>
34;;; Copyright © 2022 Paul A. Patience <[email protected]>
35;;; Copyright © 2022 dan <[email protected]>
36;;; Copyright © 2023 Sharlatan Hellseher <[email protected]>
37;;; Copyright © 2023 David Thompson <[email protected]>
38;;; Copyright © 2023 Eric Bavier <[email protected]>
39;;; Copyright © 2023, 2024 Artyom V. Poptsov <[email protected]>
40;;; Copyright © 2024 Ivan Vilata-i-Balaguer <[email protected]>
41;;; Copyright © 2024 James Smith <[email protected]>
42;;; Copyright © 2025 Nicolas Graves <[email protected]>
43;;; Copyright © 2024 Janneke Nieuwenhuizen <[email protected]>
44;;; Copyright © 2025 James Smith <[email protected]>
45;;; Copyright © 2026 Cayetano Santos <[email protected]>
46;;; Copyright © 2026 Jan Wielkiewicz <[email protected]>
47;;; Copyright © 2026 Sughosha <[email protected]>
48;;;
49;;; This file is part of GNU Guix.
50;;;
51;;; GNU Guix is free software; you can redistribute it and/or modify it
52;;; under the terms of the GNU General Public License as published by
53;;; the Free Software Foundation; either version 3 of the License, or (at
54;;; your option) any later version.
55;;;
56;;; GNU Guix is distributed in the hope that it will be useful, but
57;;; WITHOUT ANY WARRANTY; without even the implied warranty of
58;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
59;;; GNU General Public License for more details.
60;;;
61;;; You should have received a copy of the GNU General Public License
62;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
63
64(define-module (gnu packages graphics)
65 #:use-module (gnu packages)
66 #:use-module (gnu packages algebra)
67 #:use-module (gnu packages audio)
68 #:use-module (gnu packages autotools)
69 #:use-module (gnu packages base)
70 #:use-module (gnu packages bash)
71 #:use-module (gnu packages bison)
72 #:use-module (gnu packages boost)
73 #:use-module (gnu packages build-tools)
74 #:use-module (gnu packages cdrom)
75 #:use-module (gnu packages check)
76 #:use-module (gnu packages cmake)
77 #:use-module (gnu packages compression)
78 #:use-module (gnu packages cpp)
79 #:use-module (gnu packages crypto)
80 #:use-module (gnu packages datastructures)
81 #:use-module (gnu packages documentation)
82 #:use-module (gnu packages compiler-tools)
83 #:use-module (gnu packages fonts)
84 #:use-module (gnu packages fontutils)
85 #:use-module (gnu packages freedesktop)
86 #:use-module (gnu packages game-development)
87 #:use-module (gnu packages gettext)
88 #:use-module (gnu packages ghostscript)
89 #:use-module (gnu packages gl)
90 #:use-module (gnu packages glib)
91 #:use-module (gnu packages gnome)
92 #:use-module (gnu packages gnunet)
93 #:use-module (gnu packages gnuzilla)
94 #:use-module (gnu packages graphviz)
95 #:use-module (gnu packages gstreamer)
96 #:use-module (gnu packages gtk)
97 #:use-module (gnu packages hardware)
98 #:use-module (gnu packages haskell-xyz)
99 #:use-module (gnu packages icu4c)
100 #:use-module (gnu packages image)
101 #:use-module (gnu packages image-processing)
102 #:use-module (gnu packages imagemagick)
103 #:use-module (gnu packages jemalloc)
104 #:use-module (gnu packages kde-frameworks)
105 #:use-module (gnu packages libunwind)
106 #:use-module (gnu packages libusb)
107 #:use-module (gnu packages linux)
108 #:use-module (gnu packages logging)
109 #:use-module (gnu packages llvm)
110 #:use-module (gnu packages lua)
111 #:use-module (gnu packages man)
112 #:use-module (gnu packages maths)
113 #:use-module (gnu packages mp3)
114 #:use-module (gnu packages multiprecision)
115 #:use-module (gnu packages opencl)
116 #:use-module (gnu packages oneapi)
117 #:use-module (gnu packages pciutils)
118 #:use-module (gnu packages pdf)
119 #:use-module (gnu packages perl)
120 #:use-module (gnu packages photo)
121 #:use-module (gnu packages pkg-config)
122 #:use-module (gnu packages plotutils)
123 #:use-module (gnu packages pretty-print)
124 #:use-module (gnu packages pth)
125 #:use-module (gnu packages pulseaudio) ; libsndfile, libsamplerate
126 #:use-module (gnu packages python)
127 #:use-module (gnu packages python-build)
128 #:use-module (gnu packages python-xyz)
129 #:use-module (gnu packages qt)
130 #:use-module (gnu packages readline)
131 #:use-module (gnu packages sdl)
132 #:use-module (gnu packages serialization)
133 #:use-module (gnu packages stb)
134 #:use-module (gnu packages swig)
135 #:use-module (gnu packages tbb)
136 #:use-module (gnu packages toolkits)
137 #:use-module (gnu packages upnp)
138 #:use-module (gnu packages version-control)
139 #:use-module (gnu packages video)
140 #:use-module (gnu packages vulkan)
141 #:use-module (gnu packages web)
142 #:use-module (gnu packages xiph)
143 #:use-module (gnu packages xml)
144 #:use-module (gnu packages xorg)
145 #:use-module (gnu packages xdisorg)
146 #:use-module (guix build-system copy)
147 #:use-module (guix build-system cmake)
148 #:use-module (guix build-system gnu)
149 #:use-module (guix build-system meson)
150 #:use-module (guix build-system pyproject)
151 #:use-module (guix build-system qt)
152 #:use-module (guix download)
153 #:use-module (guix gexp)
154 #:use-module (guix git-download)
155 #:use-module (guix hg-download)
156 #:use-module ((guix licenses) #:prefix license:)
157 #:use-module (guix packages)
158 #:use-module (guix deprecation)
159 #:use-module (guix utils)
160 #:use-module (ice-9 match))
161
162(define-public mmm
163 (package
164 (name "mmm")
165 (version "0.1.1")
166 (source
167 (origin
168 (method git-fetch)
169 (uri
170 (git-reference
171 (url "https://github.com/hodefoting/mmm")
172 (commit version)))
173 (file-name
174 (git-file-name name version))
175 (sha256
176 (base32 "1xmcv6rwinqsbr863rgl9005h2jlmd7k2qrwsc1h4fb8r61ykpjl"))))
177 (build-system meson-build-system)
178 (arguments
179 (list #:phases #~(modify-phases %standard-phases
180 ;; XXX: Meson build fails due to a misspelling of
181 ;; "description" keyword in the configuration. This phase
182 ;; fixes that.
183 (add-after 'unpack 'patch-meson-build
184 (lambda _
185 (substitute* "meson.build"
186 (("not stable, Description:")
187 "not stable, description:")))))))
188 (native-inputs
189 (list luajit pkg-config))
190 (inputs
191 (list alsa-lib sdl sdl2))
192 (synopsis "Memory Mapped Machine")
193 (description "MMM is a shared memory protocol for virtualising access to
194framebuffer graphics, audio output and input event.")
195 (home-page "https://github.com/hodefoting/mmm")
196 (license license:isc)))
197
198(define-public directfb
199 (package
200 (name "directfb")
201 (version "1.7.7")
202 (source
203 (origin
204 (method git-fetch)
205 (uri
206 (git-reference
207 (url "https://github.com/deniskropp/DirectFB")
208 (commit "DIRECTFB_1_7_7")))
209 (file-name (git-file-name name version))
210 (sha256
211 (base32 "0bs3yzb7hy3mgydrj8ycg7pllrd2b6j0gxj596inyr7ihssr3i0y"))))
212 (build-system gnu-build-system)
213 (arguments
214 `(#:parallel-build? #f
215 #:configure-flags
216 '("CFLAGS=-g -O2 -Wno-error=incompatible-pointer-types")
217 #:phases
218 (modify-phases %standard-phases
219 (add-after 'unpack 'remove-buildtime
220 ;; Remove embedded build time for reproducible builds
221 (lambda _
222 (substitute* "src/core/core.c"
223 (("..BUILDTIME..") ""))))
224 ;; TODO: Move patch to source.
225 ,@(if (target-arm32?)
226 `((add-after 'unpack 'patch-source
227 (lambda* (#:key inputs #:allow-other-keys)
228 (invoke "patch" "--force" "-p1" "-i"
229 (assoc-ref inputs "patch-file")))))
230 '())
231 (add-after 'unpack 'disable-configure-during-bootstrap
232 (lambda _
233 (substitute* "autogen.sh"
234 (("^.*\\$srcdir/configure.*") "")))))))
235 (native-inputs
236 `(("autoconf" ,autoconf)
237 ("automake" ,automake)
238 ("libtool" ,libtool)
239 ("perl" ,perl)
240 ("pkg-config" ,pkg-config)
241 ,@(if (target-arm32?)
242 `(("patch" ,patch)
243 ("patch-file"
244 ,(search-patch "directfb-davinci-glibc-228-compat.patch")))
245 '())))
246 (inputs
247 (list alsa-lib
248 ffmpeg
249 freetype
250 glu
251 gstreamer
252 imlib2
253 jasper
254 libjpeg-turbo
255 libcddb
256 libdrm
257 libtimidity
258 libmad
259 libmng
260 libmpeg2
261 libmpeg3
262 mesa
263 libpng
264 sdl
265 (librsvg-for-system)
266 libtiff
267 tslib
268 libvdpau
269 libvorbis
270 wayland
271 libwebp
272 libx11
273 libxcomposite
274 libxext
275 xorgproto
276 zlib))
277 (propagated-inputs
278 (list flux))
279 (synopsis "DFB Graphics Library")
280 (description "DirectFB is a graphics library which was designed with embedded
281systems in mind. It offers maximum hardware accelerated performance at a
282minimum of resource usage and overhead.")
283 (home-page "https://github.com/deniskropp/DirectFB")
284 (license license:lgpl2.1+)))
285
286(define-public minifb
287 (let ((commit "43f8c1309341f4709a471b592d04434326042483")
288 (revision "1"))
289 (package
290 (name "minifb")
291 (version (git-version "0" revision commit))
292 (source (origin
293 (method git-fetch)
294 (uri
295 (git-reference
296 (url "https://github.com/emoon/minifb")
297 (commit commit)))
298 (file-name (git-file-name name version))
299 (sha256
300 (base32 "1z0720azsgi83yg4ysmfvpvsg0566s2cq59xx52w8w5rpkla4cjh"))))
301 (build-system cmake-build-system)
302 (arguments
303 ;; Don't build examples.
304 '(#:configure-flags '("-DMINIFB_BUILD_EXAMPLES=0")
305 #:phases
306 ;; There is no install target, so we have to copy the static library
307 ;; and headers to the output directory ourselves.
308 (modify-phases %standard-phases
309 (replace 'install
310 (lambda* (#:key outputs #:allow-other-keys)
311 (let* ((out (assoc-ref outputs "out"))
312 (includedir (string-append out "/include"))
313 (libdir (string-append out "/lib")))
314 (mkdir-p includedir)
315 (mkdir-p libdir)
316 (for-each (lambda (header)
317 (copy-file header
318 (string-append includedir "/"
319 (basename header))))
320 (find-files "../source/include" "\\.h$"))
321 (copy-file "libminifb.a" (string-append libdir "/libminifb.a"))))))
322 ;; No check target.
323 #:tests? #f))
324 ;; libminifb.a won't work without these libraries, so propagate them.
325 (propagated-inputs (list libx11 libxkbcommon mesa))
326 (synopsis "Small library for rendering pixels to a framebuffer")
327 (description "MiniFB (Mini FrameBuffer) is a small, cross-platform
328library that makes it easy to render (32-bit) pixels in a window.")
329 (home-page "https://github.com/emoon/minifb")
330 (license license:expat))))
331
332(define-public flux
333 (package
334 (name "flux")
335 (version "1.4.4")
336 (source
337 (origin
338 (method git-fetch)
339 (uri
340 (git-reference
341 (url "https://github.com/deniskropp/flux")
342 (commit "e45758a")))
343 (file-name (git-file-name name version))
344 (sha256
345 (base32 "11f3ypg0sdq5kj69zgz6kih1yrzgm48r16spyvzwvlswng147410"))))
346 (build-system gnu-build-system)
347 (native-inputs
348 (list autoconf automake libtool pkg-config))
349 (synopsis "Interface description language")
350 (description "Flux is an interface description language used by DirectFB.
351Fluxcomp compiles .flux files to .cpp or .c files.")
352 (home-page "https://www.directfb.org/")
353 (license license:lgpl2.1+))) ; Same as DirectFB
354
355(define-public fox
356 (package
357 (name "fox")
358 (version "1.6.57")
359 (source
360 (origin
361 (method url-fetch)
362 (uri
363 (string-append "https://fox-toolkit.org/ftp/fox-" version ".tar.gz"))
364 (sha256
365 (base32 "08w98m6wjadraw1pi13igzagly4b2nfa57kdqdnkjfhgkvg1bvv5"))))
366 (build-system gnu-build-system)
367 (arguments
368 `(#:phases
369 (modify-phases %standard-phases
370 (add-after 'unpack 'patch
371 (lambda _
372 (substitute* "configure"
373 (("-I/usr/include/freetype2")
374 (string-append "-I"
375 (string-append
376 (assoc-ref %build-inputs "freetype")
377 "/include/freetype2"))))
378 #t)))))
379 (native-inputs
380 (list doxygen))
381 (inputs
382 `(("bzip2" ,lbzip2)
383 ("freetype" ,freetype)
384 ("gl" ,mesa)
385 ("glu" ,glu)
386 ("jpeg" ,libjpeg-turbo)
387 ("png" ,libpng)
388 ("tiff" ,libtiff)
389 ("x11" ,libx11)
390 ("xcursor" ,libxcursor)
391 ("xext" ,libxext)
392 ("xfixes" ,libxfixes)
393 ("xft" ,libxft)
394 ("xinput" ,libxi)
395 ("xrandr" ,libxrandr)
396 ("xrender" ,libxrender)
397 ("xshm" ,libxshmfence)
398 ("zlib" ,zlib)))
399 (synopsis "Widget Toolkit for building GUI")
400 (description"FOX (Free Objects for X) is a C++ based Toolkit for developing
401Graphical User Interfaces easily and effectively. It offers a wide, and
402growing, collection of Controls, and provides state of the art facilities such
403as drag and drop, selection, as well as OpenGL widgets for 3D graphical
404manipulation. FOX also implements icons, images, and user-convenience features
405such as status line help, and tooltips. Tooltips may even be used for 3D
406objects!")
407 (home-page "http://www.fox-toolkit.org")
408 (license license:lgpl2.1+)))
409
410(define-public friction
411 (package
412 (name "friction")
413 (version "0.9.6.1")
414 (source
415 (origin
416 (method git-fetch)
417 (uri (git-reference
418 (url "https://github.com/friction2d/friction")
419 (commit (string-append "v" version))
420 (recursive? #true)))
421 (file-name (git-file-name name version))
422 (sha256
423 (base32 "1ndg9f4m3zmdn89llchfnc4dmhckms3cx8vm6pqr8fvd7w95ak37"))
424 (modules '((guix build utils)))
425 (snippet
426 '(begin
427 (delete-file-recursively "src/engine/skia")
428 (delete-file-recursively "src/gperftools")))))
429 (build-system cmake-build-system)
430 (arguments
431 (list
432 #:tests? #false ;there is no test target
433 #:configure-flags
434 '(list "-DCMAKE_CXX_COMPILER=clang++"
435 "-DCMAKE_C_COMPILER=clang")
436 #:phases
437 #~(modify-phases %standard-phases
438 (add-after 'unpack 'use-system-libraries
439 (lambda _
440 (substitute* "CMakeLists.txt"
441 (("add_subdirectory\\(src/engine\\)") "")
442 (("add_dependencies\\(frictioncore Engine\\)") "")
443 (("add_subdirectory\\(src/gperftools\\)") ""))
444 (substitute* "src/app/CMakeLists.txt"
445 (("\\$\\{GPERF_LIBRARIES\\}") "-ltcmalloc_and_profiler")
446 (("\\$\\{GPERF_INCLUDE_DIRS\\}")
447 (string-append #$(this-package-input "gperftools") "/include")))
448 (substitute* "src/app/memorychecker.cpp"
449 (("../gperftools/include/") ""))
450 (substitute* '("src/app/CMakeLists.txt"
451 "src/core/CMakeLists.txt"
452 "src/ui/CMakeLists.txt")
453 (("\\$\\{CMAKE_CURRENT_BINARY_DIR\\}/../engine/skia")
454 (string-append #$(this-package-input "skia") "/lib/"))
455 (("\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}/../engine/skia")
456 (string-append #$(this-package-input "skia") "/include/skia")))))
457 ;; Ensure that all required Qt plugins are found at runtime.
458 (add-after 'install 'wrap-executable
459 (lambda* (#:key inputs #:allow-other-keys)
460 (let ((qt '("qtbase" "qtdeclarative" "qtmultimedia")))
461 (wrap-program (string-append #$output "/bin/friction")
462 `("QT_PLUGIN_PATH" ":" prefix
463 ,(map (lambda (label)
464 (string-append (assoc-ref inputs label)
465 "/lib/qt5/plugins/"))
466 qt)))))))))
467 (inputs
468 (list expat
469 ffmpeg-6
470 fontconfig
471 freetype
472 gperftools-for-friction
473 harfbuzz
474 icu4c
475 libjpeg-turbo
476 libpng
477 libunwind
478 libwebp
479 python
480 qscintilla-qt5
481 qtbase-5
482 qtdeclarative-5
483 qtmultimedia-5
484 skia-for-friction
485 zlib))
486 (native-inputs (list clang-15 llvm-15 pkg-config))
487 (home-page "https://friction.graphics")
488 (synopsis "Create vector and raster animations for web and video")
489 (description "Friction is a versatile motion graphics application that
490allows you to create vector and raster animations for web and video.
491
492Motion graphics has a wide variety of uses, including:
493
494@itemize
495@item Television and film: Title sequences, commercials, and visual effects
496@item Web design: Animated logos, banners, and interactive elements
497@item Social media: Animated posts and stories
498@item Presentations: Animated infographics and slideshows
499@end itemize
500")
501 (license license:gpl3+)))
502
503(define-public godsvg
504 (package
505 (name "godsvg")
506 (version "1.0-alpha13")
507 (source (origin
508 (method git-fetch)
509 (uri (git-reference
510 (url "https://github.com/MewPurPur/GodSVG")
511 (commit (string-append "v" version))))
512 (file-name (git-file-name name version))
513 (sha256
514 (base32
515 "0p9vhvvgmydhpy7yl8hlzrjif2246ais8cv3ji093m4ggc5hnsxa"))))
516 (build-system gnu-build-system)
517 (arguments
518 (list #:tests? #f ; No tests exist.
519 #:phases
520 #~(modify-phases %standard-phases
521 ;; FPS is uncapped by default, resulting in the editor consuming
522 ;; all available resources while idling. Set a more reasonable
523 ;; default.
524 (add-after 'unpack 'cap-fps
525 (lambda _
526 (substitute* "src/config_classes/SaveData.gd"
527 (("(\"max_fps\": return |var max_fps := )0" _ pre)
528 (string-append pre "30")))))
529 (delete 'configure)
530 (replace 'build
531 (lambda* (#:key inputs native-inputs #:allow-other-keys)
532 (let ((native (or native-inputs inputs)))
533 (invoke (search-input-file native "bin/godot")
534 "--headless" "--export-pack" "Linux"
535 "godsvg.pck" "project.godot"))))
536 (replace 'install
537 (lambda* (#:key inputs #:allow-other-keys)
538 (let ((bin (string-append #$output "/bin"))
539 (share (string-append #$output "/share/godot")))
540 (mkdir-p bin)
541 (install-file "godsvg.pck" share)
542 (call-with-output-file (string-append bin "/godsvg")
543 (lambda (port)
544 (format port "#!~a~%exec ~a --main-pack ~a~%"
545 (search-input-file inputs "bin/bash")
546 (search-input-file inputs "bin/godot")
547 (string-append share "/godsvg.pck"))))
548 (chmod (string-append bin "/godsvg") #o755)))))))
549 (supported-systems (filter target-linux? %supported-systems))
550 (inputs (list bash godot))
551 (native-inputs (list godot))
552 (home-page "https://www.godsvg.com/")
553 (synopsis "Real-time SVG design tool")
554 (description "GodSVG is a structured WYSIWYG SVG editor allowing image
555editing and source editing simultaneously.")
556 (license license:expat)))
557
558(define-public autotrace
559 (package
560 (name "autotrace")
561 (version "0.31.10")
562 (source (origin
563 (method git-fetch)
564 (uri (git-reference
565 (url "https://github.com/autotrace/autotrace")
566 (commit version)))
567 (file-name (git-file-name name version))
568 (sha256
569 (base32
570 "0ai91c567c5z560s4zjgjclgca1pm61h8cb8c8q84wg3xvkhmc9x"))))
571 (build-system gnu-build-system)
572 (arguments
573 (list #:configure-flags #~'("--disable-static")
574 #:phases
575 #~(modify-phases %standard-phases
576 (add-after 'unpack 'fix-pkg-config-file
577 (lambda _
578 ;; autotrace can be built against either GraphicsMagick or
579 ;; ImageMagick. However the pkg-config file refers to
580 ;; non-existent MAGICK_ variables instead of GRAPHICSMAGICK_
581 ;; or IMAGEMAGICK_; fix that.
582 (substitute* "autotrace.pc.in"
583 (("@MAGICK_(LIBS|CFLAGS)@" _ var)
584 (string-append "@IMAGEMAGICK_" var "@"))))))))
585 (native-inputs
586 (list which
587 autoconf
588 automake
589 libtool
590 intltool
591 pkg-config
592 procps)) ;for tests
593 (inputs
594 (list glib
595 imagemagick
596 libjpeg-turbo
597 libpng
598 pstoedit
599 ;; pango is required because of libtool, from the imagemagick
600 ;; library files (.la), which records all its transitive
601 ;; dependencies.
602 pango))
603 (home-page "https://github.com/autotrace/autotrace")
604 (synopsis "Bitmap to vector graphics converter")
605 (description "AutoTrace is a utility for converting bitmap into vector
606graphics. It can trace outlines and midlines, effect color reduction or
607despeckling and has support for many input and output formats. It can be used
608with the @command{autotrace} utility or as a C library, @code{libautotrace}.")
609 (license (list license:gpl2+ ;for the utility itself
610 license:lgpl2.1+)))) ;for use as a library
611
612(define-public embree
613 (package
614 (name "embree")
615 (version "4.4.1")
616 (source (origin
617 (method git-fetch)
618 (uri (git-reference
619 (url "https://github.com/RenderKit/embree")
620 (commit (string-append "v" version))))
621 (file-name (git-file-name name version))
622 (sha256
623 (base32
624 "1hyv68b0q6chflf9p1s64z2qcddv7yrh2f4vjf9nclnpgnkjv4k4"))))
625 (build-system cmake-build-system)
626 (arguments
627 (list
628 #:tests? #f ; no tests (apparently)
629 #:configure-flags
630 #~(list "-DEMBREE_ISPC_SUPPORT=OFF"
631 #$@(cond
632 ((target-x86-64?)
633 ;; They SAY that that's the default--but it isn't
634 ;; (that would be AVX512--and that segfaults GCC (!)).
635 '("-DEMBREE_MAX_ISA=AVX2"))
636 ((target-aarch64?)
637 '("-DEMBREE_ARM=ON"
638 "-DEMBREE_IGNORE_CMAKE_CXX_FLAGS=OFF"
639 "-DCMAKE_CXX_FLAGS=-flax-vector-conversions"))
640 (else
641 '())))
642 #:phases
643 #~(modify-phases %standard-phases
644 (add-after 'install 'install-pkg-config
645 (lambda _
646 (let* ((pkgconfig-dir (string-append #$output "/lib/pkgconfig"))
647 (pc-file (string-append pkgconfig-dir "/embree4.pc")))
648 (mkdir-p pkgconfig-dir)
649 (call-with-output-file pc-file
650 (lambda (port)
651 (format port "\
652prefix=~a
653exec_prefix=${prefix}
654libdir=${exec_prefix}/lib
655includedir=${prefix}/include
656
657Name: Embree
658Description: High-performance ray tracing library
659Version: ~a
660Cflags: -I${includedir}
661Libs: -L${libdir} -lembree4
662" #$output #$version)))))))))
663 (inputs
664 (list glfw onetbb))
665 (home-page "https://www.embree.org/")
666 (synopsis "High performance ray tracing kernels")
667 (description
668 "Embree is a collection of high-performance ray tracing kernels.
669Embree is meant to increase performance of photo-realistic rendering
670applications.")
671 ;; From the README: Embree requires at least an x86 CPU with support for
672 ;; SSE2 or an Apple M1 CPU.
673 (supported-systems '("x86_64-linux" "aarch64-linux"))
674 (license license:asl2.0)))
675
676(define-public embree-3
677 (package
678 (inherit embree)
679 (name "embree")
680 (version "3.13.5")
681 (source (origin
682 (method git-fetch)
683 (uri (git-reference
684 (url "https://github.com/embree/embree")
685 (commit (string-append "v" version))))
686 (file-name (git-file-name name version))
687 (sha256
688 (base32
689 "1kcvz7g6j56anv9zjyd3gidxl46vipw0gg82lns12m45cd43iwxm"))))
690 (arguments
691 (substitute-keyword-arguments arguments
692 ((#:phases phases)
693 #~(modify-phases #$phases
694 (delete 'install-pkg-config)))))))
695
696(define-public openvdb
697 (package
698 (name "openvdb")
699 (version "13.0.0")
700 (source (origin
701 (method git-fetch)
702 (uri (git-reference
703 (url "https://github.com/AcademySoftwareFoundation/openvdb/")
704 (commit (string-append "v" version))
705 (recursive? #t)))
706 (file-name (git-file-name name version))
707 (sha256
708 (base32
709 "0q9ri8mjfyj0wq39d04pjnc5ijv0x28qc7lsfzcr7wmbz1jxvmzs"))))
710 (build-system cmake-build-system)
711 (arguments
712 (list #:tests? #f
713 #:configure-flags
714 #~(list (string-append "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath="
715 #$output "/lib"))))
716 (inputs
717 (list boost c-blosc jemalloc onetbb-2022 zlib))
718 (native-inputs
719 (list pkg-config))
720 (home-page "https://www.openvdb.org/")
721 (synopsis "Sparse volume data structure and tools")
722 (description "OpenVDB is a C++ library comprising a hierarchical data
723structure and a large suite of tools for the efficient storage and
724manipulation of sparse volumetric data discretized on three-dimensional grids.
725It was developed by DreamWorks Animation for use in volumetric applications
726typically encountered in feature film production.")
727 (license license:mpl2.0)))
728
729(define-public blender-assets
730 (package
731 (name "blender-assets")
732 (version "4.4.3")
733 (source
734 (origin
735 (method git-fetch/lfs) ;Needs LFS because .blender files are dummies
736 (uri (git-reference
737 (url "https://projects.blender.org/blender/blender-assets.git")
738 (commit (string-append "v" version))))
739 (file-name (git-file-name name version))
740 (modules '((guix build utils)))
741 (snippet '(begin
742 (delete-file-recursively "working")))
743 (sha256
744 (base32 "1011zn4g1f5hs4dqar4sa7mh02kl4jnrwkpl6gfsi6sc0qhrxxdz"))))
745 (build-system copy-build-system)
746 (home-page "https://www.blender.org/")
747 (synopsis "Bundled assets for Blender")
748 (description
749 "Assets bundled with Blender releases in the Essentials assets library.")
750 (license license:cc0)))
751
752(define-public blender
753 (package
754 (name "blender")
755 (version "4.5.10") ;5.1.x+ requires Python >= 3.13
756 (source (origin
757 (method url-fetch)
758 (uri (string-append "https://download.blender.org/source/"
759 "blender-" version ".tar.xz"))
760 (sha256
761 (base32
762 "1z4sq4rmg5lx0502i2kgalmdyw3a4kc3lw70kwnwkih5wkjnrbyx"))))
763 (build-system cmake-build-system)
764 (arguments
765 (list
766 ;; Test files are very large and not included in the release tarball.
767 #:tests? #f
768 #:configure-flags
769 (let ((python-version (version-major+minor (package-version python))))
770 #~(list "-DWITH_CODEC_FFMPEG=ON"
771 "-DWITH_CODEC_SNDFILE=ON"
772 "-DWITH_CYCLES=ON"
773 "-DWITH_DOC_MANPAGE=ON"
774 "-DWITH_FFTW3=ON"
775 "-DWITH_IMAGE_OPENJPEG=ON"
776 "-DWITH_INPUT_NDOF=ON"
777 "-DWITH_INSTALL_PORTABLE=OFF"
778 "-DWITH_JACK=ON"
779 "-DWITH_MOD_OCEANSIM=ON"
780 "-DWITH_OPENVDB=ON"
781 "-DWITH_OPENSUBDIV=ON"
782 "-DWITH_PYTHON_INSTALL=OFF"
783 "-DWITH_SYSTEM_BULLET=ON"
784 "-DWITH_SYSTEM_EIGEN3=ON"
785 "-DWITH_SYSTEM_FREETYPE=ON"
786 "-DWITH_SYSTEM_GLOG=ON"
787 "-DWITH_SYSTEM_LZO=ON"
788 (string-append "-DPYTHON_LIBRARY=python" #$python-version)
789 (string-append "-DPYTHON_LIBPATH=" #$python "/lib")
790 (string-append "-DPYTHON_INCLUDE_DIR=" #$python
791 "/include/python" #$python-version)
792 (string-append "-DPYTHON_VERSION=" #$python-version)
793 (string-append "-DPYTHON_NUMPY_INCLUDE_DIRS="
794 #$(this-package-input "python-numpy")
795 "/lib/python" #$python-version
796 "/site-packages/numpy/core/include/")
797 (string-append "-DPYTHON_NUMPY_PATH="
798 #$(this-package-input "python-numpy")
799 "/lib/python" #$python-version
800 "/site-packages/")))
801 #:phases
802 #~(modify-phases %standard-phases
803 (add-after 'unpack 'install-assets
804 (lambda _
805 (copy-recursively #$(this-package-input "blender-assets")
806 "./release/datafiles/assets")))
807 (add-after 'install 'link-python-binary
808 (lambda _
809 (let* ((blender-dir (string-append #$output "/share/blender/"
810 #$(version-major+minor version)))
811 (blender-python-dir (string-append blender-dir "/python")))
812 (mkdir-p blender-dir)
813 (symlink #$(this-package-input "python")
814 blender-python-dir))))
815 (add-after 'install 'wrap-bin
816 (lambda _
817 (let ((python-path (getenv "GUIX_PYTHONPATH")))
818 (when python-path
819 (wrap-program (string-append #$output "/bin/blender")
820 `("GUIX_PYTHONPATH" ":" prefix (,python-path))))))))))
821 (native-inputs
822 (list pkg-config))
823 (inputs
824 (list bash-minimal
825 blender-assets
826 boost
827 bullet
828 eigen
829 embree
830 ffmpeg-6
831 fftw
832 fftwf
833 freetype-with-brotli
834 glew
835 glog
836 gmp ;needed for boolean operations on meshes
837 imath
838 jack-1
839 jemalloc
840 libepoxy
841 libjpeg-turbo
842 libpng
843 libsndfile
844 libtiff
845 libx11
846 libxi
847 libxrender
848 lzo
849 onetbb
850 openal
851 opencolorio
852 openexr
853 openimageio
854 openjpeg
855 opensubdiv
856 openvdb
857 pugixml
858 python
859 python-numpy-1
860 shaderc
861 vulkan-headers
862 vulkan-loader
863 zlib
864 `(,zstd "lib")))
865 (home-page "https://www.blender.org/")
866 (synopsis "3D graphics creation suite")
867 (description
868 "Blender is a 3D graphics creation suite. It supports the entirety of
869the 3D pipeline—modeling, rigging, animation, simulation, rendering,
870compositing and motion tracking, even video editing and game creation. The
871application can be customized via its API for Python scripting.")
872 (license license:gpl2+)))
873
874(define-public goxel
875 ;; The latest commit is used as it builds with GCC 14.
876 (let ((commit "66d36e0c3511479ceaac8cbf9f5c7c3e619b30d3")
877 (revision "0"))
878 (package
879 (name "goxel")
880 (version (git-version "0.15.1" revision commit))
881 (source
882 (origin
883 (method git-fetch)
884 (uri (git-reference
885 (url "https://github.com/guillaumechereau/goxel")
886 (commit commit)))
887 (file-name (git-file-name name version))
888 (sha256
889 (base32 "18xbfkn3xh5y88iahrykyqh5nykkx7y468f450l5gdiagwpgz7g2"))))
890 (build-system gnu-build-system)
891 (arguments
892 (list
893 #:tests? #f
894 #:make-flags
895 #~(list (string-append "PREFIX=" #$output)
896 "release")
897 #:phases
898 #~(modify-phases %standard-phases
899 ;; No configure provided
900 (delete 'configure))))
901 (native-inputs
902 (list pkg-config
903 scons))
904 (inputs
905 (list gtk+
906 glfw
907 libpng))
908 (home-page "https://goxel.xyz/")
909 (synopsis "Voxel editor")
910 (description
911 "Goxel is a voxel editor that features unlimited scene size, unlimited
912history buffer, 24-bit RGB colors, layers, procedural rendering, ray tracing,
913and export to various formats including the format used by Magicavoxel.")
914 (license license:gpl3+))))
915
916(define-public assimp
917 (package
918 (name "assimp")
919 (version "5.4.3")
920 (source (origin
921 (method git-fetch)
922 (uri (git-reference
923 (url "https://github.com/assimp/assimp")
924 (commit (string-append "v" version))))
925 (file-name (git-file-name name version))
926 (sha256
927 (base32
928 "097fxq0frb2nl6bp8wz7kjx6vq4i4117wwq9fnxzkiij9xwv3cq9"))))
929 (arguments
930 (list #:phases
931 #~(modify-phases %standard-phases
932 (add-after 'unpack 'enable-testing
933 (lambda _
934 (substitute* "CMakeLists.txt"
935 (("IF \\( ASSIMP_BUILD_TESTS \\)" all)
936 (string-append all "\n enable_testing()")))
937 (substitute* "test/CMakeLists.txt"
938 ;; Leave the test binary where ctest will look for it.
939 (("TARGET_USE_COMMON_OUTPUT_DIRECTORY\\(unit\\)")
940 ""))
941
942 ;; Some tests fail on aarch64:
943 ;; <https://github.com/assimp/assimp/issues/6246>.
944 (when #$(target-aarch64?)
945 (substitute* "test/unit/AssimpAPITest_aiMatrix3x3.cpp"
946 (("aiMatrix3FromToTest")
947 "DISABLED_aiMatrix3FromToTest"))
948 (substitute* "test/unit/AssimpAPITest_aiMatrix4x4.cpp"
949 (("aiMatrix4FromToTest")
950 "DISABLED_aiMatrix4FromToTest"))
951 (substitute* "test/unit/AssimpAPITest_aiQuaternion.cpp"
952 (("aiQuaternionFromNormalizedQuaternionTest")
953 "DISABLED_aiQuaternionFromNormalizedQuaternionTest"))))))))
954 (build-system cmake-build-system)
955 (inputs
956 (list zlib))
957 (home-page "https://www.assimp.org/")
958 (synopsis "Asset import library")
959 (description
960 "The Open Asset Import Library loads more than 40 3D file formats into
961one unified data structure. Additionally, assimp features various mesh post
962processing tools: normals and tangent space generation, triangulation, vertex
963cache locality optimization, removal of degenerate primitives and duplicate
964vertices, sorting by primitive type, merging of redundant materials and many
965more.")
966 (license license:bsd-3)))
967
968(define-public mikktspace
969 ;; The latest commit is used as there is no release.
970 (let ((commit "3e895b49d05ea07e4c2133156cfa94369e19e409")
971 (revision "0"))
972 (package
973 (name "mikktspace")
974 (version (git-version "0.0.0" revision commit))
975 (source (origin
976 (method git-fetch)
977 (uri (git-reference
978 (url "https://github.com/mmikk/MikkTSpace")
979 (commit commit)))
980 (file-name (git-file-name name version))
981 (sha256
982 (base32
983 "1rjh9zflx51hdhnfadal87v4hhkrbprkv692hjkg9wkxx0ch39zi"))))
984 (build-system gnu-build-system)
985 (arguments
986 (list #:tests? #f
987 #:phases
988 #~(modify-phases %standard-phases
989 (delete 'configure)
990 (replace 'build
991 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
992 (invoke #$(cc-for-target) "mikktspace.c" "-O2" "-g" "-fPIC"
993 "-shared" "-o" "libmikktspace.so")))
994 (replace 'install
995 (lambda _
996 (install-file "mikktspace.h"
997 (string-append #$output "/include"))
998 (install-file "libmikktspace.so"
999 (string-append #$output "/lib")))))))
1000 (home-page "http://www.mikktspace.com/")
1001 (synopsis "Library for a common standard for tangent spaces")
1002 (description
1003 "This package provides a common standard tangent space library used in
1004baking tools to produce normal maps.")
1005 (license license:zlib))))
1006
1007(define-public openshadinglanguage
1008 (package
1009 (name "openshadinglanguage")
1010 (version "1.13.10.0")
1011 (source
1012 (origin
1013 (method git-fetch)
1014 (uri (git-reference
1015 (url "https://github.com/AcademySoftwareFoundation/OpenShadingLanguage")
1016 (commit (string-append "v" version))))
1017 (file-name (git-file-name name version))
1018 (sha256
1019 (base32 "1x97w4infifw33r4ii53q3v1ia0p21lbacd7z01vsz4vq7sy0dxn"))))
1020 (build-system cmake-build-system)
1021 (arguments
1022 (list #:configure-flags
1023 #~(list "-DUSE_PARTIO=OFF" ; TODO: not packaged
1024 (string-append "-DLLVM_BC_GENERATOR="
1025 #$(this-package-native-input "clang")
1026 "/bin/clang++"))
1027 #:test-exclude (string-join
1028 (list
1029 "osl-imageio" ; file does not exist
1030 "osl-imageio.opt" ; file does not exist
1031 "osl-imageio.opt.rs_bitcode" ; file does not exist
1032 "texture-udim" ; file does not exist
1033 "texture-udim.opt" ; file does not exist
1034 "texture-udim.opt.rs_bitcode" ; file does not exist
1035 "example-deformer" ; could not find OSLConfig
1036 "python-oslquery") ; no module oslquery
1037 "|")))
1038 (native-inputs
1039 (list bison
1040 clang-13
1041 flex
1042 llvm-13
1043 pybind11-2
1044 python-wrapper))
1045 (inputs
1046 (list boost-1.83
1047 imath
1048 openexr
1049 openimageio
1050 pugixml
1051 qtbase
1052 zlib))
1053 (home-page "https://github.com/AcademySoftwareFoundation/OpenShadingLanguage")
1054 (synopsis "Shading language for production GI renderers")
1055 (description "Open Shading Language (OSL) is a language for programmable
1056shading in advanced renderers and other applications, ideal for describing
1057materials, lights, displacement, and pattern generation.")
1058 (license license:bsd-3)))
1059
1060(define-public tachyon
1061 (package
1062 (name "tachyon")
1063 (version "0.99.5")
1064 (source (origin
1065 (method url-fetch)
1066 (uri (string-append
1067 "http://jedi.ks.uiuc.edu/~johns/raytracer/files/"
1068 version "/tachyon-" version ".tar.gz"))
1069 (sha256
1070 (base32
1071 "1xd6h5d4v6dsnm6w46bdcr15fwkcz44p8dncymfry50i4c83q809"))))
1072 (build-system gnu-build-system)
1073 (arguments
1074 (list #:tests? #f ; no tests
1075 #:make-flags #~(list "linux-thr")
1076 #:phases
1077 #~(modify-phases %standard-phases
1078 (delete 'configure)
1079 (add-after 'unpack 'prepare-src
1080 (lambda _
1081 (substitute* "unix/Make-arch"
1082 (("CC = cc")
1083 (string-append "CC = " #$(cc-for-target))))
1084 (chdir "unix")))
1085 (add-before 'build 'enable-png-jpeg-support
1086 (lambda* (#:key inputs #:allow-other-keys)
1087 (substitute* "Make-config"
1088 (("USEJPEG=")
1089 "USEJPEG = -DUSEJPEG")
1090 (("JPEGLIB=")
1091 "JPEGLIB = -ljpeg")
1092 (("USEPNG=")
1093 "USEPNG = -DUSEPNG")
1094 (("PNGLIB=")
1095 "PNGLIB = -lpng -lz"))))
1096 (add-before 'build 'fix-paths
1097 (lambda* (#:key inputs #:allow-other-keys)
1098 (substitute* "Make-config"
1099 (("SHELL=/bin/sh")
1100 (string-append "SHELL=" (which "sh"))))))
1101 (replace 'install
1102 (lambda _
1103 (install-file "../compile/linux-thr/tachyon"
1104 (string-append #$output "/bin"))
1105 (install-file "../compile/linux-thr/libtachyon.a"
1106 (string-append #$output "/lib")))))))
1107 (inputs (list libjpeg-turbo libpng))
1108 ;; The server does not seem to be reliably accessible
1109 (home-page "http://jedi.ks.uiuc.edu/~johns/raytracer/")
1110 (synopsis "Multithreaded ray tracing software")
1111 (description
1112 "This package contains the Tachyon raytracer. It supports the typical
1113ray tracer features, most of the common geometric primitives, shading and
1114texturing modes, etc. It also supports less common features such as HDR image
1115output, ambient occlusion lighting, and support for various triangle mesh and
1116volumetric texture formats beneficial for molecular visualization.")
1117 (license license:bsd-3)))
1118
1119(define-public cgal-5
1120 (package
1121 (name "cgal")
1122 (version "5.6.3")
1123 (source
1124 (origin
1125 (method git-fetch)
1126 (uri (git-reference
1127 (url "https://github.com/CGAL/cgal")
1128 (commit (string-append "v" version))))
1129 (file-name (git-file-name name version))
1130 (sha256
1131 (base32 "025dn5jphjw7arj5d6pvn7wcc4410wdi42h0ggcrqz9s4qvjwbf1"))))
1132 (build-system cmake-build-system)
1133 (arguments
1134 `(#:configure-flags
1135 ;; Prevent two mostly-duplicate directories. Use Guix's versioned
1136 ;; default for licences instead of CGAL's unversioned one.
1137 (list (string-append "-DCGAL_INSTALL_DOC_DIR=share/doc/"
1138 ,name "-"
1139 ,version))
1140 #:tests? #f)) ;no test target
1141 (inputs (list mpfr gmp boost))
1142 (home-page "https://www.cgal.org/")
1143 (synopsis "Computational geometry algorithms library")
1144 (description
1145 "CGAL provides easy access to efficient and reliable geometric algorithms
1146in the form of a C++ library. CGAL is used in various areas needing geometric
1147computation, such as: computer graphics, scientific visualization, computer
1148aided design and modeling, geographic information systems, molecular biology,
1149medical imaging, robotics and motion planning, mesh generation, numerical
1150methods, etc. It provides data structures and algorithms such as
1151triangulations, Voronoi diagrams, polygons, polyhedra, mesh generation, and
1152many more.")
1153
1154 ;; The 'LICENSE' file explains that a subset is available under more
1155 ;; permissive licenses.
1156 (license license:gpl3+)))
1157
1158(define-public cgal
1159 (package
1160 (inherit cgal-5)
1161 (name "cgal")
1162 (version "6.2")
1163 (source
1164 (origin
1165 (method git-fetch)
1166 (uri (git-reference
1167 (url "https://github.com/CGAL/cgal")
1168 (commit (string-append "v" version))))
1169 (file-name (git-file-name name version))
1170 (sha256
1171 (base32 "0v2pdazm4c1mk8cqrypywqg2vrgapqdx6dms7lhrm4hwmp9f3399"))))))
1172
1173(define-public geomcpp
1174 ;; XXX: No releases.
1175 (let ((commit "730b3d35bc4fcd5f68764239682d936bae192811")
1176 (revision "0"))
1177 (package
1178 (name "geomcpp")
1179 (version (git-version "0.0.0" revision commit))
1180 (source
1181 (origin
1182 (method git-fetch)
1183 (uri (git-reference
1184 (url "https://github.com/Grumbel/geomcpp")
1185 (commit commit)))
1186 (file-name (git-file-name name version))
1187 (sha256
1188 (base32 "0qswqbyzsns8wp1xzkl74nywdpg9f6mjjry0y3c5ghz4ah0hg8gr"))))
1189 (build-system cmake-build-system)
1190 (arguments
1191 (list
1192 #:configure-flags
1193 #~(list "-DBUILD_TESTS=ON")))
1194 (inputs (list glm))
1195 (native-inputs (list googletest tinycmmc))
1196 (home-page "https://github.com/Grumbel/geomcpp")
1197 (synopsis "Collection of point, size and rect classes")
1198 (description
1199 "This package provides a very basic collection of point, size and rect
1200classes for C++.")
1201 (license license:gpl3+))))
1202
1203(define-public imath
1204 (package
1205 (name "imath")
1206 (version "3.1.3")
1207 (source
1208 (origin
1209 (method git-fetch)
1210 (uri (git-reference
1211 (url "https://github.com/AcademySoftwareFoundation/Imath")
1212 (commit (string-append "v" version))))
1213 (file-name (git-file-name name version))
1214 (sha256
1215 (base32 "1nyld18mf220ghm1vidnfnn0rdns9z5i4l9s66xgd0kfdgarb31f"))))
1216 (build-system cmake-build-system)
1217 (arguments
1218 ;; XXX: On i686-linux, tests fail due to rounding issues (excess
1219 ;; precision), as was discussed and patched long ago:
1220 ;; <https://issues.guix.gnu.org/22049>. It seems the relevant fixes
1221 ;; didn't make it upstream, so skip tests.
1222 (list #:tests? (not (or (target-x86-32?)
1223 (%current-target-system)))))
1224 (home-page "https://github.com/AcademySoftwareFoundation/Imath")
1225 (synopsis "Library of math operations for computer graphics")
1226 (description
1227 "Imath is a C++ representation of 2D and 3D vectors and matrices and other
1228mathematical objects, functions, and data types common in computer graphics
1229applications, including the \"half\" 16-bit floating-point type.")
1230 (license license:bsd-3)))
1231
1232(define-public ilmbase
1233 (package
1234 (name "ilmbase")
1235 (version "2.5.7")
1236 (source (origin
1237 (method git-fetch)
1238 (uri (git-reference
1239 (url "https://github.com/openexr/openexr")
1240 (commit (string-append "v" version))))
1241 (file-name (git-file-name "ilmbase" version))
1242 (sha256
1243 (base32
1244 "1vja0rbilcd1wn184w8nbcmck00n7bfwlddwiaxw8dhj64nx4468"))
1245 (patches (search-patches "ilmbase-fix-tests.patch"))))
1246 (build-system cmake-build-system)
1247 (arguments
1248 (list #:phases #~(modify-phases %standard-phases
1249 (add-after 'unpack 'change-directory
1250 (lambda _
1251 (chdir "IlmBase")
1252 #t))
1253 #$@(if (target-x86-32?)
1254 #~((add-after 'change-directory 'skip-test
1255 (lambda _
1256 ;; XXX: This test fails on i686,
1257 ;; possibly due to excess precision when
1258 ;; comparing floats. Skip it.
1259 (substitute* "ImathTest/testFun.cpp"
1260 (("assert \\(bit_cast<unsigned>.*" all)
1261 (string-append "// " all "\n"))))))
1262 #~()))))
1263 (home-page "https://www.openexr.com/")
1264 (synopsis "Utility C++ libraries for threads, maths, and exceptions")
1265 (description
1266 "IlmBase provides several utility libraries for C++. Half is a class
1267that encapsulates ILM's 16-bit floating-point format. IlmThread is a thread
1268abstraction. Imath implements 2D and 3D vectors, 3x3 and 4x4 matrices,
1269quaternions and other useful 2D and 3D math functions. Iex is an
1270exception-handling library.")
1271 (license license:bsd-3)))
1272
1273(define-public lib2geom/pinned
1274 (package
1275 (name "lib2geom")
1276 (version "1.3")
1277 (source (origin
1278 (method git-fetch)
1279 (uri (git-reference
1280 (url "https://gitlab.com/inkscape/lib2geom")
1281 (commit version)))
1282 (file-name (git-file-name "lib2geom" version))
1283 (sha256
1284 (base32
1285 "1ypcn0yxk9ny7qg8s8h3px2wpimhfgkwk7x1548ky12iqmdjjmcn"))))
1286 (build-system cmake-build-system)
1287 (arguments
1288 (list
1289 #:imported-modules (append %cmake-build-system-modules
1290 %pyproject-build-system-modules)
1291 #:modules '((guix build cmake-build-system)
1292 (guix build utils)
1293 ((guix build pyproject-build-system) #:prefix python:))
1294 #:configure-flags
1295 #~(list "-D2GEOM_BUILD_SHARED=ON"
1296 "-D2GEOM_BOOST_PYTHON=ON"
1297 ;; Compiling the Cython bindings fail (see:
1298 ;; https://gitlab.com/inkscape/lib2geom/issues/21).
1299 "-D2GEOM_CYTHON_BINDINGS=OFF")
1300 #:phases
1301 #~(modify-phases %standard-phases
1302 (add-after 'unpack 'patch-python-lib-install-path
1303 (lambda* (#:key inputs outputs #:allow-other-keys)
1304 (substitute* '("src/cython/CMakeLists.txt"
1305 "src/py2geom/CMakeLists.txt")
1306 (("PYTHON_LIB_INSTALL \"[^\"]*\"")
1307 (format #f "PYTHON_LIB_INSTALL ~s"
1308 (python:site-packages inputs outputs))))))
1309 #$@(cond
1310 ((target-x86-32?)
1311 #~((add-after 'unpack 'skip-faulty-test
1312 (lambda _
1313 (substitute* "tests/CMakeLists.txt"
1314 ;; This test fails at various comparions of ±π.
1315 (("angle-test") "")
1316
1317 ;; This test fails on i686 when comparing floating point
1318 ;; values, probably due to excess precision. However,
1319 ;; '-fexcess-precision' is not implemented for C++ in
1320 ;; GCC 10 so just skip it.
1321 (("bezier-test") "")
1322
1323 ;; https://gitlab.com/inkscape/lib2geom/-/issues/68
1324 (("ellipse-test") "")
1325
1326 ;; XXX: Additional unresolved test failures.
1327 (("elliptical-arc-test") "")
1328 (("self-intersections-test") ""))))))
1329 ;; See https://gitlab.com/inkscape/lib2geom/-/issues/63
1330 ((or (target-aarch64?)
1331 (target-riscv64?)
1332 (target-ppc64le?))
1333 #~((add-after 'unpack 'fix-aarch64-faulty-test
1334 (lambda _
1335 (substitute* "tests/CMakeLists.txt"
1336 (("elliptical-arc-test") ""))))))
1337 (else
1338 #~())))))
1339 (native-inputs (list python-wrapper googletest pkg-config))
1340 (inputs (list cairo python-pycairo double-conversion glib gsl))
1341 (propagated-inputs (list boost)) ;included in 2geom/pathvector.h
1342 (home-page "https://gitlab.com/inkscape/lib2geom/")
1343 (synopsis "C++ 2D graphics library")
1344 (description "2geom is a C++ library of mathematics for paths, curves,
1345and other geometric calculations. Designed for vector graphics, it tackles
1346Bézier curves, conic sections, paths, intersections, transformations, and
1347basic geometries.")
1348 ;; Because the library is linked with the GNU Scientific Library
1349 ;; (GPLv3+), the combined work must be licensed as GPLv3+ (see:
1350 ;; https://gitlab.com/inkscape/inkscape/issues/784).
1351 (license license:gpl3+)
1352 (properties '((hidden? . #t)))))
1353
1354(define-public lib2geom
1355 (package
1356 (inherit lib2geom/pinned)
1357 (name "lib2geom")
1358 (version "1.4")
1359 (source
1360 (origin
1361 (inherit (package-source lib2geom/pinned))
1362 (method git-fetch)
1363 (uri (git-reference
1364 (url "https://gitlab.com/inkscape/lib2geom")
1365 (commit version)))
1366 (file-name (git-file-name name version))
1367 (sha256
1368 (base32 "0gfgzwm5s50caj5s6l7irgmlifpmypd0fnm6ckzli1fdziwjgdwi"))))
1369 (arguments
1370 ;; https://gitlab.com/inkscape/lib2geom/-/work_items/82
1371 (if (or (target-aarch64?)
1372 (target-riscv64?)
1373 (target-ppc64le?))
1374 (substitute-keyword-arguments arguments
1375 ((#:phases phases #~%standard-phases)
1376 #~(modify-phases #$phases
1377 (add-after 'unpack 'disable-polynomial-test
1378 (lambda _
1379 (substitute* "tests/CMakeLists.txt"
1380 (("polynomial-test") "")))))))
1381 arguments))
1382 (properties '((hidden? . #f)))))
1383
1384(define-public pstoedit
1385 (package
1386 (name "pstoedit")
1387 ;; Do not yet upgrade to 4.0.0, as its include file fails to compile for C
1388 ;; project (see: https://github.com/reviczky/pstoedit/issues/2).
1389 (version "4.00")
1390 (source (origin
1391 (method url-fetch)
1392 (uri (string-append "mirror://sourceforge/pstoedit/pstoedit/"
1393 version "/pstoedit-" version ".tar.gz"))
1394 (sha256
1395 (base32
1396 "1sk2mhrjgnlz4a1650p3qxrv6av6qc66ibmy48ckspx7mfp7snh7"))
1397 (patches
1398 (search-patches "pstoedit-fix-gcc12.patch"
1399 "pstoedit-fix-plainC.patch"
1400 "pstoedit-pkglibdir.patch"))))
1401 (build-system gnu-build-system)
1402 (arguments
1403 ;; Avoid keeping extraneous references to libtool exhaustively listed
1404 ;; dependencies.
1405 (list #:configure-flags #~(list "LDFLAGS=-Wl,--as-needed")))
1406 (native-inputs
1407 (list pkg-config))
1408 (inputs
1409 (list ghostscript
1410 imagemagick
1411 plotutils
1412 libjpeg-turbo
1413 libzip
1414 ;; The following inputs are pulled in by libtool, from the
1415 ;; imagemagick library files (.la), which records all its
1416 ;; transitive dependencies.
1417 glib
1418 pango))
1419 (home-page "http://www.pstoedit.net/")
1420 (synopsis "Converter for PostScript and PDF graphics")
1421 (description "The @code{pstoedit} utility allows translating graphics
1422in the PostScript or PDF (Portable Document Format) formats to various
1423other vector formats such as:
1424@itemize
1425@item Tgif (.obj)
1426@item gnuplot
1427@item xfig (.fig)
1428@item Flattened PostScript
1429@item DXF, a CAD (Computed-Aided Design) exchange format
1430@item PIC (for troff/groff)
1431@item MetaPost (for usage with TeX/LaTeX)
1432@item LaTeX2e picture
1433@item GNU Metafile (for use with plotutils/libplot)
1434@item Any format supported by ImageMagick
1435@end itemize")
1436 (license license:gpl2+)))
1437
1438(define-public alembic
1439 (package
1440 (name "alembic")
1441 (version "1.8.4")
1442 (source
1443 (origin
1444 (method git-fetch)
1445 (uri (git-reference
1446 (url "https://github.com/alembic/alembic")
1447 (commit version)))
1448 (file-name (git-file-name name version))
1449 (sha256
1450 (base32 "04cvzr87zqx55si4j3dqiidbmfx92ja3mc1dj0v6ddvl0cwj3m7i"))))
1451 (build-system cmake-build-system)
1452 (arguments
1453 `(#:configure-flags (list "-DUSE_HDF5=ON")))
1454 (inputs
1455 (list hdf5 imath zlib))
1456 (home-page "https://www.alembic.io/")
1457 (synopsis "Framework for storing and sharing scene data")
1458 (description "Alembic is a computer graphics interchange framework. It
1459distills complex, animated scenes into a set of baked geometric results.")
1460 (license license:bsd-3)))
1461
1462(define-public mangohud
1463 (package
1464 (name "mangohud")
1465 (version "0.8.4")
1466 (source
1467 (origin
1468 (method git-fetch)
1469 (uri (git-reference
1470 (url "https://github.com/flightlessmango/MangoHud/")
1471 (commit (string-append "v" version))))
1472 (file-name (git-file-name name version))
1473 (sha256
1474 (base32 "13zwqam7mqhc7f4gngxcrrfa7ds85nwfms1v4vaccznbfbaa28rn"))))
1475 (build-system meson-build-system)
1476 (arguments
1477 (list
1478 #:build-type "release"
1479 #:configure-flags
1480 #~(list "-Duse_system_spdlog=enabled"
1481 "-Dwith_xnvctrl=disabled"
1482 "-Dappend_libdir_mangohud=false")
1483 #:phases
1484 #~(modify-phases %standard-phases
1485 ;; MangoHud tries to build the imgui and implot libraries as a meson
1486 ;; submodules, so we change the dependency to the inputs instead.
1487 (add-after 'unpack 'unbundle-imgui-implot
1488 (lambda _
1489 (substitute* "meson.build"
1490 (("im.*_sp = .*")
1491 "")
1492 (("imgui_sp.get_variable\\('imgui_dep'\\)")
1493 (string-append
1494 "declare_dependency(dependencies: "
1495 "cpp.find_library('imgui'), include_directories: '"
1496 #$(this-package-input "imgui") "/include/imgui')"))
1497 (("implot_sp.get_variable\\('implot_dep'\\)")
1498 (string-append
1499 "declare_dependency(dependencies: "
1500 "cpp.find_library('implot'), include_directories: '"
1501 #$(this-package-input "implot") "/include/implot')")))))
1502 ;; Likewise, MangoHud bundles Vulkan submodules to use specific
1503 ;; versions, which we provide as inputs and adjust the build
1504 ;; accordingly.
1505 (add-after 'unbundle-imgui-implot 'unbundle-vulkan
1506 (lambda* (#:key inputs #:allow-other-keys)
1507 (substitute* "meson.build"
1508 (("vulkan_.*_sp = .*")
1509 "")
1510 (("vulkan_headers_sp.get_variable\\('vulkan_api_xml'\\)")
1511 (string-append "files('"
1512 (search-input-file inputs "registry/vk.xml")
1513 "')"))
1514 (("dep_vulkan.*")
1515 ""))
1516 (substitute* "src/meson.build"
1517 (("dep_vulkan.*")
1518 ""))))
1519 (add-after 'unpack 'patch-paths
1520 (lambda* (#:key inputs #:allow-other-keys)
1521 (substitute* "src/meson.build"
1522 (("\\\\\\$LIB")
1523 "lib"))
1524 (substitute* "src/overlay.cpp"
1525 (("glxinfo")
1526 (search-input-file inputs "bin/glxinfo")))
1527 (substitute* "src/loaders/loader_x11.cpp"
1528 (("libX11.so.6")
1529 (search-input-file inputs "lib/libX11.so.6")))
1530 (substitute* "src/pci_ids.cpp"
1531 (("/usr/share/hwdata/pci.ids")
1532 (search-input-file inputs "share/hwdata/pci.ids")))
1533 (substitute* "src/dbus.cpp"
1534 (("libdbus-1.so.3")
1535 (search-input-file inputs "lib/libdbus-1.so.3"))))))))
1536 (inputs
1537 (list dbus
1538 glslang
1539 hwdata
1540 imgui-for-mangohud
1541 implot
1542 libx11
1543 libxkbcommon
1544 mesa
1545 mesa-utils
1546 nlohmann-json
1547 python-mako
1548 spdlog
1549 (origin
1550 (method git-fetch)
1551 (uri (git-reference
1552 (url "https://github.com/KhronosGroup/Vulkan-Headers")
1553 (commit "v1.4.346")))
1554 (file-name (git-file-name "vulkan" "v1.4.346"))
1555 (sha256
1556 (base32
1557 "0nv0701qbwxi4p2nvrf1m80nh6pjfhbqv8qhjbb531kr47j5cc15")))
1558 vulkan-loader
1559 (origin
1560 (method git-fetch)
1561 (uri (git-reference
1562 (url "https://github.com/KhronosGroup/Vulkan-Utility-Libraries")
1563 (commit "v1.4.346")))
1564 (file-name (git-file-name "vulkan-utility-libraries" "v1.4.346"))
1565 (sha256
1566 (base32
1567 "0fwws98lkrc8df0ikrqh89df9az3pa13idxrvlzn4bk1szl5wrhm")))
1568 wayland))
1569 (native-inputs (list git-minimal/pinned pkg-config python))
1570 (home-page "https://github.com/flightlessmango/MangoHud/")
1571 (synopsis "Vulkan and OpenGL overlay for monitoring performance and hardware")
1572 (description "MangoHud is a Vulkan and OpenGL overlay for monitoring
1573frames per second (FPS), temperatures, CPU/GPU load and more.")
1574 (license license:expat)))
1575
1576(define-public ogre
1577 (package
1578 (name "ogre")
1579 (version "14.5.2")
1580 (source
1581 (origin
1582 (method git-fetch)
1583 (uri (git-reference
1584 (url "https://github.com/OGRECave/ogre")
1585 (commit (string-append "v" version))))
1586 (file-name (git-file-name name version))
1587 (sha256
1588 (base32 "08il87zgfgzvn85k9crzlx2lmkz13c2a5awn8615a3snmvlp73m8"))
1589 (patches (search-patches "ogre-double-free.patch"))))
1590 (build-system cmake-build-system)
1591 (arguments
1592 (list
1593 #:phases
1594 #~(modify-phases %standard-phases
1595 (add-after 'unpack 'do-not-attempt-building-gtest
1596 (lambda _
1597 (substitute* "Tests/CMakeLists.txt"
1598 (("NOT EXISTS \\$\\{PROJECT_BINARY_DIR}/googletest-1.11.0")
1599 "FALSE"))))
1600 (add-before 'configure 'unpack-imgui
1601 (lambda* (#:key native-inputs inputs #:allow-other-keys)
1602 (let ((imgui-source (dirname (search-input-file
1603 (or native-inputs inputs)
1604 "imgui.h"))))
1605 (copy-recursively imgui-source "../imgui-source"))))
1606 (add-before 'configure 'pre-configure
1607 ;; CMakeLists.txt forces a CMAKE_INSTALL_RPATH value. As
1608 ;; a consequence, we cannot suggest ours in configure flags. Fix
1609 ;; it.
1610 (lambda _
1611 (substitute* "CMakeLists.txt"
1612 (("set\\(CMAKE_INSTALL_RPATH .*") ""))))
1613 (add-before 'check 'run-x-server
1614 (lambda _
1615 (system "Xvfb &")
1616 (setenv "DISPLAY" ":0"))))
1617 #:configure-flags
1618 #~(let ((runpath (string-join (list (string-append #$output "/lib")
1619 (string-append #$output "/lib/OGRE"))
1620 ";")))
1621 (list (string-append "-DCMAKE_INSTALL_RPATH=" runpath)
1622 "-DIMGUI_DIR=../imgui-source"
1623 "-DOGRE_BUILD_DEPENDENCIES=OFF"
1624 "-DOGRE_BUILD_RENDERSYSTEM_VULKAN=ON"
1625 "-DOGRE_BUILD_TESTS=TRUE"
1626 "-DOGRE_INSTALL_DOCS=TRUE"
1627 "-DOGRE_INSTALL_SAMPLES=TRUE"
1628 "-DOGRE_INSTALL_SAMPLES_SOURCE=TRUE"))))
1629 (native-inputs
1630 (list doxygen
1631 (package-source imgui-1.91) ;FIXME: link to library directly
1632 googletest
1633 pkg-config
1634 python
1635 vulkan-headers
1636 xorg-server-for-tests))
1637 (inputs
1638 (list bullet
1639 freeimage
1640 freetype
1641 glslang
1642 imgui-1.91
1643 libxaw
1644 libxrandr
1645 libxt
1646 mesa
1647 pugixml
1648 sdl2
1649 spirv-tools
1650 wayland
1651 zlib))
1652 (synopsis "Scene-oriented, flexible 3D engine written in C++")
1653 (description
1654 "OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented,
1655flexible 3D engine written in C++ designed to make it easier and more intuitive
1656for developers to produce applications utilising hardware-accelerated 3D
1657graphics.")
1658 (home-page "https://www.ogre3d.org/")
1659 (license license:expat)))
1660
1661(define-public ogre-next
1662 (package
1663 (inherit ogre)
1664 (name "ogre-next")
1665 (version "3.0.0")
1666 (source (origin
1667 (method git-fetch)
1668 (uri (git-reference
1669 (url "https://github.com/OGRECave/ogre-next")
1670 (commit (string-append "v" version))))
1671 (file-name (git-file-name name version))
1672 (patches (search-patches "ogre-next-add-riscv64-support.patch"))
1673 (sha256
1674 (base32
1675 "1yrlg3s654xbp95208h9a2b8jcwdk69r6sjvll0aiyvxm4c056cw"))))
1676 (arguments (substitute-keyword-arguments (package-arguments ogre)
1677 ((#:tests? _ #f)
1678 ;; The test suite is currently disabled by the build system
1679 ;; (see: https://github.com/OGRECave/ogre-next/issues/466).
1680 #f)
1681 ((#:configure-flags flags #~(list))
1682 (if (target-riscv64?)
1683 #~(cons*
1684 "-DOGRE_SIMD_SSE2=OFF"
1685 "-DOGRE_SIMD_NEON=OFF"
1686 #$flags)
1687 flags))))
1688 (inputs
1689 (modify-inputs (package-inputs ogre)
1690 (append rapidjson)))))
1691
1692(define-public openexr
1693 (package
1694 (name "openexr")
1695 (version "3.4.11")
1696 (source
1697 (origin
1698 (method git-fetch)
1699 (uri (git-reference
1700 (url "https://github.com/AcademySoftwareFoundation/openexr")
1701 (commit (string-append "v" version))))
1702 (file-name (git-file-name name version))
1703 (sha256 (base32 "0c0l62s42i4jxp6bsf47fqlmdrazpk783jfpgj4jnprsm2spdp75"))
1704 (modules '((guix build utils)))
1705 ;; Unbundle third party libraries.
1706 (snippet #~(with-directory-excursion "external"
1707 (for-each delete-file-recursively
1708 '("deflate" "OpenJPH"))))))
1709 (build-system cmake-build-system)
1710 (arguments
1711 (list
1712 #:configure-flags
1713 #~(list #$@(match (%current-system)
1714 ;; A test explicitly checks for SSE2 (would fail on
1715 ;; i686-linux), so make sure it is enabled for both C
1716 ;; and CPP.
1717 ((or "x86_64-linux" "i686-linux")
1718 '("-DCMAKE_CXX_FLAGS=-mfpmath=sse -msse2"
1719 "-DCMAKE_C_FLAGS=-mfpmath=sse -msse2"))
1720 (_ '())))
1721 #:phases
1722 #~(modify-phases %standard-phases
1723 (add-after 'unpack 'patch-test-directory
1724 (lambda _
1725 (substitute* '("src/test/OpenEXRTest/tmpDir.h"
1726 "src/test/OpenEXRCoreTest/main.cpp")
1727 (("/var/tmp") "/tmp"))))
1728 ;; Disable tests that fail at least on i686-linux.
1729 #$@(if (target-32bit?)
1730 #~((add-after 'patch-test-directory 'disable-broken-tests
1731 (lambda _
1732 (substitute* "src/test/OpenEXRCoreTest/main.cpp"
1733 ((".*testNoCompression, .*") "")
1734 ((".*testRLECompression, .*") "")
1735 ((".*testZIPCompression, .*") "")
1736 ((".*testZIPSCompression, .*") "")
1737 ((".*testB44Compression, .*") "")
1738 ((".*testB44ACompression, .*") ""))
1739 (substitute* "src/test/OpenEXRTest/main.cpp"
1740 ((".*testCompression, .*") "")
1741 ((".*testOptimizedInterleavePatterns, .*") "")))))
1742 #~())
1743 ;; Disable tests known to fail on aarch64. Remove once
1744 ;; https://github.com/AcademySoftwareFoundation/openexr/issues/1460
1745 ;; is fixed.
1746 #$@(if (target-aarch64?)
1747 #~((add-after 'patch-test-directory 'disable-broken-tests
1748 (lambda _
1749 (substitute* '("src/test/OpenEXRCoreTest/main.cpp")
1750 (("TEST \\(testDWAACompression, \"core_compression\"\\);")
1751 "")
1752 (("TEST \\(testDWABCompression, \"core_compression\"\\);")
1753 "")))))
1754 #~()))))
1755 (propagated-inputs
1756 (list libdeflate ;marked as Requires.private in OpenEXR.pc
1757 imath ;marked as Requires in OpenEXR.pc
1758 openjph)) ;marked as Requires.private in OpenEXR.pc
1759 (home-page "https://openexr.com")
1760 (synopsis "High-dynamic-range file format library")
1761 (description
1762 "OpenEXR provides the specification and reference implementation of the
1763EXR file format. The purpose of EXR format is to accurately and efficiently
1764represent high-dynamic-range scene-linear image data and associated metadata,
1765with strong support for multi-part, multi-channel use cases.")
1766 (license license:bsd-3)))
1767
1768(define-public openexr-2
1769 (package
1770 (name "openexr")
1771 (version (package-version ilmbase))
1772 (source (origin
1773 (inherit (package-source ilmbase))
1774 (patches (append (origin-patches (package-source ilmbase))
1775 (search-patches "openexr-2-gcc-14.patch")))
1776 (file-name (git-file-name "openexr" version))))
1777 (build-system cmake-build-system)
1778 (arguments
1779 `(#:phases
1780 (modify-phases %standard-phases
1781 (add-after 'unpack 'change-directory
1782 (lambda _
1783 (chdir "OpenEXR")
1784 #t))
1785 (add-after 'change-directory 'patch-test-directory
1786 (lambda _
1787 (substitute* '("IlmImfFuzzTest/tmpDir.h"
1788 "IlmImfTest/tmpDir.h"
1789 "IlmImfUtilTest/tmpDir.h")
1790 (("/var/tmp") "/tmp"))))
1791 (add-after 'change-directory 'increase-test-timeout
1792 (lambda _
1793 ;; On some architectures, we need to override the CTest default
1794 ;; timeout of 1500 seconds for the OpenEXR.IlmImf test.
1795 (substitute* "IlmImfTest/CMakeLists.txt"
1796 (("add_test\\(NAME OpenEXR\\.IlmImf.*" all)
1797 (string-append
1798 all
1799 "set_tests_properties(OpenEXR.IlmImf PROPERTIES TIMEOUT 15000)")))
1800 #t))
1801 ,@(if (target-32bit?)
1802 `((add-after 'change-directory 'disable-broken-test
1803 (lambda _
1804 (substitute* "IlmImfTest/main.cpp"
1805 ;; This test fails on i686. Upstream developers suggest
1806 ;; that this test is broken on i686 and can be safely
1807 ;; disabled:
1808 ;; https://github.com/openexr/openexr/issues/67#issuecomment-21169748
1809 ((".*testOptimizedInterleavePatterns.*") "")
1810 ;; This one fails similarly on i686.
1811 ((".*testCompression.*") "")))))
1812 '()))))
1813 (native-inputs
1814 (list pkg-config))
1815 (propagated-inputs
1816 (list ilmbase ;used in public headers
1817 zlib)) ;OpenEXR.pc reads "-lz"
1818 (home-page (package-home-page openexr))
1819 (synopsis (package-synopsis openexr))
1820 (description (package-description openexr))
1821 (license (package-license openexr))))
1822
1823(define-public openimageio
1824 (package
1825 (name "openimageio")
1826 (version "2.5.19.1")
1827 (source
1828 (origin
1829 (method git-fetch)
1830 (uri (git-reference
1831 (url "https://github.com/AcademySoftwareFoundation/OpenImageIO")
1832 (commit (string-append "v" version))))
1833 (file-name (git-file-name name version))
1834 (sha256
1835 (base32
1836 "1nqqw8n8hagp5s29hpmcb4pripkzn8w7vk3jcyw7xjb8h8gxxapq"))))
1837 (build-system cmake-build-system)
1838 (arguments
1839 (list #:tests? #f ; half the tests require online data or use redirection
1840 #:configure-flags #~(list "-DUSE_EXTERNAL_PUGIXML=1"
1841 "-DOIIO_BUILD_TESTS=false")
1842 #:phases
1843 #~(modify-phases %standard-phases
1844 ; Work around a CMake Zlib-detection bug:
1845 ; https://issues.guix.gnu.org/72046
1846 ; https://gitlab.kitware.com/cmake/cmake/-/issues/25200
1847 (add-after 'configure 'fix-zlib-version
1848 (lambda _
1849 (substitute* "include/imageio_pvt.h"
1850 (("#define ZLIB_VERSION \"1\\.3\"")
1851 ""))))
1852 (add-after 'install 'fix-OpenImageIOConfig
1853 (lambda _
1854 (substitute* (string-append
1855 #$output
1856 "/lib/cmake/OpenImageIO/OpenImageIOConfig.cmake")
1857 (("#define ZLIB_VERSION \"1\\.3\"")
1858 "")))))))
1859 (native-inputs
1860 (list pkg-config))
1861 (inputs
1862 (list boost
1863 dcmtk
1864 fmt
1865 freetype
1866 giflib
1867 imath
1868 libglvnd
1869 libheif
1870 libjpeg-turbo
1871 libpng
1872 libraw
1873 libtiff
1874 libwebp
1875 opencolorio
1876 openexr
1877 openjpeg
1878 ;; openvdb ; OpenVDB needs OIIO to be built with C++17 or higher
1879 pugixml
1880 pybind11-2
1881 python-wrapper
1882 robin-map
1883 zlib))
1884 (synopsis "C++ library for reading and writing images")
1885 (description
1886 "OpenImageIO is a library for reading and writing images, and a bunch of
1887related classes, utilities, and applications. There is a particular emphasis
1888on formats and functionality used in professional, large-scale animation and
1889visual effects work for film.")
1890 (home-page "https://github.com/AcademySoftwareFoundation/OpenImageIO")
1891 (license license:bsd-3)))
1892
1893(define-public openscenegraph
1894 (package
1895 (name "openscenegraph")
1896 (version "3.6.5")
1897 (source
1898 (origin
1899 (method git-fetch)
1900 (uri (git-reference
1901 (url "https://github.com/openscenegraph/OpenSceneGraph")
1902 (commit (string-append "OpenSceneGraph-" version))))
1903 (sha256
1904 (base32 "00i14h82qg3xzcyd8p02wrarnmby3aiwmz0z43l50byc9f8i05n1"))
1905 (file-name (git-file-name name version))))
1906 (properties
1907 `((upstream-name . "OpenSceneGraph")
1908 (output-synopsis "pluginlib" "Plugins as shared libraries")))
1909 (build-system cmake-build-system)
1910 (outputs (list "out" "pluginlib"))
1911 (arguments
1912 (list
1913 #:tests? #f ; no test target available
1914 ;; Without this flag, 'rd' will be added to the name of the
1915 ;; library binaries and break linking with other programs.
1916 #:build-type "Release"
1917 #:configure-flags
1918 #~(list (string-append "-DCMAKE_INSTALL_RPATH="
1919 #$output "/lib:"
1920 #$output "/lib64"))
1921 #:modules `((guix build cmake-build-system)
1922 (guix build utils)
1923 (ice-9 regex))
1924 #:phases
1925 #~(modify-phases %standard-phases
1926 (add-after 'install 'copy-plugins
1927 (lambda* (#:key outputs #:allow-other-keys)
1928 (let ((out (assoc-ref outputs "out"))
1929 (pluginlib (assoc-ref outputs "pluginlib")))
1930 (mkdir-p (string-append pluginlib "/lib/pkgconfig"))
1931 (with-directory-excursion (string-append out "/lib/osgPlugins-"
1932 #$version)
1933 (for-each
1934 (lambda (lib)
1935 (let ((blib (basename lib))
1936 (m (string-match "([^/]*)\\.so$" lib)))
1937 (symlink (canonicalize-path lib)
1938 (string-append pluginlib "/lib/lib" blib))
1939 (call-with-output-file (string-append
1940 pluginlib
1941 "/lib/pkgconfig/"
1942 (match:substring m 1) ".pc")
1943 (lambda (port)
1944 (format port "libdir=~a/lib~%" pluginlib)
1945 (newline port)
1946 (format port "Name: ~a~%" (match:substring m 1))
1947 (format port "Version: ~a~%" #$version)
1948 (display "Description: A plugin for openscenegraph\n"
1949 port)
1950 (display "Requires: openscenegraph\n" port)
1951 (format port "Libs: -L${libdir} -l~a~%"
1952 (match:substring m 1))))))
1953 (find-files "." "\\.so")))))))))
1954 (native-inputs (list pkg-config unzip))
1955 (inputs
1956 (list collada-dom
1957 giflib
1958 libjpeg-turbo ; required for the JPEG texture plugin.
1959 jasper
1960 (librsvg-for-system)
1961 libxrandr
1962 ffmpeg-4
1963 mesa))
1964 (synopsis "High-performance real-time graphics toolkit")
1965 (description
1966 "The OpenSceneGraph is a high-performance 3D graphics toolkit
1967used by application developers in fields such as visual simulation, games,
1968virtual reality, scientific visualization and modeling.")
1969 (home-page "http://www.openscenegraph.org")
1970 ;; The 'LICENSE' file explains that the source is licensed under
1971 ;; LGPL 2.1, but with 4 exceptions. This version is called OSGPL.
1972 (license license:lgpl2.1)))
1973
1974(define-public gr-framework
1975 (package
1976 (name "gr-framework")
1977 (version "0.69.1")
1978 (source
1979 (origin
1980 (method git-fetch)
1981 (uri (git-reference
1982 (url "https://github.com/sciapp/gr")
1983 (commit (string-append "v" version))))
1984 (file-name (git-file-name name version))
1985 (sha256
1986 (base32 "0kllbj4bj3f5w4wzg29ilac66fd0bslqq5srj845ssmzp4ynqglh"))
1987 (modules '((guix build utils)))
1988 (snippet
1989 '(begin
1990 (delete-file-recursively "3rdparty")))))
1991 (build-system cmake-build-system)
1992 (arguments
1993 `(#:tests? #f)) ; no test target
1994 (inputs
1995 `(("bzip2" ,bzip2)
1996 ("cairo" ,cairo)
1997 ("fontconfig" ,fontconfig)
1998 ("ffmpeg" ,ffmpeg)
1999 ("freetype" ,freetype)
2000 ("ghostscript" ,ghostscript)
2001 ("glfw" ,glfw)
2002 ("libjpeg-turbo" ,libjpeg-turbo)
2003 ("libpng" ,libpng)
2004 ("libtiff" ,libtiff)
2005 ("libx11" ,libx11)
2006 ("libxft" ,libxft)
2007 ("libxt" ,libxt)
2008 ("pixman" ,pixman)
2009 ("qtbase" ,qtbase-5)
2010 ("qhull" ,qhull)
2011 ("zlib" ,zlib)))
2012 (home-page "https://gr-framework.org/")
2013 (synopsis "Graphics library for visualisation applications")
2014 (description "GR is a universal framework for cross-platform visualization
2015applications. It offers developers a compact, portable and consistent graphics
2016library for their programs. Applications range from publication quality 2D
2017graphs to the representation of complex 3D scenes. GR is essentially based on
2018an implementation of a @acronym{GKS, Graphical Kernel System}. As a
2019self-contained system it can quickly and easily be integrated into existing
2020applications (i.e. using the @code{ctypes} mechanism in Python or @code{ccall}
2021in Julia).")
2022 (license license:expat)))
2023
2024(define-public openmw-openscenegraph
2025 ;; OpenMW prefers its own fork of openscenegraph:
2026 ;; https://wiki.openmw.org/index.php?title=Development_Environment_Setup#OpenSceneGraph.
2027 (let ((commit "8aa8d91747ff414ab0de19aae1e0dbd739acea2c"))
2028 (hidden-package
2029 (package
2030 (inherit openscenegraph)
2031 (version (git-version "3.6" "5" commit))
2032 (outputs (list "out"))
2033 (source
2034 (origin
2035 (method git-fetch)
2036 (uri (git-reference
2037 (url "https://github.com/OpenMW/osg/")
2038 (commit commit)))
2039 (file-name (git-file-name (package-name openscenegraph) version))
2040 (sha256
2041 (base32
2042 "1166wcvpy5p19sg62l4lgwibf5hkmv5nm7vvp60kmm9sv8q0mmci"))))
2043 (arguments
2044 (substitute-keyword-arguments arguments
2045 ((#:configure-flags flags)
2046 ;; As per the above wiki link, the following plugins are enough:
2047 #~(append
2048 '("-DBUILD_OSG_PLUGINS_BY_DEFAULT=0"
2049 "-DBUILD_OSG_PLUGIN_OSG=1"
2050 "-DBUILD_OSG_PLUGIN_DAE=1"
2051 "-DBUILD_OSG_PLUGIN_DDS=1"
2052 "-DBUILD_OSG_PLUGIN_TGA=1"
2053 "-DBUILD_OSG_PLUGIN_BMP=1"
2054 "-DBUILD_OSG_PLUGIN_JPEG=1"
2055 "-DBUILD_OSG_PLUGIN_PNG=1"
2056 "-DBUILD_OSG_PLUGIN_FREETYPE=1"
2057 "-DBUILD_OSG_DEPRECATED_SERIALIZERS=0")
2058 #$flags))
2059 ((#:phases phases)
2060 #~(modify-phases #$phases
2061 (delete 'copy-plugins)))))))))
2062
2063(define-public povray
2064 (package
2065 (name "povray")
2066 (version "3.7.0.10")
2067 (source (origin
2068 (method git-fetch)
2069 (uri (git-reference
2070 (url "https://github.com/POV-Ray/povray")
2071 (commit (string-append "v" version))))
2072 (file-name (git-file-name name version))
2073 (sha256
2074 (base32
2075 "19bv962clwc6sk53kq8bqf77fh0v46afm2knjbki8yj0m1mnyyd0"))
2076 (modules '((guix build utils)))
2077 (snippet
2078 ;; Delete bundled libraries.
2079 '(delete-file-recursively "libraries"))))
2080 (build-system gnu-build-system)
2081 (native-inputs
2082 (list autoconf automake pkg-config))
2083 (inputs
2084 (list boost
2085 libjpeg-turbo
2086 libpng
2087 libtiff
2088 openexr
2089 sdl
2090 zlib))
2091 (arguments
2092 (list
2093 #:configure-flags
2094 #~(list "COMPILED_BY=Guix"
2095 (string-append "--with-boost-libdir="
2096 #$(this-package-input "boost") "/lib")
2097 "--disable-optimiz-arch"
2098 ;; Render breaks with -ffast-math optimizations:
2099 ;; https://github.com/POV-Ray/povray/issues/482
2100 "CXXFLAGS=-fno-finite-math-only")
2101 #:phases
2102 '(modify-phases %standard-phases
2103 (add-after 'unpack 'run-prebuild
2104 (lambda _
2105 (setenv "HOME" (getcwd))
2106 (with-directory-excursion "unix"
2107 (substitute* "prebuild.sh"
2108 (("/bin/sh") (which "sh"))
2109 ;; Make test run non-interactive.
2110 (("biscuit.pov -f \\+d \\+p \\+v") "biscuit.pov -f +v"))
2111 (invoke "sh" "prebuild.sh"))))
2112 ;; The bootstrap script is run by the prebuild script in the
2113 ;; "run-prebuild" phase.
2114 (delete 'bootstrap))))
2115 (synopsis "Tool for creating three-dimensional graphics")
2116 (description
2117 "@code{POV-Ray} is short for the Persistence of Vision Raytracer, a tool
2118for producing high-quality computer graphics. @code{POV-Ray} creates
2119three-dimensional, photo-realistic images using a rendering technique called
2120ray-tracing. It reads in a text file containing information describing the
2121objects and lighting in a scene and generates an image of that scene from the
2122view point of a camera also described in the text file. Ray-tracing is not a
2123fast process by any means, but it produces very high quality images with
2124realistic reflections, shading, perspective and other effects.")
2125 (home-page "http://www.povray.org/")
2126 (license license:agpl3+)))
2127
2128(define-public ctl
2129 (package
2130 (name "ctl")
2131 (version "1.5.4")
2132 (source (origin
2133 (method git-fetch)
2134 (uri (git-reference
2135 (url "https://github.com/ampas/CTL")
2136 (commit (string-append "ctl-" version))))
2137 (file-name (git-file-name name version))
2138 (sha256
2139 (base32
2140 "02fxvwm883wgzhf87harbvmfqvm2ry71cxr768jb8kxdnal5gyy4"))))
2141 (build-system cmake-build-system)
2142
2143 ;; Headers include OpenEXR and IlmBase headers.
2144 (propagated-inputs (list openexr))
2145 (inputs (list libtiff))
2146
2147 (home-page "https://ampasctl.sourceforge.net")
2148 (synopsis "Color Transformation Language")
2149 (description
2150 "The Color Transformation Language, or CTL, is a small programming
2151language that was designed to serve as a building block for digital color
2152management systems. CTL allows users to describe color transforms in a
2153concise and unambiguous way by expressing them as programs. In order to apply
2154a given transform to an image, the color management system instructs a CTL
2155interpreter to load and run the CTL program that describes the transform. The
2156original and the transformed image constitute the CTL program's input and
2157output.")
2158
2159 ;; The web site says it's under a BSD-3 license, but the 'LICENSE' file
2160 ;; and headers use different wording.
2161 (license (license:non-copyleft "file://LICENSE"))))
2162
2163(define-public brdf-explorer
2164 ;; There are no release tarballs, and not even tags in the repo,
2165 ;; so use the latest revision.
2166 (let ((commit "5b2cd46f38a06e47207fa7229b72d37beb945019")
2167 (revision "1"))
2168 (package
2169 (name "brdf-explorer")
2170 (version (string-append "1.0.0-" revision "." (string-take commit 9)))
2171 (source (origin
2172 (method git-fetch)
2173 (uri (git-reference
2174 (url "https://github.com/wdas/brdf")
2175 (commit commit)))
2176 (sha256
2177 (base32
2178 "06vzbiajzbi2xl8jlff5d45bc9wd68i3jdndfab1f3jgfrd8bsgx"))
2179 (file-name (string-append name "-" version "-checkout"))))
2180 (build-system gnu-build-system)
2181 (arguments
2182 `(#:phases (modify-phases %standard-phases
2183 (replace 'configure
2184 (lambda* (#:key outputs #:allow-other-keys)
2185 (let ((out (assoc-ref outputs "out")))
2186 (invoke "qmake"
2187 (string-append "prefix=" out)))))
2188 (add-after 'install 'wrap-program
2189 (lambda* (#:key outputs #:allow-other-keys)
2190 (let* ((out (assoc-ref outputs "out"))
2191 (bin (string-append out "/bin"))
2192 (data (string-append
2193 out "/share/brdf")))
2194 (with-directory-excursion bin
2195 (rename-file "brdf" ".brdf-real")
2196 (call-with-output-file "brdf"
2197 (lambda (port)
2198 (format port "#!/bin/sh
2199# Run the thing from its home, otherwise it just bails out.
2200cd \"~a\"
2201exec -a \"$0\" ~a/.brdf-real~%"
2202 data bin)))
2203 (chmod "brdf" #o555)))
2204 #t)))))
2205 (native-inputs
2206 (list qttools-5)) ;for 'qmake'
2207 (inputs
2208 (list qtbase-5 mesa glew freeglut zlib))
2209 (home-page
2210 (string-append "https://web.archive.org/web/20190115030100/"
2211 "https://www.disneyanimation.com/technology/brdf.html"))
2212 (synopsis
2213 "@acronym{BRDF, bidirectional reflectance distribution function} analyzer")
2214 (description
2215 "BRDF Explorer is an application that allows the development and analysis
2216of @acronym{BRDF, bidirectional reflectance distribution functions}. It can
2217load and plot analytic BRDF functions (coded as functions in OpenGL's GLSL
2218shader language), measured material data from the MERL database, and anisotropic
2219measured material data from MIT CSAIL. Graphs and visualizations update in real
2220time as parameters are changed, making it a useful tool for evaluating and
2221understanding different BRDFs (and other component functions).")
2222 (license license:ms-pl))))
2223
2224(define-public agg
2225 (package
2226 (name "agg")
2227 (version "2.5")
2228 (source (origin
2229 (method url-fetch)
2230 (uri (list (string-append
2231 "ftp://ftp.fau.de/gentoo/distfiles/agg-"
2232 version ".tar.gz")
2233 (string-append
2234 "ftp://ftp.ula.ve/gentoo/distfiles/agg-"
2235 version ".tar.gz")
2236
2237 ;; Site was discontinued.
2238 (string-append "http://www.antigrain.com/agg-"
2239 version ".tar.gz")))
2240 (sha256
2241 (base32 "07wii4i824vy9qsvjsgqxppgqmfdxq0xa87i5yk53fijriadq7mb"))
2242 (patches (search-patches "agg-am_c_prototype.patch"
2243 "agg-2.5-gcc8.patch"))))
2244 (build-system gnu-build-system)
2245 (arguments
2246 '(#:configure-flags
2247 (list (string-append "--x-includes=" (assoc-ref %build-inputs "libx11")
2248 "/include")
2249 (string-append "--x-libraries=" (assoc-ref %build-inputs "libx11")
2250 "/lib")
2251 "CXXFLAGS=-fpermissive" ;from ‘unsigned char*’ to ‘char*’
2252 "--disable-examples")
2253 #:phases
2254 (modify-phases %standard-phases
2255 (replace 'bootstrap
2256 (lambda _
2257 ;; let's call configure from configure phase and not now
2258 (substitute* "autogen.sh" (("./configure") "# ./configure"))
2259 (invoke "sh" "autogen.sh"))))))
2260 (native-inputs
2261 (list pkg-config libtool autoconf automake))
2262 (inputs
2263 (list libx11 freetype sdl))
2264
2265 ;; Antigrain.com was discontinued.
2266 (home-page "https://agg.sourceforge.net/antigrain.com/index.html")
2267 (synopsis "High-quality 2D graphics rendering engine for C++")
2268 (description
2269 "Anti-Grain Geometry is a high quality rendering engine written in C++.
2270It supports sub-pixel resolutions and anti-aliasing. It is also a library for
2271rendering @acronym{SVG, Scalable Vector Graphics}.")
2272 (license license:gpl2+)))
2273
2274(define-public facedetect
2275 (let ((commit "5f9b9121001bce20f7d87537ff506fcc90df48ca")
2276 (revision "0"))
2277 (package
2278 (name "facedetect")
2279 (version (git-version "0.1" revision commit))
2280 (source (origin
2281 (method git-fetch)
2282 (uri (git-reference
2283 (url "https://gitlab.com/wavexx/facedetect")
2284 (commit commit)))
2285 (file-name (git-file-name name version))
2286 (sha256
2287 (base32 "1jiz72y3ykkxkiij1qqjf45gxg223sghkjir7sr663x91kviwkjd"))))
2288 (build-system copy-build-system)
2289 (arguments
2290 (list
2291 #:install-plan
2292 #~`(("facedetect" "bin/facedetect")
2293 ("README.rst" ,(string-append "share/doc/" #$name
2294 "-" #$version "/README.rst")))
2295 #:phases
2296 #~(modify-phases %standard-phases
2297 (add-after 'unpack 'configure
2298 (lambda* (#:key inputs #:allow-other-keys)
2299 (substitute* "facedetect"
2300 (("^DATA_DIR = .*")
2301 (string-append "DATA_DIR = '"
2302 #$opencv "/share/opencv"
2303 #$(version-major (package-version opencv))
2304 "'\n")))))
2305 (add-after 'install 'wrap
2306 (lambda _
2307 (let ((program (string-append #$output "/bin/facedetect")))
2308 (patch-shebang program)
2309 (wrap-program program
2310 `("GUIX_PYTHONPATH" prefix
2311 ,(search-path-as-string->list
2312 (getenv "GUIX_PYTHONPATH"))))))))))
2313 (inputs
2314 (list bash-minimal
2315 opencv
2316 python
2317 python-numpy))
2318 (home-page "https://www.thregr.org/~wavexx/software/facedetect/")
2319 (synopsis "Face detector")
2320 (description "@code{facedetect} is a face detector for batch processing.
2321It answers the question: \"Is there a face in this image?\" and gives back
2322either an exit code or the coordinates of each detect face in the standard
2323output. @code{facedetect} is used in software such as @code{fgallery} to
2324improve the thumbnail cutting region, so that faces are always centered.")
2325 (license license:gpl2+))))
2326
2327(define-public fgallery
2328 (package
2329 (name "fgallery")
2330 (version "1.9.1")
2331 (source (origin
2332 (method url-fetch)
2333 (uri
2334 (string-append
2335 "https://www.thregr.org/~wavexx/software/fgallery/releases/"
2336 "fgallery-" version ".zip"))
2337 (sha256
2338 (base32
2339 "0zf6r88m2swgj1ylgh3qa1knzb4if501hzvga37h9psy8k179w8n"))
2340 ;; TODO: Remove this patch when updating the package.
2341 ;; Merged upstream at https://gitlab.com/wavexx/fgallery/-/commit/67b4a41de3f788e77ca619658950bae0e33b277b.
2342 (patches (search-patches "fgallery-also-look-for-7z.patch"))))
2343 (build-system gnu-build-system)
2344 (arguments
2345 `(#:tests? #f ; no tests
2346 #:phases
2347 (modify-phases %standard-phases
2348 (delete 'configure)
2349 (delete 'build)
2350 (replace 'install
2351 (lambda* (#:key inputs outputs #:allow-other-keys)
2352 (let* ((out (assoc-ref outputs "out"))
2353 (script (string-append out "/bin/fgallery"))
2354 (perl5lib (getenv "PERL5LIB")))
2355 (define (bin-directory input-name)
2356 (string-append (assoc-ref inputs input-name) "/bin"))
2357
2358 (invoke "make" "install" (string-append "PREFIX=" out))
2359
2360 ;; fgallery copies files from store when it is run. The
2361 ;; read-only permissions from the store directories will cause
2362 ;; fgallery to fail. Do not preserve file attributes when
2363 ;; copying files to prevent it.
2364 (substitute* script
2365 (("'cp'")
2366 "'cp', '--no-preserve=all'"))
2367
2368 (wrap-program script
2369 `("PATH" ":" prefix
2370 ,(map bin-directory '("imagemagick"
2371 "lcms"
2372 "facedetect"
2373 "fbida"
2374 "libjpeg-turbo"
2375 "zip"
2376 "jpegoptim"
2377 "pngcrush"
2378 "7zip")))
2379 `("PERL5LIB" ":" prefix (,perl5lib)))))))))
2380 (native-inputs
2381 (list unzip))
2382 (inputs
2383 (list bash-minimal
2384 imagemagick
2385 lcms
2386 facedetect
2387 fbida
2388 libjpeg-turbo
2389 zip
2390 perl
2391 perl-cpanel-json-xs
2392 perl-image-exiftool
2393 jpegoptim
2394 pngcrush
2395 7zip))
2396 (home-page "https://www.thregr.org/~wavexx/software/fgallery/")
2397 (synopsis "Static photo gallery generator")
2398 (description
2399 "FGallery is a static, JavaScript photo gallery generator with minimalist
2400look. The result can be uploaded on any web server without additional
2401requirements.")
2402 (license license:gpl2+)))
2403
2404(define-public opensubdiv
2405 (package
2406 (name "opensubdiv")
2407 (version "3.6.0")
2408 (source (origin
2409 (method git-fetch)
2410 (uri (git-reference
2411 (url "https://github.com/PixarAnimationStudios/OpenSubdiv")
2412 (commit (string-append "v" (string-join (string-split version #\.)
2413 "_")))))
2414 (file-name (git-file-name name version))
2415 (sha256
2416 (base32
2417 "0h9scxiigijzlpv4r0s0nhxlndhv1cmarb2bqgmlwcln1jjvlb4n"))))
2418 (build-system cmake-build-system)
2419 (arguments
2420 (list #:phases
2421 #~(modify-phases %standard-phases
2422 (add-before 'configure 'set-glew-location
2423 (lambda _
2424 (setenv "GLEW_LOCATION" #$(this-package-input "glew"))))
2425 (add-before 'check 'start-xorg-server
2426 (lambda* (#:key inputs #:allow-other-keys)
2427 ;; The test suite requires a running X server.
2428 (system "Xvfb :1 &")
2429 (setenv "DISPLAY" ":1"))))))
2430 (native-inputs
2431 (list xorg-server-for-tests))
2432 (inputs
2433 (list glew
2434 libxrandr
2435 libxcursor
2436 libxinerama
2437 libxi
2438 zlib
2439 glfw))
2440 (home-page "https://graphics.pixar.com/opensubdiv/")
2441 (synopsis "High performance subdivision surface evaluation")
2442 (description "OpenSubdiv is a set of libraries that implement high
2443performance subdivision surface (subdiv) evaluation on massively parallel CPU
2444and GPU architectures.")
2445 (license license:asl2.0)))
2446
2447(define-public opencsg
2448 (let ((dot-to-dash (lambda (c)
2449 (if (char=? c #\.) #\- c))))
2450 (package
2451 (name "opencsg")
2452 (version "1.8.1")
2453 (source
2454 (origin
2455 (method git-fetch)
2456 (uri (git-reference
2457 (url "https://github.com/floriankirsch/OpenCSG")
2458 (commit (string-append "opencsg-"
2459 (string-map dot-to-dash version)
2460 "-release"))))
2461 (file-name (git-file-name name version))
2462 (sha256
2463 (base32 "0q19mswyjlampdssqgik4q7j08fbj0dhxdr9mzg0i7ma2b2rhdhw"))))
2464 (build-system cmake-build-system)
2465 (arguments
2466 `(#:phases (modify-phases %standard-phases
2467 ;; library has no tests
2468 (delete 'check))))
2469 (inputs (list glew freeglut))
2470 (synopsis "Library for rendering Constructive Solid Geometry (CSG)")
2471 (description
2472 "OpenCSG is a library for rendering Constructive Solid Geometry (CSG) using
2473OpenGL. CSG is an approach for modeling complex 3D-shapes using simpler ones.
2474For example, two shapes can be combined by uniting them, by intersecting them,
2475or by subtracting one shape from the other.")
2476 (home-page "https://www.opencsg.org/")
2477 (license license:gpl2))))
2478
2479(define-public coin3d
2480 (package
2481 (name "coin3d")
2482 (version "4.0.2")
2483 (source
2484 (origin
2485 (method git-fetch)
2486 (uri (git-reference
2487 (url "https://github.com/coin3d/coin")
2488 (commit (string-append "v" version))
2489 (recursive? #t)))
2490 (file-name (git-file-name name version))
2491 (sha256
2492 (base32 "1p59q67zc45pwicknsccvmby09snhz35725wr3xsh2v6kxza76a4"))
2493 (modules '((guix build utils)))
2494 (snippet
2495 #~(begin
2496 ;; Delete binaries
2497 (for-each delete-file
2498 '("cfg/csubst.exe"
2499 "cfg/wrapmsvc.exe"))
2500 ;; Unbundle expat.
2501 (delete-file-recursively "src/xml/expat")
2502 (substitute* "src/xml/document.cpp"
2503 (("expat/expat\\.h") "expat.h"))
2504 ;; Delete references to packaging tool cpack. Otherwise the build
2505 ;; fails with "add_subdirectory given source "cpack.d" which is not
2506 ;; an existing directory."
2507 (substitute* "CMakeLists.txt"
2508 ((".*cpack.d.*") ""))))))
2509 (build-system cmake-build-system)
2510 (arguments
2511 (list #:configure-flags
2512 #~(list "-DCOIN_BUILD_DOCUMENTATION_MAN=ON"
2513 "-DUSE_EXTERNAL_EXPAT=ON"
2514 ;; Disable "runtime linking" of libraries, i.e. `dlopen`,
2515 ;; force to use libraries at build time.
2516 "-DFONTCONFIG_RUNTIME_LINKING=OFF"
2517 "-DFREETYPE_RUNTIME_LINKING=OFF"
2518 "-DLIBBZIP2_RUNTIME_LINKING=OFF"
2519 "-DOPENAL_RUNTIME_LINKING=OFF"
2520 ;"-DSIMAGE_RUNTIME_LINKING=OFF" -- Not packaged yet.
2521 "-DZLIB_RUNTIME_LINKING=OFF"
2522 "-DGLU_RUNTIME_LINKING=OFF"
2523 ;"-DSPIDERMONKEY_RUNTIME_LINKING=OFF" -- Can't find mozjs.
2524 (string-append "-DBOOST_ROOT="
2525 #$(this-package-input "boost")))))
2526 (native-inputs
2527 (list doxygen graphviz))
2528 (inputs
2529 (list boost
2530 bzip2
2531 expat
2532 fontconfig
2533 freeglut
2534 freetype
2535 glew
2536 libx11
2537 openal
2538 zlib))
2539 (home-page "https://github.com/coin3d/coin")
2540 (synopsis
2541 "High-level 3D visualization library with Open Inventor 2.1 API")
2542 (description
2543 "Coin is a 3D graphics library with an Application Programming Interface
2544based on the Open Inventor 2.1 API. For those who are not familiar with Open
2545Inventor, it is a scene-graph based retain-mode rendering and model interaction
2546library, written in C++, which has become the de facto standard graphics
2547library for 3D visualization and visual simulation software in the scientific
2548and engineering community.")
2549 (license license:bsd-3)))
2550
2551(define-deprecated coin3D coin3d)
2552(export coin3D)
2553
2554(define-deprecated coin3D-4 coin3d)
2555(export coin3D-4)
2556
2557(define-public skcms
2558 ;; No tags are available.
2559 (let ((commit "a7a3b15f06355692d86a3b8373c579a521598f4c")
2560 (revision "0"))
2561 (package
2562 (name "skcms")
2563 (version (git-version "0" revision commit))
2564 (source
2565 (origin
2566 (method git-fetch)
2567 (uri (git-reference
2568 (url "https://skia.googlesource.com/skcms")
2569 (commit commit)))
2570 (file-name (git-file-name name version))
2571 (sha256
2572 (base32 "0ylrsm7cinw59ilgbffazbgifax81kkya5cxq8q8wybnxx6z6ps6"))))
2573 (build-system gnu-build-system)
2574 (arguments
2575 (list
2576 #:phases
2577 #~(modify-phases %standard-phases
2578 (add-after 'unpack 'patch-includes
2579 (lambda _
2580 (substitute* "skcms.h"
2581 (("src\\/skcms_public\\.h") "skcms/skcms_public.h"))))
2582 (delete 'configure)
2583 (replace 'build
2584 (lambda _
2585 ;; Some CPUs may not support these features.
2586 (let ((cflags
2587 (list
2588 #$@(append
2589 '("-DSKCMS_DISABLE_HSW=1"
2590 "-DSKCMS_DISABLE_SKX=1")
2591 (if (target-mingw?)
2592 '("-DSKCMS_HAS_MUSTTAIL=0")
2593 '())
2594 ;; Avoid SIMD instructions where
2595 ;; not available.
2596 ;; Tests compare floating point numbers for
2597 ;; equality; avoid double rounding through
2598 ;; extended precision where needed.
2599 (if (target-x86-32?)
2600 '("-DSKCMS_PORTABLE"
2601 "-ffloat-store")
2602 '())
2603 ;; Upstream builds with
2604 ;; -ffp-contract=off (see ninja/gcc);
2605 ;; without it the tests fail on architectures
2606 ;; with fused multiply-add such as aarch64.
2607 (if (target-aarch64?)
2608 '("-ffp-contract=off")
2609 '()))))
2610 (ldflags '("-lstdc++")))
2611 (apply invoke #$(cc-for-target)
2612 `("-O2" "-g" "-fPIC" ,@cflags
2613 "skcms.cc"
2614 "src/skcms_TransformBaseline.cc"
2615 "src/skcms_TransformHsw.cc"
2616 "src/skcms_TransformSkx.cc"
2617 "-shared" ,@ldflags
2618 "-o" "libskcms.so"))
2619 (apply invoke #$(cc-for-target)
2620 `(,@cflags
2621 "tests.c" "test_only.c"
2622 "-Wl,-rpath=." "-L." "-lskcms" ,@ldflags
2623 "-o" "tests")))))
2624 (replace 'check
2625 (lambda* (#:key tests? #:allow-other-keys)
2626 (when tests?
2627 (invoke "./tests"))))
2628 (replace 'install
2629 (lambda _
2630 (install-file "libskcms.so" (string-append #$output "/lib"))
2631 (install-file "skcms.h" (string-append #$output "/include"))
2632 (install-file "src/skcms_public.h"
2633 (string-append #$output "/include/skcms")))))))
2634 (native-inputs (list ninja))
2635 (home-page "https://skia.org/")
2636 (synopsis "Color management engine")
2637 (description
2638 "skcms is the color management engine. It is a part of @code{skia}.")
2639 (license license:bsd-3))))
2640
2641(define-public skia
2642 ;; Releases follow those of Chromium, about every 6 weeks. The release
2643 ;; version can be found on this page:
2644 ;; https://skia.org/docs/user/release/release_notes/. The commit used
2645 ;; should be the last commit, as recommended at
2646 ;; https://skia.org/docs/user/release/.
2647 (let ((version "112")
2648 (revision "0")
2649 (commit "6d0b93856303fcf3021a8b40654d7739fda4dfb0"))
2650 (package
2651 (name "skia")
2652 (version (git-version version revision commit))
2653 (source (origin
2654 (method git-fetch)
2655 (uri (git-reference
2656 (url "https://skia.googlesource.com/skia.git")
2657 (commit commit)))
2658 (file-name (git-file-name name version))
2659 (sha256
2660 (base32
2661 "0g07xlvpbbxqmr9igvy5d1hy11z7dz9nzp2fd3ka9y2jqciniyz6"))))
2662 (build-system gnu-build-system) ;actually GN + Ninja
2663 (arguments
2664 (list
2665 #:phases
2666 #~(modify-phases %standard-phases
2667 (replace 'configure
2668 (lambda* (#:key inputs #:allow-other-keys)
2669 (substitute* "BUILD.gn"
2670 ;; Workaround a bug in the zlib third_party definition, that
2671 ;; fails the build even when zlib is found from the system.
2672 (("deps = \\[ \"//third_party/zlib\" ]")
2673 "deps = []"))
2674 (invoke "gn" "gen" "build"
2675 (string-append
2676 ;;
2677 "--args="
2678 "cc=\"" #$(cc-for-target) "\" " ;defaults to 'cc'
2679 "is_official_build=true " ;to use system libraries
2680 "is_component_build=true " ;build as a shared library
2681 "skia_use_system_zlib=true " ; use system zlib library
2682 ;; Specify where locate the harfbuzz and freetype
2683 ;; includes.
2684 (format #f "extra_cflags=[\"-I~a\",\"-I~a\"] "
2685 (search-input-directory inputs
2686 "include/harfbuzz")
2687 (search-input-directory inputs
2688 "include/freetype2"))
2689 ;; Otherwise the validate-runpath phase fails.
2690 "extra_ldflags=[\"-Wl,-rpath=" #$output "/lib\"] "
2691 ;; Disabled, otherwise the build system attempts to
2692 ;; download the SDK at build time.
2693 "skia_use_dng_sdk=false "
2694 ;; Wuffs is a google language that may improve performance
2695 ;; disabled while unpackaged
2696 "skia_use_wuffs=false "))))
2697 (replace 'build
2698 (lambda* (#:key parallel-build? #:allow-other-keys)
2699 (let ((job-count (if parallel-build?
2700 (number->string (parallel-job-count))
2701 "1")))
2702 (invoke "ninja" "-j" job-count "-C" "build"))))
2703 (replace 'install
2704 (lambda _
2705 ;; Install headers.
2706 (for-each (lambda (h)
2707 (install-file h (string-append
2708 #$output "/include/skia/"
2709 (dirname h))))
2710 (find-files "." "\\.h$"))
2711 ;; Install libraries.
2712 (for-each (lambda (lib)
2713 (install-file lib (string-append #$output "/lib")))
2714 (find-files "build" "^lib.*\\.(a|so)"))
2715 ;; This pkgconfig file is useful at least to the
2716 ;; python-skia-pathops package.
2717 (define skia.pc (string-append #$output
2718 "/lib/pkgconfig/skia.pc"))
2719 (mkdir-p (dirname skia.pc))
2720 (call-with-output-file skia.pc
2721 (lambda (port)
2722 (format port "\
2723prefix=~a
2724exec_prefix=${prefix}
2725libdir=${prefix}/lib
2726includedir=${prefix}/include/skia
2727
2728Name: skia
2729Description: 2D graphic library for drawing text, geometries and images.
2730URL: https://skia.org/
2731Version: ~a
2732Libs: -L${libdir} -lskia
2733Cflags: -I${includedir}~%" #$output #$version)))))
2734 (replace 'check
2735 (lambda* (#:key tests? inputs native-inputs #:allow-other-keys)
2736 (if tests?
2737 (let ((icu #$(this-package-native-input "icu4c-for-skia")))
2738 ;; Unbundle SPIRV-Tools dependency.
2739 (substitute* "BUILD.gn"
2740 (("deps \\+= \\[ \"//third_party/externals/spirv-tools:spvtools_val\" \\]")
2741 "libs += [ \"SPIRV-Tools\" ]"))
2742 (substitute* "src/sksl/SkSLCompiler.cpp"
2743 (("\"spirv-tools/libspirv.hpp\"")
2744 "<libspirv.hpp>"))
2745 ;; Configure ICU dependency.
2746 (substitute* "third_party/icu/BUILD.gn"
2747 (("data_dir = \"\\.\\./externals/icu/\"")
2748 (string-append "data_dir = \"" icu "/share/data/\""))
2749 (("script = \"\\.\\./externals/icu/scripts/")
2750 (string-append "script = \"" icu "/share/scripts/"))
2751 (("\\.\\./externals/icu/common/icudtl\\.dat")
2752 (string-append icu "/share/data/icudtl.dat"))
2753 (("sources = icu_sources")
2754 "")
2755 (("sources \\+= \\[ \"\\$data_assembly\" \\]")
2756 "sources = [ \"$data_assembly\" ]"))
2757 ;; Enable system libraries without is_official_build=true.
2758 ;; This is necessary because is_official_build prevents from
2759 ;; building dm.
2760 (for-each
2761 (lambda (libname)
2762 (let ((snake (string-join (string-split libname #\-) "_")))
2763 (substitute*
2764 (string-append "third_party/" libname "/BUILD.gn")
2765 (((string-append "skia_use_system_"
2766 snake
2767 " = is_official_build.*"))
2768 (string-append "skia_use_system_" snake " = true")))))
2769 '("zlib" "libjpeg-turbo" "harfbuzz" "libpng" "libwebp"))
2770 ;; Configure with gn.
2771 (invoke "gn" "gen" "out/Debug"
2772 (string-append
2773 "--args="
2774 "cc=\"" #$(cc-for-target) "\" " ;defaults to 'cc'
2775 "skia_compile_sksl_tests=false " ; disable some tests
2776 "skia_use_perfetto=false " ; disable performance tests
2777 "skia_use_wuffs=false " ; missing performance tool
2778 "skia_use_system_expat=true " ; use system expat library
2779 "skia_use_system_zlib=true " ; use system zlib library
2780 ;; Specify where to locate the includes.
2781 "extra_cflags=["
2782 (string-join
2783 (map
2784 (lambda (lib)
2785 (string-append
2786 "\"-I"
2787 (search-input-directory
2788 inputs
2789 (string-append "include/" lib)) "\""))
2790 '("harfbuzz"
2791 "freetype2"
2792 "spirv-tools"
2793 "spirv"
2794 "unicode"))
2795 ",")
2796 "] "
2797 ;; Otherwise the validate-runpath phase fails.
2798 "extra_ldflags=["
2799 "\"-Wl,-rpath=" #$output "/lib\""
2800 "] "
2801 ;; Disabled, otherwise the build system attempts to
2802 ;; download the SDK at build time.
2803 "skia_use_dng_sdk=false "
2804 "skia_use_runtime_icu=true "))
2805 ;; Build dm testing tool.
2806 (symlink
2807 (string-append #$(this-package-native-input "gn") "/bin/gn")
2808 "./bin/gn")
2809 (invoke "ninja" "-C" "out/Debug" "dm")
2810 ;; The test suite requires an X server.
2811 (let ((xvfb (search-input-file (or native-inputs inputs)
2812 "bin/Xvfb"))
2813 (display ":1"))
2814 (setenv "DISPLAY" display)
2815 (system (string-append xvfb " " display " &")))
2816 ;; Run tests.
2817 (invoke "out/Debug/dm" "-v"
2818 "-w" "dm_output"
2819 "--codecWritePath" "dm_output"
2820 "--simpleCodec"
2821 "--skip"
2822 ;; The underscores are part of the dm syntax for
2823 ;; skipping tests.
2824 ;; These tests fail with segmentation fault.
2825 "_" "_" "_" "Codec_trunc"
2826 "_" "_" "_" "AnimCodecPlayer"
2827 "_" "_" "_" "Codec_partialAnim"
2828 "_" "_" "_" "Codec_InvalidImages"
2829 "_" "_" "_" "Codec_GifInterlacedTruncated"
2830 ;; This test started failing possibly after mesa
2831 ;; being updated to 23.2.1 and possibly only on some
2832 ;; hardware.
2833 "_" "_" "_" "SkRuntimeBlender_GPU"
2834 "_" "_" "_" "SkText_UnicodeText_Flags"
2835 "_" "_" "_" "SkParagraph_FontStyle"
2836 "_" "_" "_" "flight_animated_image"
2837 ;; These tests fail because of Codec/Sk failure.
2838 "_" "_" "_" "AndroidCodec_computeSampleSize"
2839 "_" "_" "_" "AnimatedImage_invalidCrop"
2840 "_" "_" "_" "AnimatedImage_scaled"
2841 "_" "_" "_" "AnimatedImage_copyOnWrite"
2842 "_" "_" "_" "AnimatedImage"
2843 "_" "_" "_" "BRD_types"
2844 "_" "_" "_" "Codec_frames"
2845 "_" "_" "_" "Codec_partial"
2846 "_" "_" "_" "Codec_partialWuffs"
2847 "_" "_" "_" "Codec_requiredFrame"
2848 "_" "_" "_" "Codec_rewind"
2849 "_" "_" "_" "Codec_incomplete"
2850 "_" "_" "_" "Codec_InvalidAnimated"
2851 "_" "_" "_" "Codec_ossfuzz6274"
2852 "_" "_" "_" "Codec_gif_out_of_palette"
2853 "_" "_" "_" "Codec_xOffsetTooBig"
2854 "_" "_" "_" "Codec_gif"
2855 "_" "_" "_" "Codec_skipFullParse"
2856 "_" "_" "_" "AndroidCodec_animated_gif"
2857 ;; These fail for unknown reasons.
2858 "_" "_" "_" "Gif"
2859 "_" "_" "_" "Wuffs_seek_and_decode"
2860 "_" "_" "_" "Skottie_Shaper_ExplicitFontMgr"
2861 "8888" "skp" "_" "_"
2862 "8888" "lottie" "_" "_"
2863 "gl" "skp" "_" "_"
2864 "gl" "lottie" "_" "_"
2865 "_" "_" "_" "ES2BlendWithNoTexture"))
2866 (format #t "test suite not run~%")))))))
2867 (native-inputs
2868 (append (if (target-x86-32?)
2869 (list clang-toolchain-13)
2870 '())
2871 (list gn libjpeg-turbo ninja pkg-config python-wrapper
2872 spirv-tools spirv-headers
2873 icu4c-for-skia glu xorg-server-for-tests)))
2874 (inputs (list expat fontconfig freetype harfbuzz mesa libwebp zlib))
2875 (home-page "https://skia.org/")
2876 (synopsis "2D graphics library")
2877 (description
2878 "Skia is a 2D graphics library for drawing text, geometries, and images.
2879It supports:
2880@itemize
2881@item 3x3 matrices with perspective
2882@item antialiasing, transparency, filters
2883@item shaders, xfermodes, maskfilters, patheffects
2884@item subpixel text
2885@end itemize")
2886 (license license:bsd-3))))
2887
2888(define-public skia-for-friction
2889 (let ((version "112")
2890 (revision "0")
2891 (commit "c4284e9bdd1f794e1c72328924ad519fd0d736cf"))
2892 (package
2893 (inherit skia)
2894 (name "skia")
2895 (version (git-version version revision commit))
2896 (source (origin
2897 (method git-fetch)
2898 (uri (git-reference
2899 (url "https://github.com/friction2d/skia")
2900 (commit commit)
2901 (recursive? #true)))
2902 (file-name (git-file-name name version))
2903 (sha256
2904 (base32
2905 "15mbqz7kg23xgy46ijm8p5wnj4q8xipyr7ckwz8kpa5v3lxssyf3"))))
2906 (arguments
2907 (substitute-keyword-arguments arguments
2908 ;; gn/find_headers.py fails to decode some JSON, probably because of
2909 ;; a warning.
2910 ((#:tests? _ #false) #false)
2911 ((#:phases phases)
2912 #~(modify-phases #$phases
2913 (replace 'configure
2914 (lambda* (#:key inputs #:allow-other-keys)
2915 (substitute* "BUILD.gn"
2916 ;; Workaround a bug in the zlib third_party definition, that
2917 ;; fails the build even when zlib is found from the system.
2918 (("deps = \\[ \"//third_party/zlib\" ]")
2919 "deps = []")
2920 (("set_sources_assignment_filter\\(\\[\\]\\)") "")
2921 (("visibility = \\[ \":\\*\" \\]")
2922 "visibility = [ \"*\" ]"))
2923 (invoke "gn" "gen" "build"
2924 (string-append
2925 ;;
2926 "--args="
2927 "cc=\"gcc\" " ;defaults to 'cc'
2928 "is_official_build=true " ;to use system libraries
2929 "skia_use_system_zlib=true " ; use system zlib library
2930 "skia_use_system_expat=true "
2931 "skia_use_system_libjpeg_turbo=true "
2932 "skia_use_system_libpng=true "
2933 "skia_use_system_libwebp=true "
2934 "skia_use_system_icu=true "
2935 "skia_use_system_harfbuzz=true "
2936 "skia_use_system_freetype2=true "
2937 "skia_enable_pdf=false "
2938 "skia_enable_skottie=false "
2939 "skia_enable_tools=false "
2940 "skia_use_dng_sdk=false "
2941
2942 ;; Specify where locate the harfbuzz and freetype
2943 ;; includes.
2944 (format #f "extra_cflags=[\"-I~a\",\"-I~a\"] "
2945 (search-input-directory inputs
2946 "include/harfbuzz")
2947 (search-input-directory inputs
2948 "include/freetype2"))
2949 ;; Otherwise the validate-runpath phase fails.
2950 "extra_ldflags=[\"-Wl,-rpath=" #$output "/lib\"] "
2951 ;; Wuffs is a google language that may improve performance
2952 ;; disabled while unpackaged
2953 "skia_use_wuffs=false ")))))))))))
2954
2955(define-public superfamiconv
2956 (package
2957 (name "superfamiconv")
2958 (version "0.8.8")
2959 (source
2960 (origin
2961 (method git-fetch)
2962 (uri (git-reference
2963 (url "https://github.com/Optiroc/SuperFamiconv")
2964 (commit (string-append "v" version))))
2965 (file-name (git-file-name name version))
2966 (sha256
2967 (base32
2968 "0848szv6a2b8wdganh6mw5i8vn8cqvn1kbwzx7mb9wlrf5wzqn37"))))
2969 (build-system gnu-build-system)
2970 (arguments
2971 `(#:tests? #f ; no tests
2972 #:phases
2973 (modify-phases %standard-phases
2974 (delete 'configure)
2975 (replace 'install
2976 (lambda* (#:key outputs #:allow-other-keys)
2977 (let* ((outdir (assoc-ref outputs "out"))
2978 (bindir (string-append outdir "/bin")))
2979 (install-file "bin/superfamiconv" bindir)
2980 #t))))))
2981 (home-page "https://github.com/Optiroc/SuperFamiconv")
2982 (synopsis "Tile graphics converter supporting SNES, Game Boy Color
2983and PC Engine formats")
2984 (description "SuperFamiconv is a converter for tiled graphics, supporting
2985the graphics formats of the SNES, Game Boy Color and PC Engine game consoles.
2986Automated palette selection is supported.")
2987 (license license:expat)))
2988
2989(define-public drawpile
2990 (package
2991 (name "drawpile")
2992 (version "2.2.2-beta.5")
2993 (source (origin
2994 (method git-fetch)
2995 (uri (git-reference
2996 (url "https://github.com/drawpile/Drawpile")
2997 (commit version)))
2998 (file-name (git-file-name name version))
2999 (sha256
3000 (base32
3001 "1w6vfdm6rmnpn6s8kzm8blbaidlsg8q6spv95m7fnwr3984hf6hb"))))
3002 (build-system qt-build-system)
3003 (arguments
3004 (list #:qtbase qtbase
3005 #:configure-flags
3006 #~(list "-DTESTS=ON" "-DTOOLS=ON" "-DKIS_TABLET=ON")))
3007 (native-inputs
3008 (list extra-cmake-modules pkg-config))
3009 (inputs
3010 (list giflib
3011 karchive
3012 kdnssd
3013 libmicrohttpd
3014 libsodium
3015 libvpx
3016 libwebp
3017 libxi
3018 libxkbcommon
3019 libzip
3020 miniupnpc
3021 qtbase
3022 qtkeychain
3023 qtmultimedia
3024 qtsvg
3025 qtwayland
3026 qtx11extras
3027 vulkan-headers))
3028 (home-page "https://drawpile.net")
3029 (synopsis "Collaborative drawing program")
3030 (description "Drawpile is a drawing program that allows share the canvas
3031with other users in real time.
3032
3033Some feature highlights:
3034@itemize
3035@item Shared canvas using the built-in server or a dedicated server
3036@item Record, play back and export drawing sessions
3037@item Simple animation support
3038@item Layers and blending modes
3039@item Text layers
3040@item Supports pressure sensitive Wacom tablets
3041@item Built-in chat
3042@item Supports OpenRaster file format
3043@item Encrypted connections using SSL
3044@item Automatic port forwarding with UPnP
3045@end itemize\n")
3046 (license license:gpl3+)))
3047
3048(define-public openxr
3049 (package
3050 (name "openxr")
3051 (version "1.1.57")
3052 (source
3053 (origin
3054 (method git-fetch)
3055 (uri (git-reference
3056 (url "https://github.com/KhronosGroup/OpenXR-SDK")
3057 (commit (string-append "release-" version))))
3058 (file-name (git-file-name name version))
3059 ;; When compiling against jsoncpp 1.9.6 the build fails with
3060 ;; 'Unknown CMake command "check_required_components"'
3061 ;; (see https://github.com/open-source-parsers/jsoncpp/issues/1568).
3062 ;; When fixed uncomment the snippet and re-add jsoncpp as an input.
3063 ;(modules '((guix build utils)))
3064 ;(snippet
3065 ; '(begin
3066 ; ;; Delete bundled jsoncpp.
3067 ; (delete-file-recursively "src/external/jsoncpp")))
3068 (sha256
3069 (base32 "1s4cg0cl6cn98d3cvgvwsichic4q3bx34flbdklnzprc18vmaqv7"))))
3070 (build-system cmake-build-system)
3071 (arguments
3072 `(#:tests? #f)) ; there are no tests
3073 (native-inputs
3074 (list pkg-config python shaderc vulkan-headers))
3075 (inputs
3076 (list mesa vulkan-loader wayland))
3077 (home-page "https://www.khronos.org/openxr/")
3078 (synopsis "Generated headers and sources for OpenXR loader")
3079 (description "This package contains OpenXR headers, as well as source code
3080and build scripts for the OpenXR loader.")
3081 ;; Dual licensed. Either license applies.
3082 (license (list license:asl2.0 license:expat))))
3083
3084(define-public tinygltf
3085 (package
3086 (name "tinygltf")
3087 (version "2.9.6")
3088 (source
3089 (origin
3090 (method git-fetch)
3091 (uri (git-reference
3092 (url "https://github.com/syoyo/tinygltf")
3093 (commit (string-append "v" version))))
3094 (file-name (git-file-name name version))
3095 (sha256
3096 (base32 "0xh94bnxz5dffq9g2fdfhxfy0lkyb9qhbnh583gbqkfysmyp3l6x"))
3097 (modules '((guix build utils)))
3098 (snippet #~(begin
3099 (for-each delete-file-recursively
3100 (list "examples" ".github" "tools"))
3101 ;; tinygltf bundles json, stb-image and stb-image-write
3102 ;; headers. Delete those, and use symlink ours instead.
3103 (for-each delete-file
3104 (list "json.hpp"
3105 "stb_image.h"
3106 "stb_image_write.h"
3107 "tests/catch.hpp"))))))
3108 (build-system cmake-build-system)
3109 (arguments
3110 (list
3111 #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON")
3112 #:phases
3113 #~(modify-phases %standard-phases
3114 (add-after 'unpack 'use-our-packages
3115 (lambda* (#:key inputs #:allow-other-keys)
3116 (symlink (search-input-file inputs "include/nlohmann/json.hpp")
3117 "json.hpp")
3118 (symlink (search-input-file inputs "include/stb_image.h")
3119 "stb_image.h")
3120 (symlink (search-input-file inputs "include/stb_image_write.h")
3121 "stb_image_write.h")
3122 (symlink (search-input-file inputs "include/catch.hpp")
3123 "catch.hpp")))
3124 (replace 'check
3125 (lambda* (#:key tests? #:allow-other-keys)
3126 (if tests?
3127 (with-directory-excursion "../source/tests"
3128 (invoke "make")
3129 (invoke "./tester")
3130 (invoke "./tester_noexcept"))
3131 (format #t "test suite not run~%")))))))
3132 (inputs (list nlohmann-json stb-image stb-image-write))
3133 (native-inputs (list catch-framework clang-13))
3134 (home-page "https://github.com/syoyo/tinygltf")
3135 (synopsis "Header only GL Transmission Format library")
3136 (description "This package provides a header only C++11
3137@url{https://github.com/KhronosGroup/glTF, glTF} (GL Transmission Format) 2.0
3138library.
3139
3140GL Transmission Format (glTF) is a royalty-free specification for the
3141efficient transmission and loading of 3D scenes and models by applications.
3142glTF minimizes both the size of 3D assets, and the runtime processing needed
3143to unpack and use those assets. glTF defines an extensible, common publishing
3144format for 3D content tools and services that streamlines authoring workflows
3145and enables interoperable use of content across the industry.")
3146 (license license:expat)))
3147
3148(define-public monado
3149 (package
3150 (name "monado")
3151 (version "25.1.0")
3152 (source (origin
3153 (method git-fetch)
3154 (uri (git-reference
3155 (url "https://gitlab.freedesktop.org/monado/monado")
3156 (commit (string-append "v" version))))
3157 (file-name (git-file-name name version))
3158 (sha256
3159 (base32
3160 "09bmcqr01kakhzc26r2kmlqd1l3hqr33360qrrpmiy6mlgpsci45"))))
3161 (build-system cmake-build-system)
3162 (inputs
3163 (list ffmpeg
3164 glslang
3165 eudev
3166 hidapi
3167 libusb
3168 libxcb
3169 libxrandr
3170 mesa
3171 openhmd
3172 openvr
3173 python
3174 v4l-utils
3175 vulkan-loader
3176 wayland
3177 wayland-protocols))
3178 (native-inputs
3179 (list eigen pkg-config vulkan-headers))
3180 (home-page "https://monado.freedesktop.org/")
3181 (synopsis "OpenXR runtime")
3182 (description "Monado is an OpenXR runtime delivering immersive experiences
3183such as VR and AR on mobile, PC/desktop, and any other device. Monado aims to be
3184a complete and conforming implementation of the OpenXR API made by Khronos.")
3185 (license license:boost1.0)))
3186
3187(define-public azpainter
3188 (package
3189 (name "azpainter")
3190 (version "3.0.6")
3191 (source (origin
3192 (method git-fetch)
3193 (uri (git-reference
3194 (url "https://gitlab.com/azelpg/azpainter")
3195 (commit (string-append "v" version))))
3196 (file-name (git-file-name name version))
3197 (sha256
3198 (base32
3199 "0lk74drrksk340fzyzvrq0ixwj498adshbp505cj163qsqnndj7y"))))
3200 (build-system gnu-build-system) ;actually a home grown build system
3201 (arguments
3202 (list #:tests? #f
3203 #:phases
3204 #~(modify-phases %standard-phases
3205 (replace 'configure
3206 (lambda _
3207 (invoke "./configure"
3208 (string-append "--prefix="
3209 #$output))))
3210 (replace 'build
3211 (lambda* (#:key parallel-build? #:allow-other-keys)
3212 (let ((job-count (if parallel-build?
3213 (number->string (parallel-job-count))
3214 "1")))
3215 (invoke "ninja" "-j" job-count "-C" "build"))))
3216 (add-before 'install 'disable-cache-generation
3217 (lambda _
3218 (setenv "DESTDIR" "/") #t))
3219 (replace 'install
3220 (lambda _
3221 (invoke "ninja" "-C" "build" "install"))))))
3222 (inputs (list fontconfig
3223 freetype
3224 libjpeg-turbo
3225 libpng
3226 libtiff
3227 libwebp
3228 libx11
3229 libxcursor
3230 libxext
3231 libxi
3232 zlib))
3233 (native-inputs (list ninja pkg-config))
3234 (home-page "http://azsky2.html.xdomain.jp/soft/azpainter.html")
3235 (synopsis "Paint software for editing illustrations and images")
3236 (description
3237 "AzPainter is a lightweight full color painting application for editing
3238illustrations and images.
3239
3240Features include:
3241@itemize
3242@item Layers
3243@item Many artistic filters
3244@item Good range of selection tools
3245@item Pen pressure support with automatic brush size adjustment
3246@item Support for 16-bit color images with transparency (RGBA)
3247@item Support for image formats like PSD, PNG, JPEG, TIFF, WebP
3248@end itemize
3249")
3250 (license license:gpl3+)))
3251
3252(define-public discregrid
3253 (let ((commit "4c27e1cc88be828c6ac5b8a05759ac7e01cf79e9")
3254 (revision "0"))
3255 (package
3256 (name "discregrid")
3257 (version (git-version "0.0.0" revision commit))
3258 (source
3259 (origin
3260 (method git-fetch)
3261 (uri (git-reference
3262 (url "https://github.com/InteractiveComputerGraphics/Discregrid")
3263 (commit commit)))
3264 (file-name (git-file-name name version))
3265 (sha256
3266 (base32 "01cwfpw19rc9k5glx9dhnqpihd0is28a9b53qvzp5kgjmdq2v1p0"))
3267 (modules '((guix build utils)))
3268 (snippet
3269 #~(begin
3270 (delete-file-recursively "extern/cxxopts")
3271 (substitute* '("cmd/discrete_field_to_bitmap/main.cpp"
3272 "cmd/generate_density_map/main.cpp"
3273 "cmd/generate_sdf/main.cpp")
3274 (("^#include <cxxopts/cxxopts\\.hpp>")
3275 "#include <cxxopts.hpp>")
3276 (("cxxopts::OptionException")
3277 "cxxopts::exceptions::parsing"))))))
3278 (build-system cmake-build-system)
3279 (outputs '("out" "bin"))
3280 (arguments
3281 (list #:tests? #f ; No tests
3282 #:configure-flags
3283 #~(list (string-append "-DCMAKE_INSTALL_BINDIR="
3284 #$output:bin "/bin")
3285 ;; Bespoke version of BUILD_SHARED_LIBS.
3286 "-DBUILD_AS_SHARED_LIBS=ON")
3287 #:phases
3288 #~(modify-phases %standard-phases
3289 (add-after 'unpack 'patch-cmake
3290 (lambda _
3291 (let ((port (open-file "cmd/CMakeLists.txt" "a")))
3292 (display "install(TARGETS
3293 DiscreteFieldToBitmap
3294 GenerateDensityMap
3295 GenerateSDF)
3296"
3297 port)
3298 (close-port port)))))))
3299 (inputs
3300 (list cxxopts eigen))
3301 (home-page "https://github.com/InteractiveComputerGraphics/Discregrid")
3302 (synopsis "Discretize functions on regular grids")
3303 (description "Discregrid is a C++ library for the parallel discretization
3304of (preferably smooth) functions on regular grids. It generates a (cubic)
3305polynomial discretization given a box-shaped domain, a grid resolution, and a
33063D scalar field. The library can also serialize and deserialize the generated
3307discrete grid, and compute and discretize the signed distance field
3308corresponding to a triangle mesh. The following programs are included with
3309Discregrid:
3310
3311@itemize
3312@item @code{GenerateSDF}: Computes a discrete (cubic) signed distance field
3313from a triangle mesh in OBJ format.
3314
3315@item @code{DiscreteFieldToBitmap}: Generates an image in bitmap format of a
3316two-dimensional slice of a previously computed discretization.
3317
3318@item @code{GenerateDensityMap}: Generates a density map from a previously
3319generated discrete signed distance field using the cubic spline kernel.
3320@end itemize")
3321 (license license:expat))))
3322
3323(define-public mmg
3324 (package
3325 (name "mmg")
3326 (version "5.7.2")
3327 (source
3328 (origin
3329 (method git-fetch)
3330 (uri (git-reference
3331 (url "https://github.com/MmgTools/mmg")
3332 (commit (string-append "v" version))))
3333 (file-name (git-file-name name version))
3334 (sha256
3335 (base32 "007d0mvqhnxxj6dbcip9s615asrbpgrbkpm5xn6m8k3n9sljr153"))))
3336 (build-system cmake-build-system)
3337 (outputs '("out" "lib" "doc"))
3338 (arguments
3339 (list #:configure-flags
3340 #~(list (string-append "-DCMAKE_INSTALL_PREFIX=" #$output:lib)
3341 (string-append "-DCMAKE_INSTALL_RPATH=" #$output:lib "/lib")
3342 ;; The build doesn't honor -DCMAKE_INSTALL_BINDIR, hence
3343 ;; the adjust-bindir phase.
3344 ;;(string-append "-DCMAKE_INSTALL_BINDIR=" #$output "/bin")
3345 (string-append "-DCMAKE_INSTALL_MANDIR=" #$output "/share/man")
3346 "-DBUILD_SHARED_LIBS=ON"
3347 "-DBUILD_DOC=ON"
3348 ;; The longer tests are for continuous integration and
3349 ;; depend on input data which must be downloaded.
3350 "-DONLY_VERY_SHORT_TESTS=ON"
3351 "-DUSE_SCOTCH=ON"
3352 ;; TODO: Add Elas (from
3353 ;; https://github.com/ISCDtoolbox/LinearElasticity).
3354 "-DUSE_ELAS=OFF"
3355 ;; TODO: Figure out how to add VTK to inputs without
3356 ;; causing linking errors in ASLI of the form:
3357 ;;
3358 ;; ld: /gnu/store/…-vtk-9.0.1/lib/libvtkWrappingPythonCore-9.0.so.1:
3359 ;; undefined reference to `PyUnicode_InternFromString'
3360 ;;
3361 ;; Also, adding VTK to inputs requires adding these as well:
3362 ;;
3363 ;; double-conversion eigen expat freetype gl2ps glew hdf5
3364 ;; jsoncpp libjpeg-turbo libpng libtheora libtiff libx11
3365 ;; libxml2 lz4 netcdf proj python sqlite zlib
3366 "-DUSE_VTK=OFF")
3367 #:phases
3368 #~(modify-phases %standard-phases
3369 (add-after 'build 'build-doc
3370 (lambda _
3371 ;; Fontconfig wants to write to a cache directory.
3372 (setenv "HOME" "/tmp")
3373 (invoke "make" "doc")))
3374 (add-after 'install 'install-doc
3375 (lambda _
3376 (copy-recursively
3377 "doc" (string-append #$output:doc "/share/doc/"
3378 #$name "-" #$version))))
3379 (add-after 'install 'adjust-bindir
3380 (lambda _
3381 (let ((src (string-append #$output:lib "/bin"))
3382 (dst (string-append #$output "/bin")))
3383 (copy-recursively src dst)
3384 (delete-file-recursively src))))
3385 ;; Suffixing program names with build information, i.e.,
3386 ;; optimization flags and whether debug symbols were generated,
3387 ;; is unusual and fragilizes scripts calling these programs.
3388 (add-after 'adjust-bindir 'fix-program-names
3389 (lambda _
3390 (with-directory-excursion (string-append #$output "/bin")
3391 (rename-file "mmg2d_O3d" "mmg2d")
3392 (rename-file "mmg3d_O3d" "mmg3d")
3393 (rename-file "mmgs_O3d" "mmgs")))))))
3394 (native-inputs
3395 ;; For the documentation
3396 (list doxygen graphviz
3397 ;; TODO: Fix failing LaTeX invocation (which results in equations
3398 ;; being inserted literally into PNGs rather than being typeset).
3399 ;; (texlive-local-tree)
3400
3401 perl)) ;used to generate Fortran headers
3402 (inputs
3403 (list scotch))
3404 (home-page "http://www.mmgtools.org/")
3405 (synopsis "Surface and volume remeshers")
3406 (description "Mmg is a collection of applications and libraries for
3407bidimensional and tridimensional surface and volume remeshing. It consists
3408of:
3409
3410@itemize
3411@item the @code{mmg2d} application and library: mesh generation from a set of
3412edges, adaptation and optimization of a bidimensional triangulation and
3413isovalue discretization;
3414
3415@item the @code{mmgs} application and library: adaptation and optimization of
3416a surface triangulation and isovalue discretization;
3417
3418@item the @code{mmg3d} application and library: adaptation and optimization of
3419a tetrahedral mesh, isovalue discretization and Lagrangian movement;
3420
3421@item the @code{mmg} library gathering the @code{mmg2d}, @code{mmgs} and
3422@code{mmg3d} libraries.
3423@end itemize")
3424 (license license:lgpl3+)))
3425
3426(define-public nanosvg
3427 ;; There are no proper versions or releases; use the latest commit.
3428 (let ((commit "9da543e8329fdd81b64eb48742d8ccb09377aed1")
3429 (revision "0"))
3430 (package
3431 (name "nanosvg")
3432 (version (git-version "0.0.0" revision commit))
3433 (source (origin
3434 (method git-fetch)
3435 (uri (git-reference
3436 (url "https://github.com/memononen/nanosvg")
3437 (commit commit)))
3438 (file-name (git-file-name name version))
3439 (sha256
3440 (base32
3441 "1pkzv75kavkhrbdd2kvq755jyr0vamgrfr7lc33dq3ipkzmqvs2l"))
3442 ;; This patch required to build PrusaSlicer 2.6.
3443 ;;
3444 ;; It is taken from
3445 ;; <https://github.com/fltk/nanosvg/commit/abcd277ea45e9098bed752cf9c6875b533c0892f.patch>
3446 (patches (search-patches "nanosvg-prusa-slicer.patch"))))
3447 (build-system cmake-build-system)
3448 (arguments (list #:tests? #f ;no test suite
3449 #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON")))
3450 (home-page "https://github.com/memononen/nanosvg")
3451 (synopsis "Simple SVG parser")
3452 (description "NanoSVG is a simple single-header SVG parser. The output
3453of the parser is a list of cubic bezier shapes. The library suits well for
3454anything from rendering scalable icons in an editor application to prototyping
3455a game.")
3456 (license license:zlib))))
3457
3458(define-public f3d
3459 (package
3460 (name "f3d")
3461 (version "3.0.0")
3462 (source
3463 (origin
3464 (method git-fetch)
3465 (uri (git-reference
3466 (url "https://github.com/f3d-app/f3d")
3467 (commit (string-append "v" version))))
3468 (file-name (git-file-name name version))
3469 (sha256
3470 (base32 "118gsmn074cq7xdvgc3yrlrwy52f4byvn52nhb3hf7rgfqfi9yxi"))
3471 (modules '((guix build utils)))
3472 (snippet
3473 #~(begin
3474 (delete-file-recursively "external/cxxopts")
3475 (delete-file-recursively "external/nlohmann_json")))))
3476 (build-system cmake-build-system)
3477 ;; The package cannot easily be split into out and lib outputs because
3478 ;; VTK's vtkModule.cmake complains, and also the CMake files in
3479 ;; /lib/cmake/f3d expect the f3d executable and library to be available,
3480 ;; as they set up targets for both of them.
3481 (arguments
3482 (list
3483 ;; Many tests require files supplied by git-lfs.
3484 ;; Also, some tests segfault (after an exception?) but the tested
3485 ;; behavior, i.e., when the program is run manually, does not (for
3486 ;; example, TestNonExistentConfigFile and TestInvalidConfigFile).
3487 ;; Upstream is aware of occasionally flaky tests [1], but the tests
3488 ;; run in CI seem to be passing.
3489 ;; Anyway, the program runs and is able to open at least STL files
3490 ;; without issue.
3491 ;;
3492 ;; [1]: https://github.com/f3d-app/f3d/issues/92
3493 #:tests? #f
3494 #:configure-flags
3495 #~(list (string-append "-DCMAKE_INSTALL_DOCDIR=" #$output
3496 "/share/doc/" #$name "-" #$version)
3497 "-DF3D_LINUX_GENERATE_MAN=ON"
3498 "-DF3D_USE_EXTERNAL_CXXOPTS=ON"
3499 "-DF3D_USE_EXTERNAL_NLOHMANN_JSON=ON"
3500 "-DF3D_MODULE_EXTERNAL_RENDERING=ON"
3501 "-DF3D_MODULE_EXR=ON"
3502 "-DF3D_PLUGIN_BUILD_ALEMBIC=ON"
3503 "-DF3D_PLUGIN_BUILD_ASSIMP=ON"
3504 "-DF3D_PLUGIN_BUILD_OCCT=ON")
3505 #:phases
3506 #~(modify-phases %standard-phases
3507 (add-after 'unpack 'fix-cmake-rpath
3508 (lambda _
3509 ;; Expand $ORIGIN, and add VTK to library RPATH, because it is
3510 ;; not added automatically.
3511 (substitute* "application/CMakeLists.txt"
3512 (("(set_target_properties.*PROPERTIES.*INSTALL_RPATH ).*"
3513 _ prefix)
3514 (string-append prefix "\"" #$output "/lib\")\n")))
3515 (substitute* "library/CMakeLists.txt"
3516 (("(set_target_properties.*PROPERTIES.*INSTALL_RPATH ).*"
3517 _ prefix)
3518 (string-append prefix "\"" #$output "/lib:"
3519 #$(this-package-input "vtk") "/lib\")\n"))))))))
3520 (native-inputs
3521 (list cxxopts
3522 help2man
3523 nlohmann-json))
3524 (inputs
3525 (list alembic
3526 assimp
3527 double-conversion
3528 eigen
3529 expat
3530 fontconfig
3531 freetype
3532 glew
3533 hdf5
3534 imath
3535 jsoncpp
3536 libjpeg-turbo
3537 libpng
3538 libtiff
3539 libx11
3540 lz4
3541 netcdf
3542 opencascade-occt
3543 openexr
3544 vtk-9.5
3545 zlib))
3546 (home-page "https://f3d.app/")
3547 (synopsis "VTK-based 3D viewer")
3548 (description "F3D (pronounced @samp{/fɛd/}) is a VTK-based 3D viewer with
3549simple interaction mechanisms and which is fully controllable using arguments
3550on the command line. It supports a range of file formats (including animated
3551glTF, STL, STEP, PLY, OBJ, FBX), and provides numerous rendering and texturing
3552options.")
3553 (license license:bsd-3)))
3554
3555(define-public gpaint
3556 (package
3557 (name "gpaint")
3558 (version "0.3.4.1")
3559 (source
3560 (origin
3561 (method git-fetch)
3562 (uri (git-reference
3563 (url "https://git.savannah.gnu.org/git/gpaint.git")
3564 (commit (string-append "v"
3565 (string-replace-substring version "." "_")))))
3566 (file-name (git-file-name name version))
3567 (sha256
3568 (base32 "0drsvrihyvkdf5g65w5784ap06d2x9zkas69amp1mb6jmnzp8rir"))))
3569 (build-system gnu-build-system)
3570 (inputs (list gtk+-2 libglade))
3571 (native-inputs (list gettext-minimal
3572 `(,glib "bin") pkg-config))
3573 (synopsis "Simple paint program for GNOME")
3574 (description
3575 "GNU Paint is a simple, easy-to-use paint program for the GNOME
3576environment. It supports drawing freehand as well as basic shapes and text.
3577It features cut-and-paste for irregular regions or polygons.")
3578 (home-page "https://www.gnu.org/software/gpaint/")
3579 (license license:gpl3+)))
3580
3581(define-public basis-universal
3582 (package
3583 (name "basis-universal")
3584 (version "1.60")
3585 (source (origin
3586 (method git-fetch)
3587 (uri (git-reference
3588 (url "https://github.com/BinomialLLC/basis_universal")
3589 (commit (string-append "v"
3590 (string-replace-substring version "." "_")))))
3591 (file-name (git-file-name name version))
3592 (patches (search-patches "basis-universal-unbundle-libs.patch"))
3593 (modules '((guix build utils)))
3594 (snippet #~(for-each delete-file-recursively '("OpenCL" "zstd")))
3595 (sha256
3596 (base32
3597 "1s38fp3j9pp0s260s805lw2h4gqbx7d2cd0d96pjp5bfqndmmk8b"))))
3598 (build-system cmake-build-system)
3599 (arguments
3600 (list #:phases
3601 #~(modify-phases %standard-phases
3602 (delete 'check)
3603 (add-after 'install 'check
3604 (lambda _ (invoke (string-append #$output "/bin/basisu")
3605 "-test_dir" "../source/test_files"
3606 "-test"))))))
3607 (inputs (list opencl-headers (list zstd "lib")))
3608 (native-inputs (list pkg-config))
3609 (home-page "https://github.com/BinomialLLC/basis_universal")
3610 (synopsis "LDR/HDR compressed texture transcoder")
3611 (description "Basis Universal is an LDR/HDR GPU compressed texture
3612interchange system supporting transcoding to a large number of GPU texture
3613formats.")
3614 (license (list license:asl2.0 license:bsd-3 license:expat))))
3615
3616(define-public meshoptimizer
3617 (package
3618 (name "meshoptimizer")
3619 (version "0.25")
3620 (source
3621 (origin
3622 (method git-fetch)
3623 (uri (git-reference
3624 (url "https://github.com/zeux/meshoptimizer")
3625 (commit (string-append "v" version))))
3626 (file-name (git-file-name name version))
3627 (sha256
3628 (base32 "1j1iwys6p5ymj287q0l0rix2bs18b4mi7dwpj97dw06yp5gnmkb9"))))
3629 (build-system cmake-build-system)
3630 (arguments
3631 `(#:tests? #f)) ; no tests
3632 (synopsis "Mesh optimization library for faster rendering")
3633 (description
3634 "When a GPU renders triangle meshes, various stages of the GPU pipeline
3635have to process vertex and index data. The efficiency of these stages depends
3636on the data you feed them; this library provides algorithms to help optimize
3637meshes for these stages, as well as algorithms to reduce the mesh complexity
3638and storage overhead.")
3639 (home-page "https://github.com/zeux/meshoptimizer")
3640 (license license:expat)))
3641
3642(define-public vhacd
3643 (package
3644 (name "vhacd")
3645 (version "4.1.0")
3646 (source
3647 (origin
3648 (method git-fetch)
3649 (uri (git-reference
3650 (url "https://github.com/kmammou/v-hacd")
3651 (commit (string-append "v" version))))
3652 (file-name (git-file-name name version))
3653 (sha256
3654 (base32 "1v462m6yyhrfpaa5bph1rma6c0yhnkadmggs5l3jxi746z2238qs"))))
3655 (build-system copy-build-system)
3656 (arguments
3657 (list
3658 #:install-plan
3659 #~`(("include/VHACD.h" "include/"))))
3660 (synopsis "Approximate convex decomposition")
3661 (description
3662 "This is a headers-only library that allows approximate convex decomposition
3663of a 3D surface.")
3664 (home-page "https://github.com/kmammou/v-hacd")
3665 (license license:bsd-3)))