gnu: Add perl-archive-extract.
[jackhill/guix/guix.git] / gnu / packages / compression.scm
index 4e316e0..a2bf3a1 100644 (file)
@@ -4,7 +4,7 @@
 ;;; Copyright © 2014, 2015 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 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2015, 2017 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2015 Jeff Mickey <j@codemac.net>
 ;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
 ;;; Copyright © 2016, 2017 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2016 David Craven <david@craven.ch>
-;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org>
+;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2017 ng0 <contact.ng0@cryptolab.net>
 ;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
-;;; Copyright © 2017 Theodoros Foradis <theodoros.for@openmailbox.org>
+;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
+;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
+;;; Copyright © 2017 Petter <petter@mykolab.ch>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -50,6 +52,7 @@
   #:use-module (gnu packages base)
   #:use-module (gnu packages check)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages file)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
@@ -114,7 +117,7 @@ in compression.")
        (modify-phases %standard-phases
          (add-after 'unpack 'enter-source
            (lambda _ (chdir "contrib/minizip") #t))
-         (add-before 'configure 'autoreconf
+         (add-after 'enter-source 'autoreconf
            (lambda _
              (zero? (system* "autoreconf" "-vif")))))))
     (native-inputs
@@ -470,7 +473,7 @@ some compression ratio).")
     (description
      "Lzip is a lossless data compressor with a user interface similar to the
 one of gzip or bzip2.  Lzip decompresses almost as fast as gzip and compresses
-more than bzip2, which makes it well suited for software distribution and data
+more than bzip2, which makes it well-suited for software distribution and data
 archiving.  Lzip is a clean implementation of the LZMA algorithm.")
     (license license:gpl3+)))
 
