[bug#32947] Add java-xalan.
Commit Message
From 21400e9165ccee0a72c62eb0def9f52fdfdf5d06 Mon Sep 17 00:00:00 2001
From: Frank Pursel <frank.pursel@gmail.com>
Date: Fri, 18 Mar 2022 19:16:57 +0000
Subject: [PATCH] gnu: Add java-xalan-interp
* gnu/packages/xml.scm (java-xalan-interp): New variable
---
gnu/packages/xml.scm | 59 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
@@ -33,6 +33,7 @@
;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
;;; Copyright © 2021 David Larsson <david.larsson@selfhosted.xyz>
;;; Copyright © 2021 Matthew James Kraai <kraai@ftbfs.org>
+;;; Copyright © 2022 Frank Pursel <frank.pursel@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -2592,3 +2593,61 @@ (define-public python-xmltodict
(description "This package provides a Python library to convert XML to
@code{OrderedDict}.")
(license license:expat)))
+
+(define-public java-xalan-interp
+ (package
+ (name "java-xalan-interp")
+ (version "2.7.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "mirror://apache/xalan/xalan-j/source/xalan-j_"
+ (string-replace-substring
+ version "." "_")
+ "-src.tar.gz"))
+ (sha256
+ (base32 "166vg9i11qzi0vbv09abfb50q8caq8wr6zrwg0cwqws9k394l62w"))
+ (modules '((guix build utils)))
+ (snippet '(begin
+ ;; Removing bundled tars and jars
+ (for-each
+ delete-file
+ (find-files "." "\\.(jar|tar\\.gz)$"))))))
+ (build-system ant-build-system)
+ (arguments
+ `(#:phases (modify-phases
+ %standard-phases
+ (add-after 'unpack 'prepare-for-build
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (setenv "ANT_OPTS" "-Dxsltc.java_cup.not_needed=true")
+ (substitute* "build.xml"
+ ;; Only the interpretive compiler. xsltc contains a
+ ;; circular reference java_cup.
+ (("(<target name=\"jar\" depends=\"xalan-interpretive.compile),.*"
+ all pre)
+ (string-append pre "\""))
+ (("xml-apis") "jaxp"))
+ (substitute* (list "src/MANIFEST.MF"
+ "src/manifest.xalan-interpretive"
+ "src/MANIFEST.SERIALIZER"
+ "src/manifest.xsltc")
+ ;; This stops the indexing phase from searching for
+ ;; xml-apis in the wrong location -- java-xerces and
+ ;; java-jaxp are propagated, so the eventual Java
+ ;; application package will still have access to it.
+ (("^Class-Path:(.*)$") ""))))
+ (replace 'install
+ (install-jars "build")))))
+ (native-inputs (list java-junit java-hamcrest-core))
+ (propagated-inputs (list java-jaxp java-xerces))
+ (home-page "https://xalan.apache.org/xalan-j/index.html")
+ (synopsis "Java XSLT processor")
+ (description "XSLT processor in java implementing XSLT Version 1.0, XPath
+Version 1.0, and JAXP 1.3. It builds on SAX2 and DOM level 3. This version
+is the fully functional interpreter, xslt, not the xsltc version which may be
+faster.")
+ (license (list license:asl2.0 ; almost everything
+ ;; samples/AppletXMLtoHTML/rabbitwhorn.jpg, according to
+ ;; <https://commons.wikimedia.org/wiki/File:Alice_par_John_Tenniel_37.png>
+ license:public-domain)
+ )))