[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: guix: ant-build-system: Create INDEX.LIST.

From: Danny Milosavljevic
Subject: 01/01: guix: ant-build-system: Create INDEX.LIST.
Date: Sun, 6 May 2018 13:40:53 -0400 (EDT)

dannym pushed a commit to branch core-updates
in repository guix.

commit bc65332a38c908cab86c51bd53ae25a5e40ec374
Author: Danny Milosavljevic <address@hidden>
Date:   Sun Mar 25 12:19:18 2018 +0200

    guix: ant-build-system: Create INDEX.LIST.
    Fixes <>.
    * guix/build/ant-build-system.scm (generate-jar-indices): New procedure.
    (%standard-phases)[generate-jar-indices]: New phase.
 guix/build/ant-build-system.scm | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm
index a6da530..d28c290 100644
--- a/guix/build/ant-build-system.scm
+++ b/guix/build/ant-build-system.scm
@@ -172,6 +172,19 @@ to the default GNU unpack strategy."
   (zero? (apply system* `("ant" ,build-target ,@make-flags))))
+(define* (generate-jar-indices #:key outputs #:allow-other-keys)
+  "Generate file \"META-INF/INDEX.LIST\".  This file does not use word wraps
+and is preferred over \"META-INF/MAINFEST.MF\", which does use word wraps,
+by Java when resolving dependencies.  So we make sure to create it so that
+grafting works - and so that the garbage collector doesn't collect
+dependencies of this jar file."
+  (define (generate-index jar)
+    (invoke "jar" "-i" jar))
+  (every (match-lambda
+           ((output . directory)
+            (every generate-index (find-files directory "\\.jar$"))))
+         outputs))
 (define* (strip-jar-timestamps #:key outputs
   "Unpack all jar archives, reset the timestamp of all contained files, and
@@ -233,7 +246,9 @@ repack them.  This is necessary to ensure that archives are 
     (replace 'build build)
     (replace 'check check)
     (replace 'install install)
-    (add-after 'install 'strip-jar-timestamps strip-jar-timestamps)))
+    (add-after 'install 'generate-jar-indices generate-jar-indices)
+    (add-after 'generate-jar-indices 'strip-jar-timestamps
+               strip-jar-timestamps)))
 (define* (ant-build #:key inputs (phases %standard-phases)
                     #:allow-other-keys #:rest args)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]