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>
5 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
33 (define-public java-w3c-smil-3.0
35 (name "java-w3c-smil")
38 (build-system ant-build-system)
40 `(#:jar-name "w3c-smil.jar"
42 #:tests? #f ; No tests exist.
44 (modify-phases %standard-phases
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"
52 package org.w3c.dom.smil;
54 import org.w3c.dom.DOMException;
56 public interface ElementTimeControl {
57 public boolean beginElement();
59 public boolean beginElementAt(float offset);
61 public boolean endElement();
63 public boolean endElementAt(float offset);
66 (call-with-output-file "org/w3c/dom/smil/TimeEvent.java"
69 package org.w3c.dom.smil;
71 import org.w3c.dom.events.Event;
72 import org.w3c.dom.views.AbstractView;
74 public interface TimeEvent extends Event {
75 public AbstractView getView();
77 public int getDetail();
79 public void initTimeEvent(String typeArg,
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)))
94 (define-public java-w3c-svg-1.0
101 (uri (string-append "http://www.w3.org/TR/2001/REC-SVG-" version
102 "/java-binding.zip"))
105 "0gnxvx51bg6ijplf6l2q0i1m07101f7fickawshfygnsdjqfdnbp"))))
106 (build-system ant-build-system)
108 `(#:jar-name "w3c-svg.jar"
110 #:tests? #f ; No tests exist.
112 (modify-phases %standard-phases
114 (lambda* (#:key source #:allow-other-keys)
115 (invoke "unzip" source)))
116 (add-after 'unpack 'patch-interface
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"
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);
139 `(("java-w3c-smil" ,java-w3c-smil-3.0)))
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)))
147 (define-public java-w3c-svg
149 (inherit java-w3c-svg-1.0)
154 (uri (string-append "http://www.w3.org/TR/2011/REC-SVG11-" version
155 "/java-binding.zip"))
158 "0jicqcrxav8ggs37amgvvwgc2f0qp1c5wns4rb2i3si83s2m09ns"))))
160 (substitute-keyword-arguments (package-arguments java-w3c-svg-1.0)
162 `(modify-phases ,phases
163 (delete 'patch-interface)))))
166 (synopsis "W3C SVG interface")
167 (description "This package provides a SVG interface.")))
169 (define-public java-w3c-sac
171 (name "java-w3c-sac")
176 (uri (string-append "https://www.w3.org/2002/06/sacjava-" version
180 "1djp2nnzf8jchnwz1ij9i5jfx4cg1ryf3lbw133yzjy0wkhcla52"))))
181 (build-system ant-build-system)
183 `(#:jar-name "w3c-sac.jar"
184 #:source-dir "sac-1.3"
185 #:tests? #f ; No tests exist.
187 (modify-phases %standard-phases
189 (lambda* (#:key source #:allow-other-keys)
190 (invoke "unzip" source))))))
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)))
199 (define-public java-xmlgraphics-commons
201 (name "java-xmlgraphics-commons")
207 "mirror://apache/xmlgraphics/commons/source/xmlgraphics-commons-"
208 version "-src.tar.gz"))
210 (base32 "18gndjwzdd6vhp59fn8cwn6i6q0v0ym8nmwn65rcykdrzz0nvl72"))
211 (modules '((guix build utils)))
214 (delete-file-recursively "lib")
216 (build-system ant-build-system)
218 `(#:build-target "jar-main"
219 #:test-target "junit"
221 (modify-phases %standard-phases
222 (add-after 'unpack 'make-reproducible
224 (substitute* "build.xml"
225 (("<attribute name=\"Build-Id\" value=\"[^\"]*\"")
226 "<attribute name=\"Build-Id\" value=\"\""))
228 (add-before 'build 'prepare-build-directories
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))
240 "xmlgraphics-commons.*\\.jar$"))
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)))
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)))