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