[PATCH 0/3] Add java-xalan.

  • Open
  • quality assurance status badge
Details
5 participants
  • Danny Milosavljevic
  • Frank Pursel
  • Julien Lepiller
  • Maxime Devos
  • Vagrant Cascadian
Owner
unassigned
Submitted by
Danny Milosavljevic
Severity
normal
D
D
Danny Milosavljevic wrote on 5 Oct 2018 17:18
(address . guix-patches@gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20181005151859.9616-1-dannym@scratchpost.org
Danny Milosavljevic (3):
gnu: Add java-cup.
gnu: Add java-jakarta-regexp.
gnu: Add java-xalan.

gnu/packages/java.scm | 129 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 129 insertions(+)
D
D
Danny Milosavljevic wrote on 5 Oct 2018 17:20
[PATCH 1/3] gnu: Add java-cup.
(address . 32947@debbugs.gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20181005152044.9682-1-dannym@scratchpost.org
* gnu/packages/java.scm (java-cup): New variable.
---
gnu/packages/java.scm | 44 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)

Toggle diff (62 lines)
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 96da495c2..4ddffb357 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -69,6 +69,7 @@
#:use-module (gnu packages perl)
#:use-module (gnu packages popt)
#:use-module (gnu packages kerberos)
+ #:use-module (gnu packages version-control)
#:use-module (gnu packages xml)
#:use-module (gnu packages xorg)
#:use-module (gnu packages texinfo)
@@ -9634,6 +9635,49 @@ Candidate Recommendation, and will correctly serialize XML 1.1 documents if
the DOM level 3 load/save API's are in use.")
(license license:asl2.0)))
+(define-public java-cup
+ (package
+ (name "java-cupx")
+ (version "11b-20160615")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "http://www2.cs.tum.edu/projects/cup/releases/java-cup-src-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1ymz3plngxclh7x3xr31537rvvak7lwyd0qkmnl1mkj5drh77rz0"))))
+ (build-system ant-build-system)
+ (arguments
+ `(#:build-target "dist"
+ #:test-target "test"
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'remove-prebuilt-jars
+ (lambda _
+ (for-each delete-file
+ (find-files "." "\\.jar$"))
+ #t))
+ (add-before 'build 'chdir
+ (lambda _
+ (chdir "..")
+ #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 "dist/java-cup-11b-runtime.jar" out-share)
+ (install-file "dist/java-cup-11b.jar" out-share)
+ #t))))))
+ (native-inputs
+ `(("git" ,git)))
+ (home-page "http://www2.cs.tum.edu/projects/cup/")
+ (synopsis "LALR parser generator for Java")
+ (description "@code{java_cup} is a LALR parser generator for Java.")
+ (license license:asl2.0)))
+
(define-public java-jline
(package
(name "java-jline")
D
D
Danny Milosavljevic wrote on 5 Oct 2018 17:20
[PATCH 2/3] gnu: Add java-jakarta-regexp.
(address . 32947@debbugs.gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20181005152044.9682-2-dannym@scratchpost.org
* gnu/packages/java.scm (java-jakarta-regexp): New variable.
---
gnu/packages/java.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)

Toggle diff (42 lines)
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 4ddffb357..863a4b79c 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -9678,6 +9678,37 @@ the DOM level 3 load/save API's are in use.")
(description "@code{java_cup} is a LALR parser generator for Java.")
(license license:asl2.0)))
+(define-public java-jakarta-regexp
+ (package
+ (name "java-jakarta-regexp")
+ (version "1.5")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://archive.apache.org/dist/jakarta/regexp/jakarta-regexp-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "0zg9rmyif48dck0cv6ynpxv23mmcsx265am1fnnxss7brgw0ms3r"))))
+ (build-system ant-build-system)
+ (arguments
+ `(#:test-target "test"
+ #:phases
+ (modify-phases %standard-phases
+ (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/jakarta-regexp-1.5.jar" out-share)
+ #t))))))
+ (home-page "https://attic.apache.org/projects/jakarta-regexp.html")
+ (synopsis "Regular expression parser generator for Java.")
+ (description "@code{jakarta-regexp} is an old regular expression parser generator
+for Java.")
+ (license license:asl2.0)))
+
(define-public java-jline
(package
(name "java-jline")
D
D
Danny Milosavljevic wrote on 5 Oct 2018 17:20
[PATCH 3/3] gnu: Add java-xalan.
(address . 32947@debbugs.gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20181005152044.9682-3-dannym@scratchpost.org
* gnu/packages/java.scm (java-xalan): New variable.
---
gnu/packages/java.scm | 54 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)

Toggle diff (65 lines)
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")
J
J
Julien Lepiller wrote on 5 Oct 2018 17:28
Re: [bug#32947] [PATCH 1/3] gnu: Add java-cup.
(address . guix-patches@gnu.org)
9094b40c6c25c077212da6428dcc30dc@lepiller.eu
Le 2018-10-05 17:20, Danny Milosavljevic a écrit :
Toggle quote (26 lines)
> * gnu/packages/java.scm (java-cup): New variable.
> ---
> gnu/packages/java.scm | 44 +++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 44 insertions(+)
>
> diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
> index 96da495c2..4ddffb357 100644
> --- a/gnu/packages/java.scm
> +++ b/gnu/packages/java.scm
> @@ -69,6 +69,7 @@
> #:use-module (gnu packages perl)
> #:use-module (gnu packages popt)
> #:use-module (gnu packages kerberos)
> + #:use-module (gnu packages version-control)
> #:use-module (gnu packages xml)
> #:use-module (gnu packages xorg)
> #:use-module (gnu packages texinfo)
> @@ -9634,6 +9635,49 @@ Candidate Recommendation, and will correctly
> serialize XML 1.1 documents if
> the DOM level 3 load/save API's are in use.")
> (license license:asl2.0)))
>
> +(define-public java-cup
> + (package
> + (name "java-cupx")

Why x?

Toggle quote (23 lines)
> + (version "11b-20160615")
> + (source
> + (origin
> + (method url-fetch)
> + (uri (string-append
> +
> "http://www2.cs.tum.edu/projects/cup/releases/java-cup-src-"
> + version ".tar.gz"))
> + (sha256
> + (base32
> + "1ymz3plngxclh7x3xr31537rvvak7lwyd0qkmnl1mkj5drh77rz0"))))
> + (build-system ant-build-system)
> + (arguments
> + `(#:build-target "dist"
> + #:test-target "test"
> + #:phases
> + (modify-phases %standard-phases
> + (add-after 'unpack 'remove-prebuilt-jars
> + (lambda _
> + (for-each delete-file
> + (find-files "." "\\.jar$"))
> + #t))

Maybe that should be a snippet?

Toggle quote (25 lines)
> + (add-before 'build 'chdir
> + (lambda _
> + (chdir "..")
> + #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 "dist/java-cup-11b-runtime.jar"
> out-share)
> + (install-file "dist/java-cup-11b.jar" out-share)
> + #t))))))
> + (native-inputs
> + `(("git" ,git)))
> + (home-page "http://www2.cs.tum.edu/projects/cup/")
> + (synopsis "LALR parser generator for Java")
> + (description "@code{java_cup} is a LALR parser generator for
> Java.")
> + (license license:asl2.0)))
> +
> (define-public java-jline
> (package
> (name "java-jline")

I don't know if that's an issue, but the source code bundles generated
source by java-cup and jflex. I've tried to bootstrap both correctly,
but there is no version of jflex you can build without jflex and cup. I
have a recipe for java-jflex and java-cup that are built without
pre-generated source, using two bootstrap jars. Then, I could use them
to build other packages that I need for the future maven-build-system. I
wasn't able to build java-jflex with the latest java-cup.

Do you want me to send these recipes for comparison?
J
J
Julien Lepiller wrote on 5 Oct 2018 17:46
Re: [bug#32947] [PATCH 3/3] gnu: Add java-xalan.
(address . 32947@debbugs.gnu.org)
632a8e0a9673625822fe221e7c4c5812@lepiller.eu
Le 2018-10-05 17:20, Danny Milosavljevic a écrit :
Toggle quote (26 lines)
> * 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"))

Could you use mirror://apache/xalan/xalan-j/source/...?

Toggle quote (18 lines)
> + (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$"))

I think it's better to remove these files in a snippet. Also, there are
.tar.gz files in the source archive that we could remove.

Toggle quote (14 lines)
> + (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")

maybe something like
(let ((regexp (assoc-ref inputs "java-jakarta-regexp")))
(symlink (string-append regexp "/share/java/javakarta-regexp-"
(package-version regexp) ".jar")
"lib/regexp.jar"))

would be more future-proof in case we update regexp? Same with the other
dependencies.

Toggle quote (21 lines)
> + #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")
J
J
Julien Lepiller wrote on 5 Oct 2018 17:52
Re: [bug#32947] [PATCH 1/3] gnu: Add java-cup.
(address . 32947@debbugs.gnu.org)
12a8c86e964c3ed3205ec19fe2bd191b@lepiller.eu
Le 2018-10-05 17:20, Danny Milosavljevic a écrit :
Toggle quote (26 lines)
> * gnu/packages/java.scm (java-cup): New variable.
> ---
> gnu/packages/java.scm | 44 +++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 44 insertions(+)
>
> diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
> index 96da495c2..4ddffb357 100644
> --- a/gnu/packages/java.scm
> +++ b/gnu/packages/java.scm
> @@ -69,6 +69,7 @@
> #:use-module (gnu packages perl)
> #:use-module (gnu packages popt)
> #:use-module (gnu packages kerberos)
> + #:use-module (gnu packages version-control)
> #:use-module (gnu packages xml)
> #:use-module (gnu packages xorg)
> #:use-module (gnu packages texinfo)
> @@ -9634,6 +9635,49 @@ Candidate Recommendation, and will correctly
> serialize XML 1.1 documents if
> the DOM level 3 load/save API's are in use.")
> (license license:asl2.0)))
>
> +(define-public java-cup
> + (package
> + (name "java-cupx")

Why x?

Toggle quote (23 lines)
> + (version "11b-20160615")
> + (source
> + (origin
> + (method url-fetch)
> + (uri (string-append
> +
> "http://www2.cs.tum.edu/projects/cup/releases/java-cup-src-"
> + version ".tar.gz"))
> + (sha256
> + (base32
> + "1ymz3plngxclh7x3xr31537rvvak7lwyd0qkmnl1mkj5drh77rz0"))))
> + (build-system ant-build-system)
> + (arguments
> + `(#:build-target "dist"
> + #:test-target "test"
> + #:phases
> + (modify-phases %standard-phases
> + (add-after 'unpack 'remove-prebuilt-jars
> + (lambda _
> + (for-each delete-file
> + (find-files "." "\\.jar$"))
> + #t))

Maybe use a snippet instead?

Toggle quote (25 lines)
> + (add-before 'build 'chdir
> + (lambda _
> + (chdir "..")
> + #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 "dist/java-cup-11b-runtime.jar"
> out-share)
> + (install-file "dist/java-cup-11b.jar" out-share)
> + #t))))))
> + (native-inputs
> + `(("git" ,git)))
> + (home-page "http://www2.cs.tum.edu/projects/cup/")
> + (synopsis "LALR parser generator for Java")
> + (description "@code{java_cup} is a LALR parser generator for
> Java.")
> + (license license:asl2.0)))
> +
> (define-public java-jline
> (package
> (name "java-jline")

I don't know if that's an issue, but the source code bundles generated
source by java-cup and jflex. I've tried to bootstrap both correctly,
but there is no version of jflex you can build without jflex and cup. I
have a recipe for java-jflex and java-cup that are built without
pre-generated source, using two bootstrap jars. Then, I could use them
to build other packages that I need for the future maven-build-system. I
wasn't able to build java-jflex with the latest java-cup.

Do you want me to send these recipes for comparison?
D
D
Danny Milosavljevic wrote on 5 Oct 2018 18:00
(name . Julien Lepiller)(address . julien@lepiller.eu)(address . 32947@debbugs.gnu.org)
20181005180048.56b2ff27@scratchpost.org
Hi Julien,

On Fri, 05 Oct 2018 17:28:51 +0200
Julien Lepiller <julien@lepiller.eu> wrote:

Toggle quote (29 lines)
> Le 2018-10-05 17:20, Danny Milosavljevic a écrit :
> > * gnu/packages/java.scm (java-cup): New variable.
> > ---
> > gnu/packages/java.scm | 44 +++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 44 insertions(+)
> >
> > diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
> > index 96da495c2..4ddffb357 100644
> > --- a/gnu/packages/java.scm
> > +++ b/gnu/packages/java.scm
> > @@ -69,6 +69,7 @@
> > #:use-module (gnu packages perl)
> > #:use-module (gnu packages popt)
> > #:use-module (gnu packages kerberos)
> > + #:use-module (gnu packages version-control)
> > #:use-module (gnu packages xml)
> > #:use-module (gnu packages xorg)
> > #:use-module (gnu packages texinfo)
> > @@ -9634,6 +9635,49 @@ Candidate Recommendation, and will correctly
> > serialize XML 1.1 documents if
> > the DOM level 3 load/save API's are in use.")
> > (license license:asl2.0)))
> >
> > +(define-public java-cup
> > + (package
> > + (name "java-cupx")
>
> Why x?

Leftover from testing. Dunno how they always slip though :)

Toggle quote (2 lines)
> Maybe that should be a snippet?

Often I had problems that the entire "unpack" phase suddenly unpacked
nothing when I tried to do that in a snippet. I'll try it with this package.

Toggle quote (4 lines)
> I don't know if that's an issue, but the source code bundles generated
> source by java-cup and jflex. I've tried to bootstrap both correctly,
> but there is no version of jflex you can build without jflex and cup.

Oops, that's pretty bad.

Toggle quote (6 lines)
>I have a recipe for java-jflex and java-cup that are built without
> pre-generated source, using two bootstrap jars. Then, I could use them
> to build other packages that I need for the future maven-build-system. I
> wasn't able to build java-jflex with the latest java-cup.
> Do you want me to send these recipes for comparison?

Yes, please.

If we could get maven to work that would be cool. I've packaged batik and
it's not fun to emulate maven manually...

If we can't get maven to work, a recursive guix importer that reads the
pom.xml would be a great improvement instead.

I can help with both.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlu3irAACgkQ5xo1VCww
uqXGSgf9ELgCCjsJyP2XX0Gb4cXjab8j/hbXhCpqazOn5dA9eNlcL4FpyW0hSKYl
Cn7F7UKLjKstZ2UdavJAzolwuhUTp6FXuIeJEJvVbUFZKyiRm+B6v4KVWAXPthXP
IfTA7Wo+enbWO7AzMQYpipRCVnFJDTw8uWUz2dleBg80AMUfY4wzHq7K4LDcHgv/
qvEjTsfKC+tcQcxxuf/8iIyGYE16mxxWo2dldlrm3nCdmB6+ias+wJAbvR6ucAJF
JhWSCP2rUbj4ElWiMx0L8J5SuG52zlfPM9okQU+Eftq/5K77Foz61R1UZyNPRf3N
WhmtX6CJsyi4sBaaDv2+R2Srsk3Hxg==
=arnH
-----END PGP SIGNATURE-----


J
J
Julien Lepiller wrote on 5 Oct 2018 18:13
(address . 32947@debbugs.gnu.org)
49f3aba8442545a4299d740fd8cbe3e0@lepiller.eu
Toggle quote (18 lines)
>> I have a recipe for java-jflex and java-cup that are built without
>> pre-generated source, using two bootstrap jars. Then, I could use them
>> to build other packages that I need for the future maven-build-system.
>> I
>> wasn't able to build java-jflex with the latest java-cup.
>> Do you want me to send these recipes for comparison?
>
> Yes, please.
>
> If we could get maven to work that would be cool. I've packaged batik
> and
> it's not fun to emulate maven manually...
>
> If we can't get maven to work, a recursive guix importer that reads the
> pom.xml would be a great improvement instead.
>
> I can help with both.

There are my recipes:

(define %java-cup-bootstrap
(package
(name "java-cup")
(version "11b-20160615")
(source (origin
(method url-fetch)
"releases/java-cup-bin-" version
".tar.gz"))
(sha256
(base32
"1k6ycm5bpg7r2z2jprdp54s8bvaxggdxk4qmvkjw3013i1bxc09z"))))
(build-system trivial-build-system)
(arguments
`(#:modules ((guix build utils))
#:builder (begin
(use-modules (guix build utils))
(let* ((source (assoc-ref %build-inputs "source"))
(tar (string-append
(assoc-ref %build-inputs "tar")
"/bin/tar"))
(gzip (assoc-ref %build-inputs "gzip"))
(output (assoc-ref %outputs "out"))
(java-dir (string-append output
"/share/java")))
(mkdir-p java-dir)
(chdir java-dir)
(setenv "PATH" (string-append (getenv "PATH") ":"
gzip "/bin"))
(invoke tar "xf" source)))))
(native-inputs
`(("tar" ,tar)
("gzip" ,gzip)))
(synopsis "")
(description "")
(license license:expat)))

(define-public java-jflex
(package
(name "java-jflex")
(version "1.6.1")
(source (origin
(method url-fetch)
version
".tar.gz"))
(sha256
(base32
"1h7q2vhb4s42g4pqz5xxxliagprray7i9krr6hyaz1mjlx7gnycq"))
(modules '((guix build utils)))
(snippet
`(begin
;; The first entry is a symlink to jflex-version
(delete-file "../jflex")
;; Delete bundled jar archives.
(for-each delete-file (find-files "." ".*\\.jar"))
;; Guix wants to repack jflex as that was the first
entry in the archive
(chdir "..")
(rename-file "jflex-1.6.1" "jflex")
(chdir "jflex")
#t))))
(build-system ant-build-system)
(arguments
`(#:jdk ,icedtea-8
#:test-target "test"
#:phases
(modify-phases %standard-phases
(replace 'install
(install-jars ".")))))
(native-inputs
`(("%java-jflex-bootstrap" ,%java-jflex-bootstrap)
("java-junit" ,java-junit)))
(home-page "https://jflex.de")
(synopsis "")
(description "")
(license license:bsd-3)))

(define-public java-cup
(package
(name "java-cup")
(version "11b")
(source (origin
(method git-fetch)
(uri (git-reference
(url
(commit
"fe729fe8c27441f046dab19135a38b9dde4c4e5e")))
(sha256
(base32
"09xigxm7b44hz79xhqpfykvjrk4q90p33j2l07w69izx9sn0y42b"))
(modules '((guix build utils)))
(snippet
'(begin ;; Delete bundled jar archives.
(for-each delete-file (find-files "." ".*\\.jar"))
(for-each delete-file (find-files "." ".*\\.tar.gz"))
#t))))
(build-system ant-build-system)
(arguments
`(#:jdk ,icedtea-8
#:build-target "dist"
#:tests? #f; no test target
#:phases
(modify-phases %standard-phases
(add-before 'build 'fix-jflex
(lambda _
(substitute* "build.xml"
(("JFlex.ant") "jflex.ant"))
#t))
(add-before 'build 'add-lib
(lambda _
(mkdir-p "lib")))
(replace 'install
(install-jars ".")))))
(native-inputs
`(("%java-jflex-bootstrap" ,%java-jflex-bootstrap)
("git" ,git)))
(synopsis "")
(description "")
(license license:expat)));
J
J
Julien Lepiller wrote on 19 Dec 2018 15:05
Re: Add java-xalan.
(address . 32947@debbugs.gnu.org)
7fe43be096e34b2dcc3eb630b7ae0a12@lepiller.eu
Hi,

what's the status of these patches?
F
F
Frank Pursel wrote on 17 Mar 2022 22:08
(address . 32947@debbugs.gnu.org)
871qz0nv7s.fsf@Ginko.local.i-did-not-set--mail-host-address--so-tickle-me
Hi Guix!

I want to help get a version of xalan into guix. I independently posted
issue#54145 to this end but errors were made. I've since learned of and
from this prior work and want to offer an updated/improved patch to provide a
java-xalan-interp package to fill this gap.

This package is less ambitious than the original because it makes no
attempt to build the xsltc base of xalan and instead settles for the
likely slower, xslt base. The xslt base of xalan is likely slower than
the xsltc base but, as far as I can tell, it provides the same
functionality while not depending on the bundled cups and jflex jars.

If it meets your scrutiny we may also be able to close two issues (this,
32947 and 54145) for the price of one!

Regards,
Frank Pursel
acrow#guix

From 6d711a86959049596e6c6110a830ba1c6c7cea50 Mon Sep 17 00:00:00 2001
Message-Id: <6d711a86959049596e6c6110a830ba1c6c7cea50.1647548555.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 | 62 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)

Toggle diff (79 lines)
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 3ce5e771c7..94bcdff903 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -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,64 @@ (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 "j_2_7_2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "mirror://apache/xalan/xalan-j/source/xalan-"
+ version "-src.tar.gz"))
+ (sha256
+ (base32 "166vg9i11qzi0vbv09abfb50q8caq8wr6zrwg0cwqws9k394l62w"))
+ (modules '((guix build utils)))
+ (snippet '(begin
+ ;; Removing bundled jars
+ (format #t "~%~a~%" "Removing Bundled Jars")
+ (for-each
+ (lambda (f)
+ (format #t "~/Deleting: ~a~%" f)
+ (delete-file f))
+ (find-files "." "\\.jar$"))))))
+ (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")
+ (("xml-apis.jar") "jaxp.jar"))))
+ (replace 'install
+ (install-jars "build"))
+ (add-after 'install 'provide-jars-for-indexing
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (with-directory-excursion
+ (string-append (assoc-ref outputs "out") "/share/java")
+ (symlink
+ (search-input-file inputs "share/java/jaxp.jar")
+ "jaxp.jar")
+ (symlink
+ (search-input-file inputs "share/java/xercesImpl.jar")
+ "xercesImpl.jar")))))))
+ (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)))
--
2.34.0
M
M
Maxime Devos wrote on 17 Mar 2022 22:50
Re: [bug#32947] Add java-xalan.
3330a0f04b80c4449926583da488a65599af29fc.camel@telenet.be
Frank Pursel schreef op do 17-03-2022 om 14:08 [-0700]:
Toggle quote (2 lines)
> +    (version "j_2_7_2")

Why not use periods instead of underscores and drop the "j_" prefix
("2.7.2") instead? 'version-major+minor' and 'version-compare' would
like that better I think, and it's more in line with other packages.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYjOtDhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7syoAQC7McqrqXNdL2pGm4WCrWWipK+Q
ainWyYYvzqoRM4o/GAD+Jmp1s1JqyQm16/j7m1cCWWxfOQRNHTHuVRzVPAhiZQY=
=HvSa
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 17 Mar 2022 22:53
6117e5e03a689c6be41bf5ae7e233a239d595881.camel@telenet.be
Frank Pursel schreef op do 17-03-2022 om 14:08 [-0700]:
Toggle quote (4 lines)
> +       (snippet '(begin
> +                   ;; Removing bundled jars
> +                   (format #t "~%~a~%" "Removing Bundled Jars")

Isn't this equivalent to (display "Removing bundled jars\n")?

Toggle quote (4 lines)
> +                   (for-each
> +                    (lambda (f)
> +                      (format #t "~/Deleting: ~a~%" f)

Why ~/?

Toggle quote (3 lines)
> +                      (delete-file f))
> +                    (find-files "." "\\.jar$"))))))

FWIW, while this is useful for testing whether the unbundling works (*)
while developing the patch, I personally don't see the point of keeping
the 'format' afterwards.

(*) alternatively, you can do "guix build --source java-xalan" to test.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYjOtwxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7pvnAQCFVx7UE2eHo0vUnxYr1XapwOjm
/TYCHujq3OLHeM0wbwEAwxKSwmv7krG42TkkNro/rPo+yby19Y2wSWagyI4KawM=
=BYsE
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 17 Mar 2022 22:57
cdb924acf8cddad966e1401db47ed01d4aef2ff2.camel@telenet.be
Frank Pursel schreef op do 17-03-2022 om 14:08 [-0700]:
Toggle quote (11 lines)
> +                (add-after 'install 'provide-jars-for-indexing
> +                  (lambda* (#:key inputs outputs #:allow-other-keys)
> +                    (with-directory-excursion
> +                        (string-append (assoc-ref outputs "out") "/share/java")
> +                      (symlink
> +                       (search-input-file inputs "share/java/jaxp.jar")
> +                       "jaxp.jar")
> +                      (symlink
> +                       (search-input-file inputs "share/java/xercesImpl.jar")
> +                       "xercesImpl.jar")))))))

Why is "jaxp" and "xerces" being symlinked into share/java even though
they are propagated? Could they be removed after indexing? Is
generate-jar-indices currently broken?

Greetings
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYjOu4BccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7vXaAQD/BRpE9M/Db38+TOYBYowzRPgL
9WefbMU11MH9BfC5VQEAjzxGCZCrY/fxArci+LH0udG1JjPqZeAX4saKIkBVbgM=
=2DI/
-----END PGP SIGNATURE-----


F
F
Frank Pursel wrote on 18 Mar 2022 18:29
(address . 32947@debbugs.gnu.org)
87y217many.fsf@Ginko.local.i-did-not-set--mail-host-address--so-tickle-me
No, I don't think generate-jar-indices is broken. The problem is that
the xalan build is dependent on xml-apis.jar which guix has broken out
into pieces that are split between the guix builds of xerces and jaxp.
The index fails because it looks for all the requirements specified in
the manifest which now must identify xerces and jaxp. So, those jars
(jaxp and xerces) now need to be brought over into the outputs(out)
directory to allow the indexing to succeed. I don't know if the
symlinks are required after completion of the indexing but saw no harm
in it since we need to propagate those inputs anyway or else xalan will
not be able to find all it's dependencies when called. I was pleased to
be able to find all the xml-apis requirements already provided by the
guix builds of xerces and jaxp.

Regards,
Frank
M
M
Maxime Devos wrote on 18 Mar 2022 18:40
786015a580201958dc7903f7ecddd99cc44b7233.camel@telenet.be
Frank Pursel schreef op do 17-03-2022 om 14:08 [-0700]:
Toggle quote (9 lines)
> +       (snippet '(begin
> +                   ;; Removing bundled jars
> +                   (format #t "~%~a~%" "Removing Bundled Jars")
> +                   (for-each
> +                    (lambda (f)
> +                      (format #t "~/Deleting: ~a~%" f)
> +                      (delete-file f))
> +                    (find-files "." "\\.jar$"))))))

I looked a little further and saw a few 'tar.gz'. Perhaps those need
to be removed as well?
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYjTEKBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7sJ1AQC5C1BqWzxE99PrX5uGPXpMb2k9
LmhLhE3NQwAfktpchwEA7wMRT36oF27WRPsLNvSkt/JuEH2FwWLksRWFJMImIQw=
=6uXm
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 18 Mar 2022 18:59
519bab774b9256653bf454465c93aaf53301afde.camel@telenet.be
Frank Pursel schreef op vr 18-03-2022 om 10:29 [-0700]:
Toggle quote (13 lines)
> No, I don't think generate-jar-indices is broken.  The problem is that
> the xalan build is dependent on xml-apis.jar which guix has broken out
> into pieces that are split between the guix builds of xerces and jaxp.
> The index fails because it looks for all the requirements specified in
> the manifest which now must identify xerces and jaxp.  So, those jars
> (jaxp and xerces) now need to be brought over into the outputs(out)
> directory to allow the indexing to succeed.  I don't know if the
> symlinks are required after completion of the indexing but saw no harm
> in it since we need to propagate those inputs anyway or else xalan will
> not be able to find all it's dependencies when called.  I was pleased to
> be able to find all the xml-apis requirements already provided by the
> guix builds of xerces and jaxp.

Ok, seems like due to the changes Guix made to the packaging, the
manifest became incorrect, so that needs to be worked around. As an
alternative work-around, I've removed the jars from the Class-Path, see
attached package definition. This seems a little simpler to me, YMMV.

Greetings,
Maxime.
(use-modules (guix packages) (guix build-system ant) (gnu packages java)(guix download)(gnu packages xml) (guix utils) ((guix licenses) #:prefix license:)) (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-" (string-replace-substring version "." "_") "-src.tar.gz")) (sha256 (base32 "166vg9i11qzi0vbv09abfb50q8caq8wr6zrwg0cwqws9k394l62w")) (modules '((guix build utils))) (snippet '(begin ;; Removing bundled jars (format #t "~%~a~%" "Removing Bundled Jars") (for-each (lambda (f) (format #t "~/Deleting: ~a~%" f) (delete-file f)) (find-files "." "\\.jar$")))))) (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:(.*)$") "")))) ;; By default, no jars would be installed. (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))) java-xalan-interp
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYjTIbxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7gnDAP0d2bNFcDT001Ai4ytimUrKgfzw
5QmvQoI+RqcR8UmitAEA8W5+57JciiuZrWnk4vqh2+17Uuq5lEiA8O3f+FXctAI=
=obsp
-----END PGP SIGNATURE-----


F
F
Frank Pursel wrote on 18 Mar 2022 19:15
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 32947@debbugs.gnu.org)
CANp2FMfNEVG3NGhZocwUXXa-aacMsGhksikE-JmEiUybMvUVGA@mail.gmail.com
Deleting the tar.gz's too should be fine. And the change regarding the
Class-Path sounds appropriate too. Thank you.


On Fri, Mar 18, 2022 at 5:41 PM Maxime Devos <maximedevos@telenet.be> wrote:

Toggle quote (13 lines)
> Frank Pursel schreef op do 17-03-2022 om 14:08 [-0700]:
> > + (snippet '(begin
> > + ;; Removing bundled jars
> > + (format #t "~%~a~%" "Removing Bundled Jars")
> > + (for-each
> > + (lambda (f)
> > + (format #t "~/Deleting: ~a~%" f)
> > + (delete-file f))
> > + (find-files "." "\\.jar$"))))))
>
> I looked a little further and saw a few 'tar.gz'. Perhaps those need
> to be removed as well?
>
Attachment: file
F
F
Frank Pursel wrote on 18 Mar 2022 19:22
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 32947@debbugs.gnu.org)
CANp2FMdB0QbNax8nXy5a0dfzfXzjSFxXfPS+5t9kwf6N-Aqj2A@mail.gmail.com
I like the string-replace-substring modification in your revision but you
need to also allow for the '-j' prefix artifact that the apache upstream is
calling for.

On Fri, Mar 18, 2022 at 6:15 PM Frank Pursel <frank.pursel@gmail.com> wrote:

Toggle quote (21 lines)
> Deleting the tar.gz's too should be fine. And the change regarding the
> Class-Path sounds appropriate too. Thank you.
>
>
> On Fri, Mar 18, 2022 at 5:41 PM Maxime Devos <maximedevos@telenet.be>
> wrote:
>
>> Frank Pursel schreef op do 17-03-2022 om 14:08 [-0700]:
>> > + (snippet '(begin
>> > + ;; Removing bundled jars
>> > + (format #t "~%~a~%" "Removing Bundled Jars")
>> > + (for-each
>> > + (lambda (f)
>> > + (format #t "~/Deleting: ~a~%" f)
>> > + (delete-file f))
>> > + (find-files "." "\\.jar$"))))))
>>
>> I looked a little further and saw a few 'tar.gz'. Perhaps those need
>> to be removed as well?
>>
>
Attachment: file
F
F
Frank Pursel wrote on 18 Mar 2022 20:16
(address . 32947@debbugs.gnu.org)
87y217gjfa.fsf@Ginko.local.i-did-not-set--mail-host-address--so-tickle-me
Guix!, Maxime,

Thank you for the feedback. The result is a better package! These
changes have built successfully and incorporate the identified changes.

Regards,
Frank Pursel
acrow#guix

From 4018f56893077df82c67c06e341339fd3c00e14a Mon Sep 17 00:00:00 2001
Message-Id: <4018f56893077df82c67c06e341339fd3c00e14a.1647630491.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 | 56 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)

Toggle diff (73 lines)
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 3ce5e771c7..2a0a8e2949 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -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,58 @@ (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 jars
+ (for-each
+ (lambda (f)
+ (delete-file f))
+ (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)))
--
2.34.0
M
M
Maxime Devos wrote on 18 Mar 2022 20:19
(name . Frank Pursel)(address . frank.pursel@gmail.com)(address . 32947@debbugs.gnu.org)
5997ded43cd8f8f3c0be123c79ed47203ea826e7.camel@telenet.be
Frank Pursel schreef op vr 18-03-2022 om 18:22 [+0000]:
Toggle quote (4 lines)
> I like the string-replace-substring modification in your revision but
> you need to also allow for the '-j' prefix artifact that the apache
> upstream is calling for.

Indeed:

(string-append "mirror://apache/xalan/xalan-j/source/xalan-j_"
(string-replace-substring version "." "_")
"-src.tar.gz")

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYjTbMhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7pF8AP9nhzo6NNMYkf9sXaC2D/o5gU4X
VY7W3XgS8KtgC8YKKQEA/MhafwQZ3qrz7W11cYR8Gr6jcuZ/nLa+wWL2hlD0uQU=
=s7VW
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 18 Mar 2022 21:07
ad7f6e1fb60a118dd9c04e4ab512b486ff2e92df.camel@telenet.be
Frank Pursel schreef op vr 18-03-2022 om 19:16 [+0000]:
Toggle quote (16 lines)
> +     (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 jars
> +                   (for-each
> +                    (lambda (f)
> +                      (delete-file f))
> +                    (find-files "." "\\.(jar|tar\\.gz)$"))))))

