Merge branch 'master' into core-updates
[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 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages animation)
20 #:use-module (guix packages)
21 #:use-module (guix download)
22 #:use-module (guix utils)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages algebra)
27 #:use-module (gnu packages boost)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages fontutils)
30 #:use-module (gnu packages glib)
31 #:use-module (gnu packages gnome)
32 #:use-module (gnu packages graphics)
33 #:use-module (gnu packages gtk)
34 #:use-module (gnu packages image)
35 #:use-module (gnu packages imagemagick)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages video))
38
39 (define-public etl
40 (package
41 (name "etl")
42 (version "0.04.22")
43 (source (origin
44 (method url-fetch)
45 ;; Keep this synchronized with the synfig release version.
46 (uri (string-append "mirror://sourceforge/synfig/releases/"
47 "1.2.0/source/ETL-" version ".tar.gz"))
48 (sha256
49 (base32
50 "0ii73nsd3xzkhz6w1rnxwphl637j9w82xiy6apa9vin2isdynnmc"))))
51 (build-system gnu-build-system)
52 (home-page "http://www.synfig.org")
53 (synopsis "Extended C++ template library")
54 (description
55 "ETL is a class and template library designed to add new datatypes and
56 functions which combine well with the existing types and functions from the
57 C++ @dfn{Standard Template Library} (STL).")
58 (license license:gpl3+)))
59
60 (define-public synfig
61 (package
62 (name "synfig")
63 (version "1.2.0")
64 (source (origin
65 (method url-fetch)
66 (uri (string-append "mirror://sourceforge/synfig/releases/"
67 version "/source/synfig-" version
68 ".tar.gz"))
69 (sha256
70 (base32
71 "1gqx4gn4c73rqwhsgzx0a460gr9hadmi28csp75rx30qavqsj7k1"))))
72 (build-system gnu-build-system)
73 (arguments
74 `(#:configure-flags
75 ;; The Boost library path is taken from the value of BOOST_LDFLAGS.
76 (list (string-append "BOOST_LDFLAGS=-L"
77 (assoc-ref %build-inputs "boost")
78 "/lib"))
79 #:phases
80 (modify-phases %standard-phases
81 (add-after 'unpack 'fix-boost-build-error
82 ;; A chain of Boost headers leads to this error: "make_array" is
83 ;; not a member of "boost::serialization". This can be avoided by
84 ;; loading the "array_wrapper" header first.
85 (lambda _
86 (substitute* "src/synfig/valuenodes/valuenode_dynamic.cpp"
87 (("#include <boost/numeric/odeint/integrate/integrate.hpp>" match)
88 (string-append
89 "#include <boost/serialization/array_wrapper.hpp>\n" match)))
90 #t))
91 (add-after 'unpack 'adapt-to-libxml++-changes
92 (lambda _
93 (substitute* "configure"
94 (("libxml\\+\\+-2\\.6") "libxml++-3.0"))
95 (substitute* (append (find-files "src/modules/" "\\.cpp$")
96 (find-files "src/synfig/" "\\.(cpp|h)$"))
97 (("add_child\\(") "add_child_element(")
98 (("get_child_text\\(") "get_first_child_text(")
99 (("set_child_text\\(") "set_first_child_text(")
100 (("remove_child\\(") "remove_node("))
101 (substitute* "src/modules/mod_svg/svg_parser.cpp"
102 (("xmlpp::Node::NodeList") "xmlpp::Node::const_NodeList"))
103 #t)))))
104 (inputs
105 `(("boost" ,boost)
106 ("ffmpeg" ,ffmpeg)
107 ("libdv" ,libdv)
108 ("libjpeg" ,libjpeg)
109 ("libpng" ,libpng)
110 ("libmng" ,libmng)
111 ("zlib" ,zlib)))
112 ;; synfig.pc lists the following as required: Magick++ freetype2
113 ;; fontconfig fftw OpenEXR ETL glibmm-2.4 giomm-2.4 libxml++-3.0 sigc++-2.0
114 ;; cairo pango pangocairo mlt++
115 (propagated-inputs
116 `(("cairo" ,cairo)
117 ("etl" ,etl)
118 ("fftw" ,fftw)
119 ("fontconfig" ,fontconfig)
120 ("freetype" ,freetype)
121 ("glibmm" ,glibmm)
122 ("imagemagick" ,imagemagick)
123 ("libxml++" ,libxml++)
124 ("libsigc++" ,libsigc++)
125 ("mlt" ,mlt)
126 ("openexr" ,openexr)
127 ("pango" ,pango)))
128 (native-inputs
129 `(("pkg-config" ,pkg-config)))
130 (home-page "http://www.synfig.org")
131 (synopsis "Vector-based 2D animation renderer")
132 (description
133 "Synfig is a vector-based 2D animation package. It is designed to be
134 capable of producing feature-film quality animation. It eliminates the need
135 for tweening, preventing the need to hand-draw each frame.")
136 (license license:gpl3+)))
137
138 (define-public synfigstudio
139 (package
140 (name "synfigstudio")
141 (version "1.2.0")
142 (source (origin
143 (method url-fetch)
144 (uri (string-append "mirror://sourceforge/synfig/releases/"
145 version "/source/synfigstudio-" version
146 ".tar.gz"))
147 (sha256
148 (base32
149 "0fbckfbw8dzf0m2wv7vlmw492k1dqa3zf510z019d0as3zpnp6qm"))
150 (modules '((guix build utils)))
151 (snippet
152 '(begin
153 (substitute* "src/synfigapp/pluginmanager.cpp"
154 (("xmlpp::Node\\* n =") "const xmlpp::Node* n =")
155 (("xmlpp::Node::NodeList") "xmlpp::Node::const_NodeList"))
156 #t))
157 (patches
158 (search-patches "synfigstudio-fix-ui-with-gtk3.patch"))))
159 (build-system gnu-build-system)
160 (arguments
161 `(#:phases
162 (modify-phases %standard-phases
163 ;; This fixes the file chooser crash that happens with GTK 3.
164 (add-after 'install 'wrap-program
165 (lambda* (#:key inputs outputs #:allow-other-keys)
166 (let* ((out (assoc-ref outputs "out"))
167 (gtk (assoc-ref inputs "gtk+"))
168 (gtk-share (string-append gtk "/share")))
169 (wrap-program (string-append out "/bin/synfigstudio")
170 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))
171 #t))))))
172 (inputs
173 `(("gtkmm" ,gtkmm)
174 ("gtk+" ,gtk+)
175 ("libsigc++" ,libsigc++)
176 ("synfig" ,synfig)))
177 (native-inputs
178 `(("pkg-config" ,pkg-config)
179 ("intltool" ,intltool)))
180 (home-page "http://www.synfig.org")
181 (synopsis "Vector-based 2D animation package (GUI)")
182 (description
183 "Synfig is a vector-based 2D animation package. It is designed to
184 be capable of producing feature-film quality animation. It eliminates the
185 need for tweening, preventing the need to hand-draw each frame. This package
186 contains the graphical user interface for synfig.")
187 (license license:gpl3+)))