Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / compression.scm
index b158fea..fdfa5ce 100644 (file)
@@ -1,10 +1,10 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
-;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
 ;;; Copyright © 2015, 2016 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2015, 2017, 2018 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2015 Jeff Mickey <j@codemac.net>
 ;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
@@ -13,7 +13,7 @@
 ;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2016 David Craven <david@craven.ch>
 ;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
-;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2016, 2018 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
 ;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
@@ -22,6 +22,7 @@
 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
+;;; Copyright © 2018 Pierre Neidhardt <ambrevar@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -97,9 +98,8 @@
                ,@(if (%current-target-system)
                      `((setenv "CHOST" ,(%current-target-system)))
                      '())
-               (zero?
-                (system* "./configure"
-                         (string-append "--prefix=" out)))))))))
+               (invoke "./configure"
+                       (string-append "--prefix=" out))))))))
     (home-page "https://zlib.net/")
     (synopsis "Compression library")
     (description
@@ -127,7 +127,7 @@ in compression.")
            (lambda _ (chdir "contrib/minizip") #t))
          (add-after 'enter-source 'autoreconf
            (lambda _
-             (zero? (system* "autoreconf" "-vif")))))))
+             (invoke "autoreconf" "-vif"))))))
     (native-inputs
      `(("autoconf" ,autoconf)
        ("automake" ,automake)
@@ -184,7 +184,7 @@ utility.  Instead of being written in Java, FastJar is written in C.")
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'autoconf
-          (lambda _ (zero? (system* "sh" "autoreconf" "-vfi")))))))
+          (lambda _ (invoke "sh" "autoreconf" "-vfi"))))))
    (native-inputs
     `(("autoconf" ,autoconf)
       ("automake" ,automake)
@@ -201,14 +201,14 @@ adding and extracting files to/from a tar archive.")
 (define-public gzip
   (package
    (name "gzip")
-   (version "1.8")
+   (version "1.9")
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://gnu/gzip/gzip-"
                                 version ".tar.xz"))
             (sha256
              (base32
-              "1lxv3p4iyx7833mlihkn5wfwmz4cys5nybwpz3dfawag8kn6f5zz"))))
+              "16h8g4acy7fgfxcjacr3wijjsnixwsfd2jhz3zwdi2qrzi262l5f"))))
    (build-system gnu-build-system)
    (synopsis "General file (de)compression (using lzw)")
    (arguments
@@ -246,40 +246,61 @@ 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
          (replace 'configure
            (lambda* (#:key target #:allow-other-keys)
-             (if ,(%current-target-system)
-                 ;; Cross-compilation: use the cross tools.
-                 (substitute* (find-files "." "Makefile")
-                   (("CC=.*$")
-                    (string-append "CC = " target "-gcc\n"))
-                   (("AR=.*$")
-                    (string-append "AR = " target "-ar\n"))
-                   (("RANLIB=.*$")
-                    (string-append "RANLIB = " target "-ranlib\n"))
-                   (("^all:(.*)test" _ prerequisites)
-                    ;; Remove 'all' -> 'test' dependency.
-                    (string-append "all:" prerequisites "\n")))
-                 #t)))
+             (when ,(%current-target-system)
+               ;; Cross-compilation: use the cross tools.
+               (substitute* (find-files "." "Makefile")
+                 (("CC=.*$")
+                  (string-append "CC = " target "-gcc\n"))
+                 (("AR=.*$")
+                  (string-append "AR = " target "-ar\n"))
+                 (("RANLIB=.*$")
+                  (string-append "RANLIB = " target "-ranlib\n"))
+                 (("^all:(.*)test" _ prerequisites)
+                  ;; Remove 'all' -> 'test' dependency.
+                  (string-append "all:" prerequisites "\n"))))
+             #t))
          (add-before 'build 'build-shared-lib
            (lambda* (#:key inputs #:allow-other-keys)
              (patch-makefile-SHELL "Makefile-libbz2_so")
-             (zero? (system* "make" "-f" "Makefile-libbz2_so"))))
+             (invoke "make" "-f" "Makefile-libbz2_so")))
          (add-after 'install 'install-shared-lib
            (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")))
-               (for-each (lambda (file)
-                           (let ((base (basename file)))
-                             (format #t "installing `~a' to `~a'~%"
-                                     base libdir)
-                             (copy-file file
-                                        (string-append libdir "/" base))))
-                         (find-files "." "^libbz2\\.so")))
-             #t))
+                    (libdir (string-append out "/lib"))
+                    (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 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")))
@@ -294,6 +315,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
@@ -361,7 +383,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
@@ -370,7 +392,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
@@ -476,14 +498,14 @@ some compression ratio).")
 (define-public lzip
   (package
     (name "lzip")
-    (version "1.19")
+    (version "1.20")
     (source (origin
              (method url-fetch)
              (uri (string-append "mirror://savannah/lzip/lzip-"
                                  version ".tar.gz"))
              (sha256
               (base32
-               "1abbch762gv8rjr579q3qyyk6c80plklbv2mw4x0vg71dgsw9bgz"))))
+               "0319q59kb8g324wnj7xzbr7vvlx5bcs13lr34j0zb3kqlyjq2fy9"))))
     (build-system gnu-build-system)
     (home-page "https://www.nongnu.org/lzip/lzip.html")
     (synopsis "Lossless data compressor based on the LZMA algorithm")