Can be simplified to:

(snippet '(for-each delete-file (delete-files "." "\\.(jar|tar\\.gz)$")))

Also, xalan-j_2_7_2/samples/AppletXMLtoHTML/rabbitwhorn.jpg is an (uncoloured)
picture of a rabbit from Alice in Wonderland (not asl2.0). According to
the copyright has been expired. As such, perhaps the 'license' field
needs to be changed to

(license (list license:asl2.0 ; almost everything
;; samples/AppletXMLtoHTML/rabbitwhorn.jpg, according to
license:public-domain))

Aside from that, LGTM. I've been reading the source code, not seeing anything
‘suspicous’ (malware etc.) so far (I'm currently at
xalan-j_2_7_2/src/org/apache/xalan/templates/FuncKey.java, 25%).

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYjTmlhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7kNgAP9TpETZ9hAsuT+M4lQWoI/gBQ4E
7mXWs/zkU0XgLjZlaQEA7HwZBFMby/PHoUtUn8RiedElVVuij7bOaoHA6KrR7wk=
=7Ok7
-----END PGP SIGNATURE-----


F
F
Frank Pursel wrote on 18 Mar 2022 21:42
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 32947@debbugs.gnu.org)
CANp2FMckyBrFcmHuHu=W4e0++eb56Sk+o=paR2fSjgCtGd7gwA@mail.gmail.com
Very thorough! Apache is a bit sloppy, '(for-each delete-file
(find-file...) is the minimalistic scheme we adore and I'll be happy to
post a revised patch with all of that but I may wait until you've finished
the source review because there is no telling what else has Apache has
packed in there. Please let me know.

