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