mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: opendjk11: Reduce size by removing extraneous files.
By removing the *.diz and src.zip files, the size of the main output of OpenJDK 11 is reduced from 345 MiB to 116 MiB for OpenJDK 11, while the 'jdk' output is reduced from 805 MiB to 353 MiB. * gnu/packages/java.scm (openjdk11)[modules]: New field. [phases]{remove-diz-files}: New phase. {strip-character-data-timestamps}: Order after remove-diz-files.
This commit is contained in:
parent
6193d98717
commit
6bf7467b07
1 changed files with 19 additions and 3 deletions
|
@ -1788,7 +1788,11 @@ new Date();"))
|
||||||
(list
|
(list
|
||||||
#:imported-modules `((guix build syscalls)
|
#:imported-modules `((guix build syscalls)
|
||||||
,@%gnu-build-system-modules)
|
,@%gnu-build-system-modules)
|
||||||
|
#:modules `((guix build gnu-build-system)
|
||||||
|
(guix build utils)
|
||||||
|
(ice-9 match)
|
||||||
|
(srfi srfi-1)
|
||||||
|
(srfi srfi-26))
|
||||||
#:disallowed-references (list (gexp-input openjdk10)
|
#:disallowed-references (list (gexp-input openjdk10)
|
||||||
(gexp-input openjdk10 "jdk"))
|
(gexp-input openjdk10 "jdk"))
|
||||||
|
|
||||||
|
@ -1934,7 +1938,19 @@ new Date();"))
|
||||||
(with-directory-excursion dir
|
(with-directory-excursion dir
|
||||||
(let ((files (find-files "." ".*" #:directories? #t)))
|
(let ((files (find-files "." ".*" #:directories? #t)))
|
||||||
(apply invoke "zip" "-0" "-X" archive files))))))
|
(apply invoke "zip" "-0" "-X" archive files))))))
|
||||||
(add-after 'strip-character-data-timestamps 'strip-archive-timestamps
|
(add-after 'strip-character-data-timestamps 'remove-extraneous-files
|
||||||
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
|
;; Remove the *.diz and src.zip files for space considerations.
|
||||||
|
;; The former are compressed debuginfo files not typically
|
||||||
|
;; shipped with Java distributions, while the later corresponds
|
||||||
|
;; to Java core API source files.
|
||||||
|
(for-each delete-file
|
||||||
|
(append-map (cut find-files <> "(^src\\.zip|\\.diz)$")
|
||||||
|
(map (match-lambda
|
||||||
|
((name . dir)
|
||||||
|
dir))
|
||||||
|
outputs)))))
|
||||||
|
(add-after 'remove-diz-file 'strip-archive-timestamps
|
||||||
(lambda _
|
(lambda _
|
||||||
(use-modules (guix build syscalls)
|
(use-modules (guix build syscalls)
|
||||||
(ice-9 binary-ports)
|
(ice-9 binary-ports)
|
||||||
|
@ -1961,7 +1977,7 @@ new Date();"))
|
||||||
(for-each repack-archive
|
(for-each repack-archive
|
||||||
(find-files #$output:doc "\\.zip$"))
|
(find-files #$output:doc "\\.zip$"))
|
||||||
(for-each repack-archive
|
(for-each repack-archive
|
||||||
(find-files #$output:jdk "\\.(zip|jar|diz)$"))
|
(find-files #$output:jdk "\\.(zip|jar)$"))
|
||||||
(repack-archive (string-append #$output:jdk "/lib/ct.sym"))
|
(repack-archive (string-append #$output:jdk "/lib/ct.sym"))
|
||||||
(let ((repack-jmod
|
(let ((repack-jmod
|
||||||
(lambda (file-name)
|
(lambda (file-name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue