1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
6 ;;; Copyright © 2015, 2016 Eric Bavier <bavier@member.fsf.org>
7 ;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
8 ;;; Copyright © 2015, 2017, 2018 Leo Famulari <leo@famulari.name>
9 ;;; Copyright © 2015 Jeff Mickey <j@codemac.net>
10 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
11 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
12 ;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
13 ;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
14 ;;; Copyright © 2016 David Craven <david@craven.ch>
15 ;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
16 ;;; Copyright © 2016, 2018 Marius Bakke <mbakke@fastmail.com>
17 ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
18 ;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
19 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
20 ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
21 ;;; Copyright © 2017 Petter <petter@mykolab.ch>
22 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
23 ;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
24 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
25 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
27 ;;; This file is part of GNU Guix.
29 ;;; GNU Guix is free software; you can redistribute it and/or modify it
30 ;;; under the terms of the GNU General Public License as published by
31 ;;; the Free Software Foundation; either version 3 of the License, or (at
32 ;;; your option) any later version.
34 ;;; GNU Guix is distributed in the hope that it will be useful, but
35 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
36 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37 ;;; GNU General Public License for more details.
39 ;;; You should have received a copy of the GNU General Public License
40 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
42 (define-module (gnu packages compression)
43 #:use-module ((guix licenses) #:prefix license:)
44 #:use-module (guix utils)
45 #:use-module (guix packages)
46 #:use-module (guix download)
47 #:use-module (guix git-download)
48 #:use-module (guix build-system ant)
49 #:use-module (guix build-system cmake)
50 #:use-module (guix build-system gnu)
51 #:use-module (guix build-system perl)
52 #:use-module (guix build-system python)
53 #:use-module (gnu packages)
54 #:use-module (gnu packages assembly)
55 #:use-module (gnu packages autotools)
56 #:use-module (gnu packages backup)
57 #:use-module (gnu packages base)
58 #:use-module (gnu packages boost)
59 #:use-module (gnu packages check)
60 #:use-module (gnu packages curl)
61 #:use-module (gnu packages file)
62 #:use-module (gnu packages java)
63 #:use-module (gnu packages maths)
64 #:use-module (gnu packages perl)
65 #:use-module (gnu packages perl-check)
66 #:use-module (gnu packages pkg-config)
67 #:use-module (gnu packages python)
68 #:use-module (gnu packages tls)
69 #:use-module (gnu packages valgrind)
70 #:use-module (ice-9 match)
71 #:use-module ((srfi srfi-1) #:select (last)))
80 (uri (list (string-append "http://zlib.net/zlib-"
82 (string-append "mirror://sourceforge/libpng/zlib/"
83 version "/zlib-" version ".tar.gz")))
86 "18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3"))))
87 (build-system gnu-build-system)
88 (outputs '("out" "static"))
91 (modify-phases %standard-phases
93 (lambda* (#:key outputs #:allow-other-keys)
94 ;; Zlib's home-made `configure' fails when passed
95 ;; extra flags like `--enable-fast-install', so we need to
96 ;; invoke it with just what it understand.
97 (let ((out (assoc-ref outputs "out")))
98 ;; 'configure' doesn't understand '--host'.
99 ,@(if (%current-target-system)
100 `((setenv "CHOST" ,(%current-target-system)))
102 (invoke "./configure"
103 (string-append "--prefix=" out)))))
104 (add-after 'install 'move-static-library
105 (lambda* (#:key outputs #:allow-other-keys)
106 (let ((out (assoc-ref outputs "out"))
107 (static (assoc-ref outputs "static")))
108 (with-directory-excursion (string-append out "/lib")
109 (install-file "libz.a" (string-append static "/lib"))
110 (delete-file "libz.a")
112 (home-page "https://zlib.net/")
113 (synopsis "Compression library")
115 "zlib is designed to be a free, general-purpose, legally unencumbered --
116 that is, not covered by any patents -- lossless data-compression library for
117 use on virtually any computer hardware and operating system. The zlib data
118 format is itself portable across platforms. Unlike the LZW compression method
119 used in Unix compress(1) and in the GIF image format, the compression method
120 currently used in zlib essentially never expands the data. (LZW can double or
121 triple the file size in extreme cases.) zlib's memory footprint is also
122 independent of the input data and can be reduced, if necessary, at some cost
124 (license license:zlib)))
126 (define-public minizip
129 (version (package-version zlib))
130 (source (package-source zlib))
131 (build-system gnu-build-system)
134 (modify-phases %standard-phases
135 (add-after 'unpack 'enter-source
136 (lambda _ (chdir "contrib/minizip") #t)))))
138 `(("autoconf" ,autoconf)
139 ("automake" ,automake)
140 ("libtool" ,libtool)))
141 (propagated-inputs `(("zlib" ,zlib)))
142 (home-page (package-home-page zlib))
143 (synopsis "Zip Compression library")
145 "Minizip is a minimalistic library that supports compressing,
146 extracting and viewing ZIP archives. This version is extracted from
147 the @code{zlib} source.")
148 (license (package-license zlib))))
150 (define-public fastjar
156 (uri (string-append "mirror://savannah/fastjar/fastjar-"
160 "0iginbz2m15hcsa3x4y7v3mhk54gr1r7m3ghx0pg4n46vv2snmpi"))))
161 (build-system gnu-build-system)
162 (inputs `(("zlib" ,zlib)))
163 (home-page "https://savannah.nongnu.org/projects/fastjar")
164 (synopsis "Replacement for Sun's 'jar' utility")
166 "FastJar is an attempt to create a much faster replacement for Sun's 'jar'
167 utility. Instead of being written in Java, FastJar is written in C.")
168 (license license:gpl2+)))
170 (define-public libtar
178 "ftp://ftp.feep.net/pub/software/libtar/libtar-"
181 "mirror://debian/pool/main/libt/libtar/libtar_"
182 version ".orig.tar.gz")))
185 "02cihzl77ia0dcz7z2cga2412vyhhs5pa2355q4wpwbyga2lrwjh"))
186 (patches (search-patches "libtar-CVE-2013-4420.patch"))))
187 (build-system gnu-build-system)
188 (arguments `(#:tests? #f)) ; no "check" target
190 `(("autoconf" ,autoconf)
191 ("automake" ,automake)
192 ("libtool" ,libtool)))
195 (synopsis "C library for manipulating POSIX tar files")
197 "libtar is a C library for manipulating POSIX tar files. It handles
198 adding and extracting files to/from a tar archive.")
199 (home-page "https://repo.or.cz/libtar.git")
200 (license license:bsd-3)))
208 (uri (string-append "mirror://gnu/gzip/gzip-"
212 "16h8g4acy7fgfxcjacr3wijjsnixwsfd2jhz3zwdi2qrzi262l5f"))))
213 (build-system gnu-build-system)
214 (synopsis "General file (de)compression (using lzw)")
216 ;; FIXME: The test suite wants `less', and optionally Perl.
219 (modify-phases %standard-phases
220 (add-after 'unpack 'patch-for-glibc-2.28
222 ;; Adjust the bundled gnulib to work with glibc 2.28. See e.g.
223 ;; "m4-gnulib-libio.patch". This is a phase rather than patch
224 ;; or snippet to work around <https://bugs.gnu.org/32347>.
225 (substitute* (find-files "lib" "\\.c$")
226 (("#if defined _IO_ftrylockfile")
227 "#if defined _IO_EOF_SEEN"))
228 (substitute* "lib/stdio-impl.h"
229 (("^/\\* BSD stdio derived implementations")
230 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
231 "# define _IO_IN_BACKUP 0x100\n"
233 "/* BSD stdio derived implementations")))
235 (add-after 'unpack 'use-absolute-name-of-gzip
236 (lambda* (#:key outputs #:allow-other-keys)
237 (substitute* "gunzip.in"
239 (string-append "exec " (assoc-ref outputs "out")
243 "GNU Gzip provides data compression and decompression utilities; the
244 typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
245 file; as a result, it is often used in conjunction with \"tar\", resulting in
246 \".tar.gz\" or \".tgz\", etc.")
247 (license license:gpl3+)
248 (home-page "https://www.gnu.org/software/gzip/")))
256 ;; XXX The bzip.org domain was allowed to expire.
257 (uri (string-append "https://web.archive.org/web/20180624184806/"
258 "http://www.bzip.org/"
259 version "/bzip2-" version ".tar.gz"))
262 "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152"))))
263 (build-system gnu-build-system)
265 `(#:modules ((guix build gnu-build-system)
270 (modify-phases %standard-phases
272 (lambda* (#:key target #:allow-other-keys)
273 (when ,(%current-target-system)
274 ;; Cross-compilation: use the cross tools.
275 (substitute* (find-files "." "Makefile")
277 (string-append "CC = " target "-gcc\n"))
279 (string-append "AR = " target "-ar\n"))
281 (string-append "RANLIB = " target "-ranlib\n"))
282 (("^all:(.*)test" _ prerequisites)
283 ;; Remove 'all' -> 'test' dependency.
284 (string-append "all:" prerequisites "\n"))))
286 (add-before 'build 'build-shared-lib
287 (lambda* (#:key inputs #:allow-other-keys)
288 (patch-makefile-SHELL "Makefile-libbz2_so")
289 (invoke "make" "-f" "Makefile-libbz2_so")))
290 (add-after 'install 'install-shared-lib
291 (lambda* (#:key outputs #:allow-other-keys)
292 ;; The Makefile above does not have an 'install' target, nor does
293 ;; it create all the (un)versioned symlinks, so we handle it here.
294 (let* ((out (assoc-ref outputs "out"))
295 (libdir (string-append out "/lib"))
297 ;; Locate the built library (e.g. "libbz2.so.1.0.6").
298 (lib (car (scandir "."
300 (and (string-prefix? soname file)
302 (stat:type (lstat file))))))))
303 (soversion (string-drop lib (+ 1 (string-length soname)))))
304 (install-file lib libdir)
305 (with-directory-excursion libdir
306 ;; Create symlinks libbz2.so.1 -> libbz2.so.1.0, etc.
307 (let loop ((base soname)
308 (numbers (string-split soversion #\.)))
309 (unless (null? numbers)
310 (let ((so-file (string-append base "." (car numbers))))
311 (symlink so-file base)
312 (loop so-file (cdr numbers))))))
314 (add-after 'install-shared-lib 'move-static-lib
315 (lambda* (#:key outputs #:allow-other-keys)
316 (let ((out (assoc-ref outputs "out"))
317 (static (assoc-ref outputs "static")))
318 (with-directory-excursion (string-append out "/lib")
319 (install-file "libbz2.a" (string-append static "/lib"))
320 (delete-file "libbz2.a")
322 (add-after 'install-shared-lib 'patch-scripts
323 (lambda* (#:key outputs inputs #:allow-other-keys)
324 (let* ((out (assoc-ref outputs "out")))
325 (substitute* (string-append out "/bin/bzdiff")
329 #:make-flags (list (string-append "PREFIX="
330 (assoc-ref %outputs "out")))
332 ;; Don't attempt to run the tests when cross-compiling.
333 ,@(if (%current-target-system)
336 (outputs '("out" "static"))
337 (synopsis "High-quality data compression program")
339 "bzip2 is a freely available, patent free (see below), high-quality data
340 compressor. It typically compresses files to within 10% to 15% of the best
341 available techniques (the PPM family of statistical compressors), whilst
342 being around twice as fast at compression and six times faster at
344 (license (license:non-copyleft "file://LICENSE"
345 "See LICENSE in the distribution."))
346 (home-page "https://web.archive.org/web/20180801004107/http://www.bzip.org/")))
348 (define-public lbzip2
354 (uri (string-append "http://archive.lbzip2.org/lbzip2-"
358 "1sahaqc5bw4i0iyri05syfza4ncf5cml89an033fspn97klmxis6"))
359 (modules '((guix build utils)))
362 (substitute* (find-files "lib" "\\.c$")
363 (("#if defined _IO_ftrylockfile")
364 "#if defined _IO_EOF_SEEN"))
365 (substitute* "lib/stdio-impl.h"
366 (("^/\\* BSD stdio derived implementations")
367 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
368 "# define _IO_IN_BACKUP 0x100\n"
370 "/* BSD stdio derived implementations")))
372 (build-system gnu-build-system)
373 (synopsis "Parallel bzip2 compression utility")
375 "lbzip2 is a multi-threaded compression utility with support for the
376 bzip2 compressed file format. lbzip2 can process standard bz2 files in
377 parallel. It uses POSIX threading model (pthreads), which allows it to take
378 full advantage of symmetric multiprocessing (SMP) systems. It has been proven
379 to scale linearly, even to over one hundred processor cores. lbzip2 is fully
380 compatible with bzip2 – both at file format and command line level.")
381 (home-page "http://www.lbzip2.org/")
382 (license license:gpl3+)))
384 (define-public pbzip2
390 (uri (string-append "https://launchpad.net/pbzip2/"
391 (version-major+minor version) "/" version
392 "/+download/" name "-" version ".tar.gz"))
395 "1rnvgcdixjzbrmcr1nv9b6ccrjfrhryaj7jwz28yxxv6lam3xlcg"))))
396 (build-system gnu-build-system)
400 `(#:tests? #f ; no tests
401 #:phases (modify-phases %standard-phases
402 (delete 'configure)) ; no configure script
403 #:make-flags (list (string-append "PREFIX=" %output))))
404 (home-page "http://compression.ca/pbzip2/")
405 (synopsis "Parallel bzip2 implementation")
407 "Pbzip2 is a parallel implementation of the bzip2 block-sorting file
408 compressor that uses pthreads and achieves near-linear speedup on SMP machines.
409 The output of this version is fully compatible with bzip2 v1.0.2 (i.e. anything
410 compressed with pbzip2 can be decompressed with bzip2).")
411 (license (license:non-copyleft "file://COPYING"
412 "See COPYING in the distribution."))))
420 (uri (list (string-append "http://tukaani.org/xz/xz-" version
422 (string-append "http://multiprecision.org/guix/xz-"
426 "0ibi2zsfaz6l756spjwc5rayf4ckgc9hwmy8qinppcyk4svz64mm"))))
427 (build-system gnu-build-system)
428 (synopsis "General-purpose data compression")
430 "XZ Utils is free general-purpose data compression software with high
431 compression ratio. XZ Utils were written for POSIX-like systems, but also
432 work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
434 The core of the XZ Utils compression code is based on LZMA SDK, but it has
435 been modified quite a lot to be suitable for XZ Utils. The primary
436 compression algorithm is currently LZMA2, which is used inside the .xz
437 container format. With typical files, XZ Utils create 30 % smaller output
438 than gzip and 15 % smaller output than bzip2.")
439 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
440 (home-page "https://tukaani.org/xz/")))
449 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
453 "0wm04519pd3g8hqpjqhfr72q8qmbiwqaxcs3cndny9h86aa95y60"))))
454 (build-system gnu-build-system)
455 (arguments '(#:configure-flags '("--enable-shared")))
456 (home-page "http://www.oberhumer.com/opensource/lzo")
458 "Data compression library suitable for real-time data de-/compression")
460 "LZO is a data compression library which is suitable for data
461 de-/compression in real-time. This means it favours speed over
464 LZO is written in ANSI C. Both the source code and the compressed data
465 format are designed to be portable across platforms.")
466 (license license:gpl2+)))
468 (define-public python-lzo
475 (uri (pypi-uri "python-lzo" version))
478 "0iakqgd51n1cd7r3lpdylm2rgbmd16y74cra9kcapwg84mlf9a4p"))))
479 (build-system python-build-system)
481 `(#:test-target "check"
483 (modify-phases %standard-phases
484 (add-after 'unpack 'patch-setuppy
486 (substitute* "setup.py"
487 (("include_dirs.append\\(.*\\)")
488 (string-append "include_dirs.append('"
489 (assoc-ref %build-inputs "lzo")
495 (home-page "https://github.com/jd-boyd/python-lzo")
496 (synopsis "Python bindings for the LZO data compression library")
498 "Python-LZO provides Python bindings for LZO, i.e. you can access
499 the LZO library from your Python scripts thereby compressing ordinary
501 (license license:gpl2+)))
503 (define-public python2-lzo
504 (package-with-python2 python-lzo))
513 (uri (string-append "http://www.lzop.org/download/lzop-"
517 "0h9gb8q7y54m9mvy3jvsmxf21yx8fc3ylzh418hgbbv0i8mbcwky"))))
518 (build-system gnu-build-system)
519 (inputs `(("lzo" ,lzo)))
520 (home-page "https://www.lzop.org/")
521 (synopsis "Compress or expand files")
523 "Lzop is a file compressor which is very similar to gzip. Lzop uses the
524 LZO data compression library for compression services, and its main advantages
525 over gzip are much higher compression and decompression speed (at the cost of
526 some compression ratio).")
527 (license license:gpl2+)))
535 (uri (string-append "mirror://savannah/lzip/lzip-"
539 "0319q59kb8g324wnj7xzbr7vvlx5bcs13lr34j0zb3kqlyjq2fy9"))))
540 (build-system gnu-build-system)
541 (home-page "https://www.nongnu.org/lzip/lzip.html")
542 (synopsis "Lossless data compressor based on the LZMA algorithm")
544 "Lzip is a lossless data compressor with a user interface similar to the
545 one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
546 more than bzip2, which makes it well-suited for software distribution and data
547 archiving. Lzip is a clean implementation of the LZMA algorithm.")
548 (license license:gpl3+)))
550 (define-public lziprecover
556 (uri (string-append "mirror://savannah/lzip/" name "/"
557 name "-" version ".tar.gz"))
560 "0fpnmdxayvd1ff0rk9606dvr431ji6b1v71km4ww244rih1rmmzz"))))
561 (build-system gnu-build-system)
562 (home-page "https://www.nongnu.org/lzip/lziprecover.html")
563 (synopsis "Recover and decompress data from damaged lzip files")
565 "Lziprecover is a data recovery tool and decompressor for files in the lzip
566 compressed data format (.lz). It can test the integrity of lzip files, extract
567 data from damaged ones, and repair most files with small errors (up to one
568 single-byte error per member) entirely.
570 Lziprecover is not a replacement for regular backups, but a last line of defence
571 when even the backups are corrupt. It can recover files by merging the good
572 parts of two or more damaged copies, such as can be easily produced by running
573 @command{ddrescue} on a failing device.
575 This package also includes @command{unzcrash}, a tool to test the robustness of
576 decompressors when faced with corrupted input.")
577 (license (list license:bsd-2 ; arg_parser.{cc,h}
578 license:gpl2+)))) ; everything else
580 (define-public sharutils
587 (uri (string-append "mirror://gnu/sharutils/sharutils-"
589 (patches (search-patches "sharutils-CVE-2018-1000097.patch"))
592 "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))
593 (modules '((guix build utils)))
596 (substitute* (find-files "lib" "\\.c$")
597 (("#if defined _IO_ftrylockfile")
598 "#if defined _IO_EOF_SEEN"))
599 (substitute* "lib/stdio-impl.h"
600 (("^/\\* BSD stdio derived implementations")
601 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
602 "# define _IO_IN_BACKUP 0x100\n"
604 "/* BSD stdio derived implementations")))
606 (build-system gnu-build-system)
611 (modify-phases %standard-phases
612 (add-after 'patch-source-shebangs 'unpatch-source-shebang
613 ;; revert the patch-shebang phase on a script which is
616 (substitute* "tests/shar-1.ok"
617 (((which "sh")) "/bin/sh"))
619 (home-page "https://www.gnu.org/software/sharutils/")
620 (synopsis "Archives in shell scripts, uuencode/uudecode")
622 "GNU sharutils is a package for creating and manipulating shell
623 archives that can be readily emailed. A shell archive is a file that can be
624 processed by a Bourne-type shell to unpack the original collection of files.
625 This package is mostly for compatibility and historical interest.")
626 (license license:gpl3+)))
628 (define-public sfarklib
634 (uri (string-append "https://github.com/raboof/sfArkLib/archive/"
636 (file-name (string-append name "-" version ".tar.gz"))
639 "0bzs2d98rk1xw9qwpnc7gmlbxwmwc3dg1rpn310afy9pq1k9clzi"))))
640 (build-system gnu-build-system)
642 `(#:tests? #f ;no "check" target
644 (modify-phases %standard-phases
646 (lambda* (#:key outputs #:allow-other-keys)
647 (substitute* "Makefile"
648 (("/usr/local") (assoc-ref outputs "out")))
652 (home-page "https://github.com/raboof/sfArkLib")
653 (synopsis "Library for SoundFont decompression")
655 "SfArkLib is a C++ library for decompressing SoundFont files compressed
656 with the sfArk algorithm.")
657 (license license:gpl3+)))
659 (define-public sfarkxtc
660 (let ((commit "13cd6f93725a90d91ec5ea75babf1dbd694ac463")
664 (version (git-version "0" revision commit))
666 ;; There are no release tarballs, so we just fetch the latest
667 ;; commit at this time.
670 (url "https://github.com/raboof/sfarkxtc.git")
672 (file-name (git-file-name name version))
675 "1mb1jyk1m11l1gppd9hmql9cyp55sdf7jk5rbc7acky1z4k4mv19"))))
676 (build-system gnu-build-system)
678 `(#:tests? #f ;no "check" target
680 (modify-phases %standard-phases
682 (lambda* (#:key outputs #:allow-other-keys)
683 (substitute* "Makefile"
684 (("/usr/local") (assoc-ref outputs "out")))
688 ("sfarklib" ,sfarklib)))
689 (home-page "https://github.com/raboof/sfarkxtc")
690 (synopsis "Basic sfArk decompressor")
691 (description "SfArk extractor converts SoundFonts in the compressed legacy
692 sfArk file format to the uncompressed sf2 format.")
693 (license license:gpl3+))))
695 (define-public libmspack
698 (home-page "https://cabextract.org.uk/libmspack/")
703 (uri (string-append home-page name "-" version "alpha.tar.gz"))
705 (base32 "0h1f5w8rjnq7dcqpqm1mpx5m8q80691kid6f7npqlqwqqzckd8v2"))))
706 (build-system gnu-build-system)
708 `(#:configure-flags '("--disable-static")))
709 (synopsis "Compression tools for some formats used by Microsoft")
711 "The purpose of libmspack is to provide both compression and
712 decompression of some loosely related file formats used by Microsoft.")
713 (license license:lgpl2.1+)))
715 (define-public perl-compress-raw-bzip2
717 (name "perl-compress-raw-bzip2")
722 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
723 "Compress-Raw-Bzip2-" version ".tar.gz"))
726 "081mpkjy688lg48997fqh3d7ja12vazmz02fw84495civg4vb4l6"))))
727 (build-system perl-build-system)
728 ;; TODO: Use our bzip2 package.
729 (home-page "https://metacpan.org/release/Compress-Raw-Bzip2")
730 (synopsis "Low-level interface to bzip2 compression library")
731 (description "This module provides a Perl interface to the bzip2
732 compression library.")
733 (license license:perl-license)))
735 (define-public perl-compress-raw-zlib
737 (name "perl-compress-raw-zlib")
742 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
743 "Compress-Raw-Zlib-" version ".tar.gz"))
746 "06rsm9ahp20xfyvd3jc69sd0k8vqysryxc6apzdbn96jbcsdwmp1"))))
747 (build-system perl-build-system)
751 `(#:phases (modify-phases %standard-phases
753 'configure 'configure-zlib
754 (lambda* (#:key inputs #:allow-other-keys)
755 (call-with-output-file "config.in"
762 GZIP_OS_CODE = AUTO_DETECT"
763 (assoc-ref inputs "zlib"))))
765 (home-page "https://metacpan.org/release/Compress-Raw-Zlib")
766 (synopsis "Low-level interface to zlib compression library")
767 (description "This module provides a Perl interface to the zlib
768 compression library.")
769 (license license:perl-license)))
771 (define-public perl-io-compress
773 (name "perl-io-compress")
778 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
779 "IO-Compress-" version ".tar.gz"))
782 "1na66ns1g3nni0m9q5494ym4swr21hfgpv88mw8wbj2daiswf4aj"))))
783 (build-system perl-build-system)
785 `(("perl-compress-raw-zlib" ,perl-compress-raw-zlib) ; >=2.081
786 ("perl-compress-raw-bzip2" ,perl-compress-raw-bzip2))) ; >=2.081
787 (home-page "https://metacpan.org/release/IO-Compress")
788 (synopsis "IO Interface to compressed files/buffers")
789 (description "IO-Compress provides a Perl interface to allow reading and
790 writing of compressed data created with the zlib and bzip2 libraries.")
791 (license license:perl-license)))
800 (uri (string-append "https://github.com/lz4/lz4/archive/"
801 "v" version ".tar.gz"))
804 "1y93h6dyi3026gvpzdv310ldcylnnhwf32n75mdjf8x9fvkskwqj"))
805 (file-name (string-append name "-" version ".tar.gz"))))
806 (build-system gnu-build-system)
807 (native-inputs `(("valgrind" ,valgrind))) ; for tests
809 `(#:test-target "test"
810 #:make-flags (list "CC=gcc"
811 (string-append "prefix=" (assoc-ref %outputs "out")))
812 #:phases (modify-phases %standard-phases
813 (delete 'configure)))) ; no configure script
814 (home-page "https://www.lz4.org")
815 (synopsis "Compression algorithm focused on speed")
816 (description "LZ4 is a lossless compression algorithm, providing
817 compression speed at 400 MB/s per core (0.16 Bytes/cycle). It also features an
818 extremely fast decoder, with speed in multiple GB/s per core (0.71 Bytes/cycle).
819 A high compression derivative, called LZ4_HC, is also provided. It trades CPU
820 time for compression ratio.")
821 ;; The libraries (lz4, lz4hc, and xxhash) are BSD licenced. The command
822 ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
823 (license (list license:bsd-2 license:gpl2+))))
825 (define-public python-lz4
832 (uri (pypi-uri "lz4" version))
835 "0ghv1xbaq693kgww1x9c22bplz479ls9szjsaa4ig778ls834hm0"))))
836 (build-system python-build-system)
838 `(("python-nose" ,python-nose)
839 ("python-setuptools-scm" ,python-setuptools-scm)))
840 (home-page "https://github.com/python-lz4/python-lz4")
841 (synopsis "LZ4 bindings for Python")
843 "This package provides python bindings for the lz4 compression library
844 by Yann Collet. The project contains bindings for the LZ4 block format and
845 the LZ4 frame format.")
846 (license license:bsd-3)))
848 (define-public python2-lz4
849 (package-with-python2 python-lz4))
851 (define-public python-lzstring
853 (name "python-lzstring")
858 (uri (pypi-uri "lzstring" version))
861 "18ly9pppy2yspxzw7k1b23wk77k7m44rz2g0271bqgqrk3jn3yhs"))))
862 (build-system python-build-system)
864 `(("python-future" ,python-future)))
865 (home-page "https://github.com/gkovacs/lz-string-python")
866 (synopsis "String compression")
867 (description "Lz-string is a string compressor library for Python.")
868 (license license:expat)))
870 (define-public python2-lzstring
871 (package-with-python2 python-lzstring))
873 (define-public squashfs-tools
875 (name "squashfs-tools")
879 (uri (string-append "mirror://sourceforge/squashfs/squashfs/"
880 "squashfs" version "/"
881 "squashfs" version ".tar.gz"))
884 "1xpklm0y43nd9i6jw43y2xh5zvlmj9ar2rvknh0bh7kv8c95aq0d"))))
885 (build-system gnu-build-system)
887 '(#:tests? #f ; no check target
893 (string-append "INSTALL_DIR=" %output "/bin"))
895 (modify-phases %standard-phases
898 (chdir "squashfs-tools")
900 (add-after 'unpack 'fix-glibc-compatability
902 (substitute* '("squashfs-tools/mksquashfs.c"
903 "squashfs-tools/unsquashfs.c")
905 "<sys/sysinfo.h>\n#include <sys/sysmacros.h>"))
912 (home-page "http://squashfs.sourceforge.net/")
913 (synopsis "Tools to create and extract squashfs file systems")
915 "Squashfs is a highly compressed read-only file system for Linux. It uses
916 zlib to compress files, inodes, and directories. All blocks are packed to
917 minimize the data overhead, and block sizes of between 4K and 1M are supported.
918 It is intended to be used for archival use, for live CDs, and for embedded
919 systems where low overhead is needed. This package allows you to create and
920 extract such file systems.")
921 (license license:gpl2+)))
923 ;; We need this for building squashfs images with symlinks.
924 (define-public squashfs-tools-next
925 (let ((commit "fb33dfc32b131a1162dcf0e35bd88254ae10e265")
927 (package (inherit squashfs-tools)
928 (name "squashfs-tools-next")
929 (version (string-append "4.3-" revision (string-take commit 7)))
933 (url "https://github.com/plougher/squashfs-tools.git")
935 (file-name (git-file-name name version))
938 "1x2skf8hxzfch978nzx5mh46d4hhi6gl22270hiarjszsjk3bnsx")))))))
946 (uri (string-append "http://zlib.net/pigz/"
947 name "-" version ".tar.gz"))
950 "0wsgw5vwl23jrnpsvd8v3xcp5k4waw5mk0164fynjhkv58i1dy54"))))
951 (build-system gnu-build-system)
954 (modify-phases %standard-phases
957 (lambda* (#:key outputs #:allow-other-keys)
958 (let* ((out (assoc-ref outputs "out"))
959 (bin (string-append out "/bin"))
960 (man (string-append out "/share/man/man1")))
961 (install-file "pigz" bin)
962 (symlink "pigz" (string-append bin "/unpigz"))
963 (install-file "pigz.1" man)
965 #:make-flags (list "CC=gcc")
966 #:test-target "tests"))
967 (inputs `(("zlib" ,zlib)))
968 (home-page "https://zlib.net/pigz/")
969 (synopsis "Parallel implementation of gzip")
971 "This package provides a parallel implementation of gzip that exploits
972 multiple processors and multiple cores when compressing data.")
974 ;; Things under zopfli/ are under ASL2.0, but 4 files at the top-level,
975 ;; written by Mark Adler, are under another non-copyleft license.
976 (license license:asl2.0)))
985 "https://github.com/vasi/pixz/releases/download/v" version
986 "/pixz-" version ".tar.xz"))
989 "1s3j7zw6j5zi3fhdxg287ndr3wf6swac7z21mqd1pyiln530gi82"))))
990 (build-system gnu-build-system)
992 `(("pkg-config" ,pkg-config)
993 ("libarchive" ,libarchive)))
994 (home-page "https://github.com/vasi/pixz")
995 (synopsis "Parallel indexing implementation of LZMA")
997 "The existing XZ Utils provide great compression in the .xz file format,
998 but they produce just one big block of compressed data. Pixz instead produces
999 a collection of smaller blocks which makes random access to the original data
1000 possible and can compress in parallel. This is especially useful for large
1002 (license license:bsd-2)))
1004 (define-public brotli
1005 (let ((commit "e992cce7a174d6e2b3486616499d26bb0bad6448")
1009 (version (string-append "0.1-" revision "."
1010 (string-take commit 7)))
1014 (url "https://github.com/bagder/libbrotli.git")
1017 (file-name (string-append name "-" version ".tar.xz"))
1020 "1qxxsasvwbbbh6dl3138y9h3fg0q2v7xdk5jjc690bdg7g1wrj6n"))
1021 (modules '((guix build utils)))
1023 ;; This is a recursive submodule that is
1024 ;; unnecessary for this package, so delete it.
1025 (delete-file-recursively "brotli/terryfy")
1027 (build-system gnu-build-system)
1029 `(("autoconf" ,autoconf)
1030 ("automake" ,automake)
1031 ("libtool" ,libtool)))
1033 `(#:phases (modify-phases %standard-phases
1034 (add-after 'unpack 'autogen
1037 (invoke "autoreconf" "-vfi"))))))
1038 (home-page "https://github.com/bagder/libbrotli/")
1039 (synopsis "Implementation of the Brotli compression algorithm")
1041 "Brotli is a general-purpose lossless compression algorithm. It is
1042 similar in speed to deflate but offers denser compression. This package
1043 provides encoder and a decoder libraries: libbrotlienc and libbrotlidec,
1044 respectively, based on the reference implementation from Google.")
1045 (license license:expat))))
1047 (define-public bsdiff
1051 (home-page "https://www.daemonology.net/bsdiff/")
1054 (uri (string-append home-page name "-" version ".tar.gz"))
1057 "0j2zm3z271x5aw63mwhr3vymzn45p2vvrlrpm9cz2nywna41b0hq"))))
1058 (build-system gnu-build-system)
1060 `(#:make-flags (list "INSTALL=install" "CC=gcc"
1061 (string-append "PREFIX=" (assoc-ref %outputs "out")))
1062 #:phases (modify-phases %standard-phases
1064 (add-before 'build 'fix-Makefile
1066 (substitute* "Makefile"
1067 ;; Adjust syntax to make it compatible with GNU Make.
1069 ;; Help install(1) create the target directory.
1070 (("\\$\\{PREFIX\\}") "-D -t ${PREFIX}"))
1072 #:tests? #f)) ;no tests
1074 `(("bzip2" ,bzip2)))
1075 (synopsis "Patch binary files")
1077 "@command{bsdiff} and @command{bspatch} are tools for building and
1078 applying patches to binary files. By using suffix sorting (specifically
1079 Larsson and Sadakane's @code{qsufsort}) and taking advantage of how
1080 executable files change, bsdiff routinely produces binary patches 50-80%
1081 smaller than those produced by @code{Xdelta}.")
1082 (license license:bsd-2)))
1084 (define-public cabextract
1087 (home-page "https://cabextract.org.uk/")
1091 (uri (string-append home-page name "-" version ".tar.gz"))
1094 "1hf4zhjxfdgq9x172r5zfdnafma9q0zf7372syn8hcn7hcypkg0v"))
1095 (modules '((guix build utils)))
1098 ;; Delete bundled libmspack.
1099 (delete-file-recursively "mspack")
1101 (build-system gnu-build-system)
1103 '(#:configure-flags '("--with-external-libmspack")
1105 (modify-phases %standard-phases
1106 ;; cabextract needs some of libmspack's header files.
1107 ;; These are located in the "mspack" directory of libmspack.
1108 (add-before 'build 'unpack-libmspack
1109 (lambda* (#:key inputs #:allow-other-keys)
1110 (let ((dir-name "libmspack-src"))
1112 (invoke "tar" "-xvf" (assoc-ref inputs "libmspack-source")
1113 "-C" dir-name "--strip-components" "1")
1114 (rename-file (string-append dir-name "/mspack")
1116 (delete-file-recursively dir-name)
1119 `(("pkg-config" ,pkg-config)))
1121 `(("libmspack" ,libmspack)
1122 ("libmspack-source" ,(package-source libmspack))))
1123 (synopsis "Tool to unpack Cabinet archives")
1124 (description "Extracts files out of Microsoft Cabinet (.cab) archives")
1125 ;; Some source files specify gpl2+, lgpl2+, however COPYING is gpl3.
1126 (license license:gpl3+)))
1128 (define-public xdelta
1136 (url "https://github.com/jmacd/xdelta.git")
1137 (commit (string-append "v" version))))
1138 (file-name (git-file-name name version))
1141 "09mmsalc7dwlvgrda56s2k927rpl3a5dzfa88aslkqcjnr790wjy"))
1143 ;; This file isn't freely distributable and has no effect on building.
1145 (delete-file "xdelta3/draft-korn-vcdiff.txt")
1147 (build-system gnu-build-system)
1149 `(("autoconf" ,autoconf)
1150 ("automake" ,automake)))
1153 (modify-phases %standard-phases
1154 (add-after 'unpack 'enter-build-directory
1155 (lambda _ (chdir "xdelta3") #t)))))
1156 (home-page "http://xdelta.org")
1157 (synopsis "Delta encoder for binary files")
1158 (description "xdelta encodes only the differences between two binary files
1159 using the VCDIFF algorithm and patch file format described in RFC 3284. It can
1160 also be used to apply such patches. xdelta is similar to @command{diff} and
1161 @command{patch}, but is not limited to plain text and does not generate
1162 human-readable output.")
1163 (license license:asl2.0)))
1165 (define-public lrzip
1173 "http://ck.kolivas.org/apps/lrzip/lrzip-" version ".tar.bz2"))
1176 "0mb449vmmwpkalq732jdyginvql57nxyd31sszb108yps1lf448d"))
1177 (patches (search-patches "lrzip-CVE-2017-8842.patch"))))
1178 (build-system gnu-build-system)
1180 `(;; nasm is only required when building for 32-bit x86 platforms
1181 ,@(if (string-prefix? "i686" (or (%current-target-system)
1190 (home-page "http://ck.kolivas.org/apps/lrzip/")
1191 (synopsis "Large file compressor with a very high compression ratio")
1192 (description "lrzip is a compression utility that uses long-range
1193 redundancy reduction to improve the subsequent compression ratio of
1194 larger files. It can then further compress the result with the ZPAQ or
1195 LZMA algorithms for maximum compression, or LZO for maximum speed. This
1196 choice between size or speed allows for either better compression than
1197 even LZMA can provide, or a higher speed than gzip while compressing as
1199 (license (list license:gpl3+
1200 license:public-domain)))) ; most files in lzma/
1202 (define-public bitshuffle
1208 (uri (pypi-uri "bitshuffle" version))
1211 "1823x61kyax4dc2hjmc1xraskxi1193y8lvxd03vqv029jrj8cjy"))
1212 (modules '((guix build utils)))
1215 ;; Remove generated Cython files.
1216 (delete-file "bitshuffle/h5.c")
1217 (delete-file "bitshuffle/ext.c")
1219 (build-system python-build-system)
1221 `(#:tests? #f ; fail: https://github.com/h5py/h5py/issues/769
1223 (modify-phases %standard-phases
1224 (add-after 'unpack 'dont-build-native
1226 (substitute* "setup.py"
1227 (("'-march=native', ") ""))
1230 `(("numpy" ,python-numpy)
1231 ("h5py" ,python-h5py)
1234 `(("cython" ,python-cython)))
1235 (home-page "https://github.com/kiyo-masui/bitshuffle")
1236 (synopsis "Filter for improving compression of typed binary data")
1237 (description "Bitshuffle is an algorithm that rearranges typed, binary data
1238 for improving compression, as well as a python/C package that implements this
1239 algorithm within the Numpy framework.")
1240 (license license:expat)))
1242 (define-public snappy
1249 (uri (string-append "https://github.com/google/snappy/archive/"
1251 (file-name (string-append "snappy-" version ".tar.gz"))
1253 (base32 "1m7rcdqzkys5lspj8jcsaah8w33zh28s771bw0ga2lgzfgl05yix"))
1254 (patches (search-patches "snappy-add-O2-flag-in-CmakeLists.txt.patch"))))
1255 (build-system cmake-build-system)
1257 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
1258 (home-page "https://github.com/google/snappy")
1259 (synopsis "Fast compressor/decompressor")
1260 (description "Snappy is a compression/decompression library. It does not
1261 aim for maximum compression, or compatibility with any other compression library;
1262 instead, it aims for very high speeds and reasonable compression. For instance,
1263 compared to the fastest mode of zlib, Snappy is an order of magnitude faster
1264 for most inputs, but the resulting compressed files are anywhere from 20% to
1266 (license license:asl2.0)))
1268 (define bitshuffle-for-snappy
1270 (inherit bitshuffle)
1271 (name "bitshuffle-for-snappy")
1272 (build-system gnu-build-system)
1276 (modify-phases %standard-phases
1278 (lambda* (#:key outputs #:allow-other-keys)
1279 (with-output-to-file "Makefile"
1282 libbitshuffle.so: src/bitshuffle.o src/bitshuffle_core.o src/iochain.o lz4/lz4.o
1283 \tgcc -O3 -ffast-math -std=c99 -o $@ -shared -fPIC $^
1286 \tgcc -O3 -ffast-math -std=c99 -fPIC -Isrc -Ilz4 -c $< -o $@
1289 LIBDIR:=$(PREFIX)/lib
1290 INCLUDEDIR:=$(PREFIX)/include
1292 install: libbitshuffle.so
1293 \tinstall -dm755 $(LIBDIR)
1294 \tinstall -dm755 $(INCLUDEDIR)
1295 \tinstall -m755 libbitshuffle.so $(LIBDIR)
1296 \tinstall -m644 src/bitshuffle.h $(INCLUDEDIR)
1297 \tinstall -m644 src/bitshuffle_core.h $(INCLUDEDIR)
1298 \tinstall -m644 src/iochain.h $(INCLUDEDIR)
1299 \tinstall -m644 lz4/lz4.h $(INCLUDEDIR)
1300 " (assoc-ref outputs "out"))))
1303 (native-inputs '())))
1305 (define-public java-snappy
1307 (name "java-snappy")
1311 (uri (string-append "https://github.com/xerial/snappy-java/archive/"
1313 (file-name (string-append name "-" version ".tar.gz"))
1316 "1p557vdv006ysgxbpp83krmq0066k46108vyiyka69w8i4i8rbbm"))))
1317 (build-system ant-build-system)
1319 `(#:jar-name "snappy.jar"
1320 #:source-dir "src/main/java"
1322 (modify-phases %standard-phases
1323 (add-before 'build 'remove-binaries
1325 (delete-file "lib/org/xerial/snappy/OSInfo.class")
1326 (delete-file-recursively "src/main/resources/org/xerial/snappy/native")
1328 (add-before 'build 'build-jni
1330 ;; Rebuild one of the binaries we removed earlier
1331 (invoke "javac" "src/main/java/org/xerial/snappy/OSInfo.java"
1333 ;; Link to the dynamic bitshuffle and snappy, not the static ones
1334 (substitute* "Makefile.common"
1336 "-shared -lbitshuffle -lsnappy"))
1337 (substitute* "Makefile"
1338 ;; Don't try to use git, don't download bitshuffle source
1339 ;; and don't build it.
1340 (("\\$\\(SNAPPY_GIT_UNPACKED\\) ")
1342 ((": \\$\\(SNAPPY_GIT_UNPACKED\\)")
1344 (("\\$\\(BITSHUFFLE_UNPACKED\\) ")
1346 ((": \\$\\(SNAPPY_SOURCE_CONFIGURED\\)") ":")
1347 ;; What we actually want to build
1349 "SNAPPY_OBJ:=$(addprefix $(SNAPPY_OUT)/, \
1350 SnappyNative.o BitShuffleNative.o)\n")
1351 ;; Since we removed the directory structure in "native" during
1352 ;; the previous phase, we need to recreate it.
1353 (("NAME\\): \\$\\(SNAPPY_OBJ\\)")
1354 "NAME): $(SNAPPY_OBJ)\n\t@mkdir -p $(@D)"))
1355 ;; Finally we can run the Makefile to build the dynamic library.
1356 ;; Use the -nocmake target to avoid a dependency on cmake,
1357 ;; which in turn requires the "git_unpacked" directory.
1358 (invoke "make" "native-nocmake")))
1359 ;; Once we have built the shared library, we need to place it in the
1360 ;; "build" directory so it can be added to the jar file.
1361 (add-after 'build-jni 'copy-jni
1363 (copy-recursively "src/main/resources/org/xerial/snappy/native"
1364 "build/classes/org/xerial/snappy/native")
1366 (add-before 'check 'fix-failing
1368 (with-directory-excursion "src/test/java/org/xerial/snappy"
1369 ;; This package assumes maven build, which puts results in "target".
1370 ;; We put them in "build" instead, so fix that.
1371 (substitute* "SnappyLoaderTest.java"
1372 (("target/classes") "build/classes"))
1373 ;; This requires Hadoop, which is not in Guix yet.
1374 (delete-file "SnappyHadoopCompatibleOutputStreamTest.java"))
1377 `(("osgi-framework" ,java-osgi-framework)))
1379 `(("bitshuffle" ,bitshuffle-for-snappy)
1380 ("snappy" ,snappy)))
1382 `(("junit" ,java-junit)
1383 ("hamcrest" ,java-hamcrest-core)
1384 ("xerial-core" ,java-xerial-core)
1385 ("classworlds" ,java-plexus-classworlds)
1386 ("commons-lang" ,java-commons-lang)
1387 ("commons-io" ,java-commons-io)
1389 (home-page "https://github.com/xerial/snappy-java")
1390 (synopsis "Compression/decompression algorithm in Java")
1391 (description "Snappy-java is a Java port of snappy, a fast C++
1392 compressor/decompressor.")
1393 (license license:asl2.0)))
1395 (define-public java-snappy-1
1397 (inherit java-snappy)
1398 (version "1.0.3-rc3")
1401 (uri (string-append "https://github.com/xerial/snappy-java/archive/"
1402 "snappy-java-" version ".tar.gz"))
1405 "08hsxlqidiqck0q57fshwyv3ynyxy18vmhrai9fyc8mz17m7gsa3"))))
1407 `(#:jar-name "snappy.jar"
1408 #:source-dir "src/main/java"
1410 (modify-phases %standard-phases
1411 (add-before 'build 'remove-binaries
1413 (delete-file "lib/org/xerial/snappy/OSInfo.class")
1414 (delete-file-recursively "src/main/resources/org/xerial/snappy/native")
1416 (add-before 'build 'build-jni
1418 ;; Rebuild one of the binaries we removed earlier
1419 (invoke "javac" "src/main/java/org/xerial/snappy/OSInfo.java"
1421 ;; Link to the dynamic snappy, not the static ones
1422 (substitute* "Makefile.common"
1423 (("-shared") "-shared -lsnappy"))
1424 (substitute* "Makefile"
1425 ;; Don't download the sources here.
1426 (("\\$\\(SNAPPY_UNPACKED\\) ") "")
1427 ((": \\$\\(SNAPPY_UNPACKED\\) ") ":")
1428 ;; What we actually want to build
1430 "SNAPPY_OBJ:=$(addprefix $(SNAPPY_OUT)/, SnappyNative.o)\n")
1431 ;; Since we removed the directory structure in "native" during
1432 ;; the previous phase, we need to recreate it.
1433 (("NAME\\): \\$\\(SNAPPY_OBJ\\)")
1434 "NAME): $(SNAPPY_OBJ)\n\t@mkdir -p $(@D)"))
1435 ;; Finally we can run the Makefile to build the dynamic library.
1436 (invoke "make" "native")))
1437 ;; Once we have built the shared library, we need to place it in the
1438 ;; "build" directory so it can be added to the jar file.
1439 (add-after 'build-jni 'copy-jni
1441 (copy-recursively "src/main/resources/org/xerial/snappy/native"
1442 "build/classes/org/xerial/snappy/native")
1444 (add-before 'check 'fix-tests
1446 (mkdir-p "src/test/resources/org/xerial/snappy/")
1447 (copy-recursively "src/test/java/org/xerial/snappy/testdata"
1448 "src/test/resources/org/xerial/snappy/testdata")
1449 (install-file "src/test/java/org/xerial/snappy/alice29.txt"
1450 "src/test/resources/org/xerial/snappy/")
1453 (define-public java-iq80-snappy
1455 (name "java-iq80-snappy")
1459 (uri (string-append "https://github.com/dain/snappy/archive/snappy-"
1463 "0rb3zhci7w9wzd65lfnk7p3ip0n6gb58a9qpx8n7r0231gahyamf"))))
1464 (build-system ant-build-system)
1466 `(#:jar-name "iq80-snappy.jar"
1467 #:source-dir "src/main/java"
1468 #:test-dir "src/test"
1471 (modify-phases %standard-phases
1474 (define (test class)
1475 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
1477 ":build/test-classes")
1478 "-Dtest.resources.dir=src/test/resources"
1479 "org.testng.TestNG" "-testclass"
1481 (invoke "ant" "compile-tests")
1482 (test "org.iq80.snappy.SnappyFramedStreamTest")
1483 (test "org.iq80.snappy.SnappyStreamTest")
1485 (add-before 'build 'remove-hadoop-dependency
1487 ;; We don't have hadoop
1488 (delete-file "src/main/java/org/iq80/snappy/HadoopSnappyCodec.java")
1489 (delete-file "src/test/java/org/iq80/snappy/TestHadoopSnappyCodec.java")
1491 (home-page "https://github.com/dain/snappy")
1493 `(("guava" ,java-guava)
1494 ("java-snappy" ,java-snappy)
1495 ("hamcrest" ,java-hamcrest-core)
1496 ("testng" ,java-testng)))
1497 (synopsis "Java port of the Snappy (de)compressor")
1499 "Iq80-snappy is a port of the Snappy compressor and decompressor rewritten
1500 in pure Java. This compression code produces a byte-for-byte exact copy of the
1501 output created by the original C++ code, and is extremely fast.")
1502 (license license:asl2.0)))
1504 (define-public java-jbzip2
1506 (name "java-jbzip2")
1510 (uri (string-append "https://storage.googleapis.com/"
1511 "google-code-archive-source/v2/"
1512 "code.google.com/jbzip2/"
1513 "source-archive.zip"))
1514 (file-name (string-append name "-" version ".zip"))
1517 "0ncmhlqmrfmj96nqf6p77b9ws35lcfsvpfxzwxi2asissc83z1l3"))))
1518 (build-system ant-build-system)
1521 ("java-junit" ,java-junit)))
1523 `(#:tests? #f ; no tests
1524 #:jar-name "jbzip2.jar"
1525 #:source-dir "tags/release-0.9.1/src"
1527 (modify-phases %standard-phases
1528 (add-after 'unpack 'fix-encoding-problems
1530 ;; Some of the files we're patching are
1531 ;; ISO-8859-1-encoded, so choose it as the default
1532 ;; encoding so the byte encoding is preserved.
1533 (with-fluids ((%default-port-encoding #f))
1534 (substitute* "tags/release-0.9.1/src/org/itadaki/bzip2/HuffmanAllocator.java"
1535 (("Milidi.") "Milidiu")))
1537 (home-page "https://code.google.com/archive/p/jbzip2/")
1538 (synopsis "Java bzip2 compression/decompression library")
1539 (description "Jbzip2 is a Java bzip2 compression/decompression library.
1540 It can be used as a replacement for the Apache @code{CBZip2InputStream} /
1541 @code{CBZip2OutputStream} classes.")
1542 (license license:expat)))
1544 (define-public p7zip
1550 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1551 version "/" name "_" version
1552 "_src_all.tar.bz2"))
1555 "07rlwbbgszq8i7m8jh3x6j2w2hc9a72dc7fmqawnqkwlwb00mcjy"))
1556 (modules '((guix build utils)))
1559 ;; Remove non-free source files
1560 (for-each delete-file
1562 (find-files "CPP/7zip/Compress" "Rar.*")
1563 (find-files "CPP/7zip/Crypto" "Rar.*")
1564 (find-files "DOC/unRarLicense.txt")
1565 (find-files "Utils/file_Codecs_Rar_so.py")))
1566 (delete-file-recursively "CPP/7zip/Archive/Rar")
1567 (delete-file-recursively "CPP/7zip/Compress/Rar")
1569 (patches (search-patches "p7zip-CVE-2016-9296.patch"
1570 "p7zip-CVE-2017-17969.patch"
1571 "p7zip-remove-unused-code.patch"))))
1572 (build-system gnu-build-system)
1575 (list (string-append "DEST_HOME=" (assoc-ref %outputs "out")) "all3")
1577 (modify-phases %standard-phases
1579 (lambda* (#:key system outputs #:allow-other-keys)
1581 (let ((system ,(or (%current-target-system)
1582 (%current-system))))
1584 ((string-prefix? "x86_64" system)
1585 "makefile.linux_amd64_asm")
1586 ((string-prefix? "i686" system)
1587 "makefile.linux_x86_asm_gcc_4.X")
1589 "makefile.linux_any_cpu_gcc_4.X")))
1590 "makefile.machine")))
1593 (invoke "make" "test")
1594 (invoke "make" "test_7z")
1595 (invoke "make" "test_7zr"))))))
1597 (let ((system (or (%current-target-system)
1598 (%current-system))))
1599 `(,@(cond ((string-prefix? "x86_64" system)
1601 ((string-prefix? "i686" system)
1604 (home-page "http://p7zip.sourceforge.net/")
1605 (synopsis "Command-line file archiver with high compression ratio")
1606 (description "p7zip is a command-line port of 7-Zip, a file archiver that
1607 handles the 7z format which features very high compression ratios.")
1608 (license (list license:lgpl2.1+
1610 license:public-domain))))
1612 (define-public gzstream
1619 ;; No versioned URL, but last release was in 2003.
1620 "http://www.cs.unc.edu/Research/compgeom/gzstream/gzstream.tgz")
1621 (file-name (string-append name "-" version ".tgz"))
1624 "00y19pqjsdj5zcrx4p9j56pl73vayfwnb7y2hvp423nx0cwv5b4r"))
1625 (modules '((guix build utils)))
1627 ;; Remove pre-compiled object.
1629 (delete-file "gzstream.o")
1631 (build-system gnu-build-system)
1633 `(#:test-target "test"
1635 (modify-phases %standard-phases
1638 (lambda* (#:key outputs #:allow-other-keys)
1639 (let* ((out (assoc-ref outputs "out"))
1640 (lib (string-append out "/lib"))
1641 (include (string-append out "/include")))
1642 (install-file "libgzstream.a" lib)
1643 (install-file "gzstream.h" include)
1645 (propagated-inputs `(("zlib" ,zlib)))
1646 (home-page "http://www.cs.unc.edu/Research/compgeom/gzstream/")
1647 (synopsis "Compressed C++ iostream")
1648 (description "gzstream is a small library for providing zlib
1649 functionality in a C++ iostream.")
1650 (license license:lgpl2.1+)))
1658 (method url-fetch/zipbomb)
1659 (uri (string-append "http://mattmahoney.net/dc/zpaq"
1660 (string-delete #\. version) ".zip"))
1663 "066l94yyladlfzri877nh2dhkvspagjn3m5bmv725fmhkr9c4pp8"))
1664 (modules '((guix build utils)))
1666 ;; Delete irrelevant pre-compiled binaries.
1668 (for-each delete-file (find-files "." "\\.exe$"))
1670 (build-system gnu-build-system)
1673 (modify-phases %standard-phases
1674 (delete 'configure)) ; no ‘configure’ script
1677 (string-append "CPPFLAGS=-Dunix"
1678 ,(match (or (%current-target-system)
1683 ;; These should be safe, lowest-common-denominator instruction sets,
1684 ;; allowing for some optimisation while remaining reproducible.
1685 (string-append "CXXFLAGS=-O3 -DNDEBUG"
1686 ,(match (or (%current-target-system)
1688 ("x86_64-linux" " -march=nocona -mtune=generic")
1689 ("i686-linux" " -march=i686 -mtune=generic")
1690 ("armhf-linux" " -mtune=generic-armv7-a")
1692 (string-append "PREFIX="
1693 (assoc-ref %outputs "out")))))
1695 `(("perl" ,perl))) ; for pod2man
1696 (home-page "http://mattmahoney.net/dc/zpaq.html")
1697 (synopsis "Incremental journaling archiver")
1698 (description "ZPAQ is a command-line archiver for realistic situations with
1699 many duplicate and already compressed files. It backs up only those files
1700 modified since the last update. All previous versions remain untouched and can
1701 be independently recovered. Identical files are only stored once (known as
1702 @dfn{de-duplication}). Archives can also be encrypted.
1704 ZPAQ is intended to back up user data, not entire operating systems. It ignores
1705 owner and group IDs, ACLs, extended attributes, or special file types like
1706 devices, sockets, or named pipes. It does not follow or restore symbolic links
1707 or junctions, and always follows hard links.")
1708 (license (list license:public-domain
1709 ;; libzpaq.cpp contains a mix of public-domain and
1710 ;; expat-licenced (or ‘MIT’) code.
1713 (define-public unshield
1718 (origin (method url-fetch)
1719 (uri (string-append "http://github.com/twogood/unshield/archive/"
1721 (file-name (string-append name "-" version ".tar.gz"))
1724 "0x7ps644yp5dka2zhb8w0ifqmw3d255jafpzfwv8xbcpgq6fmm2x"))))
1725 (build-system cmake-build-system)
1728 ("openssl" ,openssl)
1729 ;; test data that is otherwise downloaded with curl
1730 ("unshield-avigomanager11b22.zip"
1733 (uri (string-append "https://www.dropbox.com/s/8r4b6752swe3nhu/"
1734 "unshield-avigomanager11b22.zip?dl=1"))
1736 (base32 "0fwq7lih04if68wpwpsk5wjqyvh32db76a41sq6gbx4dn1lc3ddn"))
1737 (file-name "unshield-avigomanager11b22.zip")))
1738 ("unshield-the-feeble-files-spanish.zip"
1741 (uri (string-append "https://www.dropbox.com/s/1ng0z9kfxc7eb1e/"
1742 "unshield-the-feeble-files-spanish.zip?dl=1"))
1744 (base32 "1k5cw6vnpja8yjlnhx5124xrw9i8s1l539hfdqqrqz3l5gn0bnyd"))
1745 (file-name "unshield-the-feeble-files-spanish.zip")))))
1747 `(("unzip" ,unzip)))
1749 `(#:out-of-source? #f
1751 (modify-phases %standard-phases
1752 (add-before 'check 'pre-check
1753 (lambda* (#:key inputs #:allow-other-keys)
1754 (for-each (lambda (i)
1755 (copy-file (assoc-ref inputs i)
1756 (string-append "test/v0/" i)))
1757 '("unshield-avigomanager11b22.zip"
1758 "unshield-the-feeble-files-spanish.zip"))
1759 (substitute* (find-files "test/" "/*\\.sh")
1760 ;; Tests expect the unshield binary in a specific
1762 (("/var/tmp/unshield/bin/unshield")
1763 (string-append (getcwd) "/src/unshield"))
1764 ;; We no longer need to download the data.
1766 (("curl -(|f)sSL -o test.zip .*") ""))
1767 (substitute* "test/v0/avigomanager.sh"
1769 (string-append (getcwd)
1770 "/test/v0/unshield-avigomanager11b22.zip")))
1771 (substitute* "test/v0/the-feeble-files-spanish.sh"
1773 (string-append (getcwd)
1774 "/test/v0/unshield-the-feeble-files-spanish.zip")))
1778 (invoke "./run-tests.sh"))))))
1779 (home-page "https://github.com/twogood/unshield")
1780 (synopsis "Extract CAB files from InstallShield installers")
1782 "@command{unshield} is a tool and library for extracting @file{.cab}
1783 archives from InstallShield installers.")
1784 (license license:expat)))
1793 (uri (string-append "https://github.com/facebook/zstd/releases/download/"
1794 "v" version "/zstd-" version ".tar.gz"))
1796 (base32 "13nlsqhkn276frxrzjdn7wz0j9zz414lf336885ykyxcvw2a0gr9"))))
1797 (build-system gnu-build-system)
1800 (modify-phases %standard-phases
1801 (delete 'configure)) ; no configure script
1804 (string-append "PREFIX=" (assoc-ref %outputs "out"))
1805 ;; Skip auto-detection of, and creating a dependency on, the build
1806 ;; environment's ‘xz’ for what amounts to a dubious feature anyway.
1808 ;; Not currently detected, but be explicit & avoid surprises later.
1811 (home-page "https://facebook.github.io/zstd/")
1812 (synopsis "Zstandard real-time compression algorithm")
1813 (description "Zstandard (@command{zstd}) is a lossless compression algorithm
1814 that combines very fast operation with a compression ratio comparable to that of
1815 zlib. In most scenarios, both compression and decompression can be performed in
1816 ‘real time’. The compressor can be configured to provide the most suitable
1817 trade-off between compression ratio and speed, without affecting decompression
1819 (license (list license:bsd-3 ; the main top-level LICENSE file
1820 license:bsd-2 ; many files explicitly state 2-Clause
1821 license:gpl2 ; the main top-level COPYING file
1822 license:gpl3+ ; tests/gzip/*.sh
1823 license:expat ; lib/dictBuilder/divsufsort.[ch]
1824 license:public-domain ; zlibWrapper/examples/fitblk*
1825 license:zlib)))) ; zlibWrapper/{gz*.c,gzguts.h}
1827 (define-public pzstd
1830 (version (package-version zstd))
1831 (source (package-source zstd))
1832 (build-system gnu-build-system)
1834 `(("googletest" ,googletest)))
1837 (modify-phases %standard-phases
1838 (add-after 'unpack 'enter-subdirectory
1839 (lambda _ (chdir "contrib/pzstd") #t))
1840 (delete 'configure) ; no configure script
1841 (add-before 'check 'compile-tests
1842 (lambda* (#:key make-flags #:allow-other-keys)
1843 (apply invoke "make" "tests" make-flags)))
1844 (add-after 'install 'install-documentation
1845 (lambda* (#:key outputs #:allow-other-keys)
1846 (let* ((out (assoc-ref outputs "out"))
1847 (doc (string-append out "/share/doc/" ,name)))
1849 (install-file "README.md" doc)
1853 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1854 (home-page (package-home-page zstd))
1855 (synopsis "Threaded implementation of the Zstandard compression algorithm")
1856 (description "Parallel Zstandard (PZstandard or @command{pzstd}) is a
1857 multi-threaded implementation of the @uref{http://zstd.net/, Zstandard
1858 compression algorithm}. It is fully compatible with the original Zstandard file
1859 format and command-line interface, and can be used as a drop-in replacement.
1861 Compression is distributed over multiple processor cores to improve performance,
1862 as is the decompression of data compressed in this manner. Data compressed by
1863 other implementations will only be decompressed by two threads: one performing
1864 the actual decompression, the other input and output.")
1865 (license (package-license zstd))))
1874 (uri (string-append "mirror://sourceforge/infozip"
1875 "/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz"))
1878 "0sb3h3067pzf3a7mlxn1hikpcjrsvycjcnj9hl9b1c3ykcgvps7h"))))
1879 (build-system gnu-build-system)
1880 (inputs `(("bzip2" ,bzip2)))
1882 `(#:tests? #f ; no test target
1883 #:make-flags (let ((out (assoc-ref %outputs "out")))
1884 (list "-f" "unix/Makefile"
1885 (string-append "prefix=" out)
1886 (string-append "MANDIR=" out "/share/man/man1")))
1888 (modify-phases %standard-phases
1890 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1891 (apply invoke "make" "generic_gcc" make-flags)))
1892 (delete 'configure))))
1893 (home-page "http://www.info-zip.org/Zip.html")
1894 (synopsis "Compression and file packing utility")
1896 "Zip is a compression and file packaging/archive utility. Zip is useful
1897 for packaging a set of files for distribution, for archiving files, and for
1898 saving disk space by temporarily compressing unused files or directories.
1899 Zip puts one or more compressed files into a single ZIP archive, along with
1900 information about the files (name, path, date, time of last modification,
1901 protection, and check information to verify file integrity). An entire
1902 directory structure can be packed into a ZIP archive with a single command.
1904 Zip has one compression method (deflation) and can also store files without
1905 compression. Zip automatically chooses the better of the two for each file.
1906 Compression ratios of 2:1 to 3:1 are common for text files.")
1907 (license (license:non-copyleft "file://LICENSE"
1908 "See LICENSE in the distribution."))))
1910 (define-public unzip
1911 (package (inherit zip)
1917 (uri (string-append "mirror://sourceforge/infozip"
1918 "/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz"))
1921 "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83"))
1922 (patches (search-patches "unzip-CVE-2014-8139.patch"
1923 "unzip-CVE-2014-8140.patch"
1924 "unzip-CVE-2014-8141.patch"
1925 "unzip-CVE-2014-9636.patch"
1926 "unzip-CVE-2015-7696.patch"
1927 "unzip-CVE-2015-7697.patch"
1928 "unzip-allow-greater-hostver-values.patch"
1929 "unzip-initialize-symlink-flag.patch"
1930 "unzip-remove-build-date.patch"
1931 "unzip-attribs-overflow.patch"
1932 "unzip-overflow-on-invalid-input.patch"
1933 "unzip-format-secure.patch"
1934 "unzip-overflow-long-fsize.patch"))))
1935 (build-system gnu-build-system)
1936 ;; no inputs; bzip2 is not supported, since not compiled with BZ_NO_STDIO
1938 `(#:phases (modify-phases %standard-phases
1940 (add-after 'unpack 'fortify
1942 ;; Mitigate CVE-2018-1000035, an exploitable buffer overflow.
1943 ;; This environment variable is recommended in 'unix/Makefile'
1944 ;; for passing flags to the C compiler.
1945 (setenv "LOCAL_UNZIP" "-D_FORTIFY_SOURCE=1")
1948 (lambda* (#:key make-flags #:allow-other-keys)
1949 (apply invoke "make"
1950 `("-j" ,(number->string
1951 (parallel-job-count))
1954 #:make-flags (list "-f" "unix/Makefile"
1955 (string-append "prefix=" %output)
1956 (string-append "MANDIR=" %output "/share/man/man1"))))
1957 (home-page "http://www.info-zip.org/UnZip.html")
1958 (synopsis "Decompression and file extraction utility")
1960 "UnZip is an extraction utility for archives compressed in .zip format,
1961 also called \"zipfiles\".
1963 UnZip lists, tests, or extracts files from a .zip archive. The default
1964 behaviour (with no options) is to extract into the current directory, and
1965 subdirectories below it, all files from the specified zipfile. UnZip
1966 recreates the stored directory structure by default.")
1967 (license (license:non-copyleft "file://LICENSE"
1968 "See LICENSE in the distribution."))))
1970 (define-public zziplib
1974 (home-page "https://github.com/gdraheim/zziplib")
1978 (uri (string-append home-page "/archive/v" version ".tar.gz"))
1981 "0i052a7shww0fzsxrdp3rd7g4mbzx7324a8ysbc0br7frpblcql4"))))
1982 (build-system gnu-build-system)
1985 (native-inputs `(("perl" ,perl) ; for the documentation
1986 ("pkg-config" ,pkg-config)
1987 ;; for the documentation; Python 3 not supported,
1988 ;; http://forums.gentoo.org/viewtopic-t-863161-start-0.html
1989 ("python" ,python-2)
1990 ("zip" ,zip))) ; to create test files
1991 (synopsis "Library for accessing zip files")
1993 "ZZipLib is a library based on zlib for accessing zip files.")
1994 ;; zziplib is dual licensed under LGPL2.0+ and MPL1.1. Some example source
1995 ;; files carry the Zlib license; see "docs/copying.html" for details.
1996 (license (list license:lgpl2.0+ license:mpl1.1))))
1998 (define-public perl-archive-zip
2000 (name "perl-archive-zip")
2006 "mirror://cpan/authors/id/P/PH/PHRED/Archive-Zip-"
2010 "0zfinh8nx3rxzscp57vq3w8hihpdb0zs67vvalykcf402kr88pyy"))))
2011 (build-system perl-build-system)
2014 `(("perl-test-mockmodule" ,perl-test-mockmodule)))
2015 (synopsis "Provides an interface to Zip archive files")
2016 (description "The @code{Archive::Zip} module allows a Perl program to
2017 create, manipulate, read, and write Zip archive files.")
2018 (home-page "https://metacpan.org/release/Archive-Zip")
2019 (license license:perl-license)))
2021 (define-public libzip
2028 "https://libzip.org/download/" name "-" version ".tar.xz"))
2031 "0wnkkvkq90wyawj9221i77sf3nix1vj3ygzdy59k8yvcjnv3bsh4"))))
2036 (build-system cmake-build-system)
2037 (home-page "https://libzip.org")
2038 (synopsis "C library for reading, creating, and modifying zip archives")
2039 (description "Libzip is a C library for reading, creating, and modifying
2040 zip archives. Files can be added from data buffers, files, or compressed data
2041 copied directly from other zip archives. Changes made without closing the
2042 archive can be reverted.")
2043 (license license:bsd-3)))
2045 (define-public atool
2052 (uri (string-append "http://savannah.nongnu.org/download/atool/atool-"
2056 "0fvhzip2v08jgnlfpyj6rapan39xlsl1ksgq4lp8gfsai2ah1xma"))))
2057 (build-system gnu-build-system)
2060 (modify-phases %standard-phases
2061 (add-after 'unpack 'embed-absolute-file-name
2062 (lambda* (#:key inputs #:allow-other-keys)
2063 (substitute* "atool"
2064 (("(^\\$::cfg_path_file.*= )'file'" _ pre)
2065 (string-append pre "'" (assoc-ref inputs "file")
2071 (home-page "https://www.nongnu.org/atool/")
2072 (synopsis "Universal tool to manage file archives of various types")
2073 (description "The main command is @command{aunpack} which extracts files
2074 from an archive. The other commands provided are @command{apack} (to create
2075 archives), @command{als} (to list files in archives), and @command{acat} (to
2076 extract files to standard out). As @command{atool} invokes external programs
2077 to handle the archives, not all commands may be supported for a certain type
2079 (license license:gpl2+)))
2081 (define-public perl-archive-extract
2083 (name "perl-archive-extract")
2088 (uri (string-append "mirror://cpan/authors/id/B/BI/BINGOS/Archive-Extract-"
2092 "1x15j1q6w6z8hqyqgap0lz4qbq2174wfhksy1fdd653ccbaw5jr5"))))
2093 (build-system perl-build-system)
2094 (home-page "https://metacpan.org/release/Archive-Extract")
2095 (synopsis "Generic archive extracting mechanism")
2096 (description "It allows you to extract any archive file of the type .tar,
2097 .tar.gz, .gz, .Z, tar.bz2, .tbz, .bz2, .zip, .xz,, .txz, .tar.xz or .lzma
2098 without having to worry how it does so, or use different interfaces for each
2099 type by using either Perl modules, or command-line tools on your system.")
2100 (license license:perl-license)))
2102 (define-public java-tukaani-xz
2104 (name "java-tukaani-xz")
2108 (uri (string-append "https://tukaani.org/xz/xz-java-" version ".zip"))
2111 "1z3p1ri1gvl07inxn0agx44ck8n7wrzfmvkz8nbq3njn8r9wba8x"))))
2112 (build-system ant-build-system)
2114 `(#:tests? #f; no tests
2116 (modify-phases %standard-phases
2117 (add-after 'unpack 'chdir
2119 ;; Our build system enters the first directory in the archive, but
2120 ;; the package is not contained in a subdirectory
2124 (lambda* (#:key outputs #:allow-other-keys)
2125 ;; Do we want to install *Demo.jar?
2126 (install-file "build/jar/xz.jar"
2128 (assoc-ref outputs "out")
2129 "/share/java/xz.jar"))
2132 `(("unzip" ,unzip)))
2133 (home-page "https://tukaani.org")
2134 (synopsis "XZ in Java")
2135 (description "Tukaani-xz is an implementation of xz compression/decompression
2136 algorithms in Java.")
2137 (license license:public-domain)))
2139 (define-public lunzip
2146 (uri (string-append "mirror://savannah/lzip/"
2147 name "/" name "-" version ".tar.gz"))
2149 (base32 "1iw59br6nsxs7l1p875h8w3vxwr04xfhg5zyal64crvamhxkj5kl"))))
2150 (build-system gnu-build-system)
2154 (home-page "https://www.nongnu.org/lzip/lunzip.html")
2155 (synopsis "Small, stand-alone lzip decompressor")
2157 "Lunzip is a decompressor for files in the lzip compression format (.lz),
2158 written as a single small C tool with no dependencies. This makes it
2159 well-suited to embedded and other systems without a C++ compiler, or for use in
2160 applications such as software installers that need only to decompress files,
2162 Lunzip is intended to be fully compatible with the regular lzip package.")
2163 (license (list license:bsd-2 ; carg_parser.[ch]
2164 license:gpl2+)))) ; everything else
2166 (define-public clzip
2173 (uri (string-append "mirror://savannah/lzip/"
2174 name "/" name "-" version ".tar.gz"))
2176 (base32 "03xcmhl3dya4jrwmsqh09ikimpb36fr3vkh2bwfzz1sbcns0cdg3"))))
2177 (build-system gnu-build-system)
2181 (home-page "https://www.nongnu.org/lzip/clzip.html")
2182 (synopsis "Small, stand-alone lzip compressor and decompressor")
2184 "Clzip is a compressor and decompressor for files in the lzip compression
2185 format (.lz), written as a single small C tool with no dependencies. This makes
2186 it well-suited to embedded and other systems without a C++ compiler, or for use
2187 in other applications like package managers.
2188 Clzip is intended to be fully compatible with the regular lzip package.")
2189 (license (list license:bsd-2 ; carg_parser.[ch], lzd in clzip.texi
2192 (define-public lzlib
2199 (uri (string-append "mirror://savannah/lzip/"
2200 name "/" name "-" version ".tar.gz"))
2202 (base32 "0hqhnj2lzqacdbmmnpy91lsm1rd9zlngs1q6s9pyahsv1a0bfshx"))))
2203 (build-system gnu-build-system)
2204 ;; The included minilzip binary is only ~16 smaller than the ‘real’ lzip.
2205 ;; It's used during the test suite, but don't be tempted to install it.
2209 "--enable-shared"))) ; only static (.a) is built by default
2210 (home-page "https://www.nongnu.org/lzip/lzlib.html")
2211 (synopsis "Lzip data compression C library")
2213 "Lzlib is a C library for in-memory LZMA compression and decompression in
2214 the lzip format. It supports integrity checking of the decompressed data, and
2215 all functions are thread-safe. The library should never crash, even in case of
2217 (license (list license:bsd-2 ; the library itself
2218 license:gpl2+)))) ; main.c (i.e. minilzip used by tests)
2220 (define-public plzip
2227 (uri (string-append "mirror://savannah/lzip/"
2228 name "/" name "-" version ".tar.gz"))
2230 (base32 "1dzjp9r7krwpsn224bhcqbzd5aj5b4556sdi9yzl2bzbk3fjrqlm"))))
2231 (build-system gnu-build-system)
2233 `(("lzlib" ,lzlib)))
2234 (home-page "https://www.nongnu.org/lzip/plzip.html")
2235 (synopsis "Parallel lossless data compressor for the lzip format")
2237 "Plzip is a massively parallel (multi-threaded) lossless data compressor
2238 and decompressor that uses the lzip file format (.lz). Files produced by plzip
2239 are fully compatible with lzip and can be rescued with lziprecover.
2240 On multiprocessor machines, plzip can compress and decompress large files much
2241 faster than lzip, at the cost of a slightly reduced compression ratio (0.4% to
2242 2%). The number of usable threads is limited by file size: on files of only a
2243 few MiB, plzip is no faster than lzip.
2244 Files that were compressed with regular lzip will also not be decompressed
2245 faster by plzip, unless the @code{-b} option was used: lzip usually produces
2246 single-member files which can't be decompressed in parallel.")
2247 (license (list license:bsd-2 ; arg_parser.{cc,h}
2248 license:gpl2+)))) ; everything else
2250 (define-public innoextract
2252 (name "innoextract")
2257 (uri (string-append "https://github.com/dscharrer/innoextract/archive/"
2261 "0khwi9f0q0h6xfbixrrc1rfpgj0b7ajwilq7yhmxnn5lpc807f6x"))
2262 (file-name (string-append name "-" version ".tar.gz"))))
2263 (build-system cmake-build-system)
2265 `(#:tests? #f)) ;; No tests available.
2266 (inputs `(("boost" ,boost-cxx14)
2267 ("libiconv" ,libiconv)
2269 (native-inputs `(("pkg-config" ,pkg-config)))
2270 (home-page "https://constexpr.org/innoextract/")
2271 (synopsis "Tool for extracting Inno Setup installers")
2272 (description "innoextract allows extracting Inno Setup installers under
2273 non-Windows systems without running the actual installer using wine.")
2274 (license license:zlib)))
2276 (define-public google-brotli
2278 (name "google-brotli")
2282 (uri (string-append "https://github.com/google/brotli/archive/v"
2286 "1hrpmz162k4x3xm6vmbpm443jlfr1kp536p8962y2dncy7gs6s12"))))
2287 (build-system cmake-build-system)
2290 (modify-phases %standard-phases
2291 (add-after 'install 'rename-static-libraries
2292 ;; The build tools put a 'static' suffix on the static libraries, but
2293 ;; other applications don't know how to find these.
2294 (lambda* (#:key outputs #:allow-other-keys)
2295 (let ((lib (string-append (assoc-ref %outputs "out") "/lib/")))
2296 (rename-file (string-append lib "libbrotlicommon-static.a")
2297 (string-append lib "libbrotlicommon.a"))
2298 (rename-file (string-append lib "libbrotlidec-static.a")
2299 (string-append lib "libbrotlidec.a"))
2300 (rename-file (string-append lib "libbrotlienc-static.a")
2301 (string-append lib "libbrotlienc.a"))
2304 (list ;; Defaults to "lib64" on 64-bit archs.
2305 (string-append "-DCMAKE_INSTALL_LIBDIR="
2306 (assoc-ref %outputs "out") "/lib"))))
2307 (home-page "https://github.com/google/brotli")
2308 (synopsis "General-purpose lossless compression")
2309 (description "This package provides the reference implementation of Brotli,
2310 a generic-purpose lossless compression algorithm that compresses data using a
2311 combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd
2312 order context modeling, with a compression ratio comparable to the best
2313 currently available general-purpose compression methods. It is similar in speed
2314 with @code{deflate} but offers more dense compression.
2316 The specification of the Brotli Compressed Data Format is defined in RFC 7932.")
2317 (license license:expat)))
2325 (uri (string-append "http://www.oberhumer.com/opensource/"
2326 name "/download/" name "-" version ".tar.gz"))
2329 "0j036lkwsxvm15gr29n8wn07cqq79dswjs9k54939ms5zngjjrdq"))))
2330 (build-system gnu-build-system)
2331 (home-page "http://www.oberhumer.com/opensource/ucl/")
2332 (synopsis "Portable lossless data compression library")
2333 (description "UCL implements a number of compression algorithms that
2334 achieve an excellent compression ratio while allowing fast decompression.
2335 Decompression requires no additional memory.
2337 Compared to LZO, the UCL algorithms achieve a better compression ratio but
2338 decompression is a little bit slower.")
2339 (license license:gpl2+)))
2347 (uri (string-append "https://github.com/upx/upx/releases/download/v"
2348 version "/" name "-" version "-src.tar.xz"))
2351 "08anybdliqsbsl6x835iwzljahnm9i7v26icdjkcv33xmk6p5vw1"))
2352 (patches (search-patches "upx-fix-CVE-2017-15056.patch"))))
2353 (build-system gnu-build-system)
2354 (native-inputs `(("perl" ,perl)
2356 (inputs `(("zlib" ,zlib)))
2360 ;; CHECK_WHITESPACE does not seem to work.
2361 ;; See https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/upx.
2362 "CHECK_WHITESPACE=true")
2364 (modify-phases %standard-phases
2368 (add-before 'build 'patch-exec-bin-sh
2370 (substitute* (find-files "Makefile")
2371 (("/bin/sh") (which "sh")))
2372 (substitute* "src/Makefile"
2373 (("/bin/sh") (which "sh")))
2375 (add-after 'build 'install-upx
2376 (lambda* (#:key outputs #:allow-other-keys)
2377 (let* ((out (assoc-ref outputs "out"))
2378 (bin (string-append out "/bin")))
2380 (copy-file "src/upx.out" (string-append bin "/upx")))
2383 (home-page "https://upx.github.io/")
2384 ;; CVE-2017-16869 is about Mach-O files which is not of a big concern for Guix.
2385 ;; See https://github.com/upx/upx/issues/146 and
2386 ;; https://nvd.nist.gov/vuln/detail?vulnId=CVE-2017-16869.
2387 ;; The issue will be fixed after version 3.94.
2388 (properties `((lint-hidden-cve . ("CVE-2017-16869"))))
2389 (synopsis "Compression tool for executables")
2391 "The Ultimate Packer for eXecutables (UPX) is an executable file
2392 compressor. UPX typically reduces the file size of programs and shared
2393 libraries by around 50%--70%, thus reducing disk space, network load times,
2394 download times, and other distribution and storage costs.")
2395 (license license:gpl2+)))