gnu: packages: Use 'search-patches' everywhere.
[jackhill/guix/guix.git] / gnu / packages / animation.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 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 boost)
27 #:use-module (gnu packages compression)
28 #:use-module (gnu packages fontutils)
29 #:use-module (gnu packages glib)
30 #:use-module (gnu packages gnome)
31 #:use-module (gnu packages graphics)
32 #:use-module (gnu packages gtk)
33 #:use-module (gnu packages image)
34 #:use-module (gnu packages imagemagick)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages video))
37
38 (define-public etl
39 (package
40 (name "etl")
41 (version "0.04.19")
42 (source (origin
43 (method url-fetch)
44 ;; Keep this synchronized with the synfig release version.
45 (uri (string-append "mirror://sourceforge/synfig/releases/"
46 "1.0.2/source/ETL-" version ".tar.gz"))
47 (sha256
48 (base32
49 "070c70slizrklq1gbgja8m49xfmq65wlcd6hz6418cpx0wd4r55s"))))
50 (build-system gnu-build-system)
51 (home-page "http://www.synfig.org")
52 (synopsis "Extended C++ template library")
53 (description
54 "ETL is a class and template library designed to add new datatypes and
55 functions which combine well with the existing types and functions from the
56 C++ @dfn{Standard Template Library} (STL).")
57 (license license:gpl3+)))
58
59 (define-public synfig
60 (package
61 (name "synfig")
62 (version "1.0.2")
63 (source (origin
64 (method url-fetch)
65 (uri (string-append "mirror://sourceforge/synfig/releases/"
66 version "/source/synfig-" version
67 ".tar.gz"))
68 (sha256
69 (base32
70 "1d3z2r78j3rkff47q3wl0ami69y3l4nyi5r9zclymb8ar7mgkk9l"))
71 (patches (search-patches "synfig-build-fix.patch"))))
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 'adapt-to-libxml++-changes
82 (lambda _
83 (substitute* "configure"
84 (("libxml\\+\\+-2\\.6") "libxml++-3.0"))
85 (substitute* (append (find-files "src/modules/" "\\.cpp$")
86 (find-files "src/synfig/" "\\.(cpp|h)$"))
87 (("add_child\\(") "add_child_element(")
88 (("get_child_text\\(") "get_first_child_text(")
89 (("set_child_text\\(") "set_first_child_text(")
90 (("remove_child\\(") "remove_node("))
91 (substitute* "src/modules/mod_svg/svg_parser.cpp"
92 (("xmlpp::Node::NodeList") "xmlpp::Node::const_NodeList"))
93 #t))
94 (add-before 'configure 'set-flags
95 (lambda _
96 ;; Compile with C++11, required by libsigc++.
97 (setenv "CXXFLAGS" "-D__STDC_CONSTANT_MACROS -std=gnu++11")
98 #t)))))
99 (inputs
100 `(("boost" ,boost)
101 ("ffmpeg" ,ffmpeg)
102 ("libdv" ,libdv)
103 ("libjpeg" ,libjpeg)
104 ("libpng" ,libpng)
105 ("libmng" ,libmng)
106 ("zlib" ,zlib)))
107 ;; synfig.pc lists the following as required: Magick++ freetype2
108 ;; fontconfig OpenEXR ETL glibmm-2.4 giomm-2.4 libxml++-3.0 sigc++-2.0
109 ;; cairo pango pangocairo mlt++
110 (propagated-inputs
111 `(("cairo" ,cairo)
112 ("etl" ,etl)
113 ("fontconfig" ,fontconfig)
114 ("freetype" ,freetype)
115 ("glibmm" ,glibmm)
116 ("imagemagick" ,imagemagick)
117 ("libxml++" ,libxml++)
118 ("libsigc++" ,libsigc++)
119 ("mlt" ,mlt)
120 ("openexr" ,openexr)
121 ("pango" ,pango)))
122 (native-inputs
123 `(("pkg-config" ,pkg-config)))
124 (home-page "http://www.synfig.org")
125 (synopsis "Vector-based 2D animation renderer")
126 (description
127 "Synfig is a vector-based 2D animation package. It is designed to be
128 capable of producing feature-film quality animation. It eliminates the need
129 for tweening, preventing the need to hand-draw each frame.")
130 (license license:gpl3+)))
131
132 (define-public synfigstudio
133 (package
134 (name "synfigstudio")
135 (version "1.0.2")
136 (source (origin
137 (method url-fetch)
138 (uri (string-append "mirror://sourceforge/synfig/releases/"
139 version "/source/synfigstudio-" version
140 ".tar.gz"))
141 (sha256
142 (base32
143 "1xa74dlgkpjn0gzdcs0x25z7wg0806v2wygvvi73f7sn1fm88ig4"))
144 (modules '((guix build utils)))
145 (snippet
146 '(begin
147 (substitute* "src/synfigapp/pluginmanager.cpp"
148 (("xmlpp::Node\\* n =") "const xmlpp::Node* n =")
149 (("xmlpp::Node::NodeList") "xmlpp::Node::const_NodeList"))
150 ;; Some files are ISO-8859-1 encoded.
151 (with-fluids ((%default-port-encoding #f))
152 (substitute* (find-files "src/" "\\.(cpp|h)$")
153 (("#include <sigc\\+\\+/retype\\.h>")
154 "#include <sigc++/adaptors/retype.h>")
155 (("#include <sigc\\+\\+/hide\\.h>")
156 "#include <sigc++/adaptors/hide.h>")
157 (("#include <sigc\\+\\+/object\\.h>")
158 "#include <sigc++/trackable.h>")))
159 #t))))
160 (build-system gnu-build-system)
161 (arguments
162 `(#:configure-flags
163 (list "CXXFLAGS=-std=gnu++11")))
164 (inputs
165 `(("gtkmm" ,gtkmm)
166 ("libsigc++" ,libsigc++)
167 ("synfig" ,synfig)))
168 (native-inputs
169 `(("pkg-config" ,pkg-config)
170 ("intltool" ,intltool)))
171 (home-page "http://www.synfig.org")
172 (synopsis "Vector-based 2D animation package (GUI)")
173 (description
174 "Synfig is a vector-based 2D animation package. It is designed to
175 be capable of producing feature-film quality animation. It eliminates the
176 need for tweening, preventing the need to hand-draw each frame. This package
177 contains the graphical user interface for synfig.")
178 (license license:gpl3+)))