gnu: Add egl-wayland.
[jackhill/guix/guix.git] / gnu / packages / graphics.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Tomáš Čech <sleep_walker@gnu.org>
4 ;;; Copyright © 2016, 2019 Leo Famulari <leo@famulari.name>
5 ;;; Copyright © 2016, 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
6 ;;; Copyright © 2016, 2018 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
8 ;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
9 ;;; Copyright © 2017, 2018 Ben Woodcroft <donttrustben@gmail.com>
10 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
12 ;;; Copyright © 2018 Alex Kost <alezost@gmail.com>
13 ;;; Copyright © 2018 Kei Kebreau <kkebreau@posteo.net>
14 ;;; Copyright © 2019, 2020 Mark H Weaver <mhw@netris.org>
15 ;;; Copyright © 2019 Carlo Zancanaro <carlo@zancanaro.id.au>
16 ;;; Copyright © 2019 Steve Sprang <scs@stevesprang.com>
17 ;;; Copyright © 2019 John Soo <jsoo1@asu.edu>
18 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
19 ;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
20 ;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
21 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
22 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
23 ;;; Copyright © 2020 Raghav Gururajan <raghavgururajan@disroot.org>
24 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
25 ;;;
26 ;;; This file is part of GNU Guix.
27 ;;;
28 ;;; GNU Guix is free software; you can redistribute it and/or modify it
29 ;;; under the terms of the GNU General Public License as published by
30 ;;; the Free Software Foundation; either version 3 of the License, or (at
31 ;;; your option) any later version.
32 ;;;
33 ;;; GNU Guix is distributed in the hope that it will be useful, but
34 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
35 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 ;;; GNU General Public License for more details.
37 ;;;
38 ;;; You should have received a copy of the GNU General Public License
39 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
40
41 (define-module (gnu packages graphics)
42 #:use-module (gnu packages)
43 #:use-module (gnu packages algebra)
44 #:use-module (gnu packages audio)
45 #:use-module (gnu packages autotools)
46 #:use-module (gnu packages base)
47 #:use-module (gnu packages bash)
48 #:use-module (gnu packages bison)
49 #:use-module (gnu packages boost)
50 #:use-module (gnu packages cdrom)
51 #:use-module (gnu packages check)
52 #:use-module (gnu packages compression)
53 #:use-module (gnu packages crypto)
54 #:use-module (gnu packages datastructures)
55 #:use-module (gnu packages documentation)
56 #:use-module (gnu packages flex)
57 #:use-module (gnu packages fonts)
58 #:use-module (gnu packages fontutils)
59 #:use-module (gnu packages freedesktop)
60 #:use-module (gnu packages gettext)
61 #:use-module (gnu packages ghostscript)
62 #:use-module (gnu packages gl)
63 #:use-module (gnu packages glib)
64 #:use-module (gnu packages gnome)
65 #:use-module (gnu packages gnunet)
66 #:use-module (gnu packages graphviz)
67 #:use-module (gnu packages gstreamer)
68 #:use-module (gnu packages gtk)
69 #:use-module (gnu packages haskell-xyz)
70 #:use-module (gnu packages image)
71 #:use-module (gnu packages imagemagick)
72 #:use-module (gnu packages jemalloc)
73 #:use-module (gnu packages kde-frameworks)
74 #:use-module (gnu packages linux)
75 #:use-module (gnu packages lua)
76 #:use-module (gnu packages maths)
77 #:use-module (gnu packages mp3)
78 #:use-module (gnu packages multiprecision)
79 #:use-module (gnu packages pdf)
80 #:use-module (gnu packages perl)
81 #:use-module (gnu packages photo)
82 #:use-module (gnu packages pkg-config)
83 #:use-module (gnu packages plotutils)
84 #:use-module (gnu packages pth)
85 #:use-module (gnu packages pulseaudio) ; libsndfile, libsamplerate
86 #:use-module (gnu packages python)
87 #:use-module (gnu packages python-xyz)
88 #:use-module (gnu packages qt)
89 #:use-module (gnu packages readline)
90 #:use-module (gnu packages sdl)
91 #:use-module (gnu packages swig)
92 #:use-module (gnu packages tbb)
93 #:use-module (gnu packages upnp)
94 #:use-module (gnu packages video)
95 #:use-module (gnu packages xiph)
96 #:use-module (gnu packages xml)
97 #:use-module (gnu packages xorg)
98 #:use-module (gnu packages xdisorg)
99 #:use-module (guix build-system copy)
100 #:use-module (guix build-system cmake)
101 #:use-module (guix build-system gnu)
102 #:use-module (guix build-system meson)
103 #:use-module (guix build-system python)
104 #:use-module (guix build-system qt)
105 #:use-module (guix download)
106 #:use-module (guix git-download)
107 #:use-module (guix hg-download)
108 #:use-module ((guix licenses) #:prefix license:)
109 #:use-module (guix packages)
110 #:use-module (guix utils))
111
112 (define-public eglexternalplatform
113 (package
114 (name "eglexternalplatform")
115 (version "1.1")
116 (source
117 (origin
118 (method git-fetch)
119 (uri
120 (git-reference
121 (url "https://github.com/NVIDIA/eglexternalplatform.git")
122 (commit version)))
123 (file-name
124 (git-file-name name version))
125 (sha256
126 (base32 "0lr5s2xa1zn220ghmbsiwgmx77l156wk54c7hybia0xpr9yr2nhb"))))
127 (build-system copy-build-system)
128 (arguments
129 `(#:phases
130 (modify-phases %standard-phases
131 (add-after 'unpack 'patch-pkgconfig
132 (lambda* (#:key outputs #:allow-other-keys)
133 (substitute* "eglexternalplatform.pc"
134 (("/usr")
135 (assoc-ref outputs "out")))
136 #t))
137 (add-after 'install 'revise
138 (lambda* (#:key outputs #:allow-other-keys)
139 (let* ((out (assoc-ref outputs "out")))
140 (mkdir-p (string-append out "/include/EGL"))
141 (rename-file
142 (string-append out "/interface")
143 (string-append out "/include/EGL"))
144 (mkdir-p (string-append out "/share/pkgconfig"))
145 (rename-file
146 (string-append out "/eglexternalplatform.pc")
147 (string-append out "/share/pkgconfig/eglexternalplatform.pc"))
148 (for-each delete-file-recursively
149 (list
150 (string-append out "/samples")
151 (string-append out "/COPYING")
152 (string-append out "/README.md"))))
153 #t)))))
154 (synopsis "EGL External Platform interface")
155 (description "EGLExternalPlatform is an specification of the EGL External
156 Platform interface for writing EGL platforms and their interactions with modern
157 window systems on top of existing low-level EGL platform implementations. This
158 keeps window system implementation specifics out of EGL drivers by using
159 application-facing EGL functions.")
160 (home-page "https://github.com/NVIDIA/eglexternalplatform")
161 (license license:expat)))
162
163 (define-public egl-wayland
164 (package
165 (name "egl-wayland")
166 (version "1.1.5")
167 (source
168 (origin
169 (method git-fetch)
170 (uri
171 (git-reference
172 (url "https://github.com/NVIDIA/egl-wayland.git")
173 (commit version)))
174 (file-name
175 (git-file-name name version))
176 (sha256
177 (base32 "09r6a69z75j3hb9751g3ap4gm1xn71aw3j7z0c7jns292cnaa76n"))))
178 (build-system meson-build-system)
179 (native-inputs
180 `(("pkg-config" ,pkg-config)))
181 (inputs
182 `(("mesa" ,mesa)
183 ("wayland" ,wayland)))
184 (propagated-inputs
185 `(("eglexternalplatform" ,eglexternalplatform)))
186 (synopsis "EGLStream-based Wayland external platform")
187 (description "EGL-Wayland is an implementation of a EGL External Platform
188 library to add client-side Wayland support to EGL on top of EGLDevice and
189 EGLStream families of extensions.")
190 (home-page "https://github.com/NVIDIA/egl-wayland")
191 (license license:expat)))
192
193 (define-public mmm
194 (package
195 (name "mmm")
196 (version "0.1.1")
197 (source
198 (origin
199 (method git-fetch)
200 (uri
201 (git-reference
202 (url "https://github.com/hodefoting/mmm.git")
203 (commit version)))
204 (file-name
205 (git-file-name name version))
206 (sha256
207 (base32 "1xmcv6rwinqsbr863rgl9005h2jlmd7k2qrwsc1h4fb8r61ykpjl"))))
208 (build-system meson-build-system)
209 (native-inputs
210 `(("luajit" ,luajit)
211 ("pkg-config" ,pkg-config)))
212 (inputs
213 `(("alsa" ,alsa-lib)
214 ("sdl" ,sdl)
215 ("sdl2" ,sdl2)))
216 (synopsis "Memory Mapped Machine")
217 (description "MMM is a shared memory protocol for virtualising access to
218 framebuffer graphics, audio output and input event.")
219 (home-page "https://github.com/hodefoting/mrg")
220 (license license:isc)))
221
222 (define-public directfb
223 (package
224 (name "directfb")
225 (version "1.7.7")
226 (source
227 (origin
228 (method git-fetch)
229 (uri
230 (git-reference
231 (url "https://github.com/deniskropp/DirectFB.git")
232 (commit "DIRECTFB_1_7_7")))
233 (file-name (git-file-name name version))
234 (sha256
235 (base32 "0bs3yzb7hy3mgydrj8ycg7pllrd2b6j0gxj596inyr7ihssr3i0y"))))
236 (build-system gnu-build-system)
237 (arguments
238 `(#:phases
239 (modify-phases %standard-phases
240 (add-after 'unpack 'disable-configure-during-bootstrap
241 (lambda _
242 (substitute* "autogen.sh"
243 (("^.*\\$srcdir/configure.*") ""))
244 #t)))))
245 (native-inputs
246 `(("autoconf" ,autoconf)
247 ("automake" ,automake)
248 ("libtool" ,libtool)
249 ("perl" ,perl)
250 ("pkg-config" ,pkg-config)))
251 (inputs
252 `(("alsa" ,alsa-lib)
253 ("ffmpeg" ,ffmpeg)
254 ("freetype" ,freetype)
255 ("glu" ,glu)
256 ("gstreamer" ,gstreamer)
257 ("imlib2" ,imlib2)
258 ("jasper" ,jasper)
259 ("jpeg" ,libjpeg-turbo)
260 ("libcddb" ,libcddb)
261 ("libdrm" ,libdrm)
262 ("libtimidity" ,libtimidity)
263 ("linux-headers" ,linux-libre-headers)
264 ("mad" ,libmad)
265 ("mng" ,libmng)
266 ("mpeg2" ,libmpeg2)
267 ("mpeg3" ,libmpeg3)
268 ("opengl" ,mesa)
269 ("png" ,libpng)
270 ("sdl" ,sdl)
271 ("svg" ,librsvg)
272 ("tiff" ,libtiff)
273 ("tslib" ,tslib)
274 ("vdpau" ,libvdpau)
275 ("vorbisfile" ,libvorbis)
276 ("wayland" ,wayland)
277 ("webp" ,libwebp)
278 ("x11" ,libx11)
279 ("xcomposite" ,libxcomposite)
280 ("xext" ,libxext)
281 ("xproto" ,xorgproto)
282 ("zlib" ,zlib)))
283 (propagated-inputs
284 `(("flux" ,flux)))
285 (synopsis "DFB Graphics Library")
286 (description "DirectFB is a graphics library which was designed with embedded
287 systems in mind. It offers maximum hardware accelerated performance at a
288 minimum of resource usage and overhead.")
289 (home-page "http://www.directfb.org/")
290 (license license:lgpl2.1+)))
291
292 (define-public flux
293 (package
294 (name "flux")
295 (version "1.4.4")
296 (source
297 (origin
298 (method git-fetch)
299 (uri
300 (git-reference
301 (url "https://github.com/deniskropp/flux.git")
302 (commit "e45758a")))
303 (file-name (git-file-name name version))
304 (sha256
305 (base32 "11f3ypg0sdq5kj69zgz6kih1yrzgm48r16spyvzwvlswng147410"))))
306 (build-system gnu-build-system)
307 (native-inputs
308 `(("autoconf" ,autoconf)
309 ("automake" ,automake)
310 ("libtool" ,libtool)
311 ("pkg-config" ,pkg-config)))
312 (synopsis "Interface description language")
313 (description "Flux is an interface description language used by DirectFB.
314 Fluxcomp compiles .flux files to .cpp or .c files.")
315 (home-page "http://www.directfb.org/")
316 (license license:lgpl2.1+))) ; Same as DirectFB
317
318 (define-public fox
319 (package
320 (name "fox")
321 (version "1.6.57")
322 (source
323 (origin
324 (method url-fetch)
325 (uri
326 (string-append "https://fox-toolkit.org/ftp/fox-" version ".tar.gz"))
327 (sha256
328 (base32 "08w98m6wjadraw1pi13igzagly4b2nfa57kdqdnkjfhgkvg1bvv5"))))
329 (build-system gnu-build-system)
330 (arguments
331 `(#:phases
332 (modify-phases %standard-phases
333 (add-after 'unpack 'patch
334 (lambda _
335 (substitute* "configure"
336 (("-I/usr/include/freetype2")
337 (string-append "-I"
338 (string-append
339 (assoc-ref %build-inputs "freetype")
340 "/include/freetype2"))))
341 #t)))))
342 (native-inputs
343 `(("doxygen" ,doxygen)))
344 (inputs
345 `(("bzip2" ,lbzip2)
346 ("freetype" ,freetype)
347 ("gl" ,mesa)
348 ("glu" ,glu)
349 ("jpeg" ,libjpeg-turbo)
350 ("png" ,libpng)
351 ("tiff" ,libtiff)
352 ("x11" ,libx11)
353 ("xcursor" ,libxcursor)
354 ("xext" ,libxext)
355 ("xfixes" ,libxfixes)
356 ("xft" ,libxft)
357 ("xinput" ,libxi)
358 ("xrandr" ,libxrandr)
359 ("xrender" ,libxrender)
360 ("xshm" ,libxshmfence)
361 ("zlib" ,zlib)))
362 (synopsis "Widget Toolkit for building GUI")
363 (description"FOX (Free Objects for X) is a C++ based Toolkit for developing
364 Graphical User Interfaces easily and effectively. It offers a wide, and
365 growing, collection of Controls, and provides state of the art facilities such
366 as drag and drop, selection, as well as OpenGL widgets for 3D graphical
367 manipulation. FOX also implements icons, images, and user-convenience features
368 such as status line help, and tooltips. Tooltips may even be used for 3D
369 objects!")
370 (home-page "http://www.fox-toolkit.org")
371 (license license:lgpl2.1+)))
372
373 (define-public autotrace
374 (let ((commit "travis-20190624.59")
375 (version-base "0.40.0"))
376 (package
377 (name "autotrace")
378 (version (string-append version-base "-"
379 (if (string-prefix? "travis-" commit)
380 (string-drop commit 7)
381 commit)))
382 (source (origin
383 (method git-fetch)
384 (uri (git-reference
385 (url "https://github.com/autotrace/autotrace")
386 (commit commit)))
387 (file-name (git-file-name name version))
388 (sha256
389 (base32
390 "0mk4yavy42dj0pszr1ggnggpvmzs4ds46caa9wr55cqsypn7bq6s"))))
391 (build-system gnu-build-system)
392 (arguments
393 `(#:phases (modify-phases %standard-phases
394 ;; See: https://github.com/autotrace/autotrace/issues/27.
395 (add-after 'unpack 'include-spline.h-header
396 (lambda _
397 (substitute* "Makefile.am"
398 ((".*src/types.h.*" all)
399 (string-append all "\t\tsrc/spline.h \\\n")))
400 #t))
401 ;; See: https://github.com/autotrace/autotrace/issues/26.
402 (replace 'check
403 (lambda _
404 (invoke "sh" "tests/runtests.sh"))))))
405 (native-inputs
406 `(("which" ,which)
407 ("pkg-config" ,pkg-config)
408 ("autoconf" ,autoconf)
409 ("automake" ,automake)
410 ("intltool" ,intltool)
411 ("libtool" ,libtool)
412 ("gettext" ,gettext-minimal)))
413 (inputs
414 `(("glib" ,glib)
415 ("libjpeg" ,libjpeg-turbo)
416 ("libpng" ,libpng)
417 ("imagemagick" ,imagemagick)
418 ("pstoedit" ,pstoedit)))
419 (home-page "https://github.com/autotrace/autotrace")
420 (synopsis "Bitmap to vector graphics converter")
421 (description "AutoTrace is a utility for converting bitmap into vector
422 graphics. It can trace outlines and midlines, effect color reduction or
423 despeckling and has support for many input and output formats. It can be used
424 with the @command{autotrace} utility or as a C library, @code{libautotrace}.")
425 (license (list license:gpl2+ ;for the utility itself
426 license:lgpl2.1+))))) ;for use as a library
427
428 (define-public blender
429 (package
430 (name "blender")
431 (version "2.83.4")
432 (source (origin
433 (method url-fetch)
434 (uri (string-append "https://download.blender.org/source/"
435 "blender-" version ".tar.xz"))
436 (sha256
437 (base32
438 "1y4phkzrxy17kpjbg0jbz1236nw8w8p006x1crbqmvwz8wd3dm46"))))
439 (build-system cmake-build-system)
440 (arguments
441 (let ((python-version (version-major+minor (package-version python))))
442 `(;; Test files are very large and not included in the release tarball.
443 #:tests? #f
444 #:configure-flags
445 (list "-DWITH_CODEC_FFMPEG=ON"
446 "-DWITH_CODEC_SNDFILE=ON"
447 "-DWITH_CYCLES=ON"
448 "-DWITH_DOC_MANPAGE=ON"
449 "-DWITH_FFTW3=ON"
450 "-DWITH_IMAGE_OPENJPEG=ON"
451 "-DWITH_INPUT_NDOF=ON"
452 "-DWITH_INSTALL_PORTABLE=OFF"
453 "-DWITH_JACK=ON"
454 "-DWITH_MOD_OCEANSIM=ON"
455 "-DWITH_OPENSUBDIV=ON"
456 "-DWITH_PYTHON_INSTALL=OFF"
457 (string-append "-DPYTHON_LIBRARY=python" ,python-version)
458 (string-append "-DPYTHON_LIBPATH=" (assoc-ref %build-inputs "python")
459 "/lib")
460 (string-append "-DPYTHON_INCLUDE_DIR=" (assoc-ref %build-inputs "python")
461 "/include/python" ,python-version)
462 (string-append "-DPYTHON_VERSION=" ,python-version)
463 (string-append "-DPYTHON_NUMPY_PATH="
464 (assoc-ref %build-inputs "python-numpy")
465 "/lib/python" ,python-version "/site-packages/"))
466 #:phases
467 (modify-phases %standard-phases
468 ;; XXX This file doesn't exist in the Git sources but will probably
469 ;; exist in the eventual 2.80 source tarball.
470 (add-after 'unpack 'fix-broken-import
471 (lambda _
472 (substitute* "release/scripts/addons/io_scene_fbx/json2fbx.py"
473 (("import encode_bin") "from . import encode_bin"))
474 #t))
475 (add-after 'set-paths 'add-ilmbase-include-path
476 (lambda* (#:key inputs #:allow-other-keys)
477 ;; OpenEXR propagates ilmbase, but its include files do not appear
478 ;; in the CPATH, so we need to add "$ilmbase/include/OpenEXR/" to
479 ;; the CPATH to satisfy the dependency on "half.h".
480 (setenv "CPATH"
481 (string-append (assoc-ref inputs "ilmbase")
482 "/include/OpenEXR"
483 ":" (or (getenv "CPATH") "")))
484 #t))))))
485 (inputs
486 `(("boost" ,boost)
487 ("jemalloc" ,jemalloc)
488 ("libx11" ,libx11)
489 ("libxi" ,libxi)
490 ("libxrender" ,libxrender)
491 ("openimageio" ,openimageio)
492 ("openexr" ,openexr)
493 ("opensubdiv" ,opensubdiv)
494 ("ilmbase" ,ilmbase)
495 ("openjpeg" ,openjpeg)
496 ("libjpeg" ,libjpeg-turbo)
497 ("libpng" ,libpng)
498 ("libtiff" ,libtiff)
499 ("ffmpeg" ,ffmpeg)
500 ("fftw" ,fftw)
501 ("jack" ,jack-1)
502 ("libsndfile" ,libsndfile)
503 ("freetype" ,freetype)
504 ("glew" ,glew)
505 ("openal" ,openal)
506 ("python" ,python)
507 ("python-numpy" ,python-numpy)
508 ("tbb" ,tbb)
509 ("zlib" ,zlib)))
510 (home-page "https://blender.org/")
511 (synopsis "3D graphics creation suite")
512 (description
513 "Blender is a 3D graphics creation suite. It supports the entirety of
514 the 3D pipeline—modeling, rigging, animation, simulation, rendering,
515 compositing and motion tracking, even video editing and game creation. The
516 application can be customized via its API for Python scripting.")
517 (license license:gpl2+)))
518
519 (define-public blender-2.79
520 (package
521 (name "blender")
522 (version "2.79b")
523 (source (origin
524 (method url-fetch)
525 (uri (string-append "https://download.blender.org/source/"
526 "blender-" version ".tar.gz"))
527 (sha256
528 (base32
529 "1g4kcdqmf67srzhi3hkdnr4z1ph4h9sza1pahz38mrj998q4r52c"))
530 (patches (search-patches "blender-2.79-newer-ffmpeg.patch"
531 "blender-2.79-oiio2.patch"
532 ;; The following patches may be
533 ;; needed when the default GCC is
534 ;; updated:
535 ;; "blender-2.79-gcc8.patch"
536 ;; "blender-2.79-gcc9.patch"
537 "blender-2.79-python-3.7-fix.patch"
538 "blender-2.79-python-3.8-fix.patch"))))
539 (build-system cmake-build-system)
540 (arguments
541 (let ((python-version (version-major+minor (package-version python))))
542 `(;; Test files are very large and not included in the release tarball.
543 #:tests? #f
544 #:configure-flags
545 (list "-DWITH_CODEC_FFMPEG=ON"
546 "-DWITH_CODEC_SNDFILE=ON"
547 "-DWITH_CYCLES=ON"
548 "-DWITH_DOC_MANPAGE=ON"
549 "-DWITH_FFTW3=ON"
550 "-DWITH_GAMEENGINE=ON"
551 "-DWITH_IMAGE_OPENJPEG=ON"
552 "-DWITH_INPUT_NDOF=ON"
553 "-DWITH_INSTALL_PORTABLE=OFF"
554 "-DWITH_JACK=ON"
555 "-DWITH_MOD_OCEANSIM=ON"
556 "-DWITH_PLAYER=ON"
557 "-DWITH_PYTHON_INSTALL=OFF"
558 "-DWITH_PYTHON_INSTALL=OFF"
559 "-DWITH_SYSTEM_OPENJPEG=ON"
560 (string-append "-DPYTHON_LIBRARY=python" ,python-version)
561 (string-append "-DPYTHON_LIBPATH=" (assoc-ref %build-inputs "python")
562 "/lib")
563 (string-append "-DPYTHON_INCLUDE_DIR=" (assoc-ref %build-inputs "python")
564 "/include/python" ,python-version)
565 (string-append "-DPYTHON_VERSION=" ,python-version))
566 #:phases
567 (modify-phases %standard-phases
568 (add-after 'unpack 'fix-broken-import
569 (lambda _
570 (substitute* "release/scripts/addons/io_scene_fbx/json2fbx.py"
571 (("import encode_bin") "from . import encode_bin"))
572 #t))
573 (add-after 'set-paths 'add-ilmbase-include-path
574 (lambda* (#:key inputs #:allow-other-keys)
575 ;; OpenEXR propagates ilmbase, but its include files do not appear
576 ;; in the CPATH, so we need to add "$ilmbase/include/OpenEXR/" to
577 ;; the CPATH to satisfy the dependency on "half.h".
578 (setenv "CPATH"
579 (string-append (assoc-ref inputs "ilmbase")
580 "/include/OpenEXR"
581 ":" (or (getenv "CPATH") "")))
582 #t))))))
583 (inputs
584 `(("boost" ,boost)
585 ("jemalloc" ,jemalloc)
586 ("libx11" ,libx11)
587 ("openimageio" ,openimageio)
588 ("openexr" ,openexr)
589 ("ilmbase" ,ilmbase)
590 ("openjpeg" ,openjpeg)
591 ("libjpeg" ,libjpeg-turbo)
592 ("libpng" ,libpng)
593 ("libtiff" ,libtiff)
594 ("ffmpeg" ,ffmpeg)
595 ("fftw" ,fftw)
596 ("jack" ,jack-1)
597 ("libsndfile" ,libsndfile)
598 ("freetype" ,freetype)
599 ("glew" ,glew)
600 ("openal" ,openal)
601 ("python" ,python)
602 ("zlib" ,zlib)))
603 (home-page "https://blender.org/")
604 (synopsis "3D graphics creation suite")
605 (description
606 "Blender is a 3D graphics creation suite. It supports the entirety of
607 the 3D pipeline—modeling, rigging, animation, simulation, rendering,
608 compositing and motion tracking, even video editing and game creation. The
609 application can be customized via its API for Python scripting.
610
611 NOTE: This older version of Blender is the last release that does not require
612 OpenGL 3. It is retained for use with older computers.")
613 (license license:gpl2+)))
614
615 (define-public assimp
616 (package
617 (name "assimp")
618 (version "4.1.0")
619 (source (origin
620 (method git-fetch)
621 (uri (git-reference
622 (url "https://github.com/assimp/assimp")
623 (commit (string-append "v" version))))
624 (file-name (git-file-name name version))
625 (sha256
626 (base32
627 "1rhyqfhzifdj7yibyanph3rh13ykw3i98dnn8mz65j780472hw28"))))
628 (build-system cmake-build-system)
629 (inputs
630 `(("zlib" ,zlib)))
631 (home-page "http://www.assimp.org/")
632 (synopsis "Asset import library")
633 (description
634 "The Open Asset Import Library loads more than 40 3D file formats into
635 one unified data structure. Additionally, assimp features various mesh post
636 processing tools: normals and tangent space generation, triangulation, vertex
637 cache locality optimization, removal of degenerate primitives and duplicate
638 vertices, sorting by primitive type, merging of redundant materials and many
639 more.")
640 (license license:bsd-3)))
641
642 (define-public cgal
643 (package
644 (name "cgal")
645 (version "4.14.2")
646 (source (origin
647 (method url-fetch)
648 (uri (string-append
649 "https://github.com/CGAL/cgal/releases/download/releases/"
650 "CGAL-" version "/CGAL-" version ".tar.xz"))
651 (sha256
652 (base32
653 "08lrp3hfwdypggz4138bnkh6bjxn441zg2y9xnq5mrjfc5ini6w1"))))
654 (build-system cmake-build-system)
655 (arguments
656 '(#:tests? #f)) ; no test target
657 (inputs
658 `(("mpfr" ,mpfr)
659 ("gmp" ,gmp)
660 ("boost" ,boost)))
661 (home-page "https://www.cgal.org/")
662 (synopsis "Computational geometry algorithms library")
663 (description
664 "CGAL provides easy access to efficient and reliable geometric algorithms
665 in the form of a C++ library. CGAL is used in various areas needing geometric
666 computation, such as: computer graphics, scientific visualization, computer
667 aided design and modeling, geographic information systems, molecular biology,
668 medical imaging, robotics and motion planning, mesh generation, numerical
669 methods, etc. It provides data structures and algorithms such as
670 triangulations, Voronoi diagrams, polygons, polyhedra, mesh generation, and
671 many more.")
672
673 ;; The 'LICENSE' file explains that a subset is available under more
674 ;; permissive licenses.
675 (license license:gpl3+)))
676
677 (define-public ilmbase
678 (package
679 (name "ilmbase")
680 (version "2.5.2")
681 (source (origin
682 (method git-fetch)
683 (uri (git-reference
684 (url "https://github.com/openexr/openexr")
685 (commit (string-append "v" version))))
686 (file-name (git-file-name "ilmbase" version))
687 (sha256
688 (base32
689 "1vf8bqld2bpcdi99jbr043y6vp01cp3fvbiasrn66xn91mf6imbn"))
690 (patches (search-patches "ilmbase-fix-tests.patch"))))
691 (build-system cmake-build-system)
692 (arguments
693 `(#:phases (modify-phases %standard-phases
694 (add-after 'unpack 'change-directory
695 (lambda _
696 (chdir "IlmBase")
697 #t)))))
698 (home-page "https://www.openexr.com/")
699 (synopsis "Utility C++ libraries for threads, maths, and exceptions")
700 (description
701 "IlmBase provides several utility libraries for C++. Half is a class
702 that encapsulates ILM's 16-bit floating-point format. IlmThread is a thread
703 abstraction. Imath implements 2D and 3D vectors, 3x3 and 4x4 matrices,
704 quaternions and other useful 2D and 3D math functions. Iex is an
705 exception-handling library.")
706 (license license:bsd-3)))
707
708 (define-public lib2geom
709 ;; Use the latest master commit, as the 1.0 release suffer build problems.
710 (let ((revision "3")
711 (commit "17e0d21f0afc8489656f9184bff7ad024a42394a"))
712 (package
713 (name "lib2geom")
714 (version (git-version "1.0" revision commit))
715 (source (origin
716 (method git-fetch)
717 (uri (git-reference
718 (url "https://gitlab.com/inkscape/lib2geom.git")
719 (commit commit)))
720 (file-name (git-file-name name version))
721 (sha256
722 (base32
723 "0waskrmdrrdjw8pr5cvlkrxywgf376viggpc2jzdqxxpy2k78fpr"))
724 (patches
725 ;; Patch submitted to upstream (see:
726 ;; https://gitlab.com/inkscape/lib2geom/-/merge_requests/32).
727 (search-patches "lib2geom-fix-tests.patch"))
728 (modules '((guix build utils)))
729 (snippet
730 '(begin
731 ;; Fix py2geom module initialization (see:
732 ;; https://gitlab.com/inkscape/lib2geom/merge_requests/18).
733 (substitute* "src/py2geom/__init__.py"
734 (("_py2geom") "py2geom._py2geom"))
735 #t))))
736 (build-system cmake-build-system)
737 (arguments
738 `(#:imported-modules ((guix build python-build-system)
739 ,@%cmake-build-system-modules)
740 #:configure-flags '("-D2GEOM_BUILD_SHARED=ON"
741 "-D2GEOM_BOOST_PYTHON=ON"
742 ;; Compiling the Cython bindings fail (see:
743 ;; https://gitlab.com/inkscape/lib2geom/issues/21).
744 "-D2GEOM_CYTHON_BINDINGS=OFF")
745 #:phases
746 (modify-phases %standard-phases
747 (add-after 'unpack 'patch-python-lib-install-path
748 (lambda* (#:key inputs outputs #:allow-other-keys)
749 (let* ((python-version (@ (guix build python-build-system)
750 python-version))
751 (python-maj-min-version (python-version
752 (assoc-ref inputs "python")))
753 (site-package (string-append
754 (assoc-ref outputs "out")
755 "/lib/python" python-maj-min-version
756 "/site-packages")))
757 (substitute* '("src/cython/CMakeLists.txt"
758 "src/py2geom/CMakeLists.txt")
759 (("PYTHON_LIB_INSTALL \"[^\"]*\"")
760 (format #f "PYTHON_LIB_INSTALL ~s" site-package))))
761 #t)))))
762 (native-inputs `(("python" ,python-wrapper)
763 ("googletest" ,googletest)
764 ("pkg-config" ,pkg-config)))
765 (inputs `(("cairo" ,cairo)
766 ("pycairo" ,python-pycairo)
767 ("double-conversion" ,double-conversion)
768 ("glib" ,glib)
769 ("gsl" ,gsl)))
770 (propagated-inputs
771 `(("boost" ,boost))) ;referred to in 2geom/pathvector.h.
772 (home-page "https://gitlab.com/inkscape/lib2geom/")
773 (synopsis "C++ 2D graphics library")
774 (description "2geom is a C++ library of mathematics for paths, curves,
775 and other geometric calculations. Designed for vector graphics, it tackles
776 Bézier curves, conic sections, paths, intersections, transformations, and
777 basic geometries.")
778 ;; Because the library is linked with the GNU Scientific Library
779 ;; (GPLv3+), the combined work must be licensed as GPLv3+ (see:
780 ;; https://gitlab.com/inkscape/inkscape/issues/784).
781 (license license:gpl3+))))
782
783 (define-public pstoedit
784 (package
785 (name "pstoedit")
786 (version "3.75")
787 (source (origin
788 (method url-fetch)
789 (uri (string-append "mirror://sourceforge/pstoedit/pstoedit/"
790 version "/pstoedit-" version ".tar.gz"))
791 (sha256
792 (base32
793 "1kv46g2wsvsvcngkavxl5gnw3l6g5xqnh4kmyx4b39a01d8xiddp"))))
794 (build-system gnu-build-system)
795 (native-inputs
796 `(("pkg-config" ,pkg-config)))
797 (inputs
798 `(("ghostscript" ,ghostscript)
799 ("imagemagick" ,imagemagick)
800 ("libplot" ,plotutils)
801 ("libjpeg" ,libjpeg-turbo)
802 ("zlib" ,zlib))) ;else libp2edrvmagick++.so fails to link
803 (home-page "http://www.pstoedit.net/")
804 (synopsis "Converter for PostScript and PDF graphics")
805 (description "The @code{pstoedit} utility allows translating graphics
806 in the PostScript or PDF (Portable Document Format) formats to various
807 other vector formats such as:
808 @itemize
809 @item Tgif (.obj)
810 @item gnuplot
811 @item xfig (.fig)
812 @item Flattened PostScript
813 @item DXF, a CAD (Computed-Aided Design) exchange format
814 @item PIC (for troff/groff)
815 @item MetaPost (for usage with TeX/LaTeX)
816 @item LaTeX2e picture
817 @item GNU Metafile (for use with plotutils/libplot)
818 @item Any format supported by ImageMagick
819 @end itemize")
820 (license license:gpl2+)))
821
822 (define-public ogre
823 (package
824 (name "ogre")
825 (version "1.12.5")
826 (source
827 (origin
828 (method git-fetch)
829 (uri (git-reference
830 (url "https://github.com/OGRECave/ogre")
831 (commit (string-append "v" version))
832 (recursive? #t))) ;for Dear ImGui submodule
833 (file-name (git-file-name name version))
834 (sha256
835 (base32 "1sx0jsw4kmb4ycf62bgx3ygwv8k1cgjx52y47d7dk07z6gk6wpyj"))))
836 (build-system cmake-build-system)
837 (arguments
838 '(#:phases
839 (modify-phases %standard-phases
840 (add-before 'configure 'pre-configure
841 ;; CMakeLists.txt forces CMAKE_INSTALL_RPATH value. As
842 ;; a consequence, we cannot suggest ours in configure flags. Fix
843 ;; it.
844 (lambda* (#:key inputs outputs #:allow-other-keys)
845 (substitute* "CMakeLists.txt"
846 (("set\\(CMAKE_INSTALL_RPATH .*") ""))
847 #t)))
848 #:configure-flags
849 (let* ((out (assoc-ref %outputs "out"))
850 (runpath
851 (string-join (list (string-append out "/lib")
852 (string-append out "/lib/OGRE"))
853 ";")))
854 (list (string-append "-DCMAKE_INSTALL_RPATH=" runpath)
855 "-DOGRE_BUILD_DEPENDENCIES=OFF"
856 "-DOGRE_BUILD_TESTS=TRUE"
857 "-DOGRE_INSTALL_DOCS=TRUE"
858 "-DOGRE_INSTALL_SAMPLES=TRUE"
859 "-DOGRE_INSTALL_SAMPLES_SOURCE=TRUE"))))
860 (native-inputs
861 `(("boost" ,boost)
862 ("doxygen" ,doxygen)
863 ("googletest" ,googletest-1.8)
864 ("pkg-config" ,pkg-config)))
865 (inputs
866 `(("font-dejavu" ,font-dejavu)
867 ("freeimage" ,freeimage)
868 ("freetype" ,freetype)
869 ("glu" ,glu)
870 ("libxaw" ,libxaw)
871 ("libxrandr" ,libxrandr)
872 ("pugixml" ,pugixml)
873 ("sdl2" ,sdl2)
874 ("tinyxml" ,tinyxml)
875 ("zziplib" ,zziplib)))
876 (synopsis "Scene-oriented, flexible 3D engine written in C++")
877 (description
878 "OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented,
879 flexible 3D engine written in C++ designed to make it easier and more intuitive
880 for developers to produce applications utilising hardware-accelerated 3D
881 graphics.")
882 (home-page "https://www.ogre3d.org/")
883 (license license:expat)))
884
885 (define-public openexr
886 (package
887 (name "openexr")
888 (version (package-version ilmbase))
889 (source (origin
890 (inherit (package-source ilmbase))
891 (file-name (git-file-name "openexr" version))
892 (modules '((guix build utils)))
893 (snippet
894 '(begin
895 (substitute* (find-files "OpenEXR" "tmpDir\\.h")
896 (("\"/var/tmp/\"")
897 "\"/tmp/\""))
898 #t))))
899 (build-system cmake-build-system)
900 (arguments
901 `(#:phases
902 (modify-phases %standard-phases
903 (add-after 'unpack 'change-directory
904 (lambda _
905 (chdir "OpenEXR")
906 #t))
907 (add-after 'change-directory 'increase-test-timeout
908 (lambda _
909 ;; On armhf-linux, we need to override the CTest default
910 ;; timeout of 1500 seconds for the OpenEXR.IlmImf test.
911 (substitute* "IlmImfTest/CMakeLists.txt"
912 (("add_test\\(NAME OpenEXR\\.IlmImf.*" all)
913 (string-append
914 all
915 "set_tests_properties(OpenEXR.IlmImf PROPERTIES TIMEOUT 2000)")))
916 #t))
917 ,@(if (not (target-64bit?))
918 `((add-after 'change-directory 'disable-broken-test
919 ;; This test fails on i686. Upstream developers suggest that
920 ;; this test is broken on i686 and can be safely disabled:
921 ;; https://github.com/openexr/openexr/issues/67#issuecomment-21169748
922 (lambda _
923 (substitute* "IlmImfTest/main.cpp"
924 ((".*testOptimizedInterleavePatterns.*") ""))
925 #t)))
926 '()))))
927 (native-inputs
928 `(("pkg-config" ,pkg-config)))
929 (propagated-inputs
930 `(("ilmbase" ,ilmbase) ;used in public headers
931 ("zlib" ,zlib))) ;OpenEXR.pc reads "-lz"
932 (home-page "https://www.openexr.com/")
933 (synopsis "High-dynamic range file format library")
934 (description
935 "OpenEXR is a high dynamic-range (HDR) image file format developed for
936 use in computer imaging applications. The IlmImf C++ libraries support
937 storage of the \"EXR\" file format for storing 16-bit floating-point images.")
938 (license license:bsd-3)))
939
940 (define-public openimageio
941 (package
942 (name "openimageio")
943 (version "2.0.13")
944 (source (origin
945 (method git-fetch)
946 (uri (git-reference
947 (url "https://github.com/OpenImageIO/oiio")
948 (commit (string-append "Release-" version))))
949 (file-name (git-file-name name version))
950 (sha256
951 (base32
952 "0czcls82v71wkw1syib16ncg7463hx0py0xclycsiv4w6i3wlkzz"))))
953 (build-system cmake-build-system)
954 ;; FIXME: To run all tests successfully, test image sets from multiple
955 ;; third party sources have to be present. For details see
956 ;; https://github.com/OpenImageIO/oiio/blob/master/INSTALL
957 (arguments
958 `(#:tests? #f))
959 (native-inputs
960 `(("pkg-config" ,pkg-config)))
961 (inputs
962 `(("boost" ,boost)
963 ("libpng" ,libpng)
964 ("libjpeg" ,libjpeg-turbo)
965 ("libtiff" ,libtiff)
966 ("giflib" ,giflib)
967 ("openexr" ,openexr)
968 ("ilmbase" ,ilmbase)
969 ("python" ,python-wrapper)
970 ("pybind11" ,pybind11)
971 ("robin-map" ,robin-map)
972 ("zlib" ,zlib)))
973 (synopsis "C++ library for reading and writing images")
974 (description
975 "OpenImageIO is a library for reading and writing images, and a bunch of
976 related classes, utilities, and applications. There is a particular emphasis
977 on formats and functionality used in professional, large-scale animation and
978 visual effects work for film.")
979 (home-page "https://www.openimageio.org")
980 (license license:bsd-3)))
981
982 (define-public openscenegraph
983 (package
984 (name "openscenegraph")
985 (version "3.6.5")
986 (source
987 (origin
988 (method git-fetch)
989 (uri (git-reference
990 (url "https://github.com/openscenegraph/OpenSceneGraph")
991 (commit (string-append "OpenSceneGraph-" version))))
992 (sha256
993 (base32 "00i14h82qg3xzcyd8p02wrarnmby3aiwmz0z43l50byc9f8i05n1"))
994 (file-name (git-file-name name version))))
995 (properties
996 `((upstream-name . "OpenSceneGraph")))
997 (build-system cmake-build-system)
998 (arguments
999 `(#:tests? #f ; no test target available
1000 ;; Without this flag, 'rd' will be added to the name of the
1001 ;; library binaries and break linking with other programs.
1002 #:build-type "Release"
1003 #:configure-flags
1004 (list (string-append "-DCMAKE_INSTALL_RPATH="
1005 (assoc-ref %outputs "out") "/lib:"
1006 (assoc-ref %outputs "out") "/lib64"))))
1007 (native-inputs
1008 `(("pkg-config" ,pkg-config)
1009 ("unzip" ,unzip)))
1010 (inputs
1011 `(("giflib" ,giflib)
1012 ("libjpeg" ,libjpeg-turbo) ; required for the JPEG texture plugin.
1013 ("jasper" ,jasper)
1014 ("librsvg" ,librsvg)
1015 ("libxrandr" ,libxrandr)
1016 ("ffmpeg" ,ffmpeg)
1017 ("mesa" ,mesa)))
1018 (synopsis "High-performance real-time graphics toolkit")
1019 (description
1020 "The OpenSceneGraph is a high-performance 3D graphics toolkit
1021 used by application developers in fields such as visual simulation, games,
1022 virtual reality, scientific visualization and modeling.")
1023 (home-page "http://www.openscenegraph.org")
1024 ;; The 'LICENSE' file explains that the source is licensed under
1025 ;; LGPL 2.1, but with 4 exceptions. This version is called OSGPL.
1026 (license license:lgpl2.1)))
1027
1028 ;; We need this for simgear
1029 (define-public openscenegraph-3.4
1030 (package (inherit openscenegraph)
1031 (name "openscenegraph")
1032 (version "3.4.1")
1033 (source
1034 (origin
1035 (method git-fetch)
1036 (uri (git-reference
1037 (url "https://github.com/openscenegraph/OpenSceneGraph")
1038 (commit (string-append "OpenSceneGraph-" version))))
1039 (file-name (git-file-name name version))
1040 (sha256
1041 (base32
1042 "1fbzg1ihjpxk6smlq80p3h3ggllbr16ihd2fxpfwzam8yr8yxip9"))))
1043 (arguments
1044 (substitute-keyword-arguments (package-arguments openscenegraph)
1045 ((#:configure-flags flags)
1046 `(cons
1047 ;; The jpeg plugin requires conversion between integers and booleans
1048 "-DCMAKE_CXX_FLAGS=-fpermissive"
1049 ,flags))))
1050 (inputs
1051 `(("libjpeg" ,libjpeg-turbo)
1052 ,@(package-inputs openscenegraph)))))
1053
1054
1055 (define-public openmw-openscenegraph
1056 ;; OpenMW prefers its own fork of openscenegraph:
1057 ;; https://wiki.openmw.org/index.php?title=Development_Environment_Setup#OpenSceneGraph.
1058 (let ((commit "36a962845a2c87a6671fd822157e0729d164e940"))
1059 (hidden-package
1060 (package
1061 (inherit openscenegraph)
1062 (version (git-version "3.6" "1" commit))
1063 (source
1064 (origin
1065 (method git-fetch)
1066 (uri (git-reference
1067 (url "https://github.com/OpenMW/osg/")
1068 (commit commit)))
1069 (file-name (git-file-name (package-name openscenegraph) version))
1070 (sha256
1071 (base32
1072 "05yhgq3qm5q277y32n5sf36vx5nv5qd3zlhz4csgd3a6190jrnia"))))
1073 (arguments
1074 (substitute-keyword-arguments (package-arguments openscenegraph)
1075 ((#:configure-flags flags)
1076 ;; As per the above wiki link, the following plugins are enough:
1077 `(append
1078 '("-DBUILD_OSG_PLUGINS_BY_DEFAULT=0"
1079 "-DBUILD_OSG_PLUGIN_OSG=1"
1080 "-DBUILD_OSG_PLUGIN_DDS=1"
1081 "-DBUILD_OSG_PLUGIN_TGA=1"
1082 "-DBUILD_OSG_PLUGIN_BMP=1"
1083 "-DBUILD_OSG_PLUGIN_JPEG=1"
1084 "-DBUILD_OSG_PLUGIN_PNG=1"
1085 "-DBUILD_OSG_DEPRECATED_SERIALIZERS=0"
1086 ;; The jpeg plugin requires conversion between integers and booleans
1087 "-DCMAKE_CXX_FLAGS=-fpermissive")
1088 ,flags))))))))
1089
1090 (define-public povray
1091 (package
1092 (name "povray")
1093 (version "3.7.0.8")
1094 (source (origin
1095 (method git-fetch)
1096 (uri (git-reference
1097 (url "https://github.com/POV-Ray/povray")
1098 (commit (string-append "v" version))))
1099 (file-name (git-file-name name version))
1100 (sha256
1101 (base32
1102 "1q114n4m3r7qy3yn954fq7p46rg7ypdax5fazxr9yj1jklf1lh6z"))
1103 (modules '((guix build utils)))
1104 (snippet
1105 '(begin
1106 ;; Delete bundled libraries.
1107 (delete-file-recursively "libraries")
1108 #t))))
1109 (build-system gnu-build-system)
1110 (native-inputs
1111 `(("autoconf" ,autoconf)
1112 ("automake" ,automake)
1113 ("pkg-config" ,pkg-config)))
1114 (inputs
1115 `(("boost" ,boost)
1116 ("libjpeg" ,libjpeg-turbo)
1117 ("libpng" ,libpng)
1118 ("libtiff" ,libtiff)
1119 ("openexr" ,openexr)
1120 ("sdl" ,sdl)
1121 ("zlib" ,zlib)))
1122 (arguments
1123 '(#:configure-flags
1124 (list "COMPILED_BY=Guix"
1125 (string-append "--with-boost-libdir="
1126 (assoc-ref %build-inputs "boost") "/lib")
1127 "--disable-optimiz-arch")
1128 #:phases
1129 (modify-phases %standard-phases
1130 (add-after 'unpack 'run-prebuild
1131 (lambda _
1132 (setenv "HOME" (getcwd))
1133 (with-directory-excursion "unix"
1134 (substitute* "prebuild.sh"
1135 (("/bin/sh") (which "sh")))
1136 (invoke "sh" "prebuild.sh"))
1137 #t))
1138 ;; The bootstrap script is run by the prebuild script in the
1139 ;; "run-prebuild" phase.
1140 (delete 'bootstrap))))
1141 (synopsis "Tool for creating three-dimensional graphics")
1142 (description
1143 "@code{POV-Ray} is short for the Persistence of Vision Raytracer, a tool
1144 for producing high-quality computer graphics. @code{POV-Ray} creates
1145 three-dimensional, photo-realistic images using a rendering technique called
1146 ray-tracing. It reads in a text file containing information describing the
1147 objects and lighting in a scene and generates an image of that scene from the
1148 view point of a camera also described in the text file. Ray-tracing is not a
1149 fast process by any means, but it produces very high quality images with
1150 realistic reflections, shading, perspective and other effects.")
1151 (home-page "http://www.povray.org/")
1152 (license license:agpl3+)))
1153
1154 (define-public rapicorn
1155 (package
1156 (name "rapicorn")
1157 (version "16.0.0")
1158 (source (origin
1159 (method url-fetch)
1160 (uri (string-append "https://testbit.eu/pub/dists/rapicorn/"
1161 "rapicorn-" version ".tar.xz"))
1162 (sha256
1163 (base32
1164 "1y51yjrpsihas1jy905m9p3r8iiyhq6bwi2690c564i5dnix1f9d"))
1165 (patches (search-patches "rapicorn-isnan.patch"))))
1166 (build-system gnu-build-system)
1167 (arguments
1168 `(#:phases
1169 (modify-phases %standard-phases
1170 (add-after 'unpack 'fix-tests
1171 (lambda _
1172 ;; Our grep does not support perl regular expressions.
1173 (substitute* "taptool.sh"
1174 (("grep -P") "grep -E"))
1175 ;; Disable path tests because we cannot access /bin or /sbin.
1176 (substitute* "rcore/tests/multitest.cc"
1177 (("TCMP \\(Path::equals \\(\"/bin\"") "//"))
1178 #t))
1179 (add-before 'check 'pre-check
1180 (lambda _
1181 ;; The test suite requires a running X server (with DISPLAY
1182 ;; number 99 or higher).
1183 (system "Xvfb :99 &")
1184 (setenv "DISPLAY" ":99")
1185 #t))
1186 (add-after 'unpack 'replace-fhs-paths
1187 (lambda _
1188 (substitute* (cons "Makefile.decl"
1189 (find-files "." "^Makefile\\.in$"))
1190 (("/bin/ls") (which "ls"))
1191 (("/usr/bin/env") (which "env")))
1192 #t)))))
1193 ;; These libraries are listed in the "Required" section of the pkg-config
1194 ;; file.
1195 (propagated-inputs
1196 `(("librsvg" ,librsvg)
1197 ("cairo" ,cairo)
1198 ("pango" ,pango)
1199 ("libxml2" ,libxml2)
1200 ("python2-enum34" ,python2-enum34)))
1201 (inputs
1202 `(("gdk-pixbuf" ,gdk-pixbuf)
1203 ("libpng" ,libpng-1.2)
1204 ("readline" ,readline)
1205 ("libcroco" ,libcroco)
1206 ("python" ,python-2)
1207 ("cython" ,python2-cython)))
1208 (native-inputs
1209 `(("pandoc" ,ghc-pandoc)
1210 ("bison" ,bison)
1211 ("flex" ,flex)
1212 ("doxygen" ,doxygen)
1213 ("graphviz" ,graphviz)
1214 ("intltool" ,intltool)
1215 ("pkg-config" ,pkg-config)
1216 ("xvfb" ,xorg-server-for-tests)))
1217 (home-page "https://rapicorn.testbit.org/")
1218 (synopsis "Toolkit for rapid development of user interfaces")
1219 (description
1220 "Rapicorn is a toolkit for rapid development of user interfaces in C++
1221 and Python. The user interface is designed in a declarative markup language
1222 and is connected to the programming logic using data bindings and commands.")
1223 (license license:mpl2.0)))
1224
1225 (define-public ctl
1226 (package
1227 (name "ctl")
1228 (version "1.5.2")
1229 (source (origin
1230 (method url-fetch)
1231 (uri (string-append "https://github.com/ampas/CTL/archive/ctl-"
1232 version ".tar.gz"))
1233 (sha256
1234 (base32
1235 "1gg04pyvw0m398akn0s1l07g5b1haqv5na1wpi5dii1jjd1w3ynp"))))
1236 (build-system cmake-build-system)
1237 (arguments '(#:tests? #f)) ;no 'test' target
1238
1239 ;; Headers include OpenEXR and IlmBase headers.
1240 (propagated-inputs `(("openexr" ,openexr)))
1241
1242 (home-page "http://ampasctl.sourceforge.net")
1243 (synopsis "Color Transformation Language")
1244 (description
1245 "The Color Transformation Language, or CTL, is a small programming
1246 language that was designed to serve as a building block for digital color
1247 management systems. CTL allows users to describe color transforms in a
1248 concise and unambiguous way by expressing them as programs. In order to apply
1249 a given transform to an image, the color management system instructs a CTL
1250 interpreter to load and run the CTL program that describes the transform. The
1251 original and the transformed image constitute the CTL program's input and
1252 output.")
1253
1254 ;; The web site says it's under a BSD-3 license, but the 'LICENSE' file
1255 ;; and headers use different wording.
1256 (license (license:non-copyleft "file://LICENSE"))))
1257
1258 (define-public brdf-explorer
1259 ;; There are no release tarballs, and not even tags in the repo,
1260 ;; so use the latest revision.
1261 (let ((commit "5b2cd46f38a06e47207fa7229b72d37beb945019")
1262 (revision "1"))
1263 (package
1264 (name "brdf-explorer")
1265 (version (string-append "1.0.0-" revision "." (string-take commit 9)))
1266 (source (origin
1267 (method git-fetch)
1268 (uri (git-reference
1269 (url "https://github.com/wdas/brdf")
1270 (commit commit)))
1271 (sha256
1272 (base32
1273 "06vzbiajzbi2xl8jlff5d45bc9wd68i3jdndfab1f3jgfrd8bsgx"))
1274 (file-name (string-append name "-" version "-checkout"))))
1275 (build-system gnu-build-system)
1276 (arguments
1277 `(#:phases (modify-phases %standard-phases
1278 (replace 'configure
1279 (lambda* (#:key outputs #:allow-other-keys)
1280 (let ((out (assoc-ref outputs "out")))
1281 (invoke "qmake"
1282 (string-append "prefix=" out)))))
1283 (add-after 'install 'wrap-program
1284 (lambda* (#:key outputs #:allow-other-keys)
1285 (let* ((out (assoc-ref outputs "out"))
1286 (bin (string-append out "/bin"))
1287 (data (string-append
1288 out "/share/brdf")))
1289 (with-directory-excursion bin
1290 (rename-file "brdf" ".brdf-real")
1291 (call-with-output-file "brdf"
1292 (lambda (port)
1293 (format port "#!/bin/sh
1294 # Run the thing from its home, otherwise it just bails out.
1295 cd \"~a\"
1296 exec -a \"$0\" ~a/.brdf-real~%"
1297 data bin)))
1298 (chmod "brdf" #o555)))
1299 #t)))))
1300 (native-inputs
1301 `(("qttools" ,qttools))) ;for 'qmake'
1302 (inputs
1303 `(("qtbase" ,qtbase)
1304 ("mesa" ,mesa)
1305 ("glew" ,glew)
1306 ("freeglut" ,freeglut)
1307 ("zlib" ,zlib)))
1308 (home-page "https://www.disneyanimation.com/technology/brdf.html")
1309 (synopsis
1310 "Analyze bidirectional reflectance distribution functions (BRDFs)")
1311 (description
1312 "BRDF Explorer is an application that allows the development and analysis
1313 of bidirectional reflectance distribution functions (BRDFs). It can load and
1314 plot analytic BRDF functions (coded as functions in OpenGL's GLSL shader
1315 language), measured material data from the MERL database, and anisotropic
1316 measured material data from MIT CSAIL. Graphs and visualizations update in
1317 real time as parameters are changed, making it a useful tool for evaluating
1318 and understanding different BRDFs (and other component functions).")
1319 (license license:ms-pl))))
1320
1321 (define-public agg
1322 (package
1323 (name "agg")
1324 (version "2.5")
1325 (source (origin
1326 (method url-fetch)
1327 (uri (list (string-append
1328 "ftp://ftp.fau.de/gentoo/distfiles/agg-"
1329 version ".tar.gz")
1330 (string-append
1331 "ftp://ftp.ula.ve/gentoo/distfiles/agg-"
1332 version ".tar.gz")
1333
1334 ;; Site was discontinued.
1335 (string-append "http://www.antigrain.com/agg-"
1336 version ".tar.gz")))
1337 (sha256
1338 (base32 "07wii4i824vy9qsvjsgqxppgqmfdxq0xa87i5yk53fijriadq7mb"))
1339 (patches (search-patches "agg-am_c_prototype.patch"))))
1340 (build-system gnu-build-system)
1341 (arguments
1342 '(#:configure-flags
1343 (list (string-append "--x-includes=" (assoc-ref %build-inputs "libx11")
1344 "/include")
1345 (string-append "--x-libraries=" (assoc-ref %build-inputs "libx11")
1346 "/lib")
1347 "--disable-examples")
1348 #:phases
1349 (modify-phases %standard-phases
1350 (replace 'bootstrap
1351 (lambda _
1352 ;; let's call configure from configure phase and not now
1353 (substitute* "autogen.sh" (("./configure") "# ./configure"))
1354 (invoke "sh" "autogen.sh"))))))
1355 (native-inputs
1356 `(("pkg-config" ,pkg-config)
1357 ("libtool" ,libtool)
1358 ("autoconf" ,autoconf)
1359 ("automake" ,automake)))
1360 (inputs
1361 `(("libx11" ,libx11)
1362 ("freetype" ,freetype)
1363 ("sdl" ,sdl)))
1364
1365 ;; Antigrain.com was discontinued.
1366 (home-page "http://agg.sourceforge.net/antigrain.com/index.html")
1367 (synopsis "High-quality 2D graphics rendering engine for C++")
1368 (description
1369 "Anti-Grain Geometry is a high quality rendering engine written in C++.
1370 It supports sub-pixel resolutions and anti-aliasing. It is also library for
1371 rendering SVG graphics.")
1372 (license license:gpl2+)))
1373
1374 (define-public python-pastel
1375 (package
1376 (name "python-pastel")
1377 (version "0.2.0")
1378 (source
1379 (origin
1380 (method url-fetch)
1381 (uri (pypi-uri "pastel" version))
1382 (sha256
1383 (base32
1384 "0dnaw44ss10i10z4ksy0xljknvjap7rb7g0b8p6yzm5x4g2my5a6"))))
1385 (build-system python-build-system)
1386 (arguments
1387 `(#:phases (modify-phases %standard-phases
1388 (replace 'check
1389 (lambda _ (invoke "pytest" "pastel" "tests/"))))))
1390 (native-inputs
1391 `(("python-pytest" ,python-pytest)))
1392 (home-page "https://github.com/sdispater/pastel")
1393 (synopsis "Library to colorize strings in your terminal")
1394 (description "Pastel is a simple library to help you colorize strings in
1395 your terminal.")
1396 (license license:expat)))
1397
1398 (define-public python2-pastel
1399 (package-with-python2 python-pastel))
1400
1401 (define-public fgallery
1402 (package
1403 (name "fgallery")
1404 (version "1.8.2")
1405 (source (origin
1406 (method url-fetch)
1407 (uri
1408 (string-append
1409 "http://www.thregr.org/~wavexx/software/fgallery/releases/"
1410 "fgallery-" version ".zip"))
1411 (sha256
1412 (base32
1413 "18wlvqbxcng8pawimbc8f2422s8fnk840hfr6946lzsxr0ijakvf"))))
1414 (build-system gnu-build-system)
1415 (arguments
1416 `(#:tests? #f ; no tests
1417 #:phases
1418 (modify-phases %standard-phases
1419 (delete 'configure)
1420 (delete 'build)
1421 (replace 'install
1422 (lambda* (#:key inputs outputs #:allow-other-keys)
1423 (let* ((out (assoc-ref outputs "out"))
1424 (bin (string-append out "/bin/"))
1425 (share (string-append out "/share/fgallery"))
1426 (man (string-append out "/share/man/man1"))
1427 (perl5lib (getenv "PERL5LIB"))
1428 (script (string-append share "/fgallery")))
1429 (define (bin-directory input-name)
1430 (string-append (assoc-ref inputs input-name) "/bin"))
1431
1432 (mkdir-p man)
1433 (copy-file "fgallery.1" (string-append man "/fgallery.1"))
1434
1435 (mkdir-p share)
1436 (copy-recursively "." share)
1437
1438 ;; fgallery copies files from store when it is run. The
1439 ;; read-only permissions from the store directories will cause
1440 ;; fgallery to fail. Do not preserve file attributes when
1441 ;; copying files to prevent it.
1442 (substitute* script
1443 (("'cp'")
1444 "'cp', '--no-preserve=all'"))
1445
1446 (mkdir-p bin)
1447 (symlink script (string-append out "/bin/fgallery"))
1448
1449 (wrap-program script
1450 `("PATH" ":" prefix
1451 ,(map bin-directory '("imagemagick"
1452 "lcms"
1453 "fbida"
1454 "libjpeg"
1455 "zip"
1456 "jpegoptim"
1457 "pngcrush"
1458 "p7zip")))
1459 `("PERL5LIB" ":" prefix (,perl5lib)))
1460 #t))))))
1461 (native-inputs
1462 `(("unzip" ,unzip)))
1463 ;; TODO: Add missing optional dependency: facedetect.
1464 (inputs
1465 `(("imagemagick" ,imagemagick)
1466 ("lcms" ,lcms)
1467 ("fbida" ,fbida)
1468 ("libjpeg" ,libjpeg-turbo)
1469 ("zip" ,zip)
1470 ("perl" ,perl)
1471 ("perl-cpanel-json-xs" ,perl-cpanel-json-xs)
1472 ("perl-image-exiftool" ,perl-image-exiftool)
1473 ("jpegoptim" ,jpegoptim)
1474 ("pngcrush" ,pngcrush)
1475 ("p7zip" ,p7zip)))
1476 (home-page "http://www.thregr.org/~wavexx/software/fgallery/")
1477 (synopsis "Static photo gallery generator")
1478 (description
1479 "FGallery is a static, JavaScript photo gallery generator with minimalist
1480 look. The result can be uploaded on any web server without additional
1481 requirements.")
1482 (license license:gpl2+)))
1483
1484 (define-public opensubdiv
1485 (package
1486 (name "opensubdiv")
1487 (version "3.4.0")
1488 (source (origin
1489 (method git-fetch)
1490 (uri (git-reference
1491 (url "https://github.com/PixarAnimationStudios/OpenSubdiv")
1492 (commit (string-append "v" (string-join (string-split version #\.)
1493 "_")))))
1494 (file-name (git-file-name name version))
1495 (sha256
1496 (base32
1497 "0cippg6aqc5dlya1cmh3908pwssrg52fwgyylnvz5343yrxmgk12"))))
1498 (build-system cmake-build-system)
1499 (arguments
1500 `(#:phases (modify-phases %standard-phases
1501 (add-before 'configure 'set-glew-location
1502 (lambda* (#:key inputs #:allow-other-keys)
1503 (setenv "GLEW_LOCATION" (assoc-ref inputs "glew"))
1504 #t))
1505 (add-before 'check 'start-xorg-server
1506 (lambda* (#:key inputs #:allow-other-keys)
1507 ;; The test suite requires a running X server.
1508 (system (string-append (assoc-ref inputs "xorg-server")
1509 "/bin/Xvfb :1 &"))
1510 (setenv "DISPLAY" ":1")
1511 #t)))))
1512 (native-inputs
1513 `(("xorg-server" ,xorg-server-for-tests)))
1514 (inputs
1515 `(("glew" ,glew)
1516 ("libxrandr" ,libxrandr)
1517 ("libxcursor" ,libxcursor)
1518 ("libxinerama" ,libxinerama)
1519 ("libxi" ,libxi)
1520 ("zlib" ,zlib)
1521 ("glfw" ,glfw)))
1522 (home-page "https://graphics.pixar.com/opensubdiv/")
1523 (synopsis "High performance subdivision surface evaluation")
1524 (description "OpenSubdiv is a set of libraries that implement high
1525 performance subdivision surface (subdiv) evaluation on massively parallel CPU
1526 and GPU architectures.")
1527 (license license:asl2.0)))
1528
1529 (define-public opencsg
1530 (let ((dot-to-dash (lambda (c) (if (char=? c #\.) #\- c))))
1531 (package
1532 (name "opencsg")
1533 (version "1.4.2")
1534 (source
1535 (origin
1536 (method git-fetch)
1537 (uri (git-reference
1538 (url "https://github.com/floriankirsch/OpenCSG")
1539 (commit (string-append "opencsg-"
1540 (string-map dot-to-dash version)
1541 "-release"))))
1542 (file-name (git-file-name name version))
1543 (sha256
1544 (base32
1545 "00m4vs6jn3scqczscc4591l1d6zg6anqp9v1ldf9ymf70rdyvm7m"))))
1546 (build-system gnu-build-system)
1547 (arguments
1548 `(#:phases
1549 (modify-phases %standard-phases
1550 (replace 'configure
1551 (lambda* (#:key outputs #:allow-other-keys)
1552 (substitute* "src/Makefile"
1553 (("/usr/local") (assoc-ref outputs "out")))
1554 #t))
1555 (add-before 'build 'skip-example
1556 (lambda _ (chdir "src") #t)))))
1557 (inputs
1558 `(("glew" ,glew)
1559 ("freeglut" ,freeglut)))
1560 (synopsis "Library for rendering Constructive Solid Geometry (CSG)")
1561 (description
1562 "OpenCSG is a library for rendering Constructive Solid Geometry (CSG) using
1563 OpenGL. CSG is an approach for modeling complex 3D-shapes using simpler ones.
1564 For example, two shapes can be combined by uniting them, by intersecting them,
1565 or by subtracting one shape from the other.")
1566 (home-page "http://www.opencsg.org/")
1567 (license license:gpl2))))
1568
1569 (define-public coin3D
1570 ;; The ‘4.0.0’ zip archive isn't stable, nor in fact a release. See:
1571 ;; https://bitbucket.org/Coin3D/coin/issues/179/coin-400-srczip-has-been-modified
1572 (let ((revision 1)
1573 (changeset "ab8d0e47a4de3230a8137feb39c142d6ba45f97d"))
1574 (package
1575 (name "coin3D")
1576 (version
1577 (simple-format #f "3.1.3-~A-~A" revision (string-take changeset 7)))
1578 (source
1579 (origin
1580 (method hg-fetch)
1581 (uri (hg-reference
1582 (url "https://bitbucket.org/Coin3D/coin")
1583 (changeset changeset)))
1584 (file-name (git-file-name name version))
1585 (sha256
1586 (base32 "1ff44jz6lg4rylljvy69n1hcjh9y6achbv9jpn1cv2sf8cxn3r2j"))
1587 (modules '((guix build utils)))
1588 (snippet
1589 '(begin
1590 (for-each delete-file
1591 '("cfg/csubst.exe"
1592 "cfg/wrapmsvc.exe"))
1593 #t))))
1594 (build-system cmake-build-system)
1595 (native-inputs
1596 `(("doxygen" ,doxygen)
1597 ("graphviz" ,graphviz)))
1598 (inputs
1599 `(("boost" ,boost)
1600 ("freeglut" ,freeglut)
1601 ("glew" ,glew)))
1602 (arguments
1603 `(#:configure-flags
1604 (list
1605 "-DCOIN_BUILD_DOCUMENTATION_MAN=ON"
1606 (string-append "-DBOOST_ROOT="
1607 (assoc-ref %build-inputs "boost")))))
1608 (home-page "https://bitbucket.org/Coin3D/coin/wiki/Home")
1609 (synopsis
1610 "High-level 3D visualization library with Open Inventor 2.1 API")
1611 (description
1612 "Coin is a 3D graphics library with an Application Programming Interface
1613 based on the Open Inventor 2.1 API. For those who are not familiar with
1614 Open Inventor, it is a scene-graph based retain-mode rendering and model
1615 interaction library, written in C++, which has become the de facto
1616 standard graphics library for 3D visualization and visual simulation
1617 software in the scientific and engineering community.")
1618 (license license:bsd-3))))
1619
1620 (define-public superfamiconv
1621 (package
1622 (name "superfamiconv")
1623 (version "0.8.8")
1624 (source
1625 (origin
1626 (method git-fetch)
1627 (uri (git-reference
1628 (url "https://github.com/Optiroc/SuperFamiconv")
1629 (commit (string-append "v" version))))
1630 (file-name (git-file-name name version))
1631 (sha256
1632 (base32
1633 "0848szv6a2b8wdganh6mw5i8vn8cqvn1kbwzx7mb9wlrf5wzqn37"))))
1634 (build-system gnu-build-system)
1635 (arguments
1636 `(#:tests? #f ; no tests
1637 #:phases
1638 (modify-phases %standard-phases
1639 (delete 'configure)
1640 (replace 'install
1641 (lambda* (#:key outputs #:allow-other-keys)
1642 (let* ((outdir (assoc-ref outputs "out"))
1643 (bindir (string-append outdir "/bin")))
1644 (install-file "bin/superfamiconv" bindir)
1645 #t))))))
1646 (home-page "https://github.com/Optiroc/SuperFamiconv")
1647 (synopsis "Tile graphics converter supporting SNES, Game Boy Color
1648 and PC Engine formats")
1649 (description "SuperFamiconv is a converter for tiled graphics, supporting
1650 the graphics formats of the SNES, Game Boy Color and PC Engine game consoles.
1651 Automated palette selection is supported.")
1652 (license license:expat)))
1653
1654 (define-public drawpile
1655 (package
1656 (name "drawpile")
1657 (version "2.1.17")
1658 (source (origin
1659 (method git-fetch)
1660 (uri (git-reference
1661 (url "https://github.com/drawpile/Drawpile")
1662 (commit version)))
1663 (file-name (git-file-name name version))
1664 (sha256
1665 (base32
1666 "08w8vad8pw4a8kkshys1kd2kjvzpj62klxxxp904rx0qazw5hl80"))))
1667 (build-system qt-build-system)
1668 (arguments
1669 '(#:configure-flags (list "-DTESTS=ON" "-DTOOLS=ON" "-DKIS_TABLET=ON")))
1670 (native-inputs
1671 `(("extra-cmake-modules" ,extra-cmake-modules)
1672 ("pkg-config" ,pkg-config)))
1673 (inputs
1674 `(("giflib" ,giflib)
1675 ("karchive" ,karchive)
1676 ("kdnssd" ,kdnssd)
1677 ("libmicrohttpd" ,libmicrohttpd)
1678 ("libsodium" ,libsodium)
1679 ("libvpx" ,libvpx)
1680 ("libxi" ,libxi)
1681 ;; ("miniupnpc" ,miniupnpc) ;segfaults for some reason
1682 ("qtbase" ,qtbase)
1683 ("qtkeychain" ,qtkeychain)
1684 ("qtmultimedia" ,qtmultimedia)
1685 ("qtsvg" ,qtsvg)
1686 ("qtx11extras" ,qtx11extras)))
1687 (home-page "https://drawpile.net")
1688 (synopsis "Collaborative drawing program")
1689 (description "Drawpile is a drawing program that allows share the canvas
1690 with other users in real time.
1691
1692 Some feature highlights:
1693 @itemize
1694 @item Shared canvas using the built-in server or a dedicated server
1695 @item Record, play back and export drawing sessions
1696 @item Simple animation support
1697 @item Layers and blending modes
1698 @item Text layers
1699 @item Supports pressure sensitive Wacom tablets
1700 @item Built-in chat
1701 @item Supports OpenRaster file format
1702 @item Encrypted connections using SSL
1703 @item Automatic port forwarding with UPnP
1704 @end itemize\n")
1705 (license license:gpl3+)))