unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#57749: [patch] maven: fix build with java-slf4j-simple-source expanded
@ 2022-09-12 12:33 Dr. Arne Babenhauserheide
  2022-09-12 14:13 ` Julien Lepiller
  2022-09-22  8:19 ` Rostislav Svoboda
  0 siblings, 2 replies; 6+ messages in thread
From: Dr. Arne Babenhauserheide @ 2022-09-12 12:33 UTC (permalink / raw)
  To: 57749


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

Hi,

Maven failed to build for me, because java-slf4j-simple-source is no
longer a tarball, but an expanded directory of files.

Copying the files from Scheme makes it build. A patch is attached.



[-- Attachment #1.2: 0001-gnu-maven-fix-build-with-java-slf4j-simple-source-ex.patch --]
[-- Type: text/x-patch, Size: 2064 bytes --]

From f9ca747f6ecf63d46a41e813c6c4e7b7190e9081 Mon Sep 17 00:00:00 2001
From: Arne Babenhauserheide <arne_bab@web.de>
Date: Mon, 12 Sep 2022 14:31:42 +0200
Subject: [PATCH] gnu: maven: fix build with java-slf4j-simple-source expanded

* gnu/packages/maven.scm (maven): copy files from source.
---
 gnu/packages/maven.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/maven.scm b/gnu/packages/maven.scm
index 28ec4eb9a8..a7d984fef2 100644
--- a/gnu/packages/maven.scm
+++ b/gnu/packages/maven.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2019 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2022 Artyom V. Poptsov <poptsov.artyom@gmail.com>
+;;; Copyright © 2022 Arne Babenhauserheide <arne_bab@web.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1787,7 +1788,17 @@ (define-public maven-slf4j-provider
            (lambda* (#:key inputs #:allow-other-keys)
              (mkdir-p "generated-sources")
              (with-directory-excursion "generated-sources"
-               (invoke "tar" "xf" (assoc-ref inputs "java-slf4j-simple-source"))
+               (let ((input-folder (assoc-ref inputs "java-slf4j-simple-source")))
+                 ;; copy all files
+                 (for-each (lambda (filename)
+                             (let ((target (string-drop
+                                            filename ;; remove one more than length: the slash
+                                            (1+ (string-length input-folder)))))
+                               (when (not (file-exists? (dirname target)))
+                                 (mkdir-p (dirname target)))
+                               (copy-file filename target)))
+                           (find-files (assoc-ref inputs "java-slf4j-simple-source"))))
+
                (for-each delete-file (find-files "." "StaticLoggerBinder.java")))
              (for-each
                (lambda (simple)
-- 
2.37.3


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



Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de

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

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

* bug#57749: [patch] maven: fix build with java-slf4j-simple-source expanded
  2022-09-12 12:33 bug#57749: [patch] maven: fix build with java-slf4j-simple-source expanded Dr. Arne Babenhauserheide
@ 2022-09-12 14:13 ` Julien Lepiller
  2022-09-12 15:45   ` Dr. Arne Babenhauserheide
  2022-09-22  8:19 ` Rostislav Svoboda
  1 sibling, 1 reply; 6+ messages in thread
From: Julien Lepiller @ 2022-09-12 14:13 UTC (permalink / raw)
  To: Dr. Arne Babenhauserheide, 57749

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

I don't think checking for file-exists before mkdir-p makes much sense. Doesn't mkdir-p make the same checks already?

I thought find-files required two arguments? Also the first argument could be simplified to input-folder

Otherwise LGTM, but I can't push myself currently. Thanks!

Le 12 septembre 2022 14:33:04 GMT+02:00, "Dr. Arne Babenhauserheide" <arne_bab@web.de> a écrit :
>Hi,
>
>Maven failed to build for me, because java-slf4j-simple-source is no
>longer a tarball, but an expanded directory of files.
>
>Copying the files from Scheme makes it build. A patch is attached.
>
>

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

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

* bug#57749: [patch] maven: fix build with java-slf4j-simple-source expanded
  2022-09-12 14:13 ` Julien Lepiller
@ 2022-09-12 15:45   ` Dr. Arne Babenhauserheide
  2022-09-21 21:42     ` Dr. Arne Babenhauserheide
  0 siblings, 1 reply; 6+ messages in thread
From: Dr. Arne Babenhauserheide @ 2022-09-12 15:45 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: 57749


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


Julien Lepiller <julien@lepiller.eu> writes:

> I don't think checking for file-exists before mkdir-p makes much sense. Doesn't mkdir-p make the same
> checks already?

You’re right — thank you!

> I thought find-files required two arguments? Also the first argument
> could be simplified to input-folder

The second argument is #:optional. But yes, it should be input-folder —
that was the whole point of the first let.

Thank you!

> Otherwise LGTM, but I can't push myself currently. Thanks!

Here’s the updated patch:


[-- Attachment #1.2: 0001-gnu-maven-fix-build-with-java-slf4j-simple-source-ex.patch --]
[-- Type: text/x-patch, Size: 1964 bytes --]

From 12164a5b46ad0a5c27c42b426ad94df8f9910b48 Mon Sep 17 00:00:00 2001
From: Arne Babenhauserheide <arne_bab@web.de>
Date: Mon, 12 Sep 2022 14:31:42 +0200
Subject: [PATCH] gnu: maven: fix build with java-slf4j-simple-source expanded

* gnu/packages/maven.scm (maven): copy files from source.
---
 gnu/packages/maven.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/maven.scm b/gnu/packages/maven.scm
index 28ec4eb9a8..f198c2a475 100644
--- a/gnu/packages/maven.scm
+++ b/gnu/packages/maven.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2019 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2022 Artyom V. Poptsov <poptsov.artyom@gmail.com>
+;;; Copyright © 2022 Arne Babenhauserheide <arne_bab@web.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1787,7 +1788,16 @@ (define-public maven-slf4j-provider
            (lambda* (#:key inputs #:allow-other-keys)
              (mkdir-p "generated-sources")
              (with-directory-excursion "generated-sources"
-               (invoke "tar" "xf" (assoc-ref inputs "java-slf4j-simple-source"))
+               (let ((input-folder (assoc-ref inputs "java-slf4j-simple-source")))
+                 ;; copy all files
+                 (for-each (lambda (filename)
+                             (let ((target ;; remove folder prefix plus slash
+                                    (string-drop
+                                     filename
+                                     (1+ (string-length input-folder)))))
+                               (mkdir-p (dirname target))
+                               (copy-file filename target)))
+                           (find-files input-folder)))
                (for-each delete-file (find-files "." "StaticLoggerBinder.java")))
              (for-each
                (lambda (simple)
-- 
2.37.3


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


Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de

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

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

* bug#57749: [patch] maven: fix build with java-slf4j-simple-source expanded
  2022-09-12 15:45   ` Dr. Arne Babenhauserheide
@ 2022-09-21 21:42     ` Dr. Arne Babenhauserheide
  0 siblings, 0 replies; 6+ messages in thread
From: Dr. Arne Babenhauserheide @ 2022-09-21 21:42 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: 57749

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


"Dr. Arne Babenhauserheide" <arne_bab@web.de> writes:
> Julien Lepiller <julien@lepiller.eu> writes:
>> Otherwise LGTM, but I can't push myself currently. Thanks!
>
> Here’s the updated patch:

Can you push again?
(sorry to come back, I just don’t want this to get lost)

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de

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

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

* bug#57749: [patch] maven: fix build with java-slf4j-simple-source expanded
  2022-09-12 12:33 bug#57749: [patch] maven: fix build with java-slf4j-simple-source expanded Dr. Arne Babenhauserheide
  2022-09-12 14:13 ` Julien Lepiller
@ 2022-09-22  8:19 ` Rostislav Svoboda
  2022-09-22 19:50   ` Julien Lepiller
  1 sibling, 1 reply; 6+ messages in thread
From: Rostislav Svoboda @ 2022-09-22  8:19 UTC (permalink / raw)
  To: 57749

It seems like this issue has been resolved by the
79897a37012a9bfbcb460cfe0aaaf32aab79dbe5 if so then please close this
issue.

Thanks




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

* bug#57749: [patch] maven: fix build with java-slf4j-simple-source expanded
  2022-09-22  8:19 ` Rostislav Svoboda
@ 2022-09-22 19:50   ` Julien Lepiller
  0 siblings, 0 replies; 6+ messages in thread
From: Julien Lepiller @ 2022-09-22 19:50 UTC (permalink / raw)
  To: Rostislav Svoboda; +Cc: 57749-close

Le Thu, 22 Sep 2022 10:19:16 +0200,
Rostislav Svoboda <rostislav.svoboda@gmail.com> a écrit :

> It seems like this issue has been resolved by the
> 79897a37012a9bfbcb460cfe0aaaf32aab79dbe5 if so then please close this
> issue.
> 
> Thanks
> 
> 
> 

Ah indeed, a similar patch was sent independently and pushed before
this. I was hoping another commiter would have pushed this patch, but
in the end maven-slf4j-provider was fixed :)

Closing this since it's no longer relevant. Thanks again!




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

end of thread, other threads:[~2022-09-22 19:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-12 12:33 bug#57749: [patch] maven: fix build with java-slf4j-simple-source expanded Dr. Arne Babenhauserheide
2022-09-12 14:13 ` Julien Lepiller
2022-09-12 15:45   ` Dr. Arne Babenhauserheide
2022-09-21 21:42     ` Dr. Arne Babenhauserheide
2022-09-22  8:19 ` Rostislav Svoboda
2022-09-22 19:50   ` 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).