unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#55979] [PATCH] gnu: Add java-commons-text
@ 2022-06-14 18:44 Artyom V. Poptsov
  2022-06-15 10:48 ` Julien Lepiller
  2022-06-15 10:53 ` [bug#55979] " Julien Lepiller
  0 siblings, 2 replies; 8+ messages in thread
From: Artyom V. Poptsov @ 2022-06-14 18:44 UTC (permalink / raw)
  To: 55979


[-- Attachment #1.1: Type: text/plain, Size: 396 bytes --]

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/


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-Add-java-commons-text.patch --]
[-- Type: text/x-diff, Size: 2222 bytes --]

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


[-- Attachment #1.3: Type: text/plain, Size: 207 bytes --]


-- 
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
Home page: https://memory-heap.org/~avp/
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE  B57C E9C5 A2D9 0898 A02F

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#55979] [PATCH] gnu: Add java-commons-text
  2022-06-14 18:44 [bug#55979] [PATCH] gnu: Add java-commons-text Artyom V. Poptsov
@ 2022-06-15 10:48 ` Julien Lepiller
  2022-06-18 16:25   ` Artyom V. Poptsov
  2022-06-15 10:53 ` [bug#55979] " Julien Lepiller
  1 sibling, 1 reply; 8+ messages in thread
From: Julien Lepiller @ 2022-06-15 10:48 UTC (permalink / raw)
  To: 55979, poptsov.artyom

[-- Attachment #1: Type: text/plain, Size: 1410 bytes --]

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/
>

[-- Attachment #2: Type: text/html, Size: 1763 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#55979] [PATCH] gnu: Add java-commons-text
  2022-06-14 18:44 [bug#55979] [PATCH] gnu: Add java-commons-text Artyom V. Poptsov
  2022-06-15 10:48 ` Julien Lepiller
@ 2022-06-15 10:53 ` Julien Lepiller
  1 sibling, 0 replies; 8+ messages in thread
From: Julien Lepiller @ 2022-06-15 10:53 UTC (permalink / raw)
  To: Artyom V. Poptsov, 55979

[-- Attachment #1: Type: text/plain, Size: 1412 bytes --]

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/
>

[-- Attachment #2: Type: text/html, Size: 1767 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#55979] [PATCH] gnu: Add java-commons-text
  2022-06-15 10:48 ` Julien Lepiller
@ 2022-06-18 16:25   ` Artyom V. Poptsov
  2022-06-18 19:42     ` Julien Lepiller
  0 siblings, 1 reply; 8+ messages in thread
From: Artyom V. Poptsov @ 2022-06-18 16:25 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: 55979


[-- Attachment #1.1: Type: text/plain, Size: 101 bytes --]

Hello Julien,

I've updated the patch according to your suggestions.  Could you please
take a look?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-Add-java-commons-text.patch --]
[-- Type: text/x-diff, Size: 2155 bytes --]

From aaafb87ce534f5ae337988f6b540704facfd11ee 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 | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index d2fbf840a0..25d2377c0d 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -7893,6 +7893,41 @@ 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
+           #:phases #~(modify-phases %standard-phases
+                        (replace 'install
+                          (install-from-pom "pom.xml")))))
+    (inputs
+     (list java-commons-lang3
+           java-commons-io))
+    (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


[-- Attachment #1.3: Type: text/plain, Size: 230 bytes --]


Thanks!

- Artyom

-- 
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
Home page: https://memory-heap.org/~avp/
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE  B57C E9C5 A2D9 0898 A02F

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#55979] [PATCH] gnu: Add java-commons-text
  2022-06-18 16:25   ` Artyom V. Poptsov
@ 2022-06-18 19:42     ` Julien Lepiller
  2022-06-20 19:50       ` Artyom V. Poptsov
  0 siblings, 1 reply; 8+ messages in thread
From: Julien Lepiller @ 2022-06-18 19:42 UTC (permalink / raw)
  To: Artyom V. Poptsov; +Cc: 55979

Le Sat, 18 Jun 2022 19:25:29 +0300,
"Artyom V. Poptsov" <poptsov.artyom@gmail.com> a écrit :

> +    (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.

I think ;; tests require junit5
is enough here :)

> +           #:tests? #f
> +           #:phases #~(modify-phases %standard-phases
> +                        (replace 'install
> +                          (install-from-pom "pom.xml")))))

great :)

> +    (inputs
> +     (list java-commons-lang3
> +           java-commons-io))
> +    (propagated-inputs
> +     (list apache-commons-parent-pom-52))

So this is an error, because apache-commons-parent-pom-52 is not the
parent of this package's pom file. Here's the content of the pom file
(btw you can view it easily with "guix build -S java-commons-text"):

  <parent>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-parent</artifactId>
    <version>51</version>
  </parent>

so the parent is apache-commons-parent-pom-51 (note the version number).

Also in the list of dependencies from that file I see
java-commons-lang3, so it needs to be propagated, otherwise maven might
not be able to find it.

> +    (home-page "https://commons.apache.org/text/")
> +    (synopsis "Library focused on algorithms working on strings")




^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#55979] [PATCH] gnu: Add java-commons-text
  2022-06-18 19:42     ` Julien Lepiller
@ 2022-06-20 19:50       ` Artyom V. Poptsov
  2022-06-23 18:45         ` Artyom V. Poptsov
  0 siblings, 1 reply; 8+ messages in thread
From: Artyom V. Poptsov @ 2022-06-20 19:50 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: 55979


[-- Attachment #1.1: Type: text/plain, Size: 142 bytes --]

Hello,

here's an updated version of the patch.  I've added
'apache-commons-parent-pom-51' in the same patch, not sure if it's right
though.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-Add-java-commons-text.patch --]
[-- Type: text/x-diff, Size: 2911 bytes --]

From 0b3f5533d2c97c333b201da307f31cca9deb6a1a 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/maven-parent-pom.scm (apache-commons-parent-pom-51): New
  variable, required for 'java-commons-text'.
---
 gnu/packages/java.scm             | 33 +++++++++++++++++++++++++++++++
 gnu/packages/maven-parent-pom.scm |  5 +++++
 2 files changed, 38 insertions(+)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index d2fbf840a0..4ac1e52f67 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -7893,6 +7893,39 @@ 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"
+           #:tests? #f                  ; Tests require JUnit5.
+           #:phases #~(modify-phases %standard-phases
+                        (replace 'install
+                          (install-from-pom "pom.xml")))))
+    (inputs
+     (list java-commons-io))
+    (propagated-inputs
+     (list java-commons-lang3
+           apache-commons-parent-pom-51))
+    (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)))
 
