diff options
| author | Nicolas Graves <ngraves@ngraves.fr> | 2026-05-01 19:52:31 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2026-05-18 19:12:09 +0200 |
| commit | 8ddbf2ec2a982f2e1d050f1a0f7032a7242570cc (patch) | |
| tree | 45448abc00e00797f9847a0b69e7c748491ad8eb | |
| parent | 2624a5fef2be17d33fe2868f85b70e7058e537b7 (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 4f02c3c8be3..e054857aaf0 100644 --- a/gnu/packages/compression.scm +++ b/gnu/packages/compression.scm | |||
| @@ -321,7 +321,11 @@ file; as a result, it is often used in conjunction with \"tar\", resulting in | |||
| 321 | "0s92986cv0p692icqlw1j42y9nld8zd83qwhzbqd61p1dqbh6nmb")))) | 321 | "0s92986cv0p692icqlw1j42y9nld8zd83qwhzbqd61p1dqbh6nmb")))) |
| 322 | (build-system gnu-build-system) | 322 | (build-system gnu-build-system) |
| 323 | (arguments | 323 | (arguments |
| 324 | (list #:modules '((guix build gnu-build-system) | 324 | (list #:make-flags #~(list (string-append "PREFIX=" #$output)) |
| 325 | ;; Don't attempt to run the tests when cross-compiling. | ||
| 326 | #:tests? (not (%current-target-system)) | ||
| 327 | |||
| 328 | #:modules '((guix build gnu-build-system) | ||
| 325 | (guix build utils) | 329 | (guix build utils) |
| 326 | (ice-9 ftw) | 330 | (ice-9 ftw) |
| 327 | (srfi srfi-1)) | 331 | (srfi srfi-1)) |
| @@ -356,8 +360,7 @@ file; as a result, it is often used in conjunction with \"tar\", resulting in | |||
| 356 | (string-append "RANLIB = " target "-ranlib\n")) | 360 | (string-append "RANLIB = " target "-ranlib\n")) |
| 357 | (("^all:(.*)test" _ prerequisites) | 361 | (("^all:(.*)test" _ prerequisites) |
| 358 | ;; Remove 'all' -> 'test' dependency. | 362 | ;; Remove 'all' -> 'test' dependency. |
| 359 | (string-append "all:" prerequisites "\n")))) | 363 | (string-append "all:" prerequisites "\n")))))) |
| 360 | #t)) | ||
| 361 | (add-before 'build 'build-shared-lib | 364 | (add-before 'build 'build-shared-lib |
| 362 | (lambda* (#:key inputs #:allow-other-keys) | 365 | (lambda* (#:key inputs #:allow-other-keys) |
| 363 | (patch-makefile-SHELL "Makefile-libbz2_so") | 366 | (patch-makefile-SHELL "Makefile-libbz2_so") |
| @@ -366,8 +369,7 @@ file; as a result, it is often used in conjunction with \"tar\", resulting in | |||
| 366 | (lambda* (#:key outputs #:allow-other-keys) | 369 | (lambda* (#:key outputs #:allow-other-keys) |
| 367 | ;; The Makefile above does not have an 'install' target, nor does | 370 | ;; The Makefile above does not have an 'install' target, nor does |
| 368 | ;; it create all the (un)versioned symlinks, so we handle it here. | 371 | ;; it create all the (un)versioned symlinks, so we handle it here. |
| 369 | (let* ((out (assoc-ref outputs "out")) | 372 | (let* ((libdir (string-append #$output "/lib")) |
| 370 | (libdir (string-append out "/lib")) | ||
| 371 | (soname "libbz2.so") | 373 | (soname "libbz2.so") |
| 372 | ;; Locate the built library (e.g. "libbz2.so.1.0.6"). | 374 | ;; Locate the built library (e.g. "libbz2.so.1.0.6"). |
| 373 | (lib (car (scandir "." | 375 | (lib (car (scandir "." |
| @@ -384,28 +386,16 @@ file; as a result, it is often used in conjunction with \"tar\", resulting in | |||
| 384 | (unless (null? numbers) | 386 | (unless (null? numbers) |
| 385 | (let ((so-file (string-append base "." (car numbers)))) | 387 | (let ((so-file (string-append base "." (car numbers)))) |
| 386 | (symlink so-file base) | 388 | (symlink so-file base) |
| 387 | (loop so-file (cdr numbers)))))) | 389 | (loop so-file (cdr numbers))))))))) |
| 388 | #t))) | ||
| 389 | (add-after 'install-shared-lib 'move-static-lib | 390 | (add-after 'install-shared-lib 'move-static-lib |
| 390 | (lambda* (#:key outputs #:allow-other-keys) | 391 | (lambda _ |
| 391 | (let ((out (assoc-ref outputs "out")) | 392 | (with-directory-excursion (string-append #$output "/lib") |
| 392 | (static (assoc-ref outputs "static"))) | 393 | (install-file "libbz2.a" (string-append #$output:static "/lib")) |
| 393 | (with-directory-excursion (string-append out "/lib") | 394 | (delete-file "libbz2.a")))) |
| 394 | (install-file "libbz2.a" (string-append static "/lib")) | ||
| 395 | (delete-file "libbz2.a") | ||
| 396 | #t)))) | ||
| 397 | (add-after 'install-shared-lib 'patch-scripts | 395 | (add-after 'install-shared-lib 'patch-scripts |
| 398 | (lambda* (#:key outputs inputs #:allow-other-keys) | 396 | (lambda _ |
| 399 | (let* ((out (assoc-ref outputs "out"))) | 397 | (substitute* (string-append #$output "/bin/bzdiff") |
| 400 | (substitute* (string-append out "/bin/bzdiff") | 398 | (("/bin/rm") "rm"))))))) |
| 401 | (("/bin/rm") "rm"))) | ||
| 402 | #t))) | ||
| 403 | |||
| 404 | #:make-flags #~(list (string-append "PREFIX=" | ||
| 405 | (assoc-ref %outputs "out"))) | ||
| 406 | |||
| 407 | ;; Don't attempt to run the tests when cross-compiling. | ||
| 408 | #:tests? (not (%current-target-system)))) | ||
| 409 | (inputs (if (%current-target-system) | 399 | (inputs (if (%current-target-system) |
| 410 | (list bash-minimal) | 400 | (list bash-minimal) |
| 411 | (list))) | 401 | (list))) |
