1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2017, 2019 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, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
14 ;;; Copyright © 2016 David Craven <david@craven.ch>
15 ;;; Copyright © 2016, 2019 Kei Kebreau <kkebreau@posteo.net>
16 ;;; Copyright © 2016, 2018 Marius Bakke <mbakke@fastmail.com>
17 ;;; Copyright © 2017 ng0 <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 cmake)
49 #:use-module (guix build-system gnu)
50 #:use-module (gnu packages)
51 #:use-module (gnu packages assembly)
52 #:use-module (gnu packages autotools)
53 #:use-module (gnu packages backup)
54 #:use-module (gnu packages base)
55 #:use-module (gnu packages boost)
56 #:use-module (gnu packages check)
57 #:use-module (gnu packages curl)
58 #:use-module (gnu packages file)
59 #:use-module (gnu packages maths)
60 #:use-module (gnu packages perl)
61 #:use-module (gnu packages pkg-config)
62 #:use-module (gnu packages python)
63 #:use-module (gnu packages tls)
64 #:use-module (gnu packages valgrind)
65 #:use-module (ice-9 match)
66 #:use-module ((srfi srfi-1) #:select (last)))
75 (uri (list (string-append "http://zlib.net/zlib-"
77 (string-append "mirror://sourceforge/libpng/zlib/"
78 version "/zlib-" version ".tar.gz")))
81 "18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3"))))
82 (build-system gnu-build-system)
83 (outputs '("out" "static"))
86 (modify-phases %standard-phases
88 (lambda* (#:key outputs #:allow-other-keys)
89 ;; Zlib's home-made `configure' fails when passed
90 ;; extra flags like `--enable-fast-install', so we need to
91 ;; invoke it with just what it understand.
92 (let ((out (assoc-ref outputs "out")))
93 ;; 'configure' doesn't understand '--host'.
94 ,@(if (%current-target-system)
95 `((setenv "CHOST" ,(%current-target-system)))
98 (string-append "--prefix=" out)))))
99 (add-after 'install 'move-static-library
100 (lambda* (#:key outputs #:allow-other-keys)
101 (let ((out (assoc-ref outputs "out"))
102 (static (assoc-ref outputs "static")))
103 (with-directory-excursion (string-append out "/lib")
104 (install-file "libz.a" (string-append static "/lib"))
105 (delete-file "libz.a")
107 (home-page "https://zlib.net/")
108 (synopsis "Compression library")
110 "zlib is designed to be a free, general-purpose, legally unencumbered --
111 that is, not covered by any patents -- lossless data-compression library for
112 use on virtually any computer hardware and operating system. The zlib data
113 format is itself portable across platforms. Unlike the LZW compression method
114 used in Unix compress(1) and in the GIF image format, the compression method
115 currently used in zlib essentially never expands the data. (LZW can double or
116 triple the file size in extreme cases.) zlib's memory footprint is also
117 independent of the input data and can be reduced, if necessary, at some cost
119 (license license:zlib)))
121 (define-public minizip
124 (version (package-version zlib))
125 (source (package-source zlib))
126 (build-system gnu-build-system)
129 (modify-phases %standard-phases
130 (add-after 'unpack 'enter-source
131 (lambda _ (chdir "contrib/minizip") #t))
132 (add-after 'install 'remove-crypt-h
133 (lambda* (#:key outputs #:allow-other-keys)
134 ;; Remove <minizip/crypt.h> because it interferes with libc's
135 ;; <crypt.h> given that 'minizip.pc' says "-I…/include/minizip".
136 ;; Fedora does the same:
137 ;; <https://src.fedoraproject.org/rpms/zlib/c/4d2785ec3116947872f6f32dc4104e6d36d8a7a4?branch=master>.
138 (let ((out (assoc-ref outputs "out")))
139 (delete-file (string-append out "/include/minizip/crypt.h"))
142 `(("autoconf" ,autoconf)
143 ("automake" ,automake)
144 ("libtool" ,libtool)))
145 (propagated-inputs `(("zlib" ,zlib)))
146 (home-page (package-home-page zlib))
147 (synopsis "Zip Compression library")
149 "Minizip is a minimalistic library that supports compressing,
150 extracting and viewing ZIP archives. This version is extracted from
151 the @code{zlib} source.")
152 (license (package-license zlib))))
154 (define-public fastjar
160 (uri (string-append "mirror://savannah/fastjar/fastjar-"
164 "0iginbz2m15hcsa3x4y7v3mhk54gr1r7m3ghx0pg4n46vv2snmpi"))))
165 (build-system gnu-build-system)
166 (inputs `(("zlib" ,zlib)))
167 (home-page "https://savannah.nongnu.org/projects/fastjar")
168 (synopsis "Replacement for Sun's 'jar' utility")
170 "FastJar is an attempt to create a much faster replacement for Sun's
171 @code{jar} utility. Instead of being written in Java, FastJar is written in C.")
172 (license license:gpl2+)))
174 (define-public libtar
182 "ftp://ftp.feep.net/pub/software/libtar/libtar-"
185 "mirror://debian/pool/main/libt/libtar/libtar_"
186 version ".orig.tar.gz")))
189 "02cihzl77ia0dcz7z2cga2412vyhhs5pa2355q4wpwbyga2lrwjh"))
190 (patches (search-patches "libtar-CVE-2013-4420.patch"))))
191 (build-system gnu-build-system)
192 (arguments `(#:tests? #f)) ; no "check" target
194 `(("autoconf" ,autoconf)
195 ("automake" ,automake)
196 ("libtool" ,libtool)))
199 (synopsis "C library for manipulating POSIX tar files")
201 "libtar is a C library for manipulating POSIX tar files. It handles
202 adding and extracting files to/from a tar archive.")
203 (home-page "https://repo.or.cz/libtar.git")
204 (license license:bsd-3)))
212 (uri (string-append "mirror://gnu/gzip/gzip-"
216 "16h8g4acy7fgfxcjacr3wijjsnixwsfd2jhz3zwdi2qrzi262l5f"))))
217 (build-system gnu-build-system)
218 (synopsis "General file (de)compression (using lzw)")
220 ;; FIXME: The test suite wants `less', and optionally Perl.
223 (modify-phases %standard-phases
224 (add-after 'unpack 'patch-for-glibc-2.28
226 ;; Adjust the bundled gnulib to work with glibc 2.28. See e.g.
227 ;; "m4-gnulib-libio.patch". This is a phase rather than patch
228 ;; or snippet to work around <https://bugs.gnu.org/32347>.
229 (substitute* (find-files "lib" "\\.c$")
230 (("#if defined _IO_ftrylockfile")
231 "#if defined _IO_EOF_SEEN"))
232 (substitute* "lib/stdio-impl.h"
233 (("^/\\* BSD stdio derived implementations")
234 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
235 "# define _IO_IN_BACKUP 0x100\n"
237 "/* BSD stdio derived implementations")))
239 (add-after 'unpack 'use-absolute-name-of-gzip
240 (lambda* (#:key outputs #:allow-other-keys)
241 (substitute* "gunzip.in"
243 (string-append "exec " (assoc-ref outputs "out")
247 "GNU Gzip provides data compression and decompression utilities; the
248 typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
249 file; as a result, it is often used in conjunction with \"tar\", resulting in
250 \".tar.gz\" or \".tgz\", etc.")
251 (license license:gpl3+)
252 (home-page "https://www.gnu.org/software/gzip/")))
260 ;; XXX The bzip.org domain was allowed to expire.
261 (uri (string-append "https://web.archive.org/web/20180624184806/"
262 "http://www.bzip.org/"
263 version "/bzip2-" version ".tar.gz"))
266 "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152"))))
267 (build-system gnu-build-system)
269 `(#:modules ((guix build gnu-build-system)
274 (modify-phases %standard-phases
276 (lambda* (#:key target #:allow-other-keys)
277 (when ,(%current-target-system)
278 ;; Cross-compilation: use the cross tools.
279 (substitute* (find-files "." "Makefile")
281 (string-append "CC = " target "-gcc\n"))
283 (string-append "AR = " target "-ar\n"))
285 (string-append "RANLIB = " target "-ranlib\n"))
286 (("^all:(.*)test" _ prerequisites)
287 ;; Remove 'all' -> 'test' dependency.
288 (string-append "all:" prerequisites "\n"))))
290 (add-before 'build 'build-shared-lib
291 (lambda* (#:key inputs #:allow-other-keys)
292 (patch-makefile-SHELL "Makefile-libbz2_so")
293 (invoke "make" "-f" "Makefile-libbz2_so")))
294 (add-after 'install 'install-shared-lib
295 (lambda* (#:key outputs #:allow-other-keys)
296 ;; The Makefile above does not have an 'install' target, nor does
297 ;; it create all the (un)versioned symlinks, so we handle it here.
298 (let* ((out (assoc-ref outputs "out"))
299 (libdir (string-append out "/lib"))
301 ;; Locate the built library (e.g. "libbz2.so.1.0.6").
302 (lib (car (scandir "."
304 (and (string-prefix? soname file)
306 (stat:type (lstat file))))))))
307 (soversion (string-drop lib (+ 1 (string-length soname)))))
308 (install-file lib libdir)
309 (with-directory-excursion libdir
310 ;; Create symlinks libbz2.so.1 -> libbz2.so.1.0, etc.
311 (let loop ((base soname)
312 (numbers (string-split soversion #\.)))
313 (unless (null? numbers)
314 (let ((so-file (string-append base "." (car numbers))))
315 (symlink so-file base)
316 (loop so-file (cdr numbers))))))
318 (add-after 'install-shared-lib 'move-static-lib
319 (lambda* (#:key outputs #:allow-other-keys)
320 (let ((out (assoc-ref outputs "out"))
321 (static (assoc-ref outputs "static")))
322 (with-directory-excursion (string-append out "/lib")
323 (install-file "libbz2.a" (string-append static "/lib"))
324 (delete-file "libbz2.a")
326 (add-after 'install-shared-lib 'patch-scripts
327 (lambda* (#:key outputs inputs #:allow-other-keys)
328 (let* ((out (assoc-ref outputs "out")))
329 (substitute* (string-append out "/bin/bzdiff")
333 #:make-flags (list (string-append "PREFIX="
334 (assoc-ref %outputs "out")))
336 ;; Don't attempt to run the tests when cross-compiling.
337 ,@(if (%current-target-system)
340 (outputs '("out" "static"))
341 (synopsis "High-quality data compression program")
343 "bzip2 is a freely available, patent free (see below), high-quality data
344 compressor. It typically compresses files to within 10% to 15% of the best
345 available techniques (the PPM family of statistical compressors), whilst
346 being around twice as fast at compression and six times faster at
348 (license (license:non-copyleft "file://LICENSE"
349 "See LICENSE in the distribution."))
350 (home-page "https://web.archive.org/web/20180801004107/http://www.bzip.org/")))
352 (define-public lbzip2
358 (uri (string-append "http://archive.lbzip2.org/lbzip2-"
362 "1sahaqc5bw4i0iyri05syfza4ncf5cml89an033fspn97klmxis6"))
363 (modules '((guix build utils)))
366 (substitute* (find-files "lib" "\\.c$")
367 (("#if defined _IO_ftrylockfile")
368 "#if defined _IO_EOF_SEEN"))
369 (substitute* "lib/stdio-impl.h"
370 (("^/\\* BSD stdio derived implementations")
371 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
372 "# define _IO_IN_BACKUP 0x100\n"
374 "/* BSD stdio derived implementations")))
376 (build-system gnu-build-system)
377 (synopsis "Parallel bzip2 compression utility")
379 "lbzip2 is a multi-threaded compression utility with support for the
380 bzip2 compressed file format. lbzip2 can process standard bz2 files in
381 parallel. It uses POSIX threading model (pthreads), which allows it to take
382 full advantage of symmetric multiprocessing (SMP) systems. It has been proven
383 to scale linearly, even to over one hundred processor cores. lbzip2 is fully
384 compatible with bzip2 – both at file format and command line level.")
385 (home-page "http://www.lbzip2.org/")
386 (license license:gpl3+)))
388 (define-public pbzip2
394 (uri (string-append "https://launchpad.net/pbzip2/"
395 (version-major+minor version) "/" version
396 "/+download/" name "-" version ".tar.gz"))
399 "1rnvgcdixjzbrmcr1nv9b6ccrjfrhryaj7jwz28yxxv6lam3xlcg"))))
400 (build-system gnu-build-system)
404 `(#:tests? #f ; no tests
405 #:phases (modify-phases %standard-phases
406 (delete 'configure)) ; no configure script
407 #:make-flags (list (string-append "PREFIX=" %output))))
408 (home-page "http://compression.ca/pbzip2/")
409 (synopsis "Parallel bzip2 implementation")
411 "Pbzip2 is a parallel implementation of the bzip2 block-sorting file
412 compressor that uses pthreads and achieves near-linear speedup on SMP machines.
413 The output of this version is fully compatible with bzip2 v1.0.2 (i.e. anything
414 compressed with pbzip2 can be decompressed with bzip2).")
415 (license (license:non-copyleft "file://COPYING"
416 "See COPYING in the distribution."))))
424 (uri (list (string-append "http://tukaani.org/xz/xz-" version
426 (string-append "http://multiprecision.org/guix/xz-"
430 "0ibi2zsfaz6l756spjwc5rayf4ckgc9hwmy8qinppcyk4svz64mm"))))
431 (build-system gnu-build-system)
432 (synopsis "General-purpose data compression")
434 "XZ Utils is free general-purpose data compression software with high
435 compression ratio. XZ Utils were written for POSIX-like systems, but also
436 work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
438 The core of the XZ Utils compression code is based on LZMA SDK, but it has
439 been modified quite a lot to be suitable for XZ Utils. The primary
440 compression algorithm is currently LZMA2, which is used inside the .xz
441 container format. With typical files, XZ Utils create 30 % smaller output
442 than gzip and 15 % smaller output than bzip2.")
443 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
444 (home-page "https://tukaani.org/xz/")))
453 "https://github.com/fragglet/lhasa/releases/download/v"
454 version "/lhasa-" version ".tar.gz"))
457 "092zi9av18ma20c6h9448k0bapvx2plnp292741dvfd9hmgqxc1z"))))
458 (build-system gnu-build-system)
461 (modify-phases %standard-phases
462 (add-before 'check 'set-up-test-environment
463 (lambda* (#:key inputs #:allow-other-keys)
464 (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata")
468 `(("tzdata" ,tzdata)))
469 (home-page "https://fragglet.github.com/lhasa/")
470 (synopsis "LHA archive decompressor")
471 (description "Lhasa is a replacement for the Unix LHA tool, for
472 decompressing .lzh (LHA / LHarc) and .lzs (LArc) archives. The backend for the
473 tool is a library, so that it can be reused for other purposes. Lhasa aims to
474 be compatible with as many types of lzh/lzs archives as possible. It also aims
475 to generate the same output as the (non-free) Unix LHA tool, so that it will
476 act as a free drop-in replacement.")
477 (license license:isc)))
486 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
490 "0wm04519pd3g8hqpjqhfr72q8qmbiwqaxcs3cndny9h86aa95y60"))))
491 (build-system gnu-build-system)
492 (arguments '(#:configure-flags '("--enable-shared")))
493 (home-page "http://www.oberhumer.com/opensource/lzo")
495 "Data compression library suitable for real-time data de-/compression")
497 "LZO is a data compression library which is suitable for data
498 de-/compression in real-time. This means it favours speed over
501 LZO is written in ANSI C. Both the source code and the compressed data
502 format are designed to be portable across platforms.")
503 (license license:gpl2+)))
512 (uri (string-append "http://www.lzop.org/download/lzop-"
516 "0h9gb8q7y54m9mvy3jvsmxf21yx8fc3ylzh418hgbbv0i8mbcwky"))))
517 (build-system gnu-build-system)
518 (inputs `(("lzo" ,lzo)))
519 (home-page "https://www.lzop.org/")
520 (synopsis "Compress or expand files")
522 "Lzop is a file compressor which is very similar to gzip. Lzop uses the
523 LZO data compression library for compression services, and its main advantages
524 over gzip are much higher compression and decompression speed (at the cost of
525 some compression ratio).")
526 (license license:gpl2+)))
534 (uri (string-append "mirror://savannah/lzip/lzip-"
538 "0319q59kb8g324wnj7xzbr7vvlx5bcs13lr34j0zb3kqlyjq2fy9"))))
539 (build-system gnu-build-system)
540 (home-page "https://www.nongnu.org/lzip/lzip.html")
541 (synopsis "Lossless data compressor based on the LZMA algorithm")
543 "Lzip is a lossless data compressor with a user interface similar to the
544 one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
545 more than bzip2, which makes it well-suited for software distribution and data
546 archiving. Lzip is a clean implementation of the LZMA algorithm.")
547 (license license:gpl3+)))
549 (define-public lziprecover
555 (uri (string-append "mirror://savannah/lzip/lziprecover/"
556 "lziprecover-" version ".tar.gz"))
559 "094w2z8fz41yaq0gkyr61cl7pb1d7kchpl5dka7rvm3qvbb7ncd2"))))
560 (build-system gnu-build-system)
561 (home-page "https://www.nongnu.org/lzip/lziprecover.html")
562 (synopsis "Recover and decompress data from damaged lzip files")
564 "Lziprecover is a data recovery tool and decompressor for files in the lzip
565 compressed data format (.lz). It can test the integrity of lzip files, extract
566 data from damaged ones, and repair most files with small errors (up to one
567 single-byte error per member) entirely.
569 Lziprecover is not a replacement for regular backups, but a last line of defence
570 when even the backups are corrupt. It can recover files by merging the good
571 parts of two or more damaged copies, such as can be easily produced by running
572 @command{ddrescue} on a failing device.
574 This package also includes @command{unzcrash}, a tool to test the robustness of
575 decompressors when faced with corrupted input.")
576 (license (list license:bsd-2 ; arg_parser.{cc,h}
577 license:gpl2+)))) ; everything else
579 (define-public sharutils
586 (uri (string-append "mirror://gnu/sharutils/sharutils-"
588 (patches (search-patches "sharutils-CVE-2018-1000097.patch"))
591 "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))
592 (modules '((guix build utils)))
595 (substitute* (find-files "lib" "\\.c$")
596 (("#if defined _IO_ftrylockfile")
597 "#if defined _IO_EOF_SEEN"))
598 (substitute* "lib/stdio-impl.h"
599 (("^/\\* BSD stdio derived implementations")
600 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
601 "# define _IO_IN_BACKUP 0x100\n"
603 "/* BSD stdio derived implementations")))
605 (build-system gnu-build-system)
610 (modify-phases %standard-phases
611 (add-after 'patch-source-shebangs 'unpatch-source-shebang
612 ;; revert the patch-shebang phase on a script which is
615 (substitute* "tests/shar-1.ok"
616 (((which "sh")) "/bin/sh"))
618 (home-page "https://www.gnu.org/software/sharutils/")
619 (synopsis "Archives in shell scripts, uuencode/uudecode")
621 "GNU sharutils is a package for creating and manipulating shell
622 archives that can be readily emailed. A shell archive is a file that can be
623 processed by a Bourne-type shell to unpack the original collection of files.
624 This package is mostly for compatibility and historical interest.")
625 (license license:gpl3+)))
627 (define-public sfarklib
633 (uri (string-append "https://github.com/raboof/sfArkLib/archive/"
635 (file-name (string-append name "-" version ".tar.gz"))
638 "0bzs2d98rk1xw9qwpnc7gmlbxwmwc3dg1rpn310afy9pq1k9clzi"))))
639 (build-system gnu-build-system)
641 `(#:tests? #f ;no "check" target
643 (modify-phases %standard-phases
645 (lambda* (#:key outputs #:allow-other-keys)
646 (substitute* "Makefile"
647 (("/usr/local") (assoc-ref outputs "out")))
651 (home-page "https://github.com/raboof/sfArkLib")
652 (synopsis "Library for SoundFont decompression")
654 "SfArkLib is a C++ library for decompressing SoundFont files compressed
655 with the sfArk algorithm.")
656 (license license:gpl3+)))
658 (define-public sfarkxtc
659 (let ((commit "13cd6f93725a90d91ec5ea75babf1dbd694ac463")
663 (version (git-version "0" revision commit))
665 ;; There are no release tarballs, so we just fetch the latest
666 ;; commit at this time.
669 (url "https://github.com/raboof/sfarkxtc.git")
671 (file-name (git-file-name name version))
674 "1mb1jyk1m11l1gppd9hmql9cyp55sdf7jk5rbc7acky1z4k4mv19"))))
675 (build-system gnu-build-system)
677 `(#:tests? #f ;no "check" target
679 (modify-phases %standard-phases
681 (lambda* (#:key outputs #:allow-other-keys)
682 (substitute* "Makefile"
683 (("/usr/local") (assoc-ref outputs "out")))
687 ("sfarklib" ,sfarklib)))
688 (home-page "https://github.com/raboof/sfarkxtc")
689 (synopsis "Basic sfArk decompressor")
690 (description "SfArk extractor converts SoundFonts in the compressed legacy
691 sfArk file format to the uncompressed sf2 format.")
692 (license license:gpl3+))))
694 (define-public libmspack
697 (home-page "https://cabextract.org.uk/libmspack/")
702 (uri (string-append home-page name "-" version "alpha.tar.gz"))
704 (base32 "13janaqsvm7aqc4agjgd4819pbgqv50j88bh5kci1z70wvg65j5s"))))
705 (build-system gnu-build-system)
707 `(#:configure-flags '("--disable-static")))
708 (synopsis "Compression tools for some formats used by Microsoft")
710 "The purpose of libmspack is to provide both compression and
711 decompression of some loosely related file formats used by Microsoft.")
712 (license license:lgpl2.1+)))
721 (uri (git-reference (url "https://github.com/lz4/lz4")
722 (commit (string-append "v" version))))
725 "1jggv4lvfav53advnj0pwqgxzn868lrj8dc9zp73iwvqlj82mhmx"))
726 (file-name (git-file-name name version))))
727 (build-system gnu-build-system)
728 (native-inputs `(("valgrind" ,valgrind))) ; for tests
730 `(#:test-target "test"
731 #:make-flags (list "CC=gcc"
732 (string-append "prefix=" (assoc-ref %outputs "out")))
733 #:phases (modify-phases %standard-phases
734 (delete 'configure)))) ; no configure script
735 (home-page "https://www.lz4.org")
736 (synopsis "Compression algorithm focused on speed")
737 (description "LZ4 is a lossless compression algorithm, providing
738 compression speed at 400 MB/s per core (0.16 Bytes/cycle). It also features an
739 extremely fast decoder, with speed in multiple GB/s per core (0.71 Bytes/cycle).
740 A high compression derivative, called LZ4_HC, is also provided. It trades CPU
741 time for compression ratio.")
742 ;; The libraries (lz4, lz4hc, and xxhash) are BSD licenced. The command
743 ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
744 (license (list license:bsd-2 license:gpl2+))))
746 (define-public squashfs-tools
748 (name "squashfs-tools")
752 (uri (string-append "mirror://sourceforge/squashfs/squashfs/"
753 "squashfs" version "/"
754 "squashfs" version ".tar.gz"))
757 "1xpklm0y43nd9i6jw43y2xh5zvlmj9ar2rvknh0bh7kv8c95aq0d"))))
758 (build-system gnu-build-system)
760 '(#:tests? #f ; no check target
766 (string-append "INSTALL_DIR=" %output "/bin"))
768 (modify-phases %standard-phases
771 (chdir "squashfs-tools")
773 (add-after 'unpack 'fix-glibc-compatability
775 (substitute* '("squashfs-tools/mksquashfs.c"
776 "squashfs-tools/unsquashfs.c")
778 "<sys/sysinfo.h>\n#include <sys/sysmacros.h>"))
785 (home-page "http://squashfs.sourceforge.net/")
786 (synopsis "Tools to create and extract squashfs file systems")
788 "Squashfs is a highly compressed read-only file system for Linux. It uses
789 zlib to compress files, inodes, and directories. All blocks are packed to
790 minimize the data overhead, and block sizes of between 4K and 1M are supported.
791 It is intended to be used for archival use, for live CDs, and for embedded
792 systems where low overhead is needed. This package allows you to create and
793 extract such file systems.")
794 (license license:gpl2+)))
796 ;; We need this for building squashfs images with symlinks.
797 (define-public squashfs-tools-next
798 (let ((commit "fb33dfc32b131a1162dcf0e35bd88254ae10e265")
800 (package (inherit squashfs-tools)
801 (name "squashfs-tools-next")
802 (version (string-append "4.3-" revision (string-take commit 7)))
806 (url "https://github.com/plougher/squashfs-tools.git")
808 (file-name (git-file-name name version))
811 "1x2skf8hxzfch978nzx5mh46d4hhi6gl22270hiarjszsjk3bnsx")))))))
819 (uri (string-append "http://zlib.net/pigz/"
820 name "-" version ".tar.gz"))
823 "0wsgw5vwl23jrnpsvd8v3xcp5k4waw5mk0164fynjhkv58i1dy54"))))
824 (build-system gnu-build-system)
827 (modify-phases %standard-phases
830 (lambda* (#:key outputs #:allow-other-keys)
831 (let* ((out (assoc-ref outputs "out"))
832 (bin (string-append out "/bin"))
833 (man (string-append out "/share/man/man1")))
834 (install-file "pigz" bin)
835 (symlink "pigz" (string-append bin "/unpigz"))
836 (install-file "pigz.1" man)
838 #:make-flags (list "CC=gcc")
839 #:test-target "tests"))
840 (inputs `(("zlib" ,zlib)))
841 (home-page "https://zlib.net/pigz/")
842 (synopsis "Parallel implementation of gzip")
844 "This package provides a parallel implementation of gzip that exploits
845 multiple processors and multiple cores when compressing data.")
847 ;; Things under zopfli/ are under ASL2.0, but 4 files at the top-level,
848 ;; written by Mark Adler, are under another non-copyleft license.
849 (license license:asl2.0)))
858 "https://github.com/vasi/pixz/releases/download/v" version
859 "/pixz-" version ".tar.xz"))
862 "1s3j7zw6j5zi3fhdxg287ndr3wf6swac7z21mqd1pyiln530gi82"))))
863 (build-system gnu-build-system)
865 `(("pkg-config" ,pkg-config)
866 ("libarchive" ,libarchive)))
867 (home-page "https://github.com/vasi/pixz")
868 (synopsis "Parallel indexing implementation of LZMA")
870 "The existing XZ Utils provide great compression in the .xz file format,
871 but they produce just one big block of compressed data. Pixz instead produces
872 a collection of smaller blocks which makes random access to the original data
873 possible and can compress in parallel. This is especially useful for large
875 (license license:bsd-2)))
877 (define-public brotli
878 (let ((commit "e992cce7a174d6e2b3486616499d26bb0bad6448")
882 (version (string-append "0.1-" revision "."
883 (string-take commit 7)))
887 (url "https://github.com/bagder/libbrotli.git")
890 (file-name (string-append name "-" version ".tar.xz"))
893 "1qxxsasvwbbbh6dl3138y9h3fg0q2v7xdk5jjc690bdg7g1wrj6n"))
894 (modules '((guix build utils)))
896 ;; This is a recursive submodule that is
897 ;; unnecessary for this package, so delete it.
898 (delete-file-recursively "brotli/terryfy")
900 (build-system gnu-build-system)
902 `(("autoconf" ,autoconf)
903 ("automake" ,automake)
904 ("libtool" ,libtool)))
906 `(#:phases (modify-phases %standard-phases
907 (add-after 'unpack 'autogen
910 (invoke "autoreconf" "-vfi"))))))
911 (home-page "https://github.com/bagder/libbrotli/")
912 (synopsis "Implementation of the Brotli compression algorithm")
914 "Brotli is a general-purpose lossless compression algorithm. It is
915 similar in speed to deflate but offers denser compression. This package
916 provides encoder and a decoder libraries: libbrotlienc and libbrotlidec,
917 respectively, based on the reference implementation from Google.")
918 (license license:expat))))
920 (define-public bsdiff
924 (home-page "https://www.daemonology.net/bsdiff/")
927 (uri (string-append home-page name "-" version ".tar.gz"))
930 "0j2zm3z271x5aw63mwhr3vymzn45p2vvrlrpm9cz2nywna41b0hq"))))
931 (build-system gnu-build-system)
933 `(#:make-flags (list "INSTALL=install" "CC=gcc"
934 (string-append "PREFIX=" (assoc-ref %outputs "out")))
935 #:phases (modify-phases %standard-phases
937 (add-before 'build 'fix-Makefile
939 (substitute* "Makefile"
940 ;; Adjust syntax to make it compatible with GNU Make.
942 ;; Help install(1) create the target directory.
943 (("\\$\\{PREFIX\\}") "-D -t ${PREFIX}"))
945 #:tests? #f)) ;no tests
948 (synopsis "Patch binary files")
950 "@command{bsdiff} and @command{bspatch} are tools for building and
951 applying patches to binary files. By using suffix sorting (specifically
952 Larsson and Sadakane's @code{qsufsort}) and taking advantage of how
953 executable files change, bsdiff routinely produces binary patches 50-80%
954 smaller than those produced by @code{Xdelta}.")
955 (license license:bsd-2)))
957 (define-public cabextract
960 (home-page "https://cabextract.org.uk/")
964 (uri (string-append home-page "cabextract-" version ".tar.gz"))
967 "19qwhl2r8ip95q4vxzxg2kp4p125hjmc9762sns1dwwf7ikm7hmg"))
968 (modules '((guix build utils)))
971 ;; Delete bundled libmspack.
972 (delete-file-recursively "mspack")
974 (build-system gnu-build-system)
976 '(#:configure-flags '("--with-external-libmspack")
978 (modify-phases %standard-phases
979 ;; cabextract needs some of libmspack's header files.
980 ;; These are located in the "mspack" directory of libmspack.
981 (add-before 'build 'unpack-libmspack
982 (lambda* (#:key inputs #:allow-other-keys)
983 (let ((dir-name "libmspack-src"))
985 (invoke "tar" "-xvf" (assoc-ref inputs "libmspack-source")
986 "-C" dir-name "--strip-components" "1")
987 (rename-file (string-append dir-name "/mspack")
989 (delete-file-recursively dir-name)
992 `(("pkg-config" ,pkg-config)))
994 `(("libmspack" ,libmspack)
995 ("libmspack-source" ,(package-source libmspack))))
996 (synopsis "Tool to unpack Cabinet archives")
997 (description "Extracts files out of Microsoft Cabinet (.cab) archives")
998 ;; Some source files specify gpl2+, lgpl2+, however COPYING is gpl3.
999 (license license:gpl3+)))
1001 (define-public xdelta
1009 (url "https://github.com/jmacd/xdelta.git")
1010 (commit (string-append "v" version))))
1011 (file-name (git-file-name name version))
1014 "09mmsalc7dwlvgrda56s2k927rpl3a5dzfa88aslkqcjnr790wjy"))
1016 ;; This file isn't freely distributable and has no effect on building.
1018 (delete-file "xdelta3/draft-korn-vcdiff.txt")
1020 (build-system gnu-build-system)
1022 `(("autoconf" ,autoconf)
1023 ("automake" ,automake)))
1026 (modify-phases %standard-phases
1027 (add-after 'unpack 'enter-build-directory
1028 (lambda _ (chdir "xdelta3") #t)))))
1029 (home-page "http://xdelta.org")
1030 (synopsis "Delta encoder for binary files")
1031 (description "xdelta encodes only the differences between two binary files
1032 using the VCDIFF algorithm and patch file format described in RFC 3284. It can
1033 also be used to apply such patches. xdelta is similar to @command{diff} and
1034 @command{patch}, but is not limited to plain text and does not generate
1035 human-readable output.")
1036 (license license:asl2.0)))
1038 (define-public lrzip
1046 "http://ck.kolivas.org/apps/lrzip/lrzip-" version ".tar.bz2"))
1049 "0mb449vmmwpkalq732jdyginvql57nxyd31sszb108yps1lf448d"))
1050 (patches (search-patches "lrzip-CVE-2017-8842.patch"))))
1051 (build-system gnu-build-system)
1053 `(;; nasm is only required when building for 32-bit x86 platforms
1054 ,@(if (string-prefix? "i686" (or (%current-target-system)
1063 (home-page "http://ck.kolivas.org/apps/lrzip/")
1064 (synopsis "Large file compressor with a very high compression ratio")
1065 (description "lrzip is a compression utility that uses long-range
1066 redundancy reduction to improve the subsequent compression ratio of
1067 larger files. It can then further compress the result with the ZPAQ or
1068 LZMA algorithms for maximum compression, or LZO for maximum speed. This
1069 choice between size or speed allows for either better compression than
1070 even LZMA can provide, or a higher speed than gzip while compressing as
1072 (license (list license:gpl3+
1073 license:public-domain)))) ; most files in lzma/
1075 (define-public snappy
1082 (uri (string-append "https://github.com/google/snappy/archive/"
1084 (file-name (string-append "snappy-" version ".tar.gz"))
1086 (base32 "1m7rcdqzkys5lspj8jcsaah8w33zh28s771bw0ga2lgzfgl05yix"))
1087 (patches (search-patches "snappy-add-O2-flag-in-CmakeLists.txt.patch"))))
1088 (build-system cmake-build-system)
1090 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
1091 (home-page "https://github.com/google/snappy")
1092 (synopsis "Fast compressor/decompressor")
1093 (description "Snappy is a compression/decompression library. It does not
1094 aim for maximum compression, or compatibility with any other compression library;
1095 instead, it aims for very high speeds and reasonable compression. For instance,
1096 compared to the fastest mode of zlib, Snappy is an order of magnitude faster
1097 for most inputs, but the resulting compressed files are anywhere from 20% to
1099 (license license:asl2.0)))
1101 (define-public p7zip
1107 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1108 version "/" name "_" version
1109 "_src_all.tar.bz2"))
1112 "07rlwbbgszq8i7m8jh3x6j2w2hc9a72dc7fmqawnqkwlwb00mcjy"))
1113 (modules '((guix build utils)))
1116 ;; Remove non-free source files
1117 (for-each delete-file
1119 (find-files "CPP/7zip/Compress" "Rar.*")
1120 (find-files "CPP/7zip/Crypto" "Rar.*")
1121 (find-files "DOC/unRarLicense.txt")
1122 (find-files "Utils/file_Codecs_Rar_so.py")))
1123 (delete-file-recursively "CPP/7zip/Archive/Rar")
1124 (delete-file-recursively "CPP/7zip/Compress/Rar")
1126 (patches (search-patches "p7zip-CVE-2016-9296.patch"
1127 "p7zip-CVE-2017-17969.patch"
1128 "p7zip-remove-unused-code.patch"))))
1129 (build-system gnu-build-system)
1132 (list (string-append "DEST_HOME=" (assoc-ref %outputs "out")) "all3")
1134 (modify-phases %standard-phases
1136 (lambda* (#:key system outputs #:allow-other-keys)
1138 (let ((system ,(or (%current-target-system)
1139 (%current-system))))
1141 ((string-prefix? "x86_64" system)
1142 "makefile.linux_amd64_asm")
1143 ((string-prefix? "i686" system)
1144 "makefile.linux_x86_asm_gcc_4.X")
1146 "makefile.linux_any_cpu_gcc_4.X")))
1147 "makefile.machine")))
1150 (invoke "make" "test")
1151 (invoke "make" "test_7z")
1152 (invoke "make" "test_7zr"))))))
1154 (let ((system (or (%current-target-system)
1155 (%current-system))))
1156 `(,@(cond ((string-prefix? "x86_64" system)
1158 ((string-prefix? "i686" system)
1161 (home-page "http://p7zip.sourceforge.net/")
1162 (synopsis "Command-line file archiver with high compression ratio")
1163 (description "p7zip is a command-line port of 7-Zip, a file archiver that
1164 handles the 7z format which features very high compression ratios.")
1165 (license (list license:lgpl2.1+
1167 license:public-domain))))
1169 (define-public gzstream
1176 ;; No versioned URL, but last release was in 2003.
1177 "http://www.cs.unc.edu/Research/compgeom/gzstream/gzstream.tgz")
1178 (file-name (string-append name "-" version ".tgz"))
1181 "00y19pqjsdj5zcrx4p9j56pl73vayfwnb7y2hvp423nx0cwv5b4r"))
1182 (modules '((guix build utils)))
1184 ;; Remove pre-compiled object.
1186 (delete-file "gzstream.o")
1188 (build-system gnu-build-system)
1190 `(#:test-target "test"
1192 (modify-phases %standard-phases
1195 (lambda* (#:key outputs #:allow-other-keys)
1196 (let* ((out (assoc-ref outputs "out"))
1197 (lib (string-append out "/lib"))
1198 (include (string-append out "/include")))
1199 (install-file "libgzstream.a" lib)
1200 (install-file "gzstream.h" include)
1202 (propagated-inputs `(("zlib" ,zlib)))
1203 (home-page "http://www.cs.unc.edu/Research/compgeom/gzstream/")
1204 (synopsis "Compressed C++ iostream")
1205 (description "gzstream is a small library for providing zlib
1206 functionality in a C++ iostream.")
1207 (license license:lgpl2.1+)))
1215 (method url-fetch/zipbomb)
1216 (uri (string-append "http://mattmahoney.net/dc/zpaq"
1217 (string-delete #\. version) ".zip"))
1220 "066l94yyladlfzri877nh2dhkvspagjn3m5bmv725fmhkr9c4pp8"))
1221 (modules '((guix build utils)))
1223 ;; Delete irrelevant pre-compiled binaries.
1225 (for-each delete-file (find-files "." "\\.exe$"))
1227 (build-system gnu-build-system)
1230 (modify-phases %standard-phases
1231 (delete 'configure)) ; no ‘configure’ script
1234 (string-append "CPPFLAGS=-Dunix"
1235 ,(match (or (%current-target-system)
1240 ;; These should be safe, lowest-common-denominator instruction sets,
1241 ;; allowing for some optimisation while remaining reproducible.
1242 (string-append "CXXFLAGS=-O3 -DNDEBUG"
1243 ,(match (or (%current-target-system)
1245 ("x86_64-linux" " -march=nocona -mtune=generic")
1246 ("i686-linux" " -march=i686 -mtune=generic")
1247 ("armhf-linux" " -mtune=generic-armv7-a")
1249 (string-append "PREFIX="
1250 (assoc-ref %outputs "out")))))
1252 `(("perl" ,perl))) ; for pod2man
1253 (home-page "http://mattmahoney.net/dc/zpaq.html")
1254 (synopsis "Incremental journaling archiver")
1255 (description "ZPAQ is a command-line archiver for realistic situations with
1256 many duplicate and already compressed files. It backs up only those files
1257 modified since the last update. All previous versions remain untouched and can
1258 be independently recovered. Identical files are only stored once (known as
1259 @dfn{de-duplication}). Archives can also be encrypted.
1261 ZPAQ is intended to back up user data, not entire operating systems. It ignores
1262 owner and group IDs, ACLs, extended attributes, or special file types like
1263 devices, sockets, or named pipes. It does not follow or restore symbolic links
1264 or junctions, and always follows hard links.")
1265 (license (list license:public-domain
1266 ;; libzpaq.cpp contains a mix of public-domain and
1267 ;; expat-licenced (or ‘MIT’) code.
1270 (define-public unshield
1275 (origin (method url-fetch)
1276 (uri (string-append "http://github.com/twogood/unshield/archive/"
1278 (file-name (string-append name "-" version ".tar.gz"))
1281 "1avv5c11jbmzwizq10pwvlh1dmyna8ccvpgacv95h4gbq26rg35a"))))
1282 (build-system cmake-build-system)
1285 ("openssl" ,openssl)
1286 ;; Test data that is otherwise downloaded with curl.
1287 ("unshield-avigomanager11b22.zip"
1291 "https://www.dropbox.com/s/8r4b6752swe3nhu/"
1292 "unshield-avigomanager11b22.zip?dl=1"))
1294 (base32 "0fwq7lih04if68wpwpsk5wjqyvh32db76a41sq6gbx4dn1lc3ddn"))
1295 (file-name "unshield-avigomanager11b22.zip")))
1296 ("unshield-baldurs_gate_patch_v1_1_4315_international.zip"
1300 "https://www.dropbox.com/s/9ruil8oi6amjbbk/"
1301 "unshield-baldurs_gate_patch_v1_1_4315_international.zip?dl=1"))
1303 (base32 "0spaxf6dardlhqxz3ys09fzamj007q3nfyw4xng6gh3qp9780maj"))
1304 (file-name "unshield-baldurs_gate_patch_v1_1_4315_international.zip")))
1305 ("unshield-the-feeble-files-spanish.zip"
1309 "https://www.dropbox.com/s/1ng0z9kfxc7eb1e/"
1310 "unshield-the-feeble-files-spanish.zip?dl=1"))
1312 (base32 "1k5cw6vnpja8yjlnhx5124xrw9i8s1l539hfdqqrqz3l5gn0bnyd"))
1313 (file-name "unshield-the-feeble-files-spanish.zip")))))
1315 `(("unzip" ,unzip)))
1317 `(#:out-of-source? #f
1319 (modify-phases %standard-phases
1320 (add-before 'check 'pre-check
1321 (lambda* (#:key inputs #:allow-other-keys)
1322 (for-each (lambda (i)
1323 (copy-file (assoc-ref inputs i)
1324 (string-append "test/v0/" i)))
1325 '("unshield-avigomanager11b22.zip"
1326 "unshield-baldurs_gate_patch_v1_1_4315_international.zip"
1327 "unshield-the-feeble-files-spanish.zip"))
1328 (substitute* (find-files "test/" "/*\\.sh")
1329 ;; Tests expect the unshield binary in a specific
1331 (("/var/tmp/unshield/bin/unshield")
1332 (string-append (getcwd) "/src/unshield"))
1333 ;; We no longer need to download the data.
1335 (("curl -(|f)sSL -o test.zip .*") ""))
1336 (substitute* "test/v0/avigomanager.sh"
1338 (string-append (getcwd)
1339 "/test/v0/unshield-avigomanager11b22.zip")))
1340 (substitute* "test/v0/baldurs_gate_patch_v1_1_4315_international.sh"
1344 "/test/v0/unshield-baldurs_gate_patch_v1_1_4315_international.zip")))
1345 (substitute* "test/v0/the-feeble-files-spanish.sh"
1347 (string-append (getcwd)
1348 "/test/v0/unshield-the-feeble-files-spanish.zip")))
1352 (invoke "./run-tests.sh"))))))
1353 (home-page "https://github.com/twogood/unshield")
1354 (synopsis "Extract CAB files from InstallShield installers")
1356 "@command{unshield} is a tool and library for extracting @file{.cab}
1357 archives from InstallShield installers.")
1358 (license license:expat)))
1367 (uri (string-append "https://github.com/facebook/zstd/releases/download/"
1368 "v" version "/zstd-" version ".tar.gz"))
1370 (base32 "13nlsqhkn276frxrzjdn7wz0j9zz414lf336885ykyxcvw2a0gr9"))))
1371 (build-system gnu-build-system)
1374 (modify-phases %standard-phases
1375 (delete 'configure)) ; no configure script
1378 (string-append "PREFIX=" (assoc-ref %outputs "out"))
1379 ;; Skip auto-detection of, and creating a dependency on, the build
1380 ;; environment's ‘xz’ for what amounts to a dubious feature anyway.
1382 ;; Not currently detected, but be explicit & avoid surprises later.
1385 (home-page "https://facebook.github.io/zstd/")
1386 (synopsis "Zstandard real-time compression algorithm")
1387 (description "Zstandard (@command{zstd}) is a lossless compression algorithm
1388 that combines very fast operation with a compression ratio comparable to that of
1389 zlib. In most scenarios, both compression and decompression can be performed in
1390 ‘real time’. The compressor can be configured to provide the most suitable
1391 trade-off between compression ratio and speed, without affecting decompression
1393 (license (list license:bsd-3 ; the main top-level LICENSE file
1394 license:bsd-2 ; many files explicitly state 2-Clause
1395 license:gpl2 ; the main top-level COPYING file
1396 license:gpl3+ ; tests/gzip/*.sh
1397 license:expat ; lib/dictBuilder/divsufsort.[ch]
1398 license:public-domain ; zlibWrapper/examples/fitblk*
1399 license:zlib)))) ; zlibWrapper/{gz*.c,gzguts.h}
1401 (define-public pzstd
1404 (version (package-version zstd))
1405 (source (package-source zstd))
1406 (build-system gnu-build-system)
1408 `(("googletest" ,googletest)))
1411 (modify-phases %standard-phases
1412 (add-after 'unpack 'enter-subdirectory
1413 (lambda _ (chdir "contrib/pzstd") #t))
1414 (delete 'configure) ; no configure script
1415 (add-before 'check 'compile-tests
1416 (lambda* (#:key make-flags #:allow-other-keys)
1417 (apply invoke "make" "tests" make-flags)))
1418 (add-after 'install 'install-documentation
1419 (lambda* (#:key outputs #:allow-other-keys)
1420 (let* ((out (assoc-ref outputs "out"))
1421 (doc (string-append out "/share/doc/" ,name)))
1423 (install-file "README.md" doc)
1427 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1428 (home-page (package-home-page zstd))
1429 (synopsis "Threaded implementation of the Zstandard compression algorithm")
1430 (description "Parallel Zstandard (PZstandard or @command{pzstd}) is a
1431 multi-threaded implementation of the @uref{http://zstd.net/, Zstandard
1432 compression algorithm}. It is fully compatible with the original Zstandard file
1433 format and command-line interface, and can be used as a drop-in replacement.
1435 Compression is distributed over multiple processor cores to improve performance,
1436 as is the decompression of data compressed in this manner. Data compressed by
1437 other implementations will only be decompressed by two threads: one performing
1438 the actual decompression, the other input and output.")
1439 (license (package-license zstd))))
1448 (uri (string-append "mirror://sourceforge/infozip"
1449 "/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz"))
1452 "0sb3h3067pzf3a7mlxn1hikpcjrsvycjcnj9hl9b1c3ykcgvps7h"))))
1453 (build-system gnu-build-system)
1454 (inputs `(("bzip2" ,bzip2)))
1456 `(#:tests? #f ; no test target
1457 #:make-flags (let ((out (assoc-ref %outputs "out")))
1458 (list "-f" "unix/Makefile"
1459 (string-append "prefix=" out)
1460 (string-append "MANDIR=" out "/share/man/man1")))
1462 (modify-phases %standard-phases
1464 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1465 (apply invoke "make" "generic_gcc" make-flags)))
1466 (delete 'configure))))
1467 (home-page "http://www.info-zip.org/Zip.html")
1468 (synopsis "Compression and file packing utility")
1470 "Zip is a compression and file packaging/archive utility. Zip is useful
1471 for packaging a set of files for distribution, for archiving files, and for
1472 saving disk space by temporarily compressing unused files or directories.
1473 Zip puts one or more compressed files into a single ZIP archive, along with
1474 information about the files (name, path, date, time of last modification,
1475 protection, and check information to verify file integrity). An entire
1476 directory structure can be packed into a ZIP archive with a single command.
1478 Zip has one compression method (deflation) and can also store files without
1479 compression. Zip automatically chooses the better of the two for each file.
1480 Compression ratios of 2:1 to 3:1 are common for text files.")
1481 (license (license:non-copyleft "file://LICENSE"
1482 "See LICENSE in the distribution."))))
1484 (define-public unzip
1485 (package (inherit zip)
1491 (uri (string-append "mirror://sourceforge/infozip"
1492 "/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz"))
1495 "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83"))
1496 (patches (search-patches "unzip-CVE-2014-8139.patch"
1497 "unzip-CVE-2014-8140.patch"
1498 "unzip-CVE-2014-8141.patch"
1499 "unzip-CVE-2014-9636.patch"
1500 "unzip-CVE-2015-7696.patch"
1501 "unzip-CVE-2015-7697.patch"
1502 "unzip-allow-greater-hostver-values.patch"
1503 "unzip-initialize-symlink-flag.patch"
1504 "unzip-remove-build-date.patch"
1505 "unzip-attribs-overflow.patch"
1506 "unzip-overflow-on-invalid-input.patch"
1507 "unzip-format-secure.patch"
1508 "unzip-overflow-long-fsize.patch"))))
1509 (build-system gnu-build-system)
1510 ;; no inputs; bzip2 is not supported, since not compiled with BZ_NO_STDIO
1512 `(#:phases (modify-phases %standard-phases
1514 (add-after 'unpack 'fortify
1516 ;; Mitigate CVE-2018-1000035, an exploitable buffer overflow.
1517 ;; This environment variable is recommended in 'unix/Makefile'
1518 ;; for passing flags to the C compiler.
1519 (setenv "LOCAL_UNZIP" "-D_FORTIFY_SOURCE=1")
1522 (lambda* (#:key make-flags #:allow-other-keys)
1523 (apply invoke "make"
1524 `("-j" ,(number->string
1525 (parallel-job-count))
1528 #:make-flags (list "-f" "unix/Makefile"
1529 (string-append "prefix=" %output)
1530 (string-append "MANDIR=" %output "/share/man/man1"))))
1531 (home-page "http://www.info-zip.org/UnZip.html")
1532 (synopsis "Decompression and file extraction utility")
1534 "UnZip is an extraction utility for archives compressed in .zip format,
1535 also called \"zipfiles\".
1537 UnZip lists, tests, or extracts files from a .zip archive. The default
1538 behaviour (with no options) is to extract into the current directory, and
1539 subdirectories below it, all files from the specified zipfile. UnZip
1540 recreates the stored directory structure by default.")
1541 (license (license:non-copyleft "file://LICENSE"
1542 "See LICENSE in the distribution."))))
1544 (define-public zziplib
1548 (home-page "https://github.com/gdraheim/zziplib")
1552 (uri (string-append home-page "/archive/v" version ".tar.gz"))
1555 "0i052a7shww0fzsxrdp3rd7g4mbzx7324a8ysbc0br7frpblcql4"))))
1556 (build-system gnu-build-system)
1559 (native-inputs `(("perl" ,perl) ; for the documentation
1560 ("pkg-config" ,pkg-config)
1561 ;; for the documentation; Python 3 not supported,
1562 ;; http://forums.gentoo.org/viewtopic-t-863161-start-0.html
1563 ("python" ,python-2)
1564 ("zip" ,zip))) ; to create test files
1565 (synopsis "Library for accessing zip files")
1567 "ZZipLib is a library based on zlib for accessing zip files.")
1568 ;; zziplib is dual licensed under LGPL2.0+ and MPL1.1. Some example source
1569 ;; files carry the Zlib license; see "docs/copying.html" for details.
1570 (license (list license:lgpl2.0+ license:mpl1.1))))
1572 (define-public libzip
1579 "https://libzip.org/download/libzip-" version ".tar.xz"))
1582 "1d53shcy7nvls5db573bbdlm25lfz1iw2zshng5f00cssi5lvpmk"))))
1587 (build-system cmake-build-system)
1588 (home-page "https://libzip.org")
1589 (synopsis "C library for reading, creating, and modifying zip archives")
1590 (description "Libzip is a C library for reading, creating, and modifying
1591 zip archives. Files can be added from data buffers, files, or compressed data
1592 copied directly from other zip archives. Changes made without closing the
1593 archive can be reverted.")
1594 (license license:bsd-3)))
1596 (define-public atool
1603 (uri (string-append "http://savannah.nongnu.org/download/atool/atool-"
1607 "0fvhzip2v08jgnlfpyj6rapan39xlsl1ksgq4lp8gfsai2ah1xma"))))
1608 (build-system gnu-build-system)
1611 (modify-phases %standard-phases
1612 (add-after 'unpack 'embed-absolute-file-name
1613 (lambda* (#:key inputs #:allow-other-keys)
1614 (substitute* "atool"
1615 (("(^\\$::cfg_path_file.*= )'file'" _ pre)
1616 (string-append pre "'" (assoc-ref inputs "file")
1622 (home-page "https://www.nongnu.org/atool/")
1623 (synopsis "Universal tool to manage file archives of various types")
1624 (description "The main command is @command{aunpack} which extracts files
1625 from an archive. The other commands provided are @command{apack} (to create
1626 archives), @command{als} (to list files in archives), and @command{acat} (to
1627 extract files to standard out). As @command{atool} invokes external programs
1628 to handle the archives, not all commands may be supported for a certain type
1630 (license license:gpl2+)))
1632 (define-public lunzip
1639 (uri (string-append "mirror://savannah/lzip/lunzip/"
1640 "lunzip-" version ".tar.gz"))
1642 (base32 "19zq3gmlbia2krq4k4zs1j0xjdv7nsdzqvfb0pyca5n53h2mzb91"))))
1643 (build-system gnu-build-system)
1647 (home-page "https://www.nongnu.org/lzip/lunzip.html")
1648 (synopsis "Small, stand-alone lzip decompressor")
1650 "Lunzip is a decompressor for files in the lzip compression format (.lz),
1651 written as a single small C tool with no dependencies. This makes it
1652 well-suited to embedded and other systems without a C++ compiler, or for use in
1653 applications such as software installers that need only to decompress files,
1655 Lunzip is intended to be fully compatible with the regular lzip package.")
1656 (license (list license:bsd-2 ; carg_parser.[ch]
1657 license:gpl2+)))) ; everything else
1659 (define-public clzip
1666 (uri (string-append "mirror://savannah/lzip/clzip/"
1667 "clzip-" version ".tar.gz"))
1669 (base32 "1h14dmc9fi10gcdpdpbgq1bwvcxvivppilj64pf720x8mw915mfr"))))
1670 (build-system gnu-build-system)
1674 (home-page "https://www.nongnu.org/lzip/clzip.html")
1675 (synopsis "Small, stand-alone lzip compressor and decompressor")
1677 "Clzip is a compressor and decompressor for files in the lzip compression
1678 format (.lz), written as a single small C tool with no dependencies. This makes
1679 it well-suited to embedded and other systems without a C++ compiler, or for use
1680 in other applications like package managers.
1681 Clzip is intended to be fully compatible with the regular lzip package.")
1682 (license (list license:bsd-2 ; carg_parser.[ch], lzd in clzip.texi
1685 (define-public lzlib
1692 (uri (string-append "mirror://savannah/lzip/lzlib/"
1693 "lzlib-" version ".tar.gz"))
1695 (base32 "0djdj4sg33rzi4k84cygvnp09bfsv6i8wy2k7i67rayib63myp3c"))))
1696 (build-system gnu-build-system)
1700 "--enable-shared"))) ; only static (.a) is built by default
1701 (home-page "https://www.nongnu.org/lzip/lzlib.html")
1702 (synopsis "Lzip data compression C library")
1704 "Lzlib is a C library for in-memory LZMA compression and decompression in
1705 the lzip format. It supports integrity checking of the decompressed data, and
1706 all functions are thread-safe. The library should never crash, even in case of
1708 (license (list license:bsd-2 ; the library itself
1709 license:gpl2+)))) ; main.c (i.e. minilzip used by tests)
1711 (define-public plzip
1718 (uri (string-append "mirror://savannah/lzip/plzip/"
1719 "plzip-" version ".tar.gz"))
1721 (base32 "04indil809qgfmz776imb3dnhkysh7zk28jcv3mw0ahl2lyaxbzd"))))
1722 (build-system gnu-build-system)
1724 `(("lzlib" ,lzlib)))
1725 (home-page "https://www.nongnu.org/lzip/plzip.html")
1726 (synopsis "Parallel lossless data compressor for the lzip format")
1728 "Plzip is a massively parallel (multi-threaded) lossless data compressor
1729 and decompressor that uses the lzip file format (.lz). Files produced by plzip
1730 are fully compatible with lzip and can be rescued with lziprecover.
1731 On multiprocessor machines, plzip can compress and decompress large files much
1732 faster than lzip, at the cost of a slightly reduced compression ratio (0.4% to
1733 2%). The number of usable threads is limited by file size: on files of only a
1734 few MiB, plzip is no faster than lzip.
1735 Files that were compressed with regular lzip will also not be decompressed
1736 faster by plzip, unless the @code{-b} option was used: lzip usually produces
1737 single-member files which can't be decompressed in parallel.")
1738 (license (list license:bsd-2 ; arg_parser.{cc,h}
1739 license:gpl2+)))) ; everything else
1741 (define-public innoextract
1743 (name "innoextract")
1748 (uri (string-append "https://github.com/dscharrer/innoextract/archive/"
1752 "0khwi9f0q0h6xfbixrrc1rfpgj0b7ajwilq7yhmxnn5lpc807f6x"))
1753 (file-name (string-append name "-" version ".tar.gz"))))
1754 (build-system cmake-build-system)
1756 `(#:tests? #f)) ;; No tests available.
1757 (inputs `(("boost" ,boost)
1758 ("libiconv" ,libiconv)
1760 (native-inputs `(("pkg-config" ,pkg-config)))
1761 (home-page "https://constexpr.org/innoextract/")
1762 (synopsis "Tool for extracting Inno Setup installers")
1763 (description "innoextract allows extracting Inno Setup installers under
1764 non-Windows systems without running the actual installer using wine.")
1765 (license license:zlib)))
1767 (define-public google-brotli
1769 (name "google-brotli")
1775 (url "https://github.com/google/brotli.git")
1776 (commit (string-append "v" version))))
1777 (file-name (git-file-name name version))
1779 (base32 "1811b55wdfg4kbsjcgh1kc938g118jpvif97ilgrmbls25dfpvvw"))))
1780 (build-system cmake-build-system)
1783 (modify-phases %standard-phases
1784 (add-after 'install 'rename-static-libraries
1785 ;; The build tools put a 'static' suffix on the static libraries, but
1786 ;; other applications don't know how to find these.
1787 (lambda* (#:key outputs #:allow-other-keys)
1788 (let ((lib (string-append (assoc-ref %outputs "out") "/lib/")))
1789 (rename-file (string-append lib "libbrotlicommon-static.a")
1790 (string-append lib "libbrotlicommon.a"))
1791 (rename-file (string-append lib "libbrotlidec-static.a")
1792 (string-append lib "libbrotlidec.a"))
1793 (rename-file (string-append lib "libbrotlienc-static.a")
1794 (string-append lib "libbrotlienc.a"))
1797 (list ;; Defaults to "lib64" on 64-bit archs.
1798 (string-append "-DCMAKE_INSTALL_LIBDIR="
1799 (assoc-ref %outputs "out") "/lib"))))
1800 (home-page "https://github.com/google/brotli")
1801 (synopsis "General-purpose lossless compression")
1802 (description "This package provides the reference implementation of Brotli,
1803 a generic-purpose lossless compression algorithm that compresses data using a
1804 combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd
1805 order context modeling, with a compression ratio comparable to the best
1806 currently available general-purpose compression methods. It is similar in speed
1807 with @code{deflate} but offers more dense compression.
1809 The specification of the Brotli Compressed Data Format is defined in RFC 7932.")
1810 (license license:expat)))
1818 (uri (string-append "http://www.oberhumer.com/opensource/"
1819 name "/download/" name "-" version ".tar.gz"))
1822 "0j036lkwsxvm15gr29n8wn07cqq79dswjs9k54939ms5zngjjrdq"))))
1823 (build-system gnu-build-system)
1824 (home-page "http://www.oberhumer.com/opensource/ucl/")
1825 (synopsis "Portable lossless data compression library")
1826 (description "UCL implements a number of compression algorithms that
1827 achieve an excellent compression ratio while allowing fast decompression.
1828 Decompression requires no additional memory.
1830 Compared to LZO, the UCL algorithms achieve a better compression ratio but
1831 decompression is a little bit slower.")
1832 (license license:gpl2+)))
1840 (uri (string-append "https://github.com/upx/upx/releases/download/v"
1841 version "/" name "-" version "-src.tar.xz"))
1844 "08anybdliqsbsl6x835iwzljahnm9i7v26icdjkcv33xmk6p5vw1"))
1845 (patches (search-patches "upx-fix-CVE-2017-15056.patch"))))
1846 (build-system gnu-build-system)
1847 (native-inputs `(("perl" ,perl)
1849 (inputs `(("zlib" ,zlib)))
1853 ;; CHECK_WHITESPACE does not seem to work.
1854 ;; See https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/upx.
1855 "CHECK_WHITESPACE=true")
1857 (modify-phases %standard-phases
1861 (add-before 'build 'patch-exec-bin-sh
1863 (substitute* (find-files "Makefile")
1864 (("/bin/sh") (which "sh")))
1865 (substitute* "src/Makefile"
1866 (("/bin/sh") (which "sh")))
1868 (add-after 'build 'install-upx
1869 (lambda* (#:key outputs #:allow-other-keys)
1870 (let* ((out (assoc-ref outputs "out"))
1871 (bin (string-append out "/bin")))
1873 (copy-file "src/upx.out" (string-append bin "/upx")))
1876 (home-page "https://upx.github.io/")
1877 ;; CVE-2017-16869 is about Mach-O files which is not of a big concern for Guix.
1878 ;; See https://github.com/upx/upx/issues/146 and
1879 ;; https://nvd.nist.gov/vuln/detail?vulnId=CVE-2017-16869.
1880 ;; The issue will be fixed after version 3.94.
1881 (properties `((lint-hidden-cve . ("CVE-2017-16869"))))
1882 (synopsis "Compression tool for executables")
1884 "The Ultimate Packer for eXecutables (UPX) is an executable file
1885 compressor. UPX typically reduces the file size of programs and shared
1886 libraries by around 50%--70%, thus reducing disk space, network load times,
1887 download times, and other distribution and storage costs.")
1888 (license license:gpl2+)))