Thanks,
Frank

On Fri, Mar 18, 2022 at 8:07 PM Maxime Devos <maximedevos@telenet.be> wrote:

Toggle quote (44 lines)
> Frank Pursel schreef op vr 18-03-2022 om 19:16 [+0000]:
> > + (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 jars
> > + (for-each
> > + (lambda (f)
> > + (delete-file f))
> > + (find-files "." "\\.(jar|tar\\.gz)$"))))))
>
> Can be simplified to:
>
> (snippet '(for-each delete-file (delete-files "."
> "\\.(jar|tar\\.gz)$")))
>
> Also, xalan-j_2_7_2/samples/AppletXMLtoHTML/rabbitwhorn.jpg is an
> (uncoloured)
> picture of a rabbit from Alice in Wonderland (not asl2.0). According to
> <https://commons.wikimedia.org/wiki/File:Alice_par_John_Tenniel_37.png>,
> the copyright has been expired. As such, perhaps the 'license' field
> needs to be changed to
>
> (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))
>
> Aside from that, LGTM. I've been reading the source code, not seeing
> anything
> ‘suspicous’ (malware etc.) so far (I'm currently at
> xalan-j_2_7_2/src/org/apache/xalan/templates/FuncKey.java, 25%).
>
> Greetings,
> Maxime.
>
Attachment: file
F
F
Frank Pursel wrote on 19 Mar 2022 16:41
Re: [bug#32947] Add java-xalan.
(address . 32947@debbugs.gnu.org)
87r16yq794.fsf@gmail.com
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(+)

Toggle diff (76 lines)
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 49275c3e0c..a90aee2783 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -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)
+ )))
--
2.34.0
M
M
Maxime Devos wrote on 19 Mar 2022 16:58
Re: [bug#32947] Add java-xalan.
b0f466794211875a5c4a0f3c5bf8770e678082e5.camel@telenet.be
Maxime Devos schreef op vr 18-03-2022 om 21:07 [+0100]:
Toggle quote (4 lines)
> I've been reading the source code, not seeing anything
> ‘suspicous’ (malware etc.) so far (I'm currently at
> xalan-j_2_7_2/src/org/apache/xalan/templates/FuncKey.java, 25%).

Now at src/org/apache/xalan/xsltc/compiler/IdKeyPattern.java, line 36%.
I noticed some Java code does some classpath and class loader things,
so I'm not sure that the java-xalan package will actually work.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYjX9qxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7kwxAP9Hos5xqtpFEsSZUyaI3Ick1G9Q
PRyhQOmAqL1Pfz0IYQEAr7CvHy84w4/dANL5+2941hU95VnoOuptFxpx9UZ8Pwo=
=RudD
-----END PGP SIGNATURE-----


F
F
Frank Pursel wrote on 19 Mar 2022 17:38
87o821rj6w.fsf@gmail.com
Maxime,

Maxime Devos writes:
Toggle quote (4 lines)
> Now at src/org/apache/xalan/xsltc/compiler/IdKeyPattern.java, line 36%.
> I noticed some Java code does some classpath and class loader things,
> so I'm not sure that the java-xalan package will actually work.

Yes, I think that is why apache continues to maintain the xslt base in
parallel with the xsltc base and why the java-xalan-interp avoids using
the xsltc branch of the source.

I've also read articles that questioned the notion that cup (used by the
xsltc base) offers any real value. eg...