@@ -533,6 +555,7 @@ decompressors when faced with corrupted input.")
       (method url-fetch)
       (uri (string-append "mirror://gnu/sharutils/sharutils-"
                           version ".tar.xz"))
+      (patches (search-patches "sharutils-CVE-2018-1000097.patch"))
       (sha256
        (base32
         "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))))
@@ -590,53 +613,55 @@ with the sfArk algorithm.")
     (license license:gpl3+)))
 
 (define-public sfarkxtc
- (let ((commit "b5e0a2ba3921f019d74d4b92bd31c36dd19d2cf1"))
-  (package
-    (name "sfarkxtc")
-    (version (string-take commit 10))
-    (source (origin
-              ;; There are no release tarballs, so we just fetch the latest
-              ;; commit at this time.
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/raboof/sfarkxtc.git")
-                    (commit commit)))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "0f5x6i46qfl6ry21s7g2p4sd4b2r1g4fb03yqi2vv4kq3saryhvj"))))
-    (build-system gnu-build-system)
-    (arguments
-     `(#:tests? #f ;no "check" target
-       #:phases
-       (modify-phases %standard-phases
-         (replace 'configure
-                  (lambda* (#:key outputs #:allow-other-keys)
-                    (substitute* "Makefile"
-                      (("/usr/local") (assoc-ref outputs "out")))
-                    #t)))))
-    (inputs
-     `(("zlib" ,zlib)
-       ("sfarklib" ,sfarklib)))
-    (home-page "https://github.com/raboof/sfarkxtc")
-    (synopsis "Basic sfArk decompressor")
-    (description "SfArk extractor converts SoundFonts in the compressed legacy
+  (let ((commit "13cd6f93725a90d91ec5ea75babf1dbd694ac463")
+        (revision "1"))
+    (package
+      (name "sfarkxtc")
+      (version (git-version "0" revision commit))
+      (source (origin
+                ;; There are no release tarballs, so we just fetch the latest
+                ;; commit at this time.
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/raboof/sfarkxtc.git")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1mb1jyk1m11l1gppd9hmql9cyp55sdf7jk5rbc7acky1z4k4mv19"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:tests? #f                    ;no "check" target
+         #:phases
+         (modify-phases %standard-phases
+           (replace 'configure
+             (lambda* (#:key outputs #:allow-other-keys)
+               (substitute* "Makefile"
+                 (("/usr/local") (assoc-ref outputs "out")))
+               #t)))))
+      (inputs
+       `(("zlib" ,zlib)
+         ("sfarklib" ,sfarklib)))
+      (home-page "https://github.com/raboof/sfarkxtc")
+      (synopsis "Basic sfArk decompressor")
+      (description "SfArk extractor converts SoundFonts in the compressed legacy
 sfArk file format to the uncompressed sf2 format.")
-    (license license:gpl3+))))
+      (license license:gpl3+))))
 
 (define-public libmspack
   (package
     (name "libmspack")
-    (version "0.6")
+    (home-page "https://cabextract.org.uk/libmspack/")
+    (version "0.7")
     (source
      (origin
       (method url-fetch)
-      (uri (string-append "http://www.cabextract.org.uk/libmspack/libmspack-"
-                          version "alpha.tar.gz"))
+      (uri (string-append home-page name "-" version "alpha.tar.gz"))
       (sha256
-       (base32 "08gr2pcinas6bdqz3k0286g5cnksmcx813skmdwyca6bmj1fxnqy"))))
+       (base32 "0wi7ydq8vjiq0kfnpkj2d6vll2s49x38bywnsdqphqb0vdn53q1n"))))
     (build-system gnu-build-system)
-    (home-page "http://www.cabextract.org.uk/libmspack/")
+    (arguments
+     `(#:configure-flags '("--disable-static")))
     (synopsis "Compression tools for some formats used by Microsoft")
     (description
      "The purpose of libmspack is to provide both compression and
@@ -646,7 +671,7 @@ decompression of some loosely related file formats used by Microsoft.")
 (define-public perl-compress-raw-bzip2
   (package
     (name "perl-compress-raw-bzip2")
-    (version "2.074")
+    (version "2.081")
     (source
      (origin
        (method url-fetch)
@@ -654,7 +679,7 @@ decompression of some loosely related file formats used by Microsoft.")
                            "Compress-Raw-Bzip2-" version ".tar.gz"))
        (sha256
         (base32
-         "0b5jwqf15zr787acnx8sfyy2zavdd7gfkd98n1dgy8fs6r8yb8a4"))))
+         "081mpkjy688lg48997fqh3d7ja12vazmz02fw84495civg4vb4l6"))))
     (build-system perl-build-system)
     ;; TODO: Use our bzip2 package.
     (home-page "http://search.cpan.org/dist/Compress-Raw-Bzip2")
@@ -666,7 +691,7 @@ compression library.")
 (define-public perl-compress-raw-zlib
   (package
     (name "perl-compress-raw-zlib")
-    (version "2.076")
+    (version "2.081")
     (source
      (origin
        (method url-fetch)
@@ -674,7 +699,7 @@ compression library.")
                            "Compress-Raw-Zlib-" version ".tar.gz"))
        (sha256
         (base32
-         "1al2h0i6mspldmlf5c09fy5a4j8swsxd31v6zi8zx9iyqk1lw7in"))))
+         "06rsm9ahp20xfyvd3jc69sd0k8vqysryxc6apzdbn96jbcsdwmp1"))))
     (build-system perl-build-system)
     (inputs
      `(("zlib" ,zlib)))
@@ -701,7 +726,7 @@ compression library.")
 (define-public perl-io-compress
   (package
     (name "perl-io-compress")
-    (version "2.074")
+    (version "2.081")
     (source
      (origin
        (method url-fetch)
@@ -709,11 +734,11 @@ compression library.")
                            "IO-Compress-" version ".tar.gz"))
        (sha256
         (base32
-         "1wlpy2026djfmq0bjync531yq6s695jf7bcnpvjphrasi776igdl"))))
+         "1na66ns1g3nni0m9q5494ym4swr21hfgpv88mw8wbj2daiswf4aj"))))
     (build-system perl-build-system)
     (propagated-inputs
-     `(("perl-compress-raw-zlib" ,perl-compress-raw-zlib)     ; >=2.074
-       ("perl-compress-raw-bzip2" ,perl-compress-raw-bzip2))) ; >=2.074
+     `(("perl-compress-raw-zlib" ,perl-compress-raw-zlib)     ; >=2.081
+       ("perl-compress-raw-bzip2" ,perl-compress-raw-bzip2))) ; >=2.081
     (home-page "http://search.cpan.org/dist/IO-Compress")
     (synopsis "IO Interface to compressed files/buffers")
     (description "IO-Compress provides a Perl interface to allow reading and
@@ -741,7 +766,7 @@ writing of compressed data created with the zlib and bzip2 libraries.")
                           (string-append "prefix=" (assoc-ref %outputs "out")))
        #:phases (modify-phases %standard-phases
                   (delete 'configure))))        ; no configure script
-    (home-page "http://www.lz4.org")
+    (home-page "https://www.lz4.org")
     (synopsis "Compression algorithm focused on speed")
     (description "LZ4 is a lossless compression algorithm, providing
 compression speed at 400 MB/s per core (0.16 Bytes/cycle).  It also features an
@@ -842,6 +867,23 @@ systems where low overhead is needed.  This package allows you to create and
 extract such file systems.")
     (license license:gpl2+)))
 
+;; We need this for building squashfs images with symlinks.
+(define-public squashfs-tools-next
+  (let ((commit "fb33dfc32b131a1162dcf0e35bd88254ae10e265")
+        (revision "1"))
+    (package (inherit squashfs-tools)
+      (name "squashfs-tools-next")
+      (version (string-append "4.3-" revision (string-take commit 7)))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/plougher/squashfs-tools.git")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1x2skf8hxzfch978nzx5mh46d4hhi6gl22270hiarjszsjk3bnsx")))))))
+
 (define-public pigz
   (package
     (name "pigz")
@@ -924,10 +966,11 @@ tarballs.")
                  (base32
                   "1qxxsasvwbbbh6dl3138y9h3fg0q2v7xdk5jjc690bdg7g1wrj6n"))
                 (modules '((guix build utils)))
-                (snippet
-                 ;; This is a recursive submodule that is unnecessary for this
-                 ;; package, so delete it.
-                 '(delete-file-recursively "brotli/terryfy"))))
+                (snippet '(begin
+                            ;; This is a recursive submodule that is
+                            ;; unnecessary for this package, so delete it.
+                            (delete-file-recursively "brotli/terryfy")
+                            #t))))
       (build-system gnu-build-system)
       (native-inputs
        `(("autoconf" ,autoconf)
@@ -938,7 +981,7 @@ tarballs.")
                     (add-after 'unpack 'autogen
                       (lambda _
                         (mkdir "m4")
-                        (zero? (system* "autoreconf" "-vfi")))))))
+                        (invoke "autoreconf" "-vfi"))))))
       (home-page "https://github.com/bagder/libbrotli/")
       (synopsis "Implementation of the Brotli compression algorithm")
       (description
@@ -948,24 +991,66 @@ provides encoder and a decoder libraries: libbrotlienc and libbrotlidec,
 respectively, based on the reference implementation from Google.")
       (license license:expat))))
 
