Subject: [bug#32947] [PATCH 3/3] gnu: Add java-xalan.

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

* gnu/packages/java.scm (java-xalan): New variable.
---
 gnu/packages/java.scm | 54 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 863a4b79c..02a8f65e8 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -9709,6 +9709,60 @@ the DOM level 3 load/save API's are in use.")
 for Java.")
     (license license:asl2.0)))
 
+(define-public java-xalan
+  (package
+    (name "java-xalan")
+    (version "2.7.2")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append "https://archive.apache.org/dist/xalan/xalan-j/source/"
+                            "xalan-j_" (string-join (string-split version #\.) "_")
+                            "-src.tar.gz"))
+        (sha256
+         (base32
+          "166vg9i11qzi0vbv09abfb50q8caq8wr6zrwg0cwqws9k394l62w"))))
+    (build-system ant-build-system)
+    (arguments
+     `(#:build-target "jar"
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-classpath
+           (lambda _
+             (substitute* "src/MANIFEST.MF"
+              (("^Class-Path: .*$") "\n"))
+             #t))
+         (add-after 'unpack 'replace-prebuilt-jars
+           (lambda* (#:key inputs #:allow-other-keys)
+             (for-each delete-file
+                       (find-files "." "\\.jar$"))
+             (symlink (string-append (assoc-ref inputs "java-commons-bcel")
+                                     "/share/java/bcel.jar")
+                      "lib/BCEL.jar")
+             (symlink (string-append (assoc-ref inputs "java-cup")
+                                     "/share/java/java-cup-11b-runtime.jar")
+                      "lib/runtime.jar")
+             (symlink (string-append (assoc-ref inputs "java-jakarta-regexp")
+                                     "/share/java/jakarta-regexp-1.5.jar")
+                      "lib/regexp.jar")
+             #t))
+          (replace 'install
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))
+                     (out-share (string-append out "/share/java")))
+                (mkdir-p out-share)
+                (install-file "build/xalan.jar" out-share)
+                #t))))))
+    (propagated-inputs
+     `(("java-commons-bcel" ,java-commons-bcel)
+       ("java-cup" ,java-cup)
+       ("java-jakarta-regexp" ,java-jakarta-regexp)
+       ("java-xerces" ,java-xerces)))
+    (home-page "https://xml.apache.org/xalan-j/")
+    (synopsis "XSLT processor for Java")
+    (description "@code{xalan} is an XSLT processor for Java.")
+    (license license:asl2.0)))
+
 (define-public java-jline
   (package
     (name "java-jline")