guix-devel
[Top][All Lists]
Advanced

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

[PATCH] Create INDEX.LIST; Was: Fix references in jar manifests


From: Danny Milosavljevic
Subject: [PATCH] Create INDEX.LIST; Was: Fix references in jar manifests
Date: Sun, 25 Mar 2018 12:19:18 +0200

diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm
index 6ce813a00..d09062625 100644
--- a/guix/build/ant-build-system.scm
+++ b/guix/build/ant-build-system.scm
@@ -172,6 +172,18 @@ to the default GNU unpack strategy."
                 #:allow-other-keys)
   (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."
+  (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
                                #:allow-other-keys)
   "Unpack all jar archives, reset the timestamp of all contained files, and
@@ -232,7 +244,9 @@ repack them.  This is necessary to ensure that archives are 
reproducible."
     (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)

Attachment: pgpnHI_W1MZ_v.pgp
Description: OpenPGP digital signature


reply via email to

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