From 8dfda0f40e3419fcbd5702f54acec1f4121a6e6b Mon Sep 17 00:00:00 2001 From: Tim Gesthuizen Date: Sat, 19 Jan 2019 17:08:52 +0100 Subject: [PATCH 08/11] gnu: openjdk9: Use repack for repacking zips * gnu/packages/java.scm (openjdk9): [native-inputs]: Remove zip and unzip in favour of repack. [phases]: Rewrite strip-zip-timestamps to use repack. --- gnu/packages/java.scm | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 4211e9a1e..a6095f8e7 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -1738,22 +1738,8 @@ new Date();")) #t)) (add-after 'install 'strip-zip-timestamps (lambda* (#:key outputs #:allow-other-keys) - (use-modules (guix build syscalls)) - (for-each (lambda (zip) - (let ((dir (mkdtemp! "zip-contents.XXXXXX"))) - (with-directory-excursion dir - (invoke "unzip" zip)) - (delete-file zip) - (for-each (lambda (file) - (let ((s (lstat file))) - (unless (eq? (stat:type s) 'symlink) - (format #t "reset ~a~%" file) - (utime file 0 0 0 0)))) - (find-files dir #:directories? #t)) - (with-directory-excursion dir - (let ((files (find-files "." ".*" #:directories? #t))) - (apply invoke "zip" "-0" "-X" zip files))))) - (find-files (assoc-ref outputs "doc") ".*.zip$")) + (repack-archives (assoc-ref outputs "doc") + ".*.zip$") #t))))) (inputs `(("alsa-lib" ,alsa-lib) @@ -1776,9 +1762,10 @@ new Date();")) (native-inputs `(("icedtea-8" ,icedtea-8) ("icedtea-8:jdk" ,icedtea-8 "jdk") + ("zip" ,zip) ("unzip" ,unzip) - ("which" ,which) - ("zip" ,zip))) + ("repack" ,repack) + ("which" ,which))) (home-page "https://openjdk.java.net/projects/jdk9/") (synopsis "Java development kit") (description -- 2.20.1