animation.scm 20 KB

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