From e75ddb90f965f6348f69a026fbb59b79acefd84b Mon Sep 17 00:00:00 2001 From: Nicolas Graves Date: Fri, 1 May 2026 19:52:31 +0200 Subject: gnu: bzip2: Improve style. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/compression.scm (bzip2)[arguments]: Improve style: Put <#:make-flags> and <#:tests?> keywords on top. <#:phases>: Drop trailing #t, use gexps when simpler. Signed-off-by: Ludovic Courtès --- gnu/packages/compression.scm | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm index 548723b42ca..db087e8c50c 100644 --- a/gnu/packages/compression.scm +++ b/gnu/packages/compression.scm @@ -361,7 +361,11 @@ file; as a result, it is often used in conjunction with \"tar\", resulting in "0s92986cv0p692icqlw1j42y9nld8zd83qwhzbqd61p1dqbh6nmb")))) (build-system gnu-build-system) (arguments - (list #:modules '((guix build gnu-build-system) + (list #:make-flags #~(list (string-append "PREFIX=" #$output)) + ;; Don't attempt to run the tests when cross-compiling. + #:tests? (not (%current-target-system)) + + #:modules '((guix build gnu-build-system) (guix build utils) (ice-9 ftw) (srfi srfi-1)) @@ -397,8 +401,7 @@ file; as a result, it is often used in conjunction with \"tar\", resulting in (string-append "RANLIB = " target "-ranlib\n")) (("^all:(.*)test" _ prerequisites) ;; Remove 'all' -> 'test' dependency. - (string-append "all:" prerequisites "\n")))) - #t)) + (string-append "all:" prerequisites "\n")))))) (add-before 'build 'build-shared-lib (lambda* (#:key inputs #:allow-other-keys) (patch-makefile-SHELL "Makefile-libbz2_so") @@ -407,8 +410,7 @@ file; as a result, it is often used in conjunction with \"tar\", resulting in (lambda* (#:key outputs #:allow-other-keys) ;; The Makefile above does not have an 'install' target, nor does ;; it create all the (un)versioned symlinks, so we handle it here. - (let* ((out (assoc-ref outputs "out")) - (libdir (string-append out "/lib")) + (let* ((libdir (string-append #$output "/lib")) (soname "libbz2.so") ;; Locate the built library (e.g. "libbz2.so.1.0.6"). (lib (car (scandir "." @@ -425,28 +427,16 @@ file; as a result, it is often used in conjunction with \"tar\", resulting in (unless (null? numbers) (let ((so-file (string-append base "." (car numbers)))) (symlink so-file base) - (loop so-file (cdr numbers)))))) - #t))) + (loop so-file (cdr numbers))))))))) (add-after 'install-shared-lib 'move-static-lib - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (static (assoc-ref outputs "static"))) - (with-directory-excursion (string-append out "/lib") - (install-file "libbz2.a" (string-append static "/lib")) - (delete-file "libbz2.a") - #t)))) + (lambda _ + (with-directory-excursion (string-append #$output "/lib") + (install-file "libbz2.a" (string-append #$output:static "/lib")) + (delete-file "libbz2.a")))) (add-after 'install-shared-lib 'patch-scripts - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out"))) - (substitute* (string-append out "/bin/bzdiff") - (("/bin/rm") "rm"))) - #t))) - - #:make-flags #~(list (string-append "PREFIX=" - (assoc-ref %outputs "out"))) - - ;; Don't attempt to run the tests when cross-compiling. - #:tests? (not (%current-target-system)))) + (lambda _ + (substitute* (string-append #$output "/bin/bzdiff") + (("/bin/rm") "rm"))))))) (inputs (if (%current-target-system) (list bash-minimal) (list))) -- cgit v1.2.3