From 77d6222ceb26838da63dd0e73013245157e25d40 Mon Sep 17 00:00:00 2001 From: Tim Gesthuizen Date: Thu, 17 Jan 2019 22:51:10 +0100 Subject: [PATCH 06/11] gnu: ant-bootstrap: Use strip-jar-timestamps * gnu/packages/java.scm (ant-bootstrap): [arguments]: Use build phase from ant-build-system. --- gnu/packages/java.scm | 37 ++++++------------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 163c29627..dd7abfaf3 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -10,6 +10,7 @@ ;;; Copyright © 2018 Gábor Boskovits ;;; Copyright © 2018 Chris Marusich ;;; Copyright © 2018 Efraim Flashner +;;; Copyright © 2019 Tim Gesthuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -217,9 +218,11 @@ JNI.") (build-system gnu-build-system) (arguments `(#:imported-modules ((guix build syscalls) + (guix build ant-build-system) ,@%gnu-build-system-modules) #:modules ((srfi srfi-1) (guix build gnu-build-system) + ((guix build ant-build-system) #:prefix ant:) (guix build utils) (guix build syscalls)) #:tests? #f ; no "check" target @@ -267,42 +270,14 @@ JNI.") (invoke "bash" "bootstrap.sh" (string-append "-Ddist.dir=" (assoc-ref %outputs "out"))))) - (add-after 'build 'strip-jar-timestamps ;based on ant-build-system - (lambda* (#:key outputs #:allow-other-keys) - (define (repack-archive jar) - (let* ((dir (mkdtemp! "jar-contents.XXXXXX")) - (manifest (string-append dir "/META-INF/MANIFESTS.MF"))) - (with-directory-excursion dir - (invoke "unzip" jar)) - (delete-file jar) - ;; XXX: copied from (gnu build install) - (for-each (lambda (file) - (let ((s (lstat file))) - (unless (eq? (stat:type s) 'symlink) - (utime file 0 0 0 0)))) - (find-files dir #:directories? #t)) - ;; It is important that the manifest appears first. - (with-directory-excursion dir - (let* ((files (find-files "." ".*" #:directories? #t)) - ;; To ensure that the reference scanner can - ;; detect all store references in the jars - ;; we disable compression with the "-0" option. - (command (if (file-exists? manifest) - `("zip" "-0" "-X" ,jar ,manifest - ,@files) - `("zip" "-0" "-X" ,jar ,@files)))) - (apply invoke command))))) - (for-each repack-archive - (find-files - (string-append (assoc-ref %outputs "out") "/lib") - "\\.jar$")) - #t)) + (add-after 'build 'strip-jar-timestamps + (assoc-ref ant:%standard-phases 'strip-jar-timestamps)) (delete 'install)))) (native-inputs `(("jikes" ,jikes) ("jamvm" ,jamvm-1-bootstrap) ("unzip" ,unzip) - ("zip" ,zip))) + ("repack" ,repack))) (home-page "http://ant.apache.org") (synopsis "Build tool for Java") (description -- 2.20.1