diff mbox series

[bug#55979] gnu: Add java-commons-text

Message ID 87edzrw0e7.fsf@gmail.com
State Accepted
Headers show
Series [bug#55979] gnu: Add java-commons-text | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Artyom V. Poptsov June 14, 2022, 6:44 p.m. UTC
Hello,

here's the patch that adds 'java-commons-text'. [1]

Unfortunately I had to disable tests as they require JUnit5 (which is
missing from GNU Guix at the moment.)

Also many thanks to Julien Lepiller who helped me to update
'java-commons-lang3' to 3.12.0, which in turn was required to package
'java-commons-text'.

- Artyom

References:
1. https://commons.apache.org/proper/commons-text/

Comments

Julien Lepiller June 15, 2022, 10:48 a.m. UTC | #1
Hi!

The patch looks good to me. I would just change some things for style: no need for a new line between a keyword and it value in the arguments list, and use a quote or semi-quote instead of list. I think the comments are a bit too much, but I'm not sure what's the riggt amount. If it were me, I would only add a comment to #:tests? saying it depends on junit5 which is not packaged.

Maybe more important, you say it's a dependency for maven-plugin-plugin. In that case, we need to install it with its pom file, to lib/m2. This is done by install-from-pom.

Maybe at this point we should mandate using it for java packages? We can always go back and fix them when needed, but it's much less work to do the right thing from the start.

Just thinking out load, maybe we could add a #:pom argument to the ant-build-system, so we don't have to modify the phases all the time?

On June 14, 2022 8:44:16 PM GMT+02:00, "Artyom V. Poptsov" <poptsov.artyom@gmail.com> wrote:
>Hello,
>
>here's the patch that adds 'java-commons-text'. [1]
>
>Unfortunately I had to disable tests as they require JUnit5 (which is
>missing from GNU Guix at the moment.)
>
>Also many thanks to Julien Lepiller who helped me to update
>'java-commons-lang3' to 3.12.0, which in turn was required to package
>'java-commons-text'.
>
>- Artyom
>
>References:
>1. https://commons.apache.org/proper/commons-text/
>
Julien Lepiller June 15, 2022, 10:53 a.m. UTC | #2
Hi!

The patch looks good to me. I would just change some things for style: no need for a new line between a keyword and it value in the arguments list, and use a quote or semi-quote instead of list. I think the comments are a bit too much, but I'm not sure what's the riggt amount. If it were me, I would only add a comment to #:tests? saying it depends on junit5 which is not packaged.

Maybe more important, you say it's a dependency for maven-plugin-plugin. In that case, we need to install it with its pom file, to lib/m2. This is done by install-from-pom.

Maybe at this point we should mandate using it for java packages? We can always go back and fix them when needed, but it's much less work to do the right thing from the start.

Just thinking out load, maybe we could add a #:pom argument to the ant-build-system, so we don't have to modify the phases all the time?


On June 14, 2022 8:44:16 PM GMT+02:00, "Artyom V. Poptsov" <poptsov.artyom@gmail.com> wrote:
>Hello,
>
>here's the patch that adds 'java-commons-text'. [1]
>
>Unfortunately I had to disable tests as they require JUnit5 (which is
>missing from GNU Guix at the moment.)
>
>Also many thanks to Julien Lepiller who helped me to update
>'java-commons-lang3' to 3.12.0, which in turn was required to package
>'java-commons-text'.
>
>- Artyom
>
>References:
>1. https://commons.apache.org/proper/commons-text/
>
diff mbox series

Patch

From a3c835fb370930a6bc99ae872bc7f4c541587189 Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Mon, 13 Jun 2022 06:54:25 +0300
Subject: [PATCH] gnu: Add java-commons-text

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

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index d2fbf840a0..1750dc662b 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -7893,6 +7893,44 @@  Commons CLI supports different types of options:
 @item long options with single hyphen (ie. ant -projecthelp)
 @end itemize
 
+This is a part of the Apache Commons Project.")
+    (license license:asl2.0)))
+
+(define-public java-commons-text
+  (package
+    (name "java-commons-text")
+    (version "1.9")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://apache/commons/text/source/"
+                                  "commons-text-" version "-src.tar.gz"))
+              (sha256
+               (base32
+                "1k99ib2dxlqxb5y94kpzf4ix8xgxz1j3n9kq3ddssqqcccsp5ik2"))))
+    (build-system ant-build-system)
+    (arguments
+     (list #:jar-name
+           "java-commons-text.jar"
+           #:source-dir
+           "src/main/java"
+           #:test-dir
+           "src/test"
+           ;; XXX: Tests require JUnit5, namely 'org.junit.jupiter.api' module
+           ;; from JUnit5.
+           #:tests?
+           #f))
+    (inputs (list java-commons-lang3 java-commons-io))
+    ;; XXX: These are dependencies required for running the tests (which are
+    ;; disable until JUnit5 is available.)
+    ;; (native-inputs
+    ;; (list java-assertj
+    ;; java-junit))
+    (propagated-inputs (list apache-commons-parent-pom-52))
+    (home-page "https://commons.apache.org/text/")
+    (synopsis "Library focused on algorithms working on strings")
+    (description "Apache Commons Text is a library focused on algorithms
+working on strings.
+
 This is a part of the Apache Commons Project.")
     (license license:asl2.0)))
 
-- 
2.25.1