projects/guix·blob javascript-team · refs

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