animation.scm 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@elephly.net>
  3. ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
  4. ;;; Copyright © 2019 Pkill -9 <pkill9@runbox.com>
  5. ;;;
  6. ;;; This file is part of GNU Guix.
  7. ;;;
  8. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  9. ;;; under the terms of the GNU General Public License as published by
  10. ;;; the Free Software Foundation; either version 3 of the License, or (at
  11. ;;; your option) any later version.
  12. ;;;
  13. ;;; GNU Guix is distributed in the hope that it will be useful, but
  14. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. ;;; GNU General Public License for more details.
  17. ;;;
  18. ;;; You should have received a copy of the GNU General Public License
  19. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  20. (define-module (gnu packages animation)
  21. #:use-module (guix packages)
  22. #:use-module (guix download)
  23. #:use-module (guix git-download)
  24. #:use-module (guix utils)
  25. #:use-module ((guix licenses) #:prefix license:)
  26. #:use-module (guix build-system gnu)
  27. #:use-module (gnu packages)
  28. #:use-module (gnu packages algebra)
  29. #:use-module (gnu packages boost)
  30. #:use-module (gnu packages compression)
  31. #:use-module (gnu packages fontutils)
  32. #:use-module (gnu packages glib)
  33. #:use-module (gnu packages gnome)
  34. #:use-module (gnu packages graphics)
  35. #:use-module (gnu packages gtk)
  36. #:use-module (gnu packages image)
  37. #:use-module (gnu packages imagemagick)
  38. #:use-module (gnu packages pkg-config)
  39. #:use-module (gnu packages pulseaudio)
  40. #:use-module (gnu packages qt)
  41. #:use-module (gnu packages video))
  42. (define-public etl
  43. (package
  44. (name "etl")
  45. (version "0.04.22")
  46. (source (origin
  47. (method url-fetch)
  48. ;; Keep this synchronized with the synfig release version.
  49. (uri (string-append "mirror://sourceforge/synfig/releases/"
  50. "1.2.0/source/ETL-" version ".tar.gz"))
  51. (sha256
  52. (base32
  53. "0ii73nsd3xzkhz6w1rnxwphl637j9w82xiy6apa9vin2isdynnmc"))))
  54. (build-system gnu-build-system)
  55. (home-page "https://www.synfig.org")
  56. (synopsis "Extended C++ template library")
  57. (description
  58. "ETL is a class and template library designed to add new datatypes and
  59. functions which combine well with the existing types and functions from the
  60. C++ @dfn{Standard Template Library} (STL).")
  61. (license license:gpl3+)))
  62. (define-public synfig
  63. (package
  64. (name "synfig")
  65. (version "1.2.0")
  66. (source (origin
  67. (method url-fetch)
  68. (uri (string-append "mirror://sourceforge/synfig/releases/"
  69. version "/source/synfig-" version
  70. ".tar.gz"))
  71. (sha256
  72. (base32
  73. "1gqx4gn4c73rqwhsgzx0a460gr9hadmi28csp75rx30qavqsj7k1"))))
  74. (build-system gnu-build-system)
  75. (arguments
  76. `(#:configure-flags
  77. ;; The Boost library path is taken from the value of BOOST_LDFLAGS.
  78. (list (string-append "BOOST_LDFLAGS=-L"
  79. (assoc-ref %build-inputs "boost")
  80. "/lib"))
  81. #:phases
  82. (modify-phases %standard-phases
  83. (add-after 'unpack 'fix-boost-build-error
  84. ;; A chain of Boost headers leads to this error: "make_array" is
  85. ;; not a member of "boost::serialization". This can be avoided by
  86. ;; loading the "array_wrapper" header first.
  87. (lambda _
  88. (substitute* "src/synfig/valuenodes/valuenode_dynamic.cpp"
  89. (("#include <boost/numeric/odeint/integrate/integrate.hpp>" match)
  90. (string-append
  91. "#include <boost/serialization/array_wrapper.hpp>\n" match)))
  92. #t))
  93. (add-after 'unpack 'adapt-to-libxml++-changes
  94. (lambda _
  95. (substitute* "configure"
  96. (("libxml\\+\\+-2\\.6") "libxml++-3.0"))
  97. (substitute* (append (find-files "src/modules/" "\\.cpp$")
  98. (find-files "src/synfig/" "\\.(cpp|h)$"))
  99. (("add_child\\(") "add_child_element(")
  100. (("get_child_text\\(") "get_first_child_text(")
  101. (("set_child_text\\(") "set_first_child_text(")
  102. (("remove_child\\(") "remove_node("))
  103. (substitute* "src/modules/mod_svg/svg_parser.cpp"
  104. (("xmlpp::Node::NodeList") "xmlpp::Node::const_NodeList"))
  105. #t)))))
  106. (inputs
  107. `(("boost" ,boost)
  108. ("ffmpeg" ,ffmpeg)
  109. ("libdv" ,libdv)
  110. ("libjpeg" ,libjpeg)
  111. ("libpng" ,libpng)
  112. ("libmng" ,libmng)
  113. ("zlib" ,zlib)))
  114. ;; synfig.pc lists the following as required: Magick++ freetype2
  115. ;; fontconfig fftw OpenEXR ETL glibmm-2.4 giomm-2.4 libxml++-3.0 sigc++-2.0
  116. ;; cairo pango pangocairo mlt++
  117. (propagated-inputs
  118. `(("cairo" ,cairo)
  119. ("etl" ,etl)
  120. ("fftw" ,fftw)
  121. ("fontconfig" ,fontconfig)
  122. ("freetype" ,freetype)
  123. ("glibmm" ,glibmm)
  124. ("imagemagick" ,imagemagick)
  125. ("libxml++" ,libxml++)
  126. ("libsigc++" ,libsigc++)
  127. ("mlt" ,mlt)
  128. ("openexr" ,openexr)
  129. ("pango" ,pango)))
  130. (native-inputs
  131. `(("pkg-config" ,pkg-config)))
  132. (home-page "https://www.synfig.org")
  133. (synopsis "Vector-based 2D animation renderer")
  134. (description
  135. "Synfig is a vector-based 2D animation package. It is designed to be
  136. capable of producing feature-film quality animation. It eliminates the need
  137. for tweening, preventing the need to hand-draw each frame.")
  138. (license license:gpl3+)))
  139. (define-public synfigstudio
  140. (package
  141. (name "synfigstudio")
  142. (version "1.2.0")
  143. (source (origin
  144. (method url-fetch)
  145. (uri (string-append "mirror://sourceforge/synfig/releases/"
  146. version "/source/synfigstudio-" version
  147. ".tar.gz"))
  148. (sha256
  149. (base32
  150. "0fbckfbw8dzf0m2wv7vlmw492k1dqa3zf510z019d0as3zpnp6qm"))
  151. (modules '((guix build utils)))
  152. (snippet
  153. '(begin
  154. (substitute* "src/synfigapp/pluginmanager.cpp"
  155. (("xmlpp::Node\\* n =") "const xmlpp::Node* n =")
  156. (("xmlpp::Node::NodeList") "xmlpp::Node::const_NodeList"))
  157. #t))
  158. (patches
  159. (search-patches "synfigstudio-fix-ui-with-gtk3.patch"))))
  160. (build-system gnu-build-system)
  161. (arguments
  162. `(#:phases
  163. (modify-phases %standard-phases
  164. ;; This fixes the file chooser crash that happens with GTK 3.
  165. (add-after 'install 'wrap-program
  166. (lambda* (#:key inputs outputs #:allow-other-keys)
  167. (let* ((out (assoc-ref outputs "out"))
  168. (gtk (assoc-ref inputs "gtk+"))
  169. (gtk-share (string-append gtk "/share")))
  170. (wrap-program (string-append out "/bin/synfigstudio")
  171. `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))
  172. #t))))))
  173. (inputs
  174. `(("gtkmm" ,gtkmm)
  175. ("gtk+" ,gtk+)
  176. ("libsigc++" ,libsigc++)
  177. ("synfig" ,synfig)))
  178. (native-inputs
  179. `(("pkg-config" ,pkg-config)
  180. ("intltool" ,intltool)))
  181. (home-page "https://www.synfig.org")
  182. (synopsis "Vector-based 2D animation package (GUI)")
  183. (description
  184. "Synfig is a vector-based 2D animation package. It is designed to
  185. be capable of producing feature-film quality animation. It eliminates the
  186. need for tweening, preventing the need to hand-draw each frame. This package
  187. contains the graphical user interface for synfig.")
  188. (license license:gpl3+)))
  189. (define-public papagayo
  190. (let ((commit "e143684b30e59fe4a554f965cb655d23cbe93ee7")
  191. (revision "1"))
  192. (package
  193. (name "papagayo")
  194. (version (string-append "2.0b1-" revision "." (string-take commit 9)))
  195. (source (origin
  196. (method git-fetch)
  197. (uri (git-reference
  198. (url "https://github.com/LostMoho/Papagayo.git")
  199. (commit commit)))
  200. (file-name (git-file-name name version))
  201. (sha256
  202. (base32
  203. "1p9gffjhbph34jhrvgpg93yha75bf88vkvlnk06x1r9601ph5321"))
  204. (modules '((guix build utils)))
  205. ;; Delete bundled libsndfile sources.
  206. (snippet
  207. '(begin
  208. (delete-file-recursively "libsndfile_1.0.19")
  209. (delete-file-recursively "libsndfile_1.0.25")
  210. #t))))
  211. (build-system gnu-build-system)
  212. (arguments
  213. `(#:phases
  214. (modify-phases %standard-phases
  215. (replace 'configure
  216. (lambda* (#:key inputs outputs #:allow-other-keys)
  217. (let ((libsndfile (assoc-ref inputs "libsndfile")))
  218. ;; Do not use bundled libsndfile sources
  219. (substitute* "Papagayo.pro"
  220. (("else \\{")
  221. (string-append "\nINCLUDEPATH += " libsndfile
  222. "/include"
  223. "\nLIBS +=" libsndfile
  224. "/lib/libsndfile.so\n"
  225. "win32 {"))))
  226. (invoke "qmake"
  227. (string-append "DESTDIR="
  228. (assoc-ref outputs "out")
  229. "/bin"))))
  230. ;; Ensure that all required Qt plugins are found at runtime.
  231. (add-after 'install 'wrap-executable
  232. (lambda* (#:key inputs outputs #:allow-other-keys)
  233. (let* ((out (assoc-ref outputs "out"))
  234. (qt '("qt" "qtmultimedia")))
  235. (wrap-program (string-append out "/bin/Papagayo")
  236. `("QT_PLUGIN_PATH" ":" prefix
  237. ,(map (lambda (label)
  238. (string-append (assoc-ref inputs label)
  239. "/lib/qt5/plugins/"))
  240. qt)))
  241. #t))))))
  242. (inputs
  243. `(("qt" ,qtbase)
  244. ("qtmultimedia" ,qtmultimedia)
  245. ("libsndfile" ,libsndfile)))
  246. (native-inputs
  247. `(("qttools" ,qttools)))
  248. (home-page "https://www.lostmarble.com/papagayo/")
  249. (synopsis "Lip-syncing for animations")
  250. (description
  251. "Papagayo is a lip-syncing program designed to help you line up
  252. phonemes with the actual recorded sound of actors speaking. Papagayo makes it
  253. easy to lip sync animated characters by making the process very simple – just
  254. type in the words being spoken, then drag the words on top of the sound’s
  255. waveform until they line up with the proper sounds.")
  256. (license license:gpl3+))))
  257. (define-public pencil2d
  258. (package
  259. (name "pencil2d")
  260. (version "0.6.2")
  261. (source (origin
  262. (method git-fetch)
  263. (uri (git-reference
  264. (url "https://github.com/pencil2d/pencil")
  265. (commit (string-append "v" version))))
  266. (file-name (git-file-name name version))
  267. (sha256
  268. (base32
  269. "1iv7drwxs32mqs3hybjx2lxyqn8cv2b4rw9ny7gzdacsbhi65knr"))))
  270. (build-system gnu-build-system)
  271. (inputs
  272. `(("qtbase" ,qtbase)
  273. ("qtxmlpatterns" ,qtxmlpatterns)
  274. ("qtmultimedia" ,qtmultimedia)
  275. ("qtsvg" ,qtsvg)))
  276. (arguments
  277. `(#:phases
  278. (modify-phases %standard-phases
  279. (replace 'configure
  280. (lambda* (#:key inputs outputs #:allow-other-keys)
  281. (let ((out (assoc-ref outputs "out")))
  282. (invoke "qmake" (string-append "PREFIX=" out)))))
  283. (add-after 'install 'wrap-executable
  284. (lambda* (#:key inputs outputs #:allow-other-keys)
  285. (let ((out (assoc-ref outputs "out"))
  286. (plugin-path (getenv "QT_PLUGIN_PATH")))
  287. (wrap-program (string-append out "/bin/pencil2d")
  288. `("QT_PLUGIN_PATH" ":" prefix (,plugin-path)))
  289. #t))))))
  290. (home-page "https://www.pencil2d.org")
  291. (synopsis "Make 2D hand-drawn animations")
  292. (description
  293. "Pencil2D is an easy-to-use and intuitive animation and drawing tool. It
  294. lets you create traditional hand-drawn animations (cartoons) using both bitmap
  295. and vector graphics.")
  296. (license license:gpl2)))