+(define-public bsdiff
+  (package
+    (name "bsdiff")
+    (version "4.3")
+    (home-page "https://www.daemonology.net/bsdiff/")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append home-page name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0j2zm3z271x5aw63mwhr3vymzn45p2vvrlrpm9cz2nywna41b0hq"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:make-flags (list "INSTALL=install" "CC=gcc"
+                          (string-append "PREFIX=" (assoc-ref %outputs "out")))
+       #:phases (modify-phases %standard-phases
+                  (delete 'configure)
+                  (add-before 'build 'fix-Makefile
+                    (lambda _
+                      (substitute* "Makefile"
+                        ;; Adjust syntax to make it compatible with GNU Make.
+                        (("^\\.") "")
+                        ;; Help install(1) create the target directory.
+                        (("\\$\\{PREFIX\\}") "-D -t ${PREFIX}"))
+                      #t)))
+       #:tests? #f)) ;no tests
+    (inputs
+     `(("bzip2" ,bzip2)))
+    (synopsis "Patch binary files")
+    (description
+     "@command{bsdiff} and @command{bspatch} are tools for building and
+applying patches to binary files.  By using suffix sorting (specifically
+Larsson and Sadakane's @code{qsufsort}) and taking advantage of how
+executable files change, bsdiff routinely produces binary patches 50-80%
+smaller than those produced by @code{Xdelta}.")
+    (license license:bsd-2)))
+
 (define-public cabextract
  (package
    (name "cabextract")
-   (version "1.6")
+   (home-page "https://cabextract.org.uk/")
+   (version "1.7")
    (source (origin
               (method url-fetch)
-              (uri (string-append
-                    "http://cabextract.org.uk/cabextract-" version ".tar.gz"))
+              (uri (string-append home-page name "-" version ".tar.gz"))
               (sha256
                (base32
-                "1ysmmz25fjghq7mxb2anyyvr1ljxqxzi4piwjhk0sdamcnsn3rnf"))))
+                "1g86wmb8lkjiv2jarfz979ngbgg7d3si8x5il4g801604v406wi9"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  ;; Delete bundled libmspack.
+                  (delete-file-recursively "mspack")
+                  #t))))
     (build-system gnu-build-system)
     (arguments '(#:configure-flags '("--with-external-libmspack")))
     (native-inputs
      `(("pkg-config" ,pkg-config)))
     (inputs
      `(("libmspack" ,libmspack)))
-    (home-page "http://www.cabextract.org.uk/")
     (synopsis "Tool to unpack Cabinet archives")
     (description "Extracts files out of Microsoft Cabinet (.cab) archives")
     ;; Some source files specify gpl2+, lgpl2+, however COPYING is gpl3.
@@ -986,7 +1071,9 @@ respectively, based on the reference implementation from Google.")
        (file-name (string-append name "-" version ".tar.gz"))
        (snippet
         ;; This file isn't freely distributable and has no effect on building.
-        '(delete-file "xdelta3/draft-korn-vcdiff.txt"))))
+        '(begin
+           (delete-file "xdelta3/draft-korn-vcdiff.txt")
+           #t))))
     (build-system gnu-build-system)
     (native-inputs
      `(("autoconf" ,autoconf)
@@ -995,9 +1082,9 @@ respectively, based on the reference implementation from Google.")
      `(#:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'enter-build-directory
-           (lambda _ (chdir "xdelta3")))
+           (lambda _ (chdir "xdelta3") #t))
          (add-after 'enter-build-directory 'autoconf
-           (lambda _ (zero? (system* "autoreconf" "-vfi")))))))
+           (lambda _ (invoke "autoreconf" "-vfi"))))))
     (home-page "http://xdelta.org")
     (synopsis "Delta encoder for binary files")
     (description "xdelta encodes only the differences between two binary files
@@ -1158,7 +1245,7 @@ install: libbitshuffle.so
          (add-before 'build 'build-jni
            (lambda _
              ;; Rebuild one of the binaries we removed earlier
-             (system* "javac" "src/main/java/org/xerial/snappy/OSInfo.java"
+             (invoke "javac" "src/main/java/org/xerial/snappy/OSInfo.java"
                       "-d" "lib")
              ;; Link to the dynamic bitshuffle and snappy, not the static ones
              (substitute* "Makefile.common"
@@ -1245,7 +1332,7 @@ compresser/decompresser.")
          (add-before 'build 'build-jni
            (lambda _
              ;; Rebuild one of the binaries we removed earlier
-             (system* "javac" "src/main/java/org/xerial/snappy/OSInfo.java"
+             (invoke "javac" "src/main/java/org/xerial/snappy/OSInfo.java"
                       "-d" "lib")
              ;; Link to the dynamic snappy, not the static ones
              (substitute* "Makefile.common"
@@ -1262,7 +1349,7 @@ compresser/decompresser.")
                (("NAME\\): \\$\\(SNAPPY_OBJ\\)")
                 "NAME): $(SNAPPY_OBJ)\n\t@mkdir -p $(@D)"))
              ;; Finally we can run the Makefile to build the dynamic library.
-             (zero? (system* "make" "native"))))
+             (invoke "make" "native")))
          ;; Once we have built the shared library, we need to place it in the
          ;; "build" directory so it can be added to the jar file.
          (add-after 'build-jni 'copy-jni
@@ -1301,16 +1388,15 @@ compresser/decompresser.")
          (replace 'check
            (lambda _
              (define (test class)
-               (zero? (system* "java" "-cp" (string-append (getenv "CLASSPATH")
-                                                           ":build/classes"
-                                                           ":build/test-classes")
-                               "-Dtest.resources.dir=src/test/resources"
-                               "org.testng.TestNG" "-testclass"
-                               class)))
-             (system* "ant" "compile-tests")
-             (and
-               (test "org.iq80.snappy.SnappyFramedStreamTest")
-               (test "org.iq80.snappy.SnappyStreamTest"))))
+               (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
+                                                   ":build/classes"
+                                                   ":build/test-classes")
+                       "-Dtest.resources.dir=src/test/resources"
+                       "org.testng.TestNG" "-testclass"
+                       class))
+             (invoke "ant" "compile-tests")
+             (test "org.iq80.snappy.SnappyFramedStreamTest")
+             (test "org.iq80.snappy.SnappyStreamTest")))
          (add-before 'build 'remove-hadoop-dependency
            (lambda _
              ;; We don't have hadoop
@@ -1406,22 +1492,22 @@ It can be used as a replacement for the Apache @code{CBZip2InputStream} /
        (modify-phases %standard-phases
          (replace 'configure
            (lambda* (#:key system outputs #:allow-other-keys)
-             (zero? (system* "cp"
-                             (let ((system ,(or (%current-target-system)
-                                                (%current-system))))
-                               (cond
-                                ((string-prefix? "x86_64" system)
-                                 "makefile.linux_amd64_asm")
-                                ((string-prefix? "i686" system)
-                                 "makefile.linux_x86_asm_gcc_4.X")
-                                (else
-                                 "makefile.linux_any_cpu_gcc_4.X")))
-                             "makefile.machine"))))
+             (invoke "cp"
+                     (let ((system ,(or (%current-target-system)
+                                        (%current-system))))
+                       (cond
+                        ((string-prefix? "x86_64" system)
+                         "makefile.linux_amd64_asm")
+                        ((string-prefix? "i686" system)
+                         "makefile.linux_x86_asm_gcc_4.X")
+                        (else
+                         "makefile.linux_any_cpu_gcc_4.X")))
+                     "makefile.machine")))
          (replace 'check
            (lambda _
-             (and (zero? (system* "make" "test"))
-                  (zero? (system* "make" "test_7z"))
-                  (zero? (system* "make" "test_7zr"))))))))
+             (invoke "make" "test")
+             (invoke "make" "test_7z")
+             (invoke "make" "test_7zr"))))))
     (inputs
      (let ((system (or (%current-target-system)
                        (%current-system))))
@@ -1454,7 +1540,9 @@ handles the 7z format which features very high compression ratios.")
                 (modules '((guix build utils)))
                 (snippet
                  ;; Remove pre-compiled object.
-                 '(delete-file "gzstream.o"))))
+                 '(begin
+                    (delete-file "gzstream.o")
+                    #t))))
     (build-system gnu-build-system)
     (arguments
      `(#:test-target "test"
@@ -1491,7 +1579,9 @@ functionality in a C++ iostream.")
        (modules '((guix build utils)))
        (snippet
         ;; Delete irrelevant pre-compiled binaries.
-        '(for-each delete-file (find-files "." "\\.exe$")))))
+        '(begin
+           (for-each delete-file (find-files "." "\\.exe$"))
+           #t))))
     (build-system gnu-build-system)
     (arguments
      `(#:phases
@@ -1600,7 +1690,7 @@ or junctions, and always follows hard links.")
              #t))
          (replace 'check
            (lambda _
-            (zero? (system* "./run-tests.sh")))))))
+             (invoke "./run-tests.sh"))))))
     (home-page "https://github.com/twogood/unshield")
     (synopsis "Extract CAB files from InstallShield installers")
     (description
@@ -1611,7 +1701,7 @@ or junctions, and always follows hard links.")
 (define-public zstd
   (package
     (name "zstd")
-    (version "1.3.3")
+    (version "1.3.5")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://github.com/facebook/zstd/archive/v"
@@ -1619,7 +1709,11 @@ or junctions, and always follows hard links.")
               (file-name (string-append name "-" version ".tar.gz"))
               (sha256
                (base32
-                "0yr91gwi380632w9y7p6idl72svq0mq0jajvdii05pp77qalfz57"))))
+                "1sifbq18p0hc978g0pq8fymrlpzz1fcxqkbxfqk44z6v9jg5bqfn"))
+              ;; Fix a regression that causes the tests to fail.  Both patches
+              ;; have been merged upstream and will be part of the next release.
+              (patches (search-patches "zstd-fix-stdin-list-without-tty.patch"
+                                       "zstd-fix-stdin-list-test.patch"))))
     (build-system gnu-build-system)
     (arguments
      `(#:phases
@@ -1666,7 +1760,7 @@ speed.")
          (delete 'configure)            ; no configure script
          (add-before 'check 'compile-tests
            (lambda* (#:key make-flags #:allow-other-keys)
-             (zero? (apply system* "make" "tests" make-flags))))
+             (apply invoke "make" "tests" make-flags)))
          (add-after 'install 'install-documentation
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
@@ -1710,14 +1804,11 @@ the actual decompression, the other input and output.")
                       (list "-f" "unix/Makefile"
                             (string-append "prefix=" out)
                             (string-append "MANDIR=" out "/share/man/man1")))
-       #:modules ((guix build gnu-build-system)
-                  (guix build utils)
-                  (srfi srfi-1))
        #:phases
        (modify-phases %standard-phases
          (replace 'build
            (lambda* (#:key (make-flags '()) #:allow-other-keys)
-             (zero? (apply system* "make" "generic_gcc" make-flags))))
+             (apply invoke "make" "generic_gcc" make-flags)))
          (delete 'configure))))
     (home-page "http://www.info-zip.org/Zip.html")
     (synopsis "Compression and file packing utility")
@@ -1739,7 +1830,6 @@ Compression ratios of 2:1 to 3:1 are common for text files.")
 (define-public unzip
   (package (inherit zip)
     (name "unzip")
-    (replacement unzip/fixed)
     (version "6.0")
     (source
      (origin
@@ -1767,13 +1857,20 @@ Compression ratios of 2:1 to 3:1 are common for text files.")
     (arguments
      `(#:phases (modify-phases %standard-phases
                   (delete 'configure)
+                  (add-after 'unpack 'fortify
+                    (lambda _
+                      ;; Mitigate CVE-2018-1000035, an exploitable buffer overflow.
+                      ;; This environment variable is recommended in 'unix/Makefile'
+                      ;; for passing flags to the C compiler.
+                      (setenv "LOCAL_UNZIP" "-D_FORTIFY_SOURCE=1")
+                      #t))
                   (replace 'build
                     (lambda* (#:key make-flags #:allow-other-keys)
-                      (zero? (apply system* "make"
-                                    `("-j" ,(number->string
-                                             (parallel-job-count))
-                                      ,@make-flags
-                                      "generic_gcc"))))))
+                      (apply invoke "make"
+                             `("-j" ,(number->string
+                                      (parallel-job-count))
+                               ,@make-flags
+                               "generic_gcc")))))
        #:make-flags (list "-f" "unix/Makefile"
                           (string-append "prefix=" %output)
                           (string-append "MANDIR=" %output "/share/man/man1"))))
@@ -1790,20 +1887,6 @@ recreates the stored directory structure by default.")
     (license (license:non-copyleft "file://LICENSE"
                                    "See LICENSE in the distribution."))))
 
-(define unzip/fixed
-  (package/inherit unzip
-    (arguments
-      (substitute-keyword-arguments (package-arguments unzip)
-        ((#:phases phases)
-          `(modify-phases ,phases
-             (add-after 'unpack 'fortify
-               (lambda _
-                 ;; Mitigate CVE-2018-1000035, an exploitable buffer overflow.
-                 ;; This environment variable is recommended in 'unix/Makefile'
-                 ;; for passing flags to the C compiler.
-                 (setenv "LOCAL_UNZIP" "-D_FORTIFY_SOURCE=1")
-                 #t))))))))
-
 (define-public zziplib
   (package
     (name "zziplib")
@@ -1858,19 +1941,19 @@ create, manipulate, read, and write Zip archive files.")
 (define-public libzip
   (package
     (name "libzip")
-    (version "1.3.2")
+    (version "1.5.1")
     (source (origin
               (method url-fetch)
               (uri (string-append
                     "https://libzip.org/download/" name "-" version ".tar.xz"))
               (sha256
                (base32
-                "11g1hvm2bxa2v5plakfzcwyk5hb5fz4kgrkp38l0xhnv21888xv2"))))
+                "0wnkkvkq90wyawj9221i77sf3nix1vj3ygzdy59k8yvcjnv3bsh4"))))
     (native-inputs
      `(("perl" ,perl)))
     (inputs
      `(("zlib" ,zlib)))
-    (build-system gnu-build-system)
+    (build-system cmake-build-system)
     (home-page "https://libzip.org")
     (synopsis "C library for reading, creating, and modifying zip archives")
     (description "Libzip is a C library for reading, creating, and modifying
@@ -2085,7 +2168,7 @@ single-member files which can't be decompressed in parallel.")
 (define-public innoextract
   (package
    (name "innoextract")
-   (version "1.6")
+   (version "1.7")
    (source
     (origin
      (method url-fetch)
@@ -2093,7 +2176,7 @@ single-member files which can't be decompressed in parallel.")
                          version ".tar.gz"))
      (sha256
       (base32
-       "08sp5vbfjvq1irhhraqkn5m2x1z209r4axhx7laf1adcw30ccapi"))
+       "0khwi9f0q0h6xfbixrrc1rfpgj0b7ajwilq7yhmxnn5lpc807f6x"))
      (file-name (string-append name "-" version ".tar.gz"))))
    (build-system cmake-build-system)
    (arguments
@@ -2111,14 +2194,14 @@ non-Windows systems without running the actual installer using wine.")
 (define-public google-brotli
   (package
     (name "google-brotli")
-    (version "1.0.2")
+    (version "1.0.4")
     (source (origin
              (method url-fetch)
              (uri (string-append "https://github.com/google/brotli/archive/v"
                                  version ".tar.gz"))
              (sha256
               (base32
-               "08kl9gww2058p1p7j9xqmcmrabcfihhj3fq984d7fi3bchb2mky2"))))
+               "1hrpmz162k4x3xm6vmbpm443jlfr1kp536p8962y2dncy7gs6s12"))))
     (build-system cmake-build-system)
     (arguments
      `(#:phases
@@ -2150,3 +2233,81 @@ with @code{deflate} but offers more dense compression.
 
 The specification of the Brotli Compressed Data Format is defined in RFC 7932.")
     (license license:expat)))
+
+(define-public ucl
+  (package
+    (name "ucl")
+    (version "1.03")
+    (source (origin
+             (method url-fetch)
+             (uri (string-append "http://www.oberhumer.com/opensource/"
+                                 name "/download/" name "-" version ".tar.gz"))
+             (sha256
+              (base32
+               "0j036lkwsxvm15gr29n8wn07cqq79dswjs9k54939ms5zngjjrdq"))))
+    (build-system gnu-build-system)
+    (home-page "http://www.oberhumer.com/opensource/ucl/")
+    (synopsis "Portable lossless data compression library")
+    (description "UCL implements a number of compression algorithms that
+achieve an excellent compression ratio while allowing fast decompression.
+Decompression requires no additional memory.
+
+Compared to LZO, the UCL algorithms achieve a better compression ratio but
+decompression is a little bit slower.")
+    (license license:gpl2+)))
+
+(define-public upx
+  (package
+    (name "upx")
+    (version "3.94")
+    (source (origin
+             (method url-fetch)
+             (uri (string-append "https://github.com/upx/upx/releases/download/v"
+                                 version "/" name "-" version "-src.tar.xz"))
+             (sha256
+              (base32
+               "08anybdliqsbsl6x835iwzljahnm9i7v26icdjkcv33xmk6p5vw1"))
+             (patches (search-patches "upx-fix-CVE-2017-15056.patch"))))
+    (build-system gnu-build-system)
+    (native-inputs `(("perl" ,perl)
+                     ("ucl" ,ucl)))
+    (inputs `(("zlib" ,zlib)))
+    (arguments
+     `(#:make-flags
+       (list "all"
+             ;; CHECK_WHITESPACE does not seem to work.
+             ;; See https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/upx.
+             "CHECK_WHITESPACE=true")
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (delete 'check)
+         (delete 'install)
+         (add-before 'build 'patch-exec-bin-sh
+           (lambda _
+             (substitute* (find-files "Makefile")
+               (("/bin/sh") (which "sh")))
+             (substitute* "src/Makefile"
+               (("/bin/sh") (which "sh")))
+             #t))
+         (add-after 'build 'install-upx
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                   (bin (string-append out "/bin")))
+               (mkdir-p bin)
+               (copy-file "src/upx.out" (string-append bin "/upx")))
+             #t))
+         )))
+    (home-page "https://upx.github.io/")
+    ;; CVE-2017-16869 is about Mach-O files which is not of a big concern for Guix.
+    ;; See https://github.com/upx/upx/issues/146 and
+    ;; https://nvd.nist.gov/vuln/detail?vulnId=CVE-2017-16869.
+    ;; The issue will be fixed after version 3.94.
+    (properties `((lint-hidden-cve . ("CVE-2017-16869"))))
+    (synopsis "Compression tool for executables")
+    (description
+     "The Ultimate Packer for eXecutables (UPX) is an executable file
+compressor.  UPX typically reduces the file size of programs and shared
+libraries by around 50%--70%, thus reducing disk space, network load times,
+download times, and other distribution and storage costs.")
+    (license license:gpl2+)))