diff --git a/gnu/packages/maven-parent-pom.scm b/gnu/packages/maven-parent-pom.scm
index cf48be86a2..bb5e97e6e2 100644
--- a/gnu/packages/maven-parent-pom.scm
+++ b/gnu/packages/maven-parent-pom.scm
@@ -143,6 +143,11 @@
     "50" "0ki8px35dan51ashblpw6rdl27c2fq62slazhslhq3lr4fwlpvxs"
     apache-parent-pom-21))
 
+(define-public apache-commons-parent-pom-51
+  (make-apache-commons-parent-pom
+   "51" "05najrpys26jymla2p5jdz4mf4fjp525h6mnr0jfx55lp03xi939"
+   apache-parent-pom-21))
+
 (define-public apache-commons-parent-pom-52
   (make-apache-commons-parent-pom
     "52" "0fb6id9cs9944fjlirjc07bf234bwi96i642px09m9nrfj338n5d"
-- 
2.25.1


[-- Attachment #1.3: Type: text/plain, Size: 230 bytes --]


Thanks!

- Artyom

-- 
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
Home page: https://memory-heap.org/~avp/
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE  B57C E9C5 A2D9 0898 A02F

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#55979] [PATCH] gnu: Add java-commons-text
  2022-06-20 19:50       ` Artyom V. Poptsov
@ 2022-06-23 18:45         ` Artyom V. Poptsov
  2022-06-25  9:39           ` bug#55979: " Julien Lepiller
  0 siblings, 1 reply; 8+ messages in thread
From: Artyom V. Poptsov @ 2022-06-23 18:45 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: 55979

[-- Attachment #1: Type: text/plain, Size: 285 bytes --]

Hello,

have you had any chance to review my patch?

Thanks!

- Artyom

-- 
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
Home page: https://memory-heap.org/~avp/
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE  B57C E9C5 A2D9 0898 A02F

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#55979: [PATCH] gnu: Add java-commons-text
  2022-06-23 18:45         ` Artyom V. Poptsov
@ 2022-06-25  9:39           ` Julien Lepiller
  0 siblings, 0 replies; 8+ messages in thread
From: Julien Lepiller @ 2022-06-25  9:39 UTC (permalink / raw)
  To: Artyom V. Poptsov; +Cc: 55979-done

I split the patch in two commits (one per package) and pushed to master
as 583537f2d6b8e5cd7f4b2f6cc7a6d7d2c9aeae7a and
2f8929482acf709d36e89ba8aca9d281b8cf6831.

I changed the propagated input of apache-commons-parent-pom-51 to
apache-parent-pom-23 instead of apache-parent-pom-21, because that's
what the pom file contains. I added a full stop at the end of the
commit message.

Thank you!




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-06-25  9:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-14 18:44 [bug#55979] [PATCH] gnu: Add java-commons-text Artyom V. Poptsov
2022-06-15 10:48 ` Julien Lepiller
2022-06-18 16:25   ` Artyom V. Poptsov
2022-06-18 19:42     ` Julien Lepiller
2022-06-20 19:50       ` Artyom V. Poptsov
2022-06-23 18:45         ` Artyom V. Poptsov
2022-06-25  9:39           ` bug#55979: " Julien Lepiller
2022-06-15 10:53 ` [bug#55979] " Julien Lepiller

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).