gnu: emacs-svg-icon: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / batik.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2018 Danny Milosavljevic <dannym@scratchpost.org>
3 ;;; Copyright © 2020 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 batik)
21 #:use-module ((guix licenses) #:prefix license:)
22 #:use-module (guix utils)
23 #:use-module (guix download)
24 #:use-module (guix git-download)
25 #:use-module (guix packages)
26 #:use-module (guix build-system ant)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages java)
30 #:use-module (gnu packages textutils)
31 #:use-module (gnu packages xml))
32
33 (define-public java-w3c-smil-3.0
34 (package
35 (name "java-w3c-smil")
36 (version "3.0")
37 (source #f)
38 (build-system ant-build-system)
39 (arguments
40 `(#:jar-name "w3c-smil.jar"
41 #:source-dir "."
42 #:tests? #f ; No tests exist.
43 #:phases
44 (modify-phases %standard-phases
45 (replace 'unpack
46 (lambda* (#:key source #:allow-other-keys)
47 ;; https://www.w3.org/TR/SMIL3/smil-timing.html#q142
48 (mkdir-p "org/w3c/dom/smil")
49 (call-with-output-file "org/w3c/dom/smil/ElementTimeControl.java"
50 (lambda (port)
51 (format port "
52 package org.w3c.dom.smil;
53
54 import org.w3c.dom.DOMException;
55
56 public interface ElementTimeControl {
57 public boolean beginElement();
58
59 public boolean beginElementAt(float offset);
60
61 public boolean endElement();
62
63 public boolean endElementAt(float offset);
64 }
65 ")))
66 (call-with-output-file "org/w3c/dom/smil/TimeEvent.java"
67 (lambda (port)
68 (format port "
69 package org.w3c.dom.smil;
70
71 import org.w3c.dom.events.Event;
72 import org.w3c.dom.views.AbstractView;
73
74 public interface TimeEvent extends Event {
75 public AbstractView getView();
76
77 public int getDetail();
78
79 public void initTimeEvent(String typeArg,
80 AbstractView viewArg,
81 int detailArg);
82
83 }
84 ")))
85 #t)))))
86 (native-inputs
87 `(("unzip" ,unzip)))
88 (home-page "https://www.w3.org/Style/CSS/SAC/")
89 (synopsis "W3C SAC interface for CSS parsers in Java")
90 (description "This package provides a SAC interface by the W3C.
91 SAC is an interface for CSS parsers.")
92 (license license:w3c)))
93
94 (define-public java-w3c-svg-1.0
95 (package
96 (name "java-w3c-svg")
97 (version "20010904")
98 (source
99 (origin
100 (method url-fetch)
101 (uri (string-append "http://www.w3.org/TR/2001/REC-SVG-" version
102 "/java-binding.zip"))
103 (sha256
104 (base32
105 "0gnxvx51bg6ijplf6l2q0i1m07101f7fickawshfygnsdjqfdnbp"))))
106 (build-system ant-build-system)
107 (arguments
108 `(#:jar-name "w3c-svg.jar"
109 #:source-dir "."
110 #:tests? #f ; No tests exist.
111 #:phases
112 (modify-phases %standard-phases
113 (replace 'unpack
114 (lambda* (#:key source #:allow-other-keys)
115 (invoke "unzip" source)))
116 (add-after 'unpack 'patch-interface
117 (lambda _
118 ;; Make it compatible with batik.
119 ;; This is equivalent to usingxml commons externals'
120 ;; "externals" part from https://xerces.apache.org/mirrors.cgi
121 (substitute* "SVGFEConvolveMatrixElement.java"
122 (("public SVGAnimatedLength[ ]*getKernelUnitLength")
123 "public SVGAnimatedNumber getKernelUnitLength"))
124 (substitute* "SVGFEMorphologyElement.java"
125 (("public SVGAnimatedLength[ ]*getRadius")
126 "public SVGAnimatedNumber getRadius"))
127 (call-with-output-file "EventListenerInitializer.java"
128 (lambda (port)
129 (format port "
130 // License: http://www.apache.org/licenses/LICENSE-2.0
131 package org.w3c.dom.svg;
132 public interface EventListenerInitializer {
133 public void initializeEventListeners(SVGDocument doc);
134 }
135
136 ")))
137 #t)))))
138 (propagated-inputs
139 `(("java-w3c-smil" ,java-w3c-smil-3.0)))
140 (native-inputs
141 `(("unzip" ,unzip)))
142 (home-page "https://www.w3.org/Style/CSS/SAC/")
143 (synopsis "W3C SVG 1.0 interface")
144 (description "This package provides a SVG 1.0 interface.")
145 (license license:w3c)))
146
147 (define-public java-w3c-svg
148 (package
149 (inherit java-w3c-svg-1.0)
150 (version "20110816")
151 (source
152 (origin
153 (method url-fetch)
154 (uri (string-append "http://www.w3.org/TR/2011/REC-SVG11-" version
155 "/java-binding.zip"))
156 (sha256
157 (base32
158 "0jicqcrxav8ggs37amgvvwgc2f0qp1c5wns4rb2i3si83s2m09ns"))))
159 (arguments
160 (substitute-keyword-arguments (package-arguments java-w3c-svg-1.0)
161 ((#:phases phases)
162 `(modify-phases ,phases
163 (delete 'patch-interface)))))
164 (propagated-inputs
165 `())
166 (synopsis "W3C SVG interface")
167 (description "This package provides a SVG interface.")))
168
169 (define-public java-w3c-sac
170 (package
171 (name "java-w3c-sac")
172 (version "1.3")
173 (source
174 (origin
175 (method url-fetch)
176 (uri (string-append "https://www.w3.org/2002/06/sacjava-" version
177 ".zip"))
178 (sha256
179 (base32
180 "1djp2nnzf8jchnwz1ij9i5jfx4cg1ryf3lbw133yzjy0wkhcla52"))))
181 (build-system ant-build-system)
182 (arguments
183 `(#:jar-name "w3c-sac.jar"
184 #:source-dir "sac-1.3"
185 #:tests? #f ; No tests exist.
186 #:phases
187 (modify-phases %standard-phases
188 (replace 'unpack
189 (lambda* (#:key source #:allow-other-keys)
190 (invoke "unzip" source))))))
191 (native-inputs
192 `(("unzip" ,unzip)))
193 (home-page "https://www.w3.org/Style/CSS/SAC/")
194 (synopsis "W3C SAC interface for CSS parsers in Java")
195 (description "This package provides a SAC interface by the W3C.
196 SAC is an interface for CSS parsers.")
197 (license license:w3c)))
198
199 (define-public java-xmlgraphics-commons
200 (package
201 (name "java-xmlgraphics-commons")
202 (version "2.6")
203 (source
204 (origin
205 (method url-fetch)
206 (uri (string-append
207 "mirror://apache/xmlgraphics/commons/source/xmlgraphics-commons-"
208 version "-src.tar.gz"))
209 (sha256
210 (base32 "18gndjwzdd6vhp59fn8cwn6i6q0v0ym8nmwn65rcykdrzz0nvl72"))
211 (modules '((guix build utils)))
212 (snippet
213 `(begin
214 (delete-file-recursively "lib")
215 #t))))
216 (build-system ant-build-system)
217 (arguments
218 `(#:build-target "jar-main"
219 #:test-target "junit"
220 #:phases
221 (modify-phases %standard-phases
222 (add-after 'unpack 'make-reproducible
223 (lambda _
224 (substitute* "build.xml"
225 (("<attribute name=\"Build-Id\" value=\"[^\"]*\"")
226 "<attribute name=\"Build-Id\" value=\"\""))
227 #t))
228 (add-before 'build 'prepare-build-directories
229 (lambda _
230 (mkdir "lib")
231 (mkdir "lib/build")
232 #t))
233 (replace 'install
234 (lambda* (#:key outputs #:allow-other-keys)
235 (let* ((out (assoc-ref outputs "out"))
236 (out-share (string-append out "/share/java")))
237 (for-each (lambda (name)
238 (install-file name out-share))
239 (find-files "build"
240 "xmlgraphics-commons.*\\.jar$"))
241 #t))))))
242 (native-inputs
243 `(("java-apache-xml-commons-resolver" ,java-apache-xml-commons-resolver)
244 ("java-asm" ,java-asm)
245 ("java-cglib" ,java-cglib)
246 ("java-hamcrest" ,java-hamcrest-core)
247 ("java-junit" ,java-junit)
248 ("java-mockito" ,java-mockito-1)
249 ("java-objenesis" ,java-objenesis)))
250 (propagated-inputs
251 `(("java-commons-io" ,java-commons-io)
252 ("java-commons-logging-minimal" ,java-commons-logging-minimal)))
253 (home-page "https://xmlgraphics.apache.org/commons/")
254 (synopsis "XMLGraphics constants")
255 (description "This package provides XMLGraphics constants (originally
256 from @code{batik}).")
257 (license license:asl2.0)))