diff options
| author | Nicolas Graves <ngraves@ngraves.fr> | 2026-05-01 19:52:31 +0200 |
|---|---|---|
| committer | Andreas Enge <andreas@enge.fr> | 2026-07-18 10:40:38 +0200 |
| commit | e75ddb90f965f6348f69a026fbb59b79acefd84b (patch) | |
| tree | 73af044bdb4ffb3b50c8226b55f66768ee8d49bc | |
| parent | 5f8b79d1152687db45fd43fab4a982e2d664f242 (diff) | |
gnu: bzip2: Improve style.
* 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 <ludo@gnu.org>
| -rw-r--r-- | gnu/packages/compression.scm | 40 |
1 files 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 | |||
| 361 | "0s92986cv0p692icqlw1j42y9nld8zd83qwhzbqd61p1dqbh6nmb")))) | 361 | "0s92986cv0p692icqlw1j42y9nld8zd83qwhzbqd61p1dqbh6nmb")))) |
| 362 | (build-system gnu-build-system) | 362 | (build-system gnu-build-system) |
| 363 | (arguments | 363 | (arguments |
| 364 | (list #:modules '((guix build gnu-build-system) | 364 | (list #:make-flags #~(list (string-append "PREFIX=" #$output)) |
| 365 | ;; Don't attempt to run the tests when cross-compiling. | ||
| 366 | #:tests? (not (%current-target-system)) | ||
| 367 | |||
| 368 | #:modules '((guix build gnu-build-system) | ||
| 365 | (guix build utils) | 369 | (guix build utils) |
| 366 | (ice-9 ftw) | 370 | (ice-9 ftw) |
| 367 | (srfi srfi-1)) | 371 | (srfi srfi-1)) |
| @@ -397,8 +401,7 @@ file; as a result, it is often used in conjunction with \"tar\", resulting in | |||
| 397 | (string-append "RANLIB = " target "-ranlib\n")) | 401 | (string-append "RANLIB = " target "-ranlib\n")) |
| 398 | (("^all:(.*)test" _ prerequisites) | 402 | (("^all:(.*)test" _ prerequisites) |
| 399 | ;; Remove 'all' -> 'test' dependency. | 403 | ;; Remove 'all' -> 'test' dependency. |
| 400 | (string-append "all:" prerequisites "\n")))) | 404 | (string-append "all:" prerequisites "\n")))))) |
| 401 | #t)) | ||
| 402 | (add-before 'build 'build-shared-lib | 405 | (add-before 'build 'build-shared-lib |
| 403 | (lambda* (#:key inputs #:allow-other-keys) | 406 | (lambda* (#:key inputs #:allow-other-keys) |
| 404 | (patch-makefile-SHELL "Makefile-libbz2_so") | 407 | (patch-makefile-SHELL "Makefile-libbz2_so") |
| @@ -407,8 +410,7 @@ file; as a result, it is often used in conjunction with \"tar\", resulting in | |||
| 407 | (lambda* (#:key outputs #:allow-other-keys) | 410 | (lambda* (#:key outputs #:allow-other-keys) |
| 408 | ;; The Makefile above does not have an 'install' target, nor does | 411 | ;; The Makefile above does not have an 'install' target, nor does |
| 409 | ;; it create all the (un)versioned symlinks, so we handle it here. | 412 | ;; it create all the (un)versioned symlinks, so we handle it here. |
| 410 | (let* ((out (assoc-ref outputs "out")) | 413 | (let* ((libdir (string-append #$output "/lib")) |
| 411 | (libdir (string-append out "/lib")) | ||
| 412 | (soname "libbz2.so") | 414 | (soname "libbz2.so") |
| 413 | ;; Locate the built library (e.g. "libbz2.so.1.0.6"). | 415 | ;; Locate the built library (e.g. "libbz2.so.1.0.6"). |
| 414 | (lib (car (scandir "." | 416 | (lib (car (scandir "." |
| @@ -425,28 +427,16 @@ file; as a result, it is often used in conjunction with \"tar\", resulting in | |||
| 425 | (unless (null? numbers) | 427 | (unless (null? numbers) |
| 426 | (let ((so-file (string-append base "." (car numbers)))) | 428 | (let ((so-file (string-append base "." (car numbers)))) |
| 427 | (symlink so-file base) | 429 | (symlink so-file base) |
| 428 | (loop so-file (cdr numbers)))))) | 430 | (loop so-file (cdr numbers))))))))) |
| 429 | #t))) | ||
| 430 | (add-after 'install-shared-lib 'move-static-lib | 431 | (add-after 'install-shared-lib 'move-static-lib |
| 431 | (lambda* (#:key outputs #:allow-other-keys) | 432 | (lambda _ |
| 432 | (let ((out (assoc-ref outputs "out")) | 433 | (with-directory-excursion (string-append #$output "/lib") |
| 433 | (static (assoc-ref outputs "static"))) | 434 | (install-file "libbz2.a" (string-append #$output:static "/lib")) |
| 434 | (with-directory-excursion (string-append out "/lib") | 435 | (delete-file "libbz2.a")))) |
| 435 | (install-file "libbz2.a" (string-append static "/lib")) | ||
| 436 | (delete-file "libbz2.a") | ||
| 437 | #t)))) | ||
| 438 | (add-after 'install-shared-lib 'patch-scripts | 436 | (add-after 'install-shared-lib 'patch-scripts |
| 439 | (lambda* (#:key outputs inputs #:allow-other-keys) | 437 | (lambda _ |
| 440 | (let* ((out (assoc-ref outputs "out"))) | 438 | (substitute* (string-append #$output "/bin/bzdiff") |
| 441 | (substitute* (string-append out "/bin/bzdiff") | 439 | (("/bin/rm") "rm"))))))) |
| 442 | (("/bin/rm") "rm"))) | ||
| 443 | #t))) | ||
| 444 | |||
| 445 | #:make-flags #~(list (string-append "PREFIX=" | ||
| 446 | (assoc-ref %outputs "out"))) | ||
| 447 | |||
| 448 | ;; Don't attempt to run the tests when cross-compiling. | ||
| 449 | #:tests? (not (%current-target-system)))) | ||
| 450 | (inputs (if (%current-target-system) | 440 | (inputs (if (%current-target-system) |
| 451 | (list bash-minimal) | 441 | (list bash-minimal) |
| 452 | (list))) | 442 | (list))) |
