Subject: [PATCH 06/21] gnu: Add java-w3c-smil.

From: Danny Milosavljevic <[email-masked]>
Date: Fri, 5 Oct 2018 17:50:07 +0200

* gnu/packages/batik.scm (java-w3c-smil-3.0): New variable.
---
 gnu/packages/batik.scm | 61 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/batik.scm b/gnu/packages/batik.scm
index b5672bb20..88be05042 100644
--- a/gnu/packages/batik.scm
+++ b/gnu/packages/batik.scm
@@ -103,3 +103,64 @@
 (define-public java-batik-ext
   (java-batik-package "batik-ext"
    `()))
+
+(define-public java-w3c-smil-3.0
+  (package
+    (name "java-w3c-smil")
+    (version "3.0")
+    (source #f)
+    (build-system ant-build-system)
+    (arguments
+     `(#:jar-name "w3c-smil.jar"
+       #:source-dir "."
+       #:tests? #f ; No tests exist.
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'unpack
+           (lambda* (#:key source #:allow-other-keys)
+             ;; https://www.w3.org/TR/SMIL3/smil-timing.html#q142
+             (mkdir-p "org/w3c/dom/smil")
+             (call-with-output-file "org/w3c/dom/smil/ElementTimeControl.java"
+               (lambda (port)
+                 (format port "
+package org.w3c.dom.smil;
+
+import org.w3c.dom.DOMException;
+
+public interface ElementTimeControl {
+    public boolean  beginElement();
+
+    public boolean  beginElementAt(float offset);
+
+    public boolean endElement();
+
+    public boolean endElementAt(float offset);
+}
+")))
+             (call-with-output-file "org/w3c/dom/smil/TimeEvent.java"
+               (lambda (port)
+                 (format port "
+package org.w3c.dom.smil;
+
+import org.w3c.dom.events.Event;
+import org.w3c.dom.views.AbstractView;
+
+public interface TimeEvent extends Event {
+    public AbstractView getView();
+
+    public int getDetail();
+
+    public void initTimeEvent(String typeArg,
+                              AbstractView viewArg,
+                              int detailArg);
+
+}
+")))
+             #t)))))
+    (native-inputs
+     `(("unzip" ,unzip)))
+    (home-page "https://www.w3.org/Style/CSS/SAC/")
+    (synopsis "W3C SAC interface for CSS parsers in Java")
+    (description "This package provides a SAC interface by the W3C.
+SAC is an interface for CSS parsers.")
+    (license license:w3c)))