aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/compression.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/compression.scm')
-rw-r--r--gnu/packages/compression.scm59
1 files changed, 46 insertions, 13 deletions
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index 8104b9d55c..ac8c1fdbc0 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -85,6 +85,7 @@
(base32
"18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3"))))
(build-system gnu-build-system)
+ (outputs '("out" "static"))
(arguments
`(#:phases
(modify-phases %standard-phases
@@ -99,7 +100,15 @@
`((setenv "CHOST" ,(%current-target-system)))
'())
(invoke "./configure"
- (string-append "--prefix=" out))))))))
+ (string-append "--prefix=" out)))))
+ (add-after 'install 'move-static-library
+ (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 "libz.a" (string-append static "/lib"))
+ (delete-file "libz.a")
+ #t)))))))
(home-page "https://zlib.net/")
(synopsis "Compression library")
(description
@@ -216,6 +225,21 @@ adding and extracting files to/from a tar archive.")
'(#:tests? #f
#:phases
(modify-phases %standard-phases
+ (add-after 'unpack 'patch-for-glibc-2.28
+ (lambda _
+ ;; Adjust the bundled gnulib to work with glibc 2.28. See e.g.
+ ;; "m4-gnulib-libio.patch". This is a phase rather than patch
+ ;; or snippet to work around <https://bugs.gnu.org/32347>.
+ (substitute* (find-files "lib" "\\.c$")
+ (("#if defined _IO_ftrylockfile")
+ "#if defined _IO_EOF_SEEN"))
+ (substitute* "lib/stdio-impl.h"
+ (("^/\\* BSD stdio derived implementations")
+ (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
+ "# define _IO_IN_BACKUP 0x100\n"
+ "#endif\n\n"
+ "/* BSD stdio derived implementations")))
+ #t))
(add-after 'unpack 'use-absolute-name-of-gzip
(lambda* (#:key outputs #:allow-other-keys)
(substitute* "gunzip.in"
@@ -248,6 +272,7 @@ file; as a result, it is often used in conjunction with \"tar\", resulting in
(arguments
`(#:modules ((guix build gnu-build-system)
(guix build utils)
+ (ice-9 ftw)
(srfi srfi-1))
#:phases
(modify-phases %standard-phases
@@ -276,25 +301,32 @@ file; as a result, it is often used in conjunction with \"tar\", resulting in
;; it create all the (un)versioned symlinks, so we handle it here.
(let* ((out (assoc-ref outputs "out"))
(libdir (string-append out "/lib"))
- ;; Find the actual library (e.g. "libbz2.so.1.0.6").
- (lib (string-drop
- (car (find-files
- "."
- (lambda (file stat)
- (and (string-prefix? "./libbz2.so" file)
- (eq? 'regular (stat:type stat))))))
- 2))
- (soversion (string-drop lib (string-length "libbz2.so."))))
+ (soname "libbz2.so")
+ ;; Locate the built library (e.g. "libbz2.so.1.0.6").
+ (lib (car (scandir "."
+ (lambda (file)
+ (and (string-prefix? soname file)
+ (eq? 'regular
+ (stat:type (lstat file))))))))
+ (soversion (string-drop lib (+ 1 (string-length soname)))))
(install-file lib libdir)
(with-directory-excursion libdir
;; Create symlinks libbz2.so.1 -> libbz2.so.1.0, etc.
- (let loop ((base "libbz2.so")
+ (let loop ((base soname)
(numbers (string-split soversion #\.)))
(unless (null? numbers)
(let ((so-file (string-append base "." (car numbers))))
(symlink so-file base)
(loop so-file (cdr numbers))))))
#t)))
+ (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))))
(add-after 'install-shared-lib 'patch-scripts
(lambda* (#:key outputs inputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")))
@@ -309,6 +341,7 @@ file; as a result, it is often used in conjunction with \"tar\", resulting in
,@(if (%current-target-system)
'(#:tests? #f)
'())))
+ (outputs '("out" "static"))
(synopsis "High-quality data compression program")
(description
"bzip2 is a freely available, patent free (see below), high-quality data
@@ -376,7 +409,7 @@ compressed with pbzip2 can be decompressed with bzip2).")
(define-public xz
(package
(name "xz")
- (version "5.2.3")
+ (version "5.2.4")
(source (origin
(method url-fetch)
(uri (list (string-append "http://tukaani.org/xz/xz-" version
@@ -385,7 +418,7 @@ compressed with pbzip2 can be decompressed with bzip2).")
version ".tar.gz")))
(sha256
(base32
- "1jr8pxnz55ifc8cvp3ivgl79ph9iik5aypsc9cma228aglsqp4ki"))))
+ "0ibi2zsfaz6l756spjwc5rayf4ckgc9hwmy8qinppcyk4svz64mm"))))
(build-system gnu-build-system)
(synopsis "General-purpose data compression")
(description