@@ -521,14 +524,14 @@ decompressors when faced with corrupted input.")
      `(("which" ,which)))
     (arguments
      `(#:phases
-        (alist-cons-after
-         'patch-source-shebangs 'unpatch-source-shebang
-         ;; revert the patch-shebang phase on a script which is
-         ;; in fact test data
-         (lambda _
-           (substitute* "tests/shar-1.ok"
-             (((which "sh")) "/bin/sh")))
-         %standard-phases)))
+       (modify-phases %standard-phases
+         (add-after 'patch-source-shebangs 'unpatch-source-shebang
+           ;; revert the patch-shebang phase on a script which is
+           ;; in fact test data
+           (lambda _
+             (substitute* "tests/shar-1.ok"
+               (((which "sh")) "/bin/sh"))
+             #t)))))
     (home-page "https://www.gnu.org/software/sharutils/")
     (synopsis "Archives in shell scripts, uuencode/uudecode")
     (description
@@ -758,6 +761,28 @@ the LZ4 frame format.")
 (define-public python2-lz4
   (package-with-python2 python-lz4))
 
+(define-public python-lzstring
+  (package
+    (name "python-lzstring")
+    (version "1.0.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "lzstring" version))
+       (sha256
+        (base32
+         "1d3ck454y41mii0gcjabpmp2skb7n0f9zk232gycqdv8z2jxakfm"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-future" ,python-future)))
+    (home-page "https://github.com/gkovacs/lz-string-python")
+    (synopsis "String compression")
+    (description "Lz-string is a string compressor library for Python.")
+    (license license:expat)))
+
+(define-public python2-lzstring
+  (package-with-python2 python-lzstring))
+
 (define-public squashfs-tools
   (package
     (name "squashfs-tools")
@@ -954,7 +979,7 @@ respectively, based on the reference implementation from Google.")
        (modify-phases %standard-phases
          (add-after 'unpack 'enter-build-directory
            (lambda _ (chdir "xdelta3")))
-         (add-before 'configure 'autoconf
+         (add-after 'enter-build-directory 'autoconf
            (lambda _ (zero? (system* "autoreconf" "-vfi")))))))
     (home-page "http://xdelta.com")
     (synopsis "Delta encoder for binary files")
@@ -1281,7 +1306,7 @@ RAR archives.")
 (define-public zstd
   (package
     (name "zstd")
-    (version "1.3.1")
+    (version "1.3.2")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://github.com/facebook/zstd/archive/v"
@@ -1289,17 +1314,7 @@ RAR archives.")
               (file-name (string-append name "-" version ".tar.gz"))
               (sha256
                (base32
-                "1imddqjhczira626nf3nqmjwj3wb37xcfcwgkjydv2k6fpfbjbri"))
-              (modules '((guix build utils)))
-              (snippet
-               ;; Remove non-free source files.
-               '(begin
-                  (for-each delete-file-recursively
-                            (list
-                             ;; Commercial use of the following is not allowed.
-                             "examples"
-                             "LICENSE-examples"))
-                  #t))))
+                "12krs9k5f408kyn0d7dwxqyc67177mgd14783ay10rafqsim8l5c"))))
     (build-system gnu-build-system)
     (arguments
      `(#:phases
@@ -1318,7 +1333,10 @@ zlib.  In most scenarios, both compression and decompression can be performed in
 trade-off between compression ratio and speed, without affecting decompression
 speed.")
     (license (list license:bsd-3         ; the main top-level LICENSE file
-                   license:bsd-2         ; quite a few files have but 2 clauses
+                   license:bsd-2         ; many files explicitly state 2-Clause
+                   license:gpl2          ; the mail top-level COPYING file
+                   license:gpl3+         ; tests/gzip/*.sh
+                   license:expat         ; lib/dictBuilder/divsufsort.[ch]
                    license:public-domain ; zlibWrapper/examples/fitblk*
                    license:zlib))))      ; zlibWrapper/{gz*.c,gzguts.h}
 
@@ -1520,22 +1538,24 @@ manipulate, read, and write Zip archive files.")
 (define-public libzip
   (package
     (name "libzip")
-    (version "1.2.0")
+    (version "1.3.0")
     (source (origin
               (method url-fetch)
               (uri (string-append
-                    "https://nih.at/libzip/libzip-" version ".tar.gz"))
-              (patches (search-patches "libzip-CVE-2017-12858.patch"))
+                    "https://nih.at/libzip/libzip-" version ".tar.xz"))
               (sha256
                (base32
-                "17vxj2ffsxwh8lkc6801ppmwj15jp8q58rin76znxfbx88789ybc"))))
+                "0wykw0q9dwdzx0gssi2dpgckx9ggr2spzc1amjnff6wi6kz6x4xa"))))
     (arguments
-     `(#:phases
+     '(#:phases
        (modify-phases %standard-phases
-         (add-before 'configure 'patch-perl
+         (add-after 'build 'remove-failing-tests
+           ;; These tests are known to fail on 32-bit architectures.
+           ;; see thread: https://nih.at/listarchive/libzip-discuss/msg00713.html
            (lambda _
-             (substitute* "regress/runtest.in"
-               (("/usr/bin/env perl") (which "perl"))))))))
+             (substitute* "regress/Makefile"
+               (("encryption-nonrandom") "#encryption-nonrandom"))
+             #t)))))
     (native-inputs
      `(("perl" ,perl)))
     (inputs
@@ -1548,3 +1568,60 @@ zip archives.  Files can be added from data buffers, files, or compressed data
 copied directly from other zip archives.  Changes made without closing the
 archive can be reverted.")
     (license license:bsd-3)))
+
+(define-public atool
+  (package
+    (name "atool")
+    (version "0.39.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "http://savannah.nongnu.org/download/atool/atool-"
+                           version ".tar.gz"))
+       (sha256
+        (base32
+         "0fvhzip2v08jgnlfpyj6rapan39xlsl1ksgq4lp8gfsai2ah1xma"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'embed-absolute-file-name
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "atool"
+               (("(^\\$::cfg_path_file.*= )'file'" _ pre)
+                (string-append pre "'" (assoc-ref inputs "file")
+                               "/bin/file'")))
+             #t)))))
+    (inputs
+     `(("perl" ,perl)
+       ("file" ,file)))
+    (home-page "http://www.nongnu.org/atool/")
+    (synopsis  "Universal tool to manage file archives of various types")
+    (description "The main command is @command{aunpack} which extracts files
+from an archive.  The other commands provided are @command{apack} (to create
+archives), @command{als} (to list files in archives), and @command{acat} (to
+extract files to standard out).  As @command{atool} invokes external programs
+to handle the archives, not all commands may be supported for a certain type
+of archives.")
+    (license license:gpl2+)))
+
+(define-public perl-archive-extract
+  (package
+    (name "perl-archive-extract")
+    (version "0.80")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://cpan/authors/id/B/BI/BINGOS/Archive-Extract-"
+                           version ".tar.gz"))
+       (sha256
+        (base32
+         "1x15j1q6w6z8hqyqgap0lz4qbq2174wfhksy1fdd653ccbaw5jr5"))))
+    (build-system perl-build-system)
+    (home-page "http://search.cpan.org/dist/Archive-Extract/")
+    (synopsis "Generic archive extracting mechanism")
+    (description "It allows you to extract any archive file of the type .tar,
+.tar.gz, .gz, .Z, tar.bz2, .tbz, .bz2, .zip, .xz,, .txz, .tar.xz or .lzma
+without having to worry how it does so, or use different interfaces for each
+type by using either Perl modules, or command-line tools on your system.")
+    (license license:perl-license)))