gnu: mlt: Rename to mlt-6.
[jackhill/guix/guix.git] / gnu / packages / animation.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2019 Pkill -9 <pkill9@runbox.com>
5 ;;; Copyright © 2020, 2021 Vinicius Monego <monego@posteo.net>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages animation)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix git-download)
26 #:use-module (guix utils)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix build-system cmake)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix build-system meson)
31 #:use-module (gnu packages)
32 #:use-module (gnu packages algebra)
33 #:use-module (gnu packages assembly)
34 #:use-module (gnu packages autotools)
35 #:use-module (gnu packages boost)
36 #:use-module (gnu packages check)
37 #:use-module (gnu packages compression)
38 #:use-module (gnu packages curl)
39 #:use-module (gnu packages dejagnu)
40 #:use-module (gnu packages fontutils)
41 #:use-module (gnu packages gettext)
42 #:use-module (gnu packages gl)
43 #:use-module (gnu packages glib)
44 #:use-module (gnu packages gnome)
45 #:use-module (gnu packages graphics)
46 #:use-module (gnu packages gtk)
47 #:use-module (gnu packages image)
48 #:use-module (gnu packages imagemagick)
49 #:use-module (gnu packages jemalloc)
50 #:use-module (gnu packages networking)
51 #:use-module (gnu packages pcre)
52 #:use-module (gnu packages perl)
53 #:use-module (gnu packages pkg-config)
54 #:use-module (gnu packages pulseaudio)
55 #:use-module (gnu packages python)
56 #:use-module (gnu packages qt)
57 #:use-module (gnu packages sdl)
58 #:use-module (gnu packages tls)
59 #:use-module (gnu packages video)
60 #:use-module (gnu packages xiph))
61
62 (define-public rlottie
63 (package
64 (name "rlottie")
65 (version "0.2")
66 (source
67 (origin
68 (method git-fetch)
69 (uri
70 (git-reference
71 (url "https://github.com/Samsung/rlottie.git")
72 (commit
73 (string-append "v" version))))
74 (file-name
75 (git-file-name name version))
76 (sha256
77 (base32 "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3"))))
78 (build-system meson-build-system)
79 (arguments
80 `(#:configure-flags
81 (list
82 "-Dlog=true"
83 "-Dtest=true")))
84 (native-inputs
85 `(("googletest" ,googletest)
86 ("pkg-config" ,pkg-config)))
87 (synopsis "Lottie Animation Library")
88 (description "Rlottie is a platform independent standalone c++ library for
89 rendering vector based animations and art in realtime.")
90 (home-page "https://github.com/Samsung/rlottie/")
91 (license license:expat)))
92
93 ;; ETL, synfig, and Synfig Studio are updated in tandem.
94 (define synfig-version "1.2.2")
95
96 (define-public etl
97 (package
98 (name "etl")
99 (version synfig-version)
100 (source (origin
101 (method url-fetch)
102 (uri (string-append "mirror://sourceforge/synfig/releases/"
103 version "/source/ETL-" version ".tar.gz"))
104 (sha256
105 (base32
106 "12sd8pz8l5xcxcmapkvih3brihdhdb6xmxisr9a415lydid9rh8d"))))
107 (build-system gnu-build-system)
108 (home-page "https://www.synfig.org")
109 (synopsis "Extended C++ template library")
110 (description
111 "ETL is a class and template library designed to add new datatypes and
112 functions which combine well with the existing types and functions from the
113 C++ @dfn{Standard Template Library} (STL).")
114 (license license:gpl3+)))
115
116 (define-public synfig
117 (package
118 (name "synfig")
119 (version synfig-version)
120 (source (origin
121 (method url-fetch)
122 (uri (string-append "mirror://sourceforge/synfig/releases/"
123 version "/source/synfig-" version
124 ".tar.gz"))
125 (sha256
126 (base32
127 "1vy27kl68sbg41sfasa58k3p2nc1xfalvzk3k9gich9h90rpnpsz"))))
128 (build-system gnu-build-system)
129 (arguments
130 `(#:configure-flags
131 ;; The Boost library path is taken from the value of BOOST_LDFLAGS.
132 (list (string-append "BOOST_LDFLAGS=-L"
133 (assoc-ref %build-inputs "boost")
134 "/lib"))
135 #:phases
136 (modify-phases %standard-phases
137 (add-after 'unpack 'fix-boost-build-error
138 ;; A chain of Boost headers leads to this error: "make_array" is
139 ;; not a member of "boost::serialization". This can be avoided by
140 ;; loading the "array_wrapper" header first.
141 (lambda _
142 (substitute* "src/synfig/valuenodes/valuenode_dynamic.cpp"
143 (("#include <boost/numeric/odeint/integrate/integrate.hpp>" match)
144 (string-append
145 "#include <boost/serialization/array_wrapper.hpp>\n" match)))
146 #t))
147 (add-after 'unpack 'adapt-to-libxml++-changes
148 (lambda _
149 (substitute* "configure"
150 (("libxml\\+\\+-2\\.6") "libxml++-3.0"))
151 (substitute* (append (find-files "src/modules/" "\\.cpp$")
152 (find-files "src/synfig/" "\\.(cpp|h)$"))
153 (("add_child\\(") "add_child_element(")
154 (("get_child_text\\(") "get_first_child_text(")
155 (("set_child_text\\(") "set_first_child_text(")
156 (("remove_child\\(") "remove_node("))
157 (substitute* "src/modules/mod_svg/svg_parser.cpp"
158 (("xmlpp::Node::NodeList") "xmlpp::Node::const_NodeList"))
159 #t)))))
160 (inputs
161 `(("boost" ,boost)
162 ("ffmpeg" ,ffmpeg)
163 ("libdv" ,libdv)
164 ("libjpeg" ,libjpeg-turbo)
165 ("libpng" ,libpng)
166 ("libmng" ,libmng)
167 ("zlib" ,zlib)))
168 ;; synfig.pc lists the following as required: Magick++ freetype2
169 ;; fontconfig fftw OpenEXR ETL glibmm-2.4 giomm-2.4 libxml++-3.0 sigc++-2.0
170 ;; cairo pango pangocairo mlt++
171 (propagated-inputs
172 `(("cairo" ,cairo)
173 ("etl" ,etl)
174 ("fftw" ,fftw)
175 ("fontconfig" ,fontconfig)
176 ("freetype" ,freetype)
177 ("glibmm" ,glibmm)
178 ("imagemagick" ,imagemagick)
179 ("libxml++" ,libxml++)
180 ("libsigc++" ,libsigc++)
181 ("mlt" ,mlt-6)
182 ("openexr" ,openexr)
183 ("pango" ,pango)))
184 (native-inputs
185 `(("intltool" ,intltool)
186 ("pkg-config" ,pkg-config)))
187 (home-page "https://www.synfig.org")
188 (synopsis "Vector-based 2D animation renderer")
189 (description
190 "Synfig is a vector-based 2D animation package. It is designed to be
191 capable of producing feature-film quality animation. It eliminates the need
192 for tweening, preventing the need to hand-draw each frame.")
193 (license license:gpl3+)))
194
195 (define-public synfigstudio
196 (package
197 (name "synfigstudio")
198 (version synfig-version)
199 (source (origin
200 (method url-fetch)
201 (uri (string-append "mirror://sourceforge/synfig/releases/"
202 version "/source/synfigstudio-" version
203 ".tar.gz"))
204 (sha256
205 (base32
206 "1ql92kh9z8w2j9yi3pr7hn7wh2r2j35xynwv9xlwyd7niackgykn"))
207 (modules '((guix build utils)))
208 (snippet
209 '(begin
210 (substitute* "src/synfigapp/pluginmanager.cpp"
211 (("xmlpp::Node\\* n =") "const xmlpp::Node* n =")
212 (("xmlpp::Node::NodeList") "xmlpp::Node::const_NodeList"))
213 #t))))
214 (build-system gnu-build-system)
215 (arguments
216 `(#:phases
217 (modify-phases %standard-phases
218 ;; This fixes the file chooser crash that happens with GTK 3.
219 (add-after 'install 'wrap-program
220 (lambda* (#:key inputs outputs #:allow-other-keys)
221 (let* ((out (assoc-ref outputs "out"))
222 (gtk (assoc-ref inputs "gtk+"))
223 (gtk-share (string-append gtk "/share")))
224 (wrap-program (string-append out "/bin/synfigstudio")
225 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))
226 #t))))))
227 (inputs
228 `(("gtkmm" ,gtkmm)
229 ("gtk+" ,gtk+)
230 ("libsigc++" ,libsigc++)
231 ("synfig" ,synfig)))
232 (native-inputs
233 `(("pkg-config" ,pkg-config)
234 ("intltool" ,intltool)))
235 (home-page "https://www.synfig.org")
236 (synopsis "Vector-based 2D animation package (GUI)")
237 (description
238 "Synfig is a vector-based 2D animation package. It is designed to
239 be capable of producing feature-film quality animation. It eliminates the
240 need for tweening, preventing the need to hand-draw each frame. This package
241 contains the graphical user interface for synfig.")
242 (license license:gpl3+)))
243
244 ;; This package provides a standalone (no browser plugin) version of Gnash.
245 (define-public gnash
246 ;; The last tagged release of Gnash was in 2013.
247 (let ((commit "583ccbc1275c7701dc4843ec12142ff86bb305b4")
248 (revision "0"))
249 (package
250 (name "gnash")
251 (version (git-version "0.8.11" revision commit))
252 (source
253 (origin
254 (method git-fetch)
255 (uri (git-reference
256 (url "https://git.savannah.gnu.org/git/gnash.git/")
257 (commit commit)))
258 (file-name (git-file-name name version))
259 (patches (search-patches "gnash-fix-giflib-version.patch"))
260 (sha256
261 (base32 "0fh0bljn0i6ypyh6l99afi855p7ki7lm869nq1qj6k8hrrwhmfry"))))
262 (build-system gnu-build-system)
263 (arguments
264 `(#:configure-flags
265 (list "--disable-static"
266 ;; Plugins are based on XULRunner and NPAPI only. Disable.
267 "--disable-plugins"
268 "--enable-gui=gtk"
269 "--enable-media=ffmpeg"
270 (string-append "--with-boost-incl="
271 (assoc-ref %build-inputs "boost") "/include")
272 (string-append "--with-boost-lib="
273 (assoc-ref %build-inputs "boost") "/lib")
274 (string-append "--with-ffmpeg-incl="
275 (assoc-ref %build-inputs "ffmpeg")
276 "/include/libavcodec")
277 (string-append "--with-speex-incl="
278 (assoc-ref %build-inputs "speex") "/include")
279 (string-append "--with-jemalloc-incl="
280 (assoc-ref %build-inputs "jemalloc")
281 "/include/jemalloc")
282 (string-append "--with-speex-lib="
283 (assoc-ref %build-inputs "speex") "/lib")
284 (string-append "--with-jpeg-incl="
285 (assoc-ref %build-inputs "libjpeg") "/include")
286 (string-append "--with-zlib-incl="
287 (assoc-ref %build-inputs "zlib") "/include")
288 (string-append "--with-png-incl="
289 (assoc-ref %build-inputs "libpng")
290 "/include"))))
291 (native-inputs
292 `(("autoconf" ,autoconf)
293 ("automake" ,automake)
294 ("dejagnu" ,dejagnu) ;for tests
295 ("gettext" ,gettext-minimal)
296 ("libtool" ,libtool)
297 ("perl" ,perl)
298 ("pkg-config" ,pkg-config)
299 ("python" ,python-wrapper)))
300 (inputs
301 `(("agg" ,agg)
302 ("atk" ,atk)
303 ("boost" ,boost)
304 ("curl" ,curl)
305 ("ffmpeg" ,ffmpeg-2.8)
306 ("freeglut" ,freeglut)
307 ("gconf" ,gconf)
308 ("giflib" ,giflib)
309 ("glib" ,glib)
310 ("gtk+" ,gtk+-2)
311 ("gtkglext" ,gtkglext)
312 ("jemalloc" ,jemalloc)
313 ("libjpeg" ,libjpeg-turbo)
314 ("libltdl" ,libltdl)
315 ("libpng" ,libpng)
316 ("pangox-compat" ,pangox-compat)
317 ("sdl" ,sdl)
318 ("speex" ,speex)))
319 (synopsis "Flash movie player")
320 (description
321 "Gnash is a Flash movie player. It supports SWF version v7 and some
322 of v8 and v9. It is possible to configure Gnash to use several different
323 audio or video backends, ensuring good performance.")
324 (home-page "https://www.gnu.org/software/gnash/")
325 (license license:gpl3+))))
326
327 ;; This package provides a standalone (no browser plugin) version of
328 ;; Lightspark.
329 (define-public lightspark
330 (package
331 (name "lightspark")
332 (version "0.8.4.1")
333 (source
334 (origin
335 (method git-fetch)
336 (uri (git-reference
337 (url "https://github.com/lightspark/lightspark")
338 (commit version)))
339 (file-name (git-file-name name version))
340 (sha256
341 (base32 "17l5gzb7p8nivx1a2frca2jklcjdsk2qj4jniv3z8bh307ksz254"))))
342 (build-system cmake-build-system)
343 (arguments
344 `(#:tests? #f ;requires Adobe Flex SDK, see README.tests
345 ;; Disable browser plugins because neither NPAPI nor PPAPI is
346 ;; supported in the browsers we have.
347 #:configure-flags
348 '("-DCOMPILE_NPAPI_PLUGIN=FALSE"
349 "-DCOMPILE_PPAPI_PLUGIN=FALSE")
350 #:phases
351 (modify-phases %standard-phases
352 (add-after 'unpack 'prepare-build-environment
353 (lambda _
354 ;; Use relative etc path.
355 (substitute* "CMakeLists.txt" (("\\/etc") "etc"))))
356 (replace 'check
357 (lambda* (#:key tests? #:allow-other-keys)
358 (when tests?
359 (invoke "./tests")))))))
360 (native-inputs
361 `(("gettext" ,gettext-minimal)
362 ("glib:bin" ,glib "bin")
363 ("nasm" ,nasm)
364 ("perl" ,perl)
365 ("pkg-config" ,pkg-config)
366 ("python" ,python-wrapper)))
367 (inputs
368 `(("cairo" ,cairo)
369 ("curl" ,curl)
370 ("ffmpeg" ,ffmpeg)
371 ("freeglut" ,freeglut)
372 ("glew" ,glew)
373 ("glibmm" ,glibmm)
374 ("gnash" ,gnash)
375 ("gnutls" ,gnutls)
376 ("libjpeg" ,libjpeg-turbo)
377 ("openssl" ,openssl)
378 ("pango" ,pango)
379 ("pcre2" ,pcre2)
380 ("rtmpdump" ,rtmpdump)
381 ("sdl2" ,sdl2)
382 ("sdl2-mixer" ,sdl2-mixer)
383 ("zlib" ,zlib)))
384 (home-page "https://lightspark.github.io/")
385 (synopsis "Flash player implementation")
386 (description
387 "Lightspark is a Flash player implementation for playing files in the SWF
388 format. It supports SWF files written on all versions of the ActionScript
389 language.")
390 ;; NOTE: The bundled pugixml is a fork specific to Lightspark and
391 ;; incompatible with the one we have.
392 ;; FIXME: we also have jxrlib, but the build fails to find JXRMeta.h so we
393 ;; use the bundled one for now.
394 (license (list license:lgpl3+ ;lightspark
395 license:mpl2.0 ;avmplus
396 license:bsd-2 ;jxrlib
397 license:expat)))) ;pugixml, PerlinNoise
398
399 (define-public papagayo
400 (let ((commit "e143684b30e59fe4a554f965cb655d23cbe93ee7")
401 (revision "1"))
402 (package
403 (name "papagayo")
404 (version (string-append "2.0b1-" revision "." (string-take commit 9)))
405 (source (origin
406 (method git-fetch)
407 (uri (git-reference
408 (url "https://github.com/LostMoho/Papagayo")
409 (commit commit)))
410 (file-name (git-file-name name version))
411 (sha256
412 (base32
413 "1p9gffjhbph34jhrvgpg93yha75bf88vkvlnk06x1r9601ph5321"))
414 (modules '((guix build utils)))
415 ;; Delete bundled libsndfile sources.
416 (snippet
417 '(begin
418 (delete-file-recursively "libsndfile_1.0.19")
419 (delete-file-recursively "libsndfile_1.0.25")
420 #t))))
421 (build-system gnu-build-system)
422 (arguments
423 `(#:phases
424 (modify-phases %standard-phases
425 (replace 'configure
426 (lambda* (#:key inputs outputs #:allow-other-keys)
427 (let ((libsndfile (assoc-ref inputs "libsndfile")))
428 ;; Do not use bundled libsndfile sources
429 (substitute* "Papagayo.pro"
430 (("else \\{")
431 (string-append "\nINCLUDEPATH += " libsndfile
432 "/include"
433 "\nLIBS +=" libsndfile
434 "/lib/libsndfile.so\n"
435 "win32 {"))))
436 (invoke "qmake"
437 (string-append "DESTDIR="
438 (assoc-ref outputs "out")
439 "/bin"))))
440 ;; Ensure that all required Qt plugins are found at runtime.
441 (add-after 'install 'wrap-executable
442 (lambda* (#:key inputs outputs #:allow-other-keys)
443 (let* ((out (assoc-ref outputs "out"))
444 (qt '("qt" "qtmultimedia")))
445 (wrap-program (string-append out "/bin/Papagayo")
446 `("QT_PLUGIN_PATH" ":" prefix
447 ,(map (lambda (label)
448 (string-append (assoc-ref inputs label)
449 "/lib/qt5/plugins/"))
450 qt)))
451 #t))))))
452 (inputs
453 `(("qt" ,qtbase-5)
454 ("qtmultimedia" ,qtmultimedia)
455 ("libsndfile" ,libsndfile)))
456 (native-inputs
457 `(("qttools" ,qttools)))
458 (home-page "https://www.lostmarble.com/papagayo/")
459 (synopsis "Lip-syncing for animations")
460 (description
461 "Papagayo is a lip-syncing program designed to help you line up
462 phonemes with the actual recorded sound of actors speaking. Papagayo makes it
463 easy to lip sync animated characters by making the process very simple – just
464 type in the words being spoken, then drag the words on top of the sound’s
465 waveform until they line up with the proper sounds.")
466 (license license:gpl3+))))
467
468 (define-public pencil2d
469 (package
470 (name "pencil2d")
471 (version "0.6.6")
472 (source (origin
473 (method git-fetch)
474 (uri (git-reference
475 (url "https://github.com/pencil2d/pencil")
476 (commit (string-append "v" version))))
477 (file-name (git-file-name name version))
478 (sha256
479 (base32
480 "0b1nwiwyg01087q318vymg4si76dw41ykxbn2zwd6dqbxzbpr1dh"))))
481 (build-system gnu-build-system)
482 (inputs
483 `(("qtbase" ,qtbase-5)
484 ("qtxmlpatterns" ,qtxmlpatterns)
485 ("qtmultimedia" ,qtmultimedia)
486 ("qtsvg" ,qtsvg)))
487 (arguments
488 `(#:phases
489 (modify-phases %standard-phases
490 (replace 'configure
491 (lambda* (#:key inputs outputs #:allow-other-keys)
492 (let ((out (assoc-ref outputs "out")))
493 (invoke "qmake" (string-append "PREFIX=" out)))))
494 (add-after 'install 'wrap-executable
495 (lambda* (#:key inputs outputs #:allow-other-keys)
496 (let ((out (assoc-ref outputs "out"))
497 (plugin-path (getenv "QT_PLUGIN_PATH")))
498 (wrap-program (string-append out "/bin/pencil2d")
499 `("QT_PLUGIN_PATH" ":" prefix (,plugin-path)))
500 #t))))))
501 (home-page "https://www.pencil2d.org")
502 (synopsis "Make 2D hand-drawn animations")
503 (description
504 "Pencil2D is an easy-to-use and intuitive animation and drawing tool. It
505 lets you create traditional hand-drawn animations (cartoons) using both bitmap
506 and vector graphics.")
507 (license license:gpl2)))