I've never seen any published performance comparisons between xslt and
xsltc and it makes me believe that if there are gains they are modest in
this application.

It is also why I chose to name this package
java-xalan-interp to make the distinction between the code bases clear.

Regards,
Frank Pursel
M
M
Maxime Devos wrote on 22 Mar 2022 18:45
fd01542ad871b18187a61763d06916d1f2ceda16.camel@telenet.be
Maxime Devos schreef op vr 18-03-2022 om 21:07 [+0100]:
Toggle quote (4 lines)
> I've been reading the source code, not seeing anything
> ‘suspicous’ (malware etc.) so far (I'm currently at
> xalan-j_2_7_2/src/org/apache/xalan/templates/FuncKey.java, 25%).

Now I'm at 42% (src/org/apache/xalan/xsltc/compiler/XPathLexer.java).
I've found two binaries (*):

* src/org/apache/xalan/xsltc/compiler/XPathLexer.java
* src/org/apache/xalan/xsltc/compiler/XPathParser.java

They appear to be generated by a lexer and parser generator --
apparently it's named ‘java_cup’? Given that they are in the 'xsltc'
part, which is currently unused in the java-xalan package IIUC, I
believe it would be sufficient to just delete these two files.

(*) Here I mean 'binaries'='generated, not source code' -- it's still
.java and not .class.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYjoLKxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7kptAQD88Uf4PcJfb+8sECnT9KMFLJmJ
3oC3Ai2Dv0b9d4yH4AEAy0CEXPuVCRbrlDEIDCkOIfrt5TBFqmRJCYoa1riVNwI=
=HCwJ
-----END PGP SIGNATURE-----


