[bug#32947] Add java-xalan.
Commit Message
From 4c867018a167053018a67fce43eb91a01a4112da Mon Sep 17 00:00:00 2001
Message-Id: <4c867018a167053018a67fce43eb91a01a4112da.1647998883.git.frank.pursel@gmail.com>
From: Frank Pursel <frank.pursel@gmail.com>
Date: Wed, 23 Feb 2022 13:59:26 -0800
Subject: [PATCH] gnu: Add java-xalan-interp
* gnu/packages/xml.scm (java-xalan-interp): New variable
---
gnu/packages/xml.scm | 61 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)
@@ -33,6 +33,8 @@
;;; 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>
+;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -2592,3 +2594,62 @@ (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
+ (for-each
+ delete-file
+ (cons*
+ ;; jflex and cup generated files
+ ;; for removal
+ "src/org/apache/xalan/xsltc/compiler/XPathLexer.java"
+ "src/org/apache/xalan/xsltc/compiler/XPathParser.java"
+ ;; Removing bundled jars
+ (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 license:asl2.0)))