From 8cffc6b1688dd9a933ac63b5fe934cf99d8febf9 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 18 Oct 2024 23:12:19 +0900 Subject: nongnu: linux-firmware: Use Zstd compression. This halves the size of the firmware collection from 1.1 GiB to 509 MiB. * nongnu/packages/linux.scm (linux-firmware)[phases]: Override install phase. [native-inputs]: Add zstd. Signed-off-by: John Kehayias --- nongnu/packages/linux.scm | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'nongnu/packages/linux.scm') diff --git a/nongnu/packages/linux.scm b/nongnu/packages/linux.scm index 9731294..038027e 100644 --- a/nongnu/packages/linux.scm +++ b/nongnu/packages/linux.scm @@ -26,6 +26,7 @@ ;;; Copyright © 2023 Ada Stevenson ;;; Copyright © 2023 Tomas Volf <~@wolfsden.cz> ;;; Copyright © 2023 PRESFIL +;;; Copyright © 2024 Maxim Cournoyer (define-module (nongnu packages linux) #:use-module (gnu packages) @@ -338,8 +339,21 @@ stable, responsive and smooth desktop experience."))) (substitute* "copy-firmware.sh" (("./check_whence.py") "true")))) - (delete 'configure)))) - (native-inputs (list rdfind)) + (delete 'configure) + (replace 'install + ;; Use Zstd compression to reduce space requirements. + (lambda* (#:key (parallel-build? #t) (make-flags '()) + #:allow-other-keys) + (let ((num-jobs (if parallel-build? + (number->string (parallel-job-count)) + "1"))) + ;; Use the best 'standard' compression level. + (setenv "ZSTD_CLEVEL" "19") + ;; Compress using multiple threads. + (setenv "ZSTD_NBTHREADS" num-jobs) + (apply invoke "make" "install-zst" "-j" num-jobs + make-flags))))))) + (native-inputs (list rdfind zstd)) (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git") (synopsis "Nonfree firmware blobs for Linux") -- cgit v1.2.3