J
J
Julien Lepiller wrote on 22 Mar 2022 19:18
748F479C-EE10-4720-BF39-525589A2AD50@lepiller.eu
On March 22, 2022 6:45:15 PM GMT+01:00, Maxime Devos <maximedevos@telenet.be> wrote:
Toggle quote (16 lines)
>Maxime Devos schreef op vr 18-03-2022 om 21:07 [+0100]:
>> I've been reading the source code, not seeing anything
>> ‘suspicous’ (malware etc.) so far (I'm currently at
>> xalan-j_2_7_2/src/org/apache/xalan/templates/FuncKey.java, 25%).
>
>Now I'm at 42% (src/org/apache/xalan/xsltc/compiler/XPathLexer.java).
>I've found two binaries (*):
>
> * src/org/apache/xalan/xsltc/compiler/XPathLexer.java
> * src/org/apache/xalan/xsltc/compiler/XPathParser.java
>
>They appear to be generated by a lexer and parser generator --
>apparently it's named ‘java_cup’? Given that they are in the 'xsltc'
>part, which is currently unused in the java-xalan package IIUC, I
>believe it would be sufficient to just delete these two files.

To add to your comment. I've encountered java_cup in tge past. It's not bootstrappable as far as I can see. It has a dependency on jflex and itself, and jflex requires itself and java_cup. I looked at the first commit of jflex, and it already depends on itself (but not cup). According to the devs, chey used a hand-written lexer that was too aweful to commit, and so we can't rebuild jflex.

If someone is interested, they would have to write a lexer for an early version of jflex :)

Toggle quote (6 lines)
>
>(*) Here I mean 'binaries'='generated, not source code' -- it's still
>.java and not .class.
>
>Greetings,
>Maxime.
F
F
Frank Pursel wrote on 23 Mar 2022 02:32
(address . 32947@debbugs.gnu.org)
87zglhcv2v.fsf@Ginko.local.i-did-not-set--mail-host-address--so-tickle-me
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(+)

Toggle diff (78 lines)
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 3ce5e771c7..197165e9bb 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -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)))
--
2.34.0
F
F
Frank Pursel wrote on 23 Mar 2022 15:14
87wngkdacr.fsf@Ginko.local.i-did-not-set--mail-host-address--so-tickle-me
Oops, I, somehow, dropped some prior work. I think it's now all here.

From f9c96acbf38ecbe3dc0e73077f92c6a8be1eb93d Mon Sep 17 00:00:00 2001
Message-Id: <f9c96acbf38ecbe3dc0e73077f92c6a8be1eb93d.1648044678.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 | 66 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)

Toggle diff (83 lines)
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 3ce5e771c7..a4d77b51d7 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -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,67 @@ (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
+ (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))))
--
2.34.0
M
M
Maxime Devos wrote on 30 Mar 2022 19:43
a503fccf98c27bc616f5a6675a2524634e2ee42f.camel@telenet.be
Maxime Devos schreef op vr 18-03-2022 om 21:07 [+0100]:
Toggle quote (3 lines)
> (I'm currently at
> xalan-j_2_7_2/src/org/apache/xalan/templates/FuncKey.java, 25%).

I've continued reading and I'm now at xalan-
j_2_7_2/src/org/apache/xalan/xsltc/dom/DocumentCache.java, 49%.

I think I see a bug there, in getStatistics:

out.print("<tr><td><a href=\""+_URIs[i]+"\">"+
"<font size=-1>"+_URIs[i]+"</font></a></td>");

what if the URI contains &, <, > or " characters? Looks like then the
XML would be malformed. To be reported upstream ... (not a blocker,
since xsltc is unused in the Guix package)

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYkSW3xccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7q65AQC2Vc/ruQU83Xc3bIY9Ck1Pv03x
9raF7OpD8R1IsZaMdQD/ZTv7zlfeNBb0LjZwWlRdknmGdaLp9cKT5xb3R+g+BAM=
=03ZE
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 30 Mar 2022 20:41
fcabaec878b1f4a82f49f3a7ba23f121f889f8ee.camel@telenet.be
Maxime Devos schreef op wo 30-03-2022 om 19:43 [+0200]:
Toggle quote (5 lines)
> what if the URI contains &, <, > or " characters?  Looks like then
> the
> XML would be malformed.  To be reported upstream ... (not a blocker,
> since xsltc is unused in the Guix package)

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYkSkVRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7sibAP9yZu0VnPXONeqdYdH7On3gYbya
Q/NZsebIW/JedyHs/AD/bLYY49b44Dd51xHfeD3DJW10CkpMf04lG3x9kedJPgY=
=Nf05
-----END PGP SIGNATURE-----


F
F
Frank Pursel wrote on 30 Mar 2022 22:23
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 32947@debbugs.gnu.org)
CANp2FMdDiqYG2Lt2_7kj8SpJL+60L5u-=UKN3DViLbYh0E8BrA@mail.gmail.com
Thank you Maxime.

On Wed, Mar 30, 2022 at 6:41 PM Maxime Devos <maximedevos@telenet.be> wrote:

Toggle quote (9 lines)
> Maxime Devos schreef op wo 30-03-2022 om 19:43 [+0200]:
> > what if the URI contains &, <, > or " characters? Looks like then
> > the
> > XML would be malformed. To be reported upstream ... (not a blocker,
> > since xsltc is unused in the Guix package)
>
> Reported upstream at
> <https://issues.apache.org/jira/browse/XALANJ-2630>.
>
Attachment: file
M
M
Maxime Devos wrote on 3 Apr 2022 10:32
4058a54966fce34a0c87568e38c5d25059a93ada.camel@telenet.be
Maxime Devos schreef op vr 18-03-2022 om 21:07 [+0100]:
Toggle quote (3 lines)
> (I'm currently at
> xalan-j_2_7_2/src/org/apache/xalan/templates/FuncKey.java, 25%).

Now at 57% (xalan-
j_2_7_2/src/org/apache/xml/dtm/ref/DTMStringPool.java). No new
‘suspicious’ things found.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYklbhxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7u5OAQCLP4WaLEhtojzLk3R4LGzyeR7N
MO5QWgTHhZgb68OhcQEA/un6e/J0jvmOQtGzzQMiXOOhsn7pwnQ21/b6/W0pLA0=
=XbTr
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 5 Apr 2022 15:12
5f00452a6bed768c7df78fee59c045f08d1a8dce.camel@telenet.be
Maxime Devos schreef op vr 18-03-2022 om 21:07 [+0100]:
Toggle quote (3 lines)
> (I'm currently at
> xalan-j_2_7_2/src/org/apache/xalan/templates/FuncKey.java, 25%).

Now at 62% (src/org/apache/xml/serializer/ToTextSAXHandler.java).

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYkxAPBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7kWWAP9xOn1T1Q4t8KeRKtEMDGouCOBw
vYk+0WAN0UKNPnxRrQEA5cYhnS/3MnY9e6/NPUO3delQPzwi3Kir+Bc5SRSGvQ8=
=Os4s
-----END PGP SIGNATURE-----


F
F
Frank Pursel wrote on 5 Apr 2022 23:09
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 32947@debbugs.gnu.org)
CANp2FMeOjaAiAaiv6y1wgrAWU8SjKJcXbiFJgK2_wUr8=cR-Rw@mail.gmail.com
Cool.

On Tue, Apr 5, 2022, 09:12 Maxime Devos <maximedevos@telenet.be> wrote:

Toggle quote (9 lines)
> Maxime Devos schreef op vr 18-03-2022 om 21:07 [+0100]:
> > (I'm currently at
> > xalan-j_2_7_2/src/org/apache/xalan/templates/FuncKey.java, 25%).
>
> Now at 62% (src/org/apache/xml/serializer/ToTextSAXHandler.java).
>
> Greetings,
> Maxime.
>
Attachment: file
M
M
Maxime Devos wrote on 9 Apr 2022 15:40
cdb25d15711af2d3c60590f4c45906464e0cdada.camel@telenet.be
Maxime Devos schreef op vr 18-03-2022 om 21:07 [+0100]:
Toggle quote (3 lines)
> (I'm currently at
> xalan-j_2_7_2/src/org/apache/xalan/templates/FuncKey.java, 25%).

I'm now at 68%, xalan-j_2_7_2/src/org/apache/xml/utils/IntStack.java.
According to the header, it is asl2.0 licensed. But there's also a
line

* @since JDK1.0

which seems to imply that this file was based on some Java code of
JDK1.0. TBI: is this the case, what is the license of JDK1.0, and does
it appear to be followed or not?

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYlGMyxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7pRQAP40K8rkzsjJjf9JEVqE9rpZf8zG
HDQrNSv2tujOJ75bZgD/XJnrQCU0ZGuIECrU6D+Uo7RsLepIru/d8KLrdoqNhg8=
=zzmO
-----END PGP SIGNATURE-----


F
F
Frank Pursel wrote on 11 Apr 2022 18:36
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 32947@debbugs.gnu.org)
CANp2FMdKa2etrG4qDMgbhg2KLb=JR4GHESQA=jLeciQu-Y2DQg@mail.gmail.com
Maxime,

I looked at the org.apache.xml/uitls/IntStack.java file you pointed out. I
think the header license certainly prevails here for several reasons.
First it is subpackage of the org.apache tree for which the source license
is clearly stated. Second, looking at the code (without being a java guru;
the code is that simple) we can see that there is no dependency on any
JDK. The statement '@since JDK1.0' appears to be true in the sense that
any JDK can compile this since 1.0. We demonstrate that it builds with
JDK8 whenever we run this package through guix build and so, I see no
licensing concerns over the '@since JDK1.0' annotation.

Regards,
Frank
Attachment: file
M
M
Maxime Devos wrote on 12 Apr 2022 11:32
(name . Frank Pursel)(address . frank.pursel@gmail.com)(address . 32947@debbugs.gnu.org)
2533f258c513aeb666823c6c3a48748f988a9ee6.camel@telenet.be
Frank Pursel schreef op ma 11-04-2022 om 16:36 [+0000]:
Toggle quote (5 lines)
> I looked at the org.apache.xml/uitls/IntStack.java file you pointed
> out.  I think the header license certainly prevails here for
> several reasons.  First it is subpackage of the org.apache tree for
> which the source license is clearly stated.

I can search for a leak of the source code of Windows, copy it to
another project, obfuscate its origin a bit by removing author
information, copyright information and the old license header and
add a ASL license header and rename it to fit inside the other project.
That doesn't make it actually ASL, it just makes it a copyright
violation.

Toggle quote (7 lines)
> Second, looking at the code (without being a java guru; the code is
> that simple) we can see that there is no dependency on any JDK.
> The statement '@since JDK1.0' appears to be true in the sense that
> any JDK can compile this since 1.0.  We demonstrate that it builds
> with JDK8 whenever we run this package through guix build and so, I
> see no licensing concerns over the '@since JDK1.0' annotation. 

This is not what @since means, at least according to the Javadoc
documentation (maybe Apache Xalan assigns its own custom meaning).
According to

This tag means that this change or feature has existed since the
software release specified by the since-text value, for example:
@since 1.5.

For Java platform source code, the @since tag indicates the version  
of the Java platform API specification [...]

so IMO it looks like this code was once part of JDK 1.0.

Maybe this is OK, maybe the license of JDK 1.0 allows this, maybe it
doesn't but Apache has gained some kind of permission from Sun, maybe
it's not legally OK, maybe it never was part of JDK 1.0. I think we'll
just have to ask upstream what's going on, WDYT?

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYlVHSxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7nErAP43Xa9XXxH5w6RDGL5D7liMSl1Y
cd69c+lb7QRmcYKrywEA5rLFnJmn6p/+7iyNcDf45V3aHz5i0DanPjo9NFdTpAg=
=S0wO
-----END PGP SIGNATURE-----


F
F
Frank Pursel wrote on 14 Apr 2022 01:43
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 32947@debbugs.gnu.org)
CANp2FMcxbFARyTOH+7xdLeb+WGPxO1-LvEhaFAU=Le41tDRZMg@mail.gmail.com
Maxime,

You wrote, WDIT?

I think that IntStack.java has almost no economic value and so the
comparison to a commercial package is not really appropriate. We
could ask upstream (file a bug report) but the question is pretty
awkward. We are not asking for a bug fix, or for clarification of a
behaviour. We are questioning if they are meeting their own stated
licensing criteria! Besides that such a ticket is very difficult to
resolve. I would feel bad asking this of them because I imagine they
are no better equipped to answer questions about JDK1.0 than we are.
Worse, if we believe such impropriety is possible why would be believe
what they tell us anyway? I think to ask for this to be investigated,
at minimum, you would need to find the actual file from JDK1.0 that
you feel was appropriated. I don't think we should be asking upstream
to work on investigation of a suspicious licensing that cannot improve
their software in any functional way.

I appreciate your keen sensitivity to the code but I don't think this
feedback to apache is helpful and is likely not even true.

Sincerely,
Frank Pursel


On Tue, Apr 12, 2022 at 9:33 AM Maxime Devos <maximedevos@telenet.be> wrote:

Toggle quote (44 lines)
> Frank Pursel schreef op ma 11-04-2022 om 16:36 [+0000]:
> > I looked at the org.apache.xml/uitls/IntStack.java file you pointed
> > out. I think the header license certainly prevails here for
> > several reasons. First it is subpackage of the org.apache tree for
> > which the source license is clearly stated.
>
> I can search for a leak of the source code of Windows, copy it to
> another project, obfuscate its origin a bit by removing author
> information, copyright information and the old license header and
> add a ASL license header and rename it to fit inside the other project.
> That doesn't make it actually ASL, it just makes it a copyright
> violation.
>
> > Second, looking at the code (without being a java guru; the code is
> > that simple) we can see that there is no dependency on any JDK.
> > The statement '@since JDK1.0' appears to be true in the sense that
> > any JDK can compile this since 1.0. We demonstrate that it builds
> > with JDK8 whenever we run this package through guix build and so, I
> > see no licensing concerns over the '@since JDK1.0' annotation.
>
> This is not what @since means, at least according to the Javadoc
> documentation (maybe Apache Xalan assigns its own custom meaning).
> According to
> <
> https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javadoc.html
> >:,
>
> This tag means that this change or feature has existed since the
> software release specified by the since-text value, for example:
> @since 1.5.
>
> For Java platform source code, the @since tag indicates the version
> of the Java platform API specification [...]
>
> so IMO it looks like this code was once part of JDK 1.0.
>
> Maybe this is OK, maybe the license of JDK 1.0 allows this, maybe it
> doesn't but Apache has gained some kind of permission from Sun, maybe
> it's not legally OK, maybe it never was part of JDK 1.0. I think we'll
> just have to ask upstream what's going on, WDYT?
>
> Greetings,
> Maxime.
>
Attachment: file
M
M
Maxime Devos wrote on 14 Apr 2022 10:30
(name . Frank Pursel)(address . frank.pursel@gmail.com)(address . 32947@debbugs.gnu.org)
c0e41122e15cd3643ec2ffcf0ecd1af8ef831512.camel@telenet.be
Frank Pursel schreef op wo 13-04-2022 om 23:43 [+0000]:
Toggle quote (3 lines)
> I think that IntStack.java has almost no economic value and so the
> comparison to a commercial package is not really appropriate.

It is not about the commercial aspect, it is about the potential
proprietariness.

Toggle quote (3 lines)
> We are not asking for a bug fix, or for clarification of a
> behaviour.

Violating the (copyright, maybe contract) law seems like a bug to me
(TBC it is not known yet if this is the case, it just seems plausible
to me at this moment).

Toggle quote (3 lines)
> We are questioning if they are meeting their own stated
> licensing criteria!

