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