1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2018 Danny Milosavljevic <dannym@scratchpost.org>
4 ;;; This file is part of GNU Guix.
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.
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.
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/>.
19 (define-module (gnu packages batik)
20 #:use-module ((guix licenses) #:prefix license:)
21 #:use-module (guix utils)
22 #:use-module (guix download)
23 #:use-module (guix git-download)
24 #:use-module (guix packages)
25 #:use-module (guix build-system ant)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages compression)
28 #:use-module (gnu packages java)
29 #:use-module (gnu packages textutils)
30 #:use-module (gnu packages xml))
32 (define-public java-w3c-smil-3.0
34 (name "java-w3c-smil")
37 (build-system ant-build-system)
39 `(#:jar-name "w3c-smil.jar"
41 #:tests? #f ; No tests exist.
43 (modify-phases %standard-phases
45 (lambda* (#:key source #:allow-other-keys)
46 ;; https://www.w3.org/TR/SMIL3/smil-timing.html#q142
47 (mkdir-p "org/w3c/dom/smil")
48 (call-with-output-file "org/w3c/dom/smil/ElementTimeControl.java"
51 package org.w3c.dom.smil;
53 import org.w3c.dom.DOMException;
55 public interface ElementTimeControl {
56 public boolean beginElement();
58 public boolean beginElementAt(float offset);
60 public boolean endElement();
62 public boolean endElementAt(float offset);
65 (call-with-output-file "org/w3c/dom/smil/TimeEvent.java"
68 package org.w3c.dom.smil;
70 import org.w3c.dom.events.Event;
71 import org.w3c.dom.views.AbstractView;
73 public interface TimeEvent extends Event {
74 public AbstractView getView();
76 public int getDetail();
78 public void initTimeEvent(String typeArg,
87 (home-page "https://www.w3.org/Style/CSS/SAC/")
88 (synopsis "W3C SAC interface for CSS parsers in Java")
89 (description "This package provides a SAC interface by the W3C.
90 SAC is an interface for CSS parsers.")
91 (license license:w3c)))
93 (define-public java-w3c-svg-1.0
100 (uri (string-append "http://www.w3.org/TR/2001/REC-SVG-" version
101 "/java-binding.zip"))
104 "0gnxvx51bg6ijplf6l2q0i1m07101f7fickawshfygnsdjqfdnbp"))))
105 (build-system ant-build-system)
107 `(#:jar-name "w3c-svg.jar"
109 #:tests? #f ; No tests exist.
111 (modify-phases %standard-phases
113 (lambda* (#:key source #:allow-other-keys)
114 (invoke "unzip" source)))
115 (add-after 'unpack 'patch-interface
117 ;; Make it compatible with batik.
118 ;; This is equivalent to usingxml commons externals'
119 ;; "externals" part from https://xerces.apache.org/mirrors.cgi
120 (substitute* "SVGFEConvolveMatrixElement.java"
121 (("public SVGAnimatedLength[ ]*getKernelUnitLength")
122 "public SVGAnimatedNumber getKernelUnitLength"))
123 (substitute* "SVGFEMorphologyElement.java"
124 (("public SVGAnimatedLength[ ]*getRadius")
125 "public SVGAnimatedNumber getRadius"))
126 (call-with-output-file "EventListenerInitializer.java"
129 // License: http://www.apache.org/licenses/LICENSE-2.0
130 package org.w3c.dom.svg;
131 public interface EventListenerInitializer {
132 public void initializeEventListeners(SVGDocument doc);
138 `(("java-w3c-smil" ,java-w3c-smil-3.0)))
141 (home-page "https://www.w3.org/Style/CSS/SAC/")
142 (synopsis "W3C SVG 1.0 interface")
143 (description "This package provides a SVG 1.0 interface.")
144 (license license:w3c)))
146 (define-public java-w3c-svg
148 (inherit java-w3c-svg-1.0)
153 (uri (string-append "http://www.w3.org/TR/2011/REC-SVG11-" version
154 "/java-binding.zip"))
157 "0jicqcrxav8ggs37amgvvwgc2f0qp1c5wns4rb2i3si83s2m09ns"))))
159 (substitute-keyword-arguments (package-arguments java-w3c-svg-1.0)
161 `(modify-phases ,phases
162 (delete 'patch-interface)))))
165 (synopsis "W3C SVG interface")
166 (description "This package provides a SVG interface.")))
168 (define-public java-w3c-sac
170 (name "java-w3c-sac")
175 (uri (string-append "https://www.w3.org/2002/06/sacjava-" version
179 "1djp2nnzf8jchnwz1ij9i5jfx4cg1ryf3lbw133yzjy0wkhcla52"))))
180 (build-system ant-build-system)
182 `(#:jar-name "w3c-sac.jar"
183 #:source-dir "sac-1.3"
184 #:tests? #f ; No tests exist.
186 (modify-phases %standard-phases
188 (lambda* (#:key source #:allow-other-keys)
189 (invoke "unzip" source))))))
192 (home-page "https://www.w3.org/Style/CSS/SAC/")
193 (synopsis "W3C SAC interface for CSS parsers in Java")
194 (description "This package provides a SAC interface by the W3C.
195 SAC is an interface for CSS parsers.")
196 (license license:w3c)))
198 (define-public java-xmlgraphics-commons
200 (name "java-xmlgraphics-commons")
206 "mirror://apache/xmlgraphics/commons/source/xmlgraphics-commons-"
207 version "-src.tar.gz"))
210 "0a432a4ca3vgnbada5cy9mlmfzmq6hi4i176drfxrp17q2d43w23"))
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)))