The problem is not if Apacha meets their own license (it seems that
they do, since they explicitly release the source code with their
license headers etc. The potential problem is Sun's licensing of
JDK1.0, which we (as distribution) might indirectly be in violation of
by including java-xalan.

Also, it's all about how the question is framed -- asking ‘did you
violate the licensing terms’ doesn't seem advisable, but ‘Does IntStack
indeed come from JDK1.0, and if so, can I use it under the ASL license
like the rest?’ would just be asking for confirmation (and somewhat
positive, because it seems to imply we want to use xalan).

Toggle quote (3 lines)
> I would feel bad asking this of them because I imagine they
> are no better equipped to answer questions about JDK1.0 than we are.

They are probably not well-equipped to answer questions about JDK1.0.
However, they _are_ well-equiped to answer questions about theirselves,
presumably they remember what they mean by @since and where their
source code came from.

Toggle quote (3 lines)
> Worse, if we believe such impropriety is possible why would be
> believe what they tell us anyway?

FWIW, IMO it would only be impropriety because of the current law (and
somewhat unclear attribution). Also, by assuming good faith.

Toggle quote (4 lines)
> I think to ask for this to be investigated,
> at minimum, you would need to find the actual file from JDK1.0 that
> you feel was appropriated.

JDK1.0 is propietary, why would I look into its sources? Also,
probably the sources aren't available anyway, given that it is
proprietary.

Toggle quote (4 lines)
> I don't think we should be asking upstream
> to work on investigation of a suspicious licensing that cannot
> improve their software in any functional way.

Moving from being in violation in the law to not seems like a
functional improvement to me (assuming it was actually in violation,
which has not been determined). Illegal software is, for many
practical purposes, not functional.

More generally, ignorance is not an excuse, and I imagine willfull
ignorance to be even less so.

Anyway, I've sent a mail upstream, presumably it will eventually appear
in the archive at

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYlfbkRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7gGvAQCyYasSS6fCQkMQJdBbOcZiRjPT
vP6M0Ve02v7KaNgZHwEAtLKgkiTddlKwHsV1xUG+oGQcRIPDvZUPj1wmKCXliQk=
=QsoF
-----END PGP SIGNATURE-----


F
F
Frank Pursel wrote on 14 Apr 2022 18:07
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 32947@debbugs.gnu.org)
CANp2FMc2_wLjOEZ12e8Of67prYFtOQh3zVb0fxHVhZFvrAZqHQ@mail.gmail.com
Well, I certainly have never intended to be an accomplice to intellectual
property theft. Having formally asked the question that cannot be the
case. I also thought you handled the 'framing' of the issue nicely.

Your perspective caused me to further investigate IntStack.java. It may be
helpful to know that the class IntStack is an extension of IntVector.java
which contains none of the suspicious references to JDK1.0. For
IntStack.java to have originated in the JDK so too must have IntVector.java
and there doesn't appear to be any similar evidence that this is the case.

I can also offer that xdocs/sources/xalan/history.xml documents that
IntStack.java has been modified multiple times to address bug reports and
for optimizations. I really don't know how those attributable
modifications would affect the licensing but apache has clearly tailored
this code to suite the needs of xalan. It also provides the email
addresses of past modifiers that might still be around to more clearly
identify the origin of the code. Though it was some time ago. This code
appears to have been settled since 2006. 15 year old open source code is
unusual by today's standards.

Regards,
Frank

On Thu, Apr 14, 2022 at 8:30 AM Maxime Devos <maximedevos@telenet.be> wrote:

Toggle quote (70 lines)
> Frank Pursel schreef op wo 13-04-2022 om 23:43 [+0000]:
> > I think that IntStack.java has almost no economic value and so the
> > comparison to a commercial package is not really appropriate.
>
> It is not about the commercial aspect, it is about the potential
> proprietariness.
>
> > We are not asking for a bug fix, or for clarification of a
> > behaviour.
>
> Violating the (copyright, maybe contract) law seems like a bug to me
> (TBC it is not known yet if this is the case, it just seems plausible
> to me at this moment).
>
> > We are questioning if they are meeting their own stated
> > licensing criteria!
>
> The problem is not if Apacha meets their own license (it seems that
> they do, since they explicitly release the source code with their
> license headers etc. The potential problem is Sun's licensing of
> JDK1.0, which we (as distribution) might indirectly be in violation of
> by including java-xalan.
>
> Also, it's all about how the question is framed -- asking ‘did you
> violate the licensing terms’ doesn't seem advisable, but ‘Does IntStack
> indeed come from JDK1.0, and if so, can I use it under the ASL license
> like the rest?’ would just be asking for confirmation (and somewhat
> positive, because it seems to imply we want to use xalan).
>
> > I would feel bad asking this of them because I imagine they
> > are no better equipped to answer questions about JDK1.0 than we are.
>
> They are probably not well-equipped to answer questions about JDK1.0.
> However, they _are_ well-equiped to answer questions about theirselves,
> presumably they remember what they mean by @since and where their
> source code came from.
>
> > Worse, if we believe such impropriety is possible why would be
> > believe what they tell us anyway?
>
> FWIW, IMO it would only be impropriety because of the current law (and
> somewhat unclear attribution). Also, by assuming good faith.
>
> > I think to ask for this to be investigated,
> > at minimum, you would need to find the actual file from JDK1.0 that
> > you feel was appropriated.
>
> JDK1.0 is propietary, why would I look into its sources? Also,
> probably the sources aren't available anyway, given that it is
> proprietary.
>
> > I don't think we should be asking upstream
> > to work on investigation of a suspicious licensing that cannot
> > improve their software in any functional way.
>
> Moving from being in violation in the law to not seems like a
> functional improvement to me (assuming it was actually in violation,
> which has not been determined). Illegal software is, for many
> practical purposes, not functional.
>
> More generally, ignorance is not an excuse, and I imagine willfull
> ignorance to be even less so.
>
> Anyway, I've sent a mail upstream, presumably it will eventually appear
> in the archive at
> <https://marc.info/?l=xalan-j-users&r=1&b=202204&w=2>.
>
> Greetings,
> Maxime.
>
Attachment: file
M
M
Maxime Devos wrote on 14 Apr 2022 22:33
23fe03e818a7598ad43e79a4fded3a1a032dd2d9.camel@telenet.be
Maxime Devos schreef op di 05-04-2022 om 15:12 [+0200]:
Toggle quote (2 lines)
> Now at 62% (src/org/apache/xml/serializer/ToTextSAXHandler.java).

Now at 74% (src/org/apache/xpath/XPathException.java). No new
potential problems found, except for ObjectStack which is a similar
situation as IntStack.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYliFBhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7tKqAPwLQyQTn2RF1wufNa3qyr3MqJsO
FCBgOyoY8dgRddUFZwEAgDjlL4sYFvM7ab1D3iaWmldsHoRR5kxZoAmr8nrlfgc=
=EaCr
-----END PGP SIGNATURE-----


F
F
Frank Pursel wrote on 14 Apr 2022 22:49
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 32947@debbugs.gnu.org)
CANp2FMeEPNw+XOEbCDmVjz3cW7jFxa972v_F=JLJqtQ3sojEEQ@mail.gmail.com
Nice progress. I believe there is an entry regarding the creation of
ObjectStack.java in history.xml.

On Thu, Apr 14, 2022, 13:33 Maxime Devos <maximedevos@telenet.be> wrote:

Toggle quote (10 lines)
> Maxime Devos schreef op di 05-04-2022 om 15:12 [+0200]:
> > Now at 62% (src/org/apache/xml/serializer/ToTextSAXHandler.java).
>
> Now at 74% (src/org/apache/xpath/XPathException.java). No new
> potential problems found, except for ObjectStack which is a similar
> situation as IntStack.
>
> Greetings,
> Maxime.
>
Attachment: file
M
M
Maxime Devos wrote on 16 Apr 2022 23:02
a8d039feb814ed1f886dd9494de0fd58cbe8463d.camel@telenet.be
Hi,

While looking superficially into the source for problems isn't a slow
process (I didn't time it thoroughly but I'd say 20 minutes for 10% or
so, and possibly less if the files are small, or maybe more if the
timing was inaccurate or unrepresentative), I'm not exactly swimming in
free time or something, so don't expect an ‘it's done!’ response
anytime soon.

I see two options here:

* you could look into the rest yourself (though technically a COI I
suppose ...)

* consider the current checks into the source code to be sufficient

Also, about the IntStack thing:

* as you wrote, upstream has modified it a lot
* IIRC and IIUC (though I only looked rather superficially) it's
a rather basic class anyway, probably not many other plausible
ways to do it. Also tiny.
* current OpenJDK's are freely licensed anyway
* upstream has been asked what, exactly, is the situation
(though it hasn't been answered yet)
* so I don't think this is a blocker

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYlsuzxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7svWAPsFhK+tXKhVnPr65dBJWEM3FAQ5
+lYl3ul5Tbfe/mOnMAD/bk7dqlck/VbpXw49wz69jK/lsRf9BeGhyFjhDZ2bUQs=
=Bub8
-----END PGP SIGNATURE-----


F
F
Frank Pursel wrote on 19 Apr 2022 19:13
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 32947@debbugs.gnu.org)
CANp2FMfBCGoL9BJ0gt58hTiQT7Nz9W9gTN3uZ0cFm3K=+wcW6w@mail.gmail.com
I concur. WDYT is next?

Thanks,
Frank
(acrow#guix)

On Sat, Apr 16, 2022 at 9:02 PM Maxime Devos <maximedevos@telenet.be> wrote:

Toggle quote (30 lines)
> Hi,
>
> While looking superficially into the source for problems isn't a slow
> process (I didn't time it thoroughly but I'd say 20 minutes for 10% or
> so, and possibly less if the files are small, or maybe more if the
> timing was inaccurate or unrepresentative), I'm not exactly swimming in
> free time or something, so don't expect an ‘it's done!’ response
> anytime soon.
>
> I see two options here:
>
> * you could look into the rest yourself (though technically a COI I
> suppose ...)
>
> * consider the current checks into the source code to be sufficient
>
> Also, about the IntStack thing:
>
> * as you wrote, upstream has modified it a lot
> * IIRC and IIUC (though I only looked rather superficially) it's
> a rather basic class anyway, probably not many other plausible
> ways to do it. Also tiny.
> * current OpenJDK's are freely licensed anyway
> * upstream has been asked what, exactly, is the situation
> (though it hasn't been answered yet)
> * so I don't think this is a blocker
>
> Greetings,
> Maxime.
>
Attachment: file
M
M
Maxime Devos wrote on 19 Apr 2022 20:44
(name . Frank Pursel)(address . frank.pursel@gmail.com)(address . 32947@debbugs.gnu.org)
772ee273a07cf3ebfcd939eac096b4fbf014dec1.camel@telenet.be
Frank Pursel schreef op di 19-04-2022 om 17:13 [+0000]:
Toggle quote (2 lines)
> I concur.  WDYT is next?

With which of the two options do you concur:

Toggle quote (9 lines)
> > I see two options here:
> >
> >   * you could look into the rest yourself (though technically a COI
> > I
> >     suppose ...)
> >
> >   * consider the current checks into the source code to be
> > sufficient

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYl8C+RccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7rhUAP9/VxPe7ykf2fyvnGuTUQ0G8ua+
vezuPQ8f/4oD/bYlrQEA3lyxgOm8HYYVkT9t6DoU5z7LjUyQ9aZLqDzouz2r9AU=
=e4Zk
-----END PGP SIGNATURE-----


F
F
Frank Pursel wrote on 19 Apr 2022 20:55
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 32947@debbugs.gnu.org)
CANp2FMd8JyP+g65g592DpqHEZPvE40BDhM3R2VKw=tnpFm1x7w@mail.gmail.com
I think the current checks are sufficient but that I could also do
additional checks if you feel that would be helpful.



On Tue, Apr 19, 2022, 11:44 Maxime Devos <maximedevos@telenet.be> wrote:

Toggle quote (17 lines)
> Frank Pursel schreef op di 19-04-2022 om 17:13 [+0000]:
> > I concur. WDYT is next?
>
> With which of the two options do you concur:
>
> > > I see two options here:
> > >
> > > * you could look into the rest yourself (though technically a COI
> > > I
> > > suppose ...)
> > >
> > > * consider the current checks into the source code to be
> > > sufficient
>
> Greetings,
> Maxime.
>
Attachment: file
M
M
Maxime Devos wrote on 24 Jun 2022 17:23
Re: [PATCH 0/3] Add java-xalan: reverse ping
(address . 32947@debbugs.gnu.org)
2094b0b2764151acf7b02dae60bbd8a3a739cde2.camel@telenet.be
On the license question:


I haven't received a reply that answered the question. The only reply
was:

Joseph Kesselman <keshlam@alum.mit.edu>:
Toggle quote (6 lines)
> It has been a long time since I looked at this, I believe IntStack
> was official JDK code but deprecated. Since we were still depending
> upon it it we copied it into Xalan's source. Web search finds a
> version on GitHub which says its performance was several times
> better than the then-available alternatives.

but this doesn't really answer the question ...

Anyway, IIUC, except for maybe the license thing, things should be
ready:

Latest patch (IIUC):

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYrXXARccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7kkVAP9udODiq3X0VmM0y8fA5O0oM6gF
OSczcQtOXhmVsdHcigEAy3Fm+LSUDlqJ7C4KpqOzHdhnUbd8m9W4PC82xSI42g4=
=fvfg
-----END PGP SIGNATURE-----


F
F
Frank Pursel wrote on 15 Jul 2022 01:46
[PATCH 0/3] Add java-xalan.
(address . 32947@debbugs.gnu.org)
CANp2FMcaVg6zJBhT3SBzY3fcePaZHgeYT5_iuXrF0ZgW7NBAeA@mail.gmail.com
Yes, that is correct.

Regards,
Frank
Attachment: file
V
V
Vagrant Cascadian wrote on 20 Aug 2022 00:05
Re: [bug#32947] Add java-xalan.
877d33khxc.fsf@contorta
On 2022-03-23, Frank Pursel wrote:
Toggle quote (97 lines)
> Oops, I, somehow, dropped some prior work. I think it's now all here.
>
> From f9c96acbf38ecbe3dc0e73077f92c6a8be1eb93d Mon Sep 17 00:00:00 2001
> Message-Id: <f9c96acbf38ecbe3dc0e73077f92c6a8be1eb93d.1648044678.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 | 66 ++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 66 insertions(+)
>
> diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
> index 3ce5e771c7..a4d77b51d7 100644
> --- a/gnu/packages/xml.scm
> +++ b/gnu/packages/xml.scm
> @@ -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,67 @@ (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
> + (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))))
> --
> 2.34.0

I was able to apply this patch on current master
ec6122250de7c83a7e77054584a34767b11337db ... and successfully build
java-xalan-interp!

But this appears to add java-xalan-interp, but the subject is "Add
java-xalan".

I'm not confident in reviewing the whole patch series, and not terribly
savvy with guile or java ...

The patches started in 2018, are some of the earlier patches applied?
Are there other patches that still need applying? Or can they be
dropped?

Do you have a summary of the discussion around licensing and other
issues? Makes me a bit nervous to apply patches as the current status is
not totally clear to me.

If these aren't the first generation patches in the series, maybe
re-send the patches that still need applying as a [PATCH v2] (or v3?
v4?) in the subject of each patch?


With a summary clarifying the licensing and which exact patches still
need applying, that would make it a lot easier to review!


Thanks for contributing to guix, and hanging onto patience with the
process!


live well,
vagrant
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCYwAJQAAKCRDcUY/If5cW
qsw2AQCU95TShUprO3dTqSDvnG5FSTs+ORyDqztVNJ/v1wmdsAD7B8mBHRzmC+Xp
3DBuCnfj5S9vTUEhXZo0c9tEb0mbGQs=
=dAzD
-----END PGP SIGNATURE-----

F
F
Frank Pursel wrote on 20 Aug 2022 02:57
Add java-xalan-interp
(address . 32947@debbugs.gnu.org)
87r11b4tr6.fsf@Ginko.local.mail-host-address-is-not-set
Toggle quote (7 lines)
> I was able to apply this patch on current master
> ec6122250de7c83a7e77054584a34767b11337db ... and successfully build
> java-xalan-interp!
>
> But this appears to add java-xalan-interp, but the subject is "Add
> java-xalan".

Back in 2018 people tried to add java-xalan but it never happened
because the dependencies were never factored out and the author of the
original effort apparently lost interest.

I submitted an original patch to build an alternate, interpreted,
version of xalan that avoided use of the unbootstrappable dependencies
that were the earlier problem. Maxime prompted significant improvements
to this patch to obtain the final version which you built but I thought
it should have a name to distinguish it from the most common version
which we did not build. The version this patch builds is an
'interpreted' version so I labelled it java-xalan-interp. Presumably,
in a future where java-cup could be bootstrapped (currently it cannot be
bootstrapped and so is excluded from guix and unused in this build of
java-xalan-interp) we might eventually be able to provide java-xalan and
comparisons might be made with java-xalan-interp.

Toggle quote (7 lines)
> I'm not confident in reviewing the whole patch series, and not terribly
> savvy with guile or java ...
>
> The patches started in 2018, are some of the earlier patches applied?
> Are there other patches that still need applying? Or can they be
> dropped?

They can be dropped because they were in the depricated style as well as
depended on binary blobs from other sources that are not in guix and
have not yet proven to be bootstrappable in guix.

Toggle quote (6 lines)
>
> Do you have a summary of the discussion around licensing and other
> issues? Makes me a bit nervous to apply patches as the current status is
> not totally clear to me.
>

Summarizing -- the details are all above -- Maxime Devos identified some
code from other projects included in the xalan source bundle which was
of a suspicious nature. The patch here deletes this code and only
creates an older version of xalan that is interpreted rather than
compiled with the unbuildable compiler dependency. Maxime conducted a
nearly line by line scrutiny of all the code and found two reference to
JDK1.0 sources that he asked about upstream. Apache responded that the
identified code was depricated by the JDK and that they had continued to
maintain it. He also found a drawing that was part of the testing code
for which we added correct acknowledgement in the current package. I
believe all these curiosities have been appropriately considered. No
further action is either needed or anticipated.

Toggle quote (4 lines)
> If these aren't the first generation patches in the series, maybe
> re-send the patches that still need applying as a [PATCH v2] (or v3?
> v4?) in the subject of each patch?

The patch you built is the only one needed to build the entire
java-xalan-interp library. The earlier versions are no longer relevant.

Toggle quote (11 lines)
> With a summary clarifying the licensing and which exact patches still
> need applying, that would make it a lot easier to review!
>
>
> Thanks for contributing to guix, and hanging onto patience with the
> process!
>
>
> live well,
> vagrant

Hoping that guix will soon be able to add this complete xalan
implementation to guix in the near future.

Regards,
Frank Pursel
F
F
Frank Pursel wrote on 20 Sep 2022 23:25
Add java-xalan-interp CVE
(address . 32947@debbugs.gnu.org)
87fsglpwkt.fsf@Ginko.local.mail-host-address-is-not-set
CVE-2022-34169 has recently been posted against the xalan XSLT library.

Looking for an appropriate patch but maybe it is a dead end and instead
effort should be focused on alternative that might allow batik and
others to function. Suggestions are, of course, welcome.

Regards,
Frank
?