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, 2020 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, 2019, 2020 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, 2019 Pierre Neidhardt <mail@ambrevar.xyz>
26 ;;; Copyright © 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
27 ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
28 ;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
29 ;;; Copyright © 2020 Arun Isaac <arunisaac@systemreboot.net>
31 ;;; This file is part of GNU Guix.
33 ;;; GNU Guix is free software; you can redistribute it and/or modify it
34 ;;; under the terms of the GNU General Public License as published by
35 ;;; the Free Software Foundation; either version 3 of the License, or (at
36 ;;; your option) any later version.
38 ;;; GNU Guix is distributed in the hope that it will be useful, but
39 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
40 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41 ;;; GNU General Public License for more details.
43 ;;; You should have received a copy of the GNU General Public License
44 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
46 (define-module (gnu packages compression)
47 #:use-module ((guix licenses) #:prefix license:)
48 #:use-module (guix utils)
49 #:use-module (guix packages)
50 #:use-module (guix download)
51 #:use-module (guix git-download)
52 #:use-module (guix build-system cmake)
53 #:use-module (guix build-system gnu)
54 #:use-module (guix build-system python)
55 #:use-module (guix build-system trivial)
56 #:use-module (gnu packages)
57 #:use-module (gnu packages assembly)
58 #:use-module (gnu packages autotools)
59 #:use-module (gnu packages backup)
60 #:use-module (gnu packages base)
61 #:use-module (gnu packages boost)
62 #:use-module (gnu packages check)
63 #:use-module (gnu packages curl)
64 #:use-module (gnu packages documentation)
65 #:use-module (gnu packages file)
66 #:use-module (gnu packages maths)
67 #:use-module (gnu packages perl)
68 #:use-module (gnu packages pkg-config)
69 #:use-module (gnu packages python)
70 #:use-module (gnu packages qt)
71 #:use-module (gnu packages tls)
72 #:use-module (gnu packages valgrind)
73 #:use-module (ice-9 match)
74 #:use-module ((srfi srfi-1) #:select (last)))
83 (uri (list (string-append "http://zlib.net/zlib-"
85 (string-append "mirror://sourceforge/libpng/zlib/"
86 version "/zlib-" version ".tar.gz")))
89 "18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3"))))
90 (build-system gnu-build-system)
91 (outputs '("out" "static"))
94 (modify-phases %standard-phases
96 (lambda* (#:key outputs #:allow-other-keys)
97 ;; Zlib's home-made `configure' fails when passed
98 ;; extra flags like `--enable-fast-install', so we need to
99 ;; invoke it with just what it understand.
100 (let ((out (assoc-ref outputs "out")))
101 ;; 'configure' doesn't understand '--host'.
102 ,@(if (%current-target-system)
103 `((setenv "CHOST" ,(%current-target-system)))
105 (invoke "./configure"
106 (string-append "--prefix=" out)))))
107 (add-after 'install 'move-static-library
108 (lambda* (#:key outputs #:allow-other-keys)
109 (let ((out (assoc-ref outputs "out"))
110 (static (assoc-ref outputs "static")))
111 (with-directory-excursion (string-append out "/lib")
112 (install-file "libz.a" (string-append static "/lib"))
113 (delete-file "libz.a")
115 (home-page "https://zlib.net/")
116 (synopsis "Compression library")
118 "zlib is designed to be a free, general-purpose, legally unencumbered --
119 that is, not covered by any patents -- lossless data-compression library for
120 use on virtually any computer hardware and operating system. The zlib data
121 format is itself portable across platforms. Unlike the LZW compression method
122 used in Unix compress(1) and in the GIF image format, the compression method
123 currently used in zlib essentially never expands the data. (LZW can double or
124 triple the file size in extreme cases.) zlib's memory footprint is also
125 independent of the input data and can be reduced, if necessary, at some cost
127 (license license:zlib)))
129 (define-public minizip
132 (version (package-version zlib))
133 (source (package-source zlib))
134 (build-system gnu-build-system)
137 (modify-phases %standard-phases
138 (add-after 'unpack 'enter-source
139 (lambda _ (chdir "contrib/minizip") #t))
140 (add-after 'install 'remove-crypt-h
141 (lambda* (#:key outputs #:allow-other-keys)
142 ;; Remove <minizip/crypt.h> because it interferes with libc's
143 ;; <crypt.h> given that 'minizip.pc' says "-I…/include/minizip".
144 ;; Fedora does the same:
145 ;; <https://src.fedoraproject.org/rpms/zlib/c/4d2785ec3116947872f6f32dc4104e6d36d8a7a4?branch=master>.
146 (let ((out (assoc-ref outputs "out")))
147 (delete-file (string-append out "/include/minizip/crypt.h"))
150 `(("autoconf" ,autoconf)
151 ("automake" ,automake)
152 ("libtool" ,libtool)))
153 (propagated-inputs `(("zlib" ,zlib)))
154 (home-page (package-home-page zlib))
155 (synopsis "Zip Compression library")
157 "Minizip is a minimalistic library that supports compressing,
158 extracting and viewing ZIP archives. This version is extracted from
159 the @code{zlib} source.")
160 (license (package-license zlib))))
162 (define-public fastjar
168 (uri (string-append "mirror://savannah/fastjar/fastjar-"
172 "0iginbz2m15hcsa3x4y7v3mhk54gr1r7m3ghx0pg4n46vv2snmpi"))))
173 (build-system gnu-build-system)
174 (inputs `(("zlib" ,zlib)))
175 (home-page "https://savannah.nongnu.org/projects/fastjar")
176 (synopsis "Replacement for Sun's 'jar' utility")
178 "FastJar is an attempt to create a much faster replacement for Sun's
179 @code{jar} utility. Instead of being written in Java, FastJar is written in C.")
180 (license license:gpl2+)))
182 (define-public libtar
190 "ftp://ftp.feep.net/pub/software/libtar/libtar-"
193 "mirror://debian/pool/main/libt/libtar/libtar_"
194 version ".orig.tar.gz")))
197 "02cihzl77ia0dcz7z2cga2412vyhhs5pa2355q4wpwbyga2lrwjh"))
198 (patches (search-patches "libtar-CVE-2013-4420.patch"))))
199 (build-system gnu-build-system)
200 (arguments `(#:tests? #f)) ; no "check" target
202 `(("autoconf" ,autoconf)
203 ("automake" ,automake)
204 ("libtool" ,libtool)))
207 (synopsis "C library for manipulating POSIX tar files")
209 "libtar is a C library for manipulating POSIX tar files. It handles
210 adding and extracting files to/from a tar archive.")
211 (home-page "https://repo.or.cz/libtar.git")
212 (license license:bsd-3)))
220 (uri (string-append "mirror://gnu/gzip/gzip-"
224 "1h6p374d3j8d4cdfydzls021xa2yby8myc0h8d6m8bc7k6ncq9c4"))))
225 (build-system gnu-build-system)
226 (synopsis "General file (de)compression (using lzw)")
228 ;; FIXME: The test suite wants `less', and optionally Perl.
231 (modify-phases %standard-phases
232 (add-after 'unpack 'patch-for-glibc-2.28
234 ;; Adjust the bundled gnulib to work with glibc 2.28. See e.g.
235 ;; "m4-gnulib-libio.patch". This is a phase rather than patch
236 ;; or snippet to work around <https://bugs.gnu.org/32347>.
237 (substitute* (find-files "lib" "\\.c$")
238 (("#if defined _IO_ftrylockfile")
239 "#if defined _IO_EOF_SEEN"))
240 (substitute* "lib/stdio-impl.h"
241 (("^/\\* BSD stdio derived implementations")
242 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
243 "# define _IO_IN_BACKUP 0x100\n"
245 "/* BSD stdio derived implementations")))
247 (add-after 'unpack 'use-absolute-name-of-gzip
248 (lambda* (#:key outputs #:allow-other-keys)
249 (substitute* "gunzip.in"
251 (string-append "exec " (assoc-ref outputs "out")
255 "GNU Gzip provides data compression and decompression utilities; the
256 typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
257 file; as a result, it is often used in conjunction with \"tar\", resulting in
258 \".tar.gz\" or \".tgz\", etc.")
259 (license license:gpl3+)
260 (home-page "https://www.gnu.org/software/gzip/")))
268 ;; XXX The bzip.org domain was allowed to expire.
269 (uri (string-append "https://web.archive.org/web/20180624184806/"
270 "http://www.bzip.org/"
271 version "/bzip2-" version ".tar.gz"))
274 "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152"))))
275 (build-system gnu-build-system)
277 `(#:modules ((guix build gnu-build-system)
282 (modify-phases %standard-phases
284 (lambda* (#:key target #:allow-other-keys)
285 (when ,(%current-target-system)
286 ;; Cross-compilation: use the cross tools.
287 (substitute* (find-files "." "Makefile")
289 (string-append "CC = " target "-gcc\n"))
291 (string-append "AR = " target "-ar\n"))
293 (string-append "RANLIB = " target "-ranlib\n"))
294 (("^all:(.*)test" _ prerequisites)
295 ;; Remove 'all' -> 'test' dependency.
296 (string-append "all:" prerequisites "\n"))))
298 (add-before 'build 'build-shared-lib
299 (lambda* (#:key inputs #:allow-other-keys)
300 (patch-makefile-SHELL "Makefile-libbz2_so")
301 (invoke "make" "-f" "Makefile-libbz2_so")))
302 (add-after 'install 'install-shared-lib
303 (lambda* (#:key outputs #:allow-other-keys)
304 ;; The Makefile above does not have an 'install' target, nor does
305 ;; it create all the (un)versioned symlinks, so we handle it here.
306 (let* ((out (assoc-ref outputs "out"))
307 (libdir (string-append out "/lib"))
309 ;; Locate the built library (e.g. "libbz2.so.1.0.6").
310 (lib (car (scandir "."
312 (and (string-prefix? soname file)
314 (stat:type (lstat file))))))))
315 (soversion (string-drop lib (+ 1 (string-length soname)))))
316 (install-file lib libdir)
317 (with-directory-excursion libdir
318 ;; Create symlinks libbz2.so.1 -> libbz2.so.1.0, etc.
319 (let loop ((base soname)
320 (numbers (string-split soversion #\.)))
321 (unless (null? numbers)
322 (let ((so-file (string-append base "." (car numbers))))
323 (symlink so-file base)
324 (loop so-file (cdr numbers))))))
326 (add-after 'install-shared-lib 'move-static-lib
327 (lambda* (#:key outputs #:allow-other-keys)
328 (let ((out (assoc-ref outputs "out"))
329 (static (assoc-ref outputs "static")))
330 (with-directory-excursion (string-append out "/lib")
331 (install-file "libbz2.a" (string-append static "/lib"))
332 (delete-file "libbz2.a")
334 (add-after 'install-shared-lib 'patch-scripts
335 (lambda* (#:key outputs inputs #:allow-other-keys)
336 (let* ((out (assoc-ref outputs "out")))
337 (substitute* (string-append out "/bin/bzdiff")
341 #:make-flags (list (string-append "PREFIX="
342 (assoc-ref %outputs "out")))
344 ;; Don't attempt to run the tests when cross-compiling.
345 ,@(if (%current-target-system)
348 (outputs '("out" "static"))
349 (synopsis "High-quality data compression program")
351 "bzip2 is a freely available, patent free (see below), high-quality data
352 compressor. It typically compresses files to within 10% to 15% of the best
353 available techniques (the PPM family of statistical compressors), whilst
354 being around twice as fast at compression and six times faster at
356 (license (license:non-copyleft "file://LICENSE"
357 "See LICENSE in the distribution."))
358 (home-page "https://web.archive.org/web/20180801004107/http://www.bzip.org/")))
360 (define-public lbzip2
366 (uri (string-append "http://archive.lbzip2.org/lbzip2-"
370 "1sahaqc5bw4i0iyri05syfza4ncf5cml89an033fspn97klmxis6"))
371 (modules '((guix build utils)))
374 (substitute* (find-files "lib" "\\.c$")
375 (("#if defined _IO_ftrylockfile")
376 "#if defined _IO_EOF_SEEN"))
377 (substitute* "lib/stdio-impl.h"
378 (("^/\\* BSD stdio derived implementations")
379 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
380 "# define _IO_IN_BACKUP 0x100\n"
382 "/* BSD stdio derived implementations")))
384 (build-system gnu-build-system)
385 (synopsis "Parallel bzip2 compression utility")
387 "lbzip2 is a multi-threaded compression utility with support for the
388 bzip2 compressed file format. lbzip2 can process standard bz2 files in
389 parallel. It uses POSIX threading model (pthreads), which allows it to take
390 full advantage of symmetric multiprocessing (SMP) systems. It has been proven
391 to scale linearly, even to over one hundred processor cores. lbzip2 is fully
392 compatible with bzip2 – both at file format and command line level.")
393 (home-page "http://www.lbzip2.org/")
394 (license license:gpl3+)))
396 (define-public pbzip2
402 (uri (string-append "https://launchpad.net/pbzip2/"
403 (version-major+minor version) "/" version
404 "/+download/" name "-" version ".tar.gz"))
407 "1rnvgcdixjzbrmcr1nv9b6ccrjfrhryaj7jwz28yxxv6lam3xlcg"))))
408 (build-system gnu-build-system)
412 `(#:tests? #f ; no tests
413 #:phases (modify-phases %standard-phases
414 (delete 'configure)) ; no configure script
415 #:make-flags (list (string-append "PREFIX=" %output))))
416 (home-page (string-append "https://web.archive.org/web/20180412020219/"
417 "http://compression.ca/pbzip2/"))
418 (synopsis "Parallel bzip2 implementation")
420 "Pbzip2 is a parallel implementation of the bzip2 block-sorting file
421 compressor that uses pthreads and achieves near-linear speedup on SMP machines.
422 The output of this version is fully compatible with bzip2 v1.0.2 (i.e. anything
423 compressed with pbzip2 can be decompressed with bzip2).")
424 (license (license:non-copyleft "file://COPYING"
425 "See COPYING in the distribution."))))
433 (uri (list (string-append "http://tukaani.org/xz/xz-" version
435 (string-append "http://multiprecision.org/guix/xz-"
439 "0ibi2zsfaz6l756spjwc5rayf4ckgc9hwmy8qinppcyk4svz64mm"))))
440 (build-system gnu-build-system)
443 (modify-phases %standard-phases
444 (add-after 'install 'move-static-lib
445 (lambda* (#:key outputs #:allow-other-keys)
446 (let ((out (assoc-ref outputs "out"))
447 (static (assoc-ref outputs "static")))
448 (mkdir-p (string-append static "/lib"))
449 (rename-file (string-append out "/lib/liblzma.a")
450 (string-append static "/lib/liblzma.a"))
451 ;; Remove reference to the static library from the .la file
452 ;; so Libtool does the right thing when both the shared and
453 ;; static library is available.
454 (substitute* (string-append out "/lib/liblzma.la")
455 (("^old_library='liblzma.a'") "old_library=''"))
457 (outputs '("out" "static"))
458 (synopsis "General-purpose data compression")
460 "XZ Utils is free general-purpose data compression software with high
461 compression ratio. XZ Utils were written for POSIX-like systems, but also
462 work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
464 The core of the XZ Utils compression code is based on LZMA SDK, but it has
465 been modified quite a lot to be suitable for XZ Utils. The primary
466 compression algorithm is currently LZMA2, which is used inside the .xz
467 container format. With typical files, XZ Utils create 30 % smaller output
468 than gzip and 15 % smaller output than bzip2.")
469 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
470 (home-page "https://tukaani.org/xz/")))
479 "https://github.com/fragglet/lhasa/releases/download/v"
480 version "/lhasa-" version ".tar.gz"))
483 "092zi9av18ma20c6h9448k0bapvx2plnp292741dvfd9hmgqxc1z"))))
484 (build-system gnu-build-system)
487 (modify-phases %standard-phases
488 (add-before 'check 'set-up-test-environment
489 (lambda* (#:key inputs #:allow-other-keys)
490 (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata")
494 `(("tzdata" ,tzdata-for-tests)))
495 (home-page "https://fragglet.github.com/lhasa/")
496 (synopsis "LHA archive decompressor")
497 (description "Lhasa is a replacement for the Unix LHA tool, for
498 decompressing .lzh (LHA / LHarc) and .lzs (LArc) archives. The backend for the
499 tool is a library, so that it can be reused for other purposes. Lhasa aims to
500 be compatible with as many types of lzh/lzs archives as possible. It also aims
501 to generate the same output as the (non-free) Unix LHA tool, so that it will
502 act as a free drop-in replacement.")
503 (license license:isc)))
512 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
516 "0wm04519pd3g8hqpjqhfr72q8qmbiwqaxcs3cndny9h86aa95y60"))))
517 (build-system gnu-build-system)
518 (arguments '(#:configure-flags '("--enable-shared")))
519 (home-page "http://www.oberhumer.com/opensource/lzo")
521 "Data compression library suitable for real-time data de-/compression")
523 "LZO is a data compression library which is suitable for data
524 de-/compression in real-time. This means it favours speed over
527 LZO is written in ANSI C. Both the source code and the compressed data
528 format are designed to be portable across platforms.")
529 (license license:gpl2+)))
538 (uri (string-append "http://www.lzop.org/download/lzop-"
542 "0h9gb8q7y54m9mvy3jvsmxf21yx8fc3ylzh418hgbbv0i8mbcwky"))))
543 (build-system gnu-build-system)
544 (inputs `(("lzo" ,lzo)))
545 (home-page "https://www.lzop.org/")
546 (synopsis "Compress or expand files")
548 "Lzop is a file compressor which is very similar to gzip. Lzop uses the
549 LZO data compression library for compression services, and its main advantages
550 over gzip are much higher compression and decompression speed (at the cost of
551 some compression ratio).")
552 (license license:gpl2+)))
560 (uri (string-append "mirror://savannah/lzip/lzip-"
564 "12qdcw5k1cx77brv9yxi1h4dzwibhfmdpigrj43nfk8nscwm12z4"))))
565 (build-system gnu-build-system)
566 (home-page "https://www.nongnu.org/lzip/lzip.html")
567 (synopsis "Lossless data compressor based on the LZMA algorithm")
569 "Lzip is a lossless data compressor with a user interface similar to the
570 one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
571 more than bzip2, which makes it well-suited for software distribution and data
572 archiving. Lzip is a clean implementation of the LZMA algorithm.")
573 (license license:gpl3+)))
575 (define-public lziprecover
581 (uri (string-append "mirror://savannah/lzip/lziprecover/"
582 "lziprecover-" version ".tar.gz"))
585 "094w2z8fz41yaq0gkyr61cl7pb1d7kchpl5dka7rvm3qvbb7ncd2"))))
586 (build-system gnu-build-system)
587 (home-page "https://www.nongnu.org/lzip/lziprecover.html")
588 (synopsis "Recover and decompress data from damaged lzip files")
590 "Lziprecover is a data recovery tool and decompressor for files in the lzip
591 compressed data format (.lz). It can test the integrity of lzip files, extract
592 data from damaged ones, and repair most files with small errors (up to one
593 single-byte error per member) entirely.
595 Lziprecover is not a replacement for regular backups, but a last line of defence
596 when even the backups are corrupt. It can recover files by merging the good
597 parts of two or more damaged copies, such as can be easily produced by running
598 @command{ddrescue} on a failing device.
600 This package also includes @command{unzcrash}, a tool to test the robustness of
601 decompressors when faced with corrupted input.")
602 (license (list license:bsd-2 ; arg_parser.{cc,h}
603 license:gpl2+)))) ; everything else
605 (define-public sharutils
612 (uri (string-append "mirror://gnu/sharutils/sharutils-"
614 (patches (search-patches "sharutils-CVE-2018-1000097.patch"))
617 "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))
618 (modules '((guix build utils)))
621 (substitute* (find-files "lib" "\\.c$")
622 (("#if defined _IO_ftrylockfile")
623 "#if defined _IO_EOF_SEEN"))
624 (substitute* "lib/stdio-impl.h"
625 (("^/\\* BSD stdio derived implementations")
626 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
627 "# define _IO_IN_BACKUP 0x100\n"
629 "/* BSD stdio derived implementations")))
631 (build-system gnu-build-system)
636 (modify-phases %standard-phases
637 (add-after 'patch-source-shebangs 'unpatch-source-shebang
638 ;; revert the patch-shebang phase on a script which is
641 (substitute* "tests/shar-1.ok"
642 (((which "sh")) "/bin/sh"))
644 (home-page "https://www.gnu.org/software/sharutils/")
645 (synopsis "Archives in shell scripts, uuencode/uudecode")
647 "GNU sharutils is a package for creating and manipulating shell
648 archives that can be readily emailed. A shell archive is a file that can be
649 processed by a Bourne-type shell to unpack the original collection of files.
650 This package is mostly for compatibility and historical interest.")
651 (license license:gpl3+)))
653 (define-public sfarklib
660 (url "https://github.com/raboof/sfArkLib.git")
662 (file-name (git-file-name name version))
665 "0jrxy24gak7q5ml06p5jjgzk9i5r2mkfjk4ycirkp4kg7k5a237w"))))
666 (build-system gnu-build-system)
668 `(#:tests? #f ;no "check" target
670 (modify-phases %standard-phases
672 (lambda* (#:key outputs #:allow-other-keys)
673 (substitute* "Makefile"
674 (("/usr/local") (assoc-ref outputs "out")))
678 (home-page "https://github.com/raboof/sfArkLib")
679 (synopsis "Library for SoundFont decompression")
681 "SfArkLib is a C++ library for decompressing SoundFont files compressed
682 with the sfArk algorithm.")
683 (license license:gpl3+)))
685 (define-public sfarkxtc
686 (let ((commit "13cd6f93725a90d91ec5ea75babf1dbd694ac463")
690 (version (git-version "0" revision commit))
692 ;; There are no release tarballs, so we just fetch the latest
693 ;; commit at this time.
696 (url "https://github.com/raboof/sfarkxtc.git")
698 (file-name (git-file-name name version))
701 "1mb1jyk1m11l1gppd9hmql9cyp55sdf7jk5rbc7acky1z4k4mv19"))))
702 (build-system gnu-build-system)
704 `(#:tests? #f ;no "check" target
706 (modify-phases %standard-phases
708 (lambda* (#:key outputs #:allow-other-keys)
709 (substitute* "Makefile"
710 (("/usr/local") (assoc-ref outputs "out")))
714 ("sfarklib" ,sfarklib)))
715 (home-page "https://github.com/raboof/sfarkxtc")
716 (synopsis "Basic sfArk decompressor")
717 (description "SfArk extractor converts SoundFonts in the compressed legacy
718 sfArk file format to the uncompressed sf2 format.")
719 (license license:gpl3+))))
721 (define-public libmspack
724 (home-page "https://cabextract.org.uk/libmspack/")
729 (uri (string-append home-page name "-" version "alpha.tar.gz"))
731 (base32 "13janaqsvm7aqc4agjgd4819pbgqv50j88bh5kci1z70wvg65j5s"))))
732 (build-system gnu-build-system)
734 `(#:configure-flags '("--disable-static")))
735 (synopsis "Compression tools for some formats used by Microsoft")
737 "The purpose of libmspack is to provide both compression and
738 decompression of some loosely related file formats used by Microsoft.")
739 (license license:lgpl2.1+)))
748 (uri (git-reference (url "https://github.com/lz4/lz4")
749 (commit (string-append "v" version))))
752 "0lpaypmk70ag2ks3kf2dl4ac3ba40n5kc1ainkp9wfjawz76mh61"))
753 (file-name (git-file-name name version))))
754 (build-system gnu-build-system)
758 ("valgrind" ,valgrind)))
760 `(#:test-target "test"
761 #:make-flags (list "CC=gcc"
762 (string-append "prefix=" (assoc-ref %outputs "out")))
763 #:phases (modify-phases %standard-phases
764 (delete 'configure) ;no configure script
765 (add-before 'check 'disable-broken-test
767 ;; XXX: test_install.sh fails when prefix is a subdirectory.
768 (substitute* "tests/Makefile"
769 (("^test: (.*) test-install" _ targets)
770 (string-append "test: " targets)))
772 (add-after 'install 'delete-static-library
773 (lambda* (#:key outputs #:allow-other-keys)
774 (let ((out (assoc-ref outputs "out")))
775 (delete-file (string-append out "/lib/liblz4.a"))
777 (home-page "https://www.lz4.org")
778 (synopsis "Compression algorithm focused on speed")
779 (description "LZ4 is a lossless compression algorithm, providing
780 compression speed at 400 MB/s per core (0.16 Bytes/cycle). It also features an
781 extremely fast decoder, with speed in multiple GB/s per core (0.71 Bytes/cycle).
782 A high compression derivative, called LZ4_HC, is also provided. It trades CPU
783 time for compression ratio.")
784 ;; The libraries (lz4, lz4hc, and xxhash) are BSD licenced. The command
785 ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
786 (license (list license:bsd-2 license:gpl2+))))
788 (define-public squashfs-tools
790 (name "squashfs-tools")
794 (uri (string-append "mirror://sourceforge/squashfs/squashfs/"
795 "squashfs" version "/"
796 "squashfs" version ".tar.gz"))
799 "0zmhvczscqz0mzh4b9m8m42asq14db0a6lc8clp5ljq5ybrv70d9"))))
800 (build-system gnu-build-system)
802 '(#:tests? #f ; no check target
808 (string-append "INSTALL_DIR=" %output "/bin"))
810 (modify-phases %standard-phases
813 (chdir "squashfs-tools")
820 (home-page "https://github.com/plougher/squashfs-tools")
821 (synopsis "Tools to create and extract squashfs file systems")
823 "Squashfs is a highly compressed read-only file system for Linux. It uses
824 zlib to compress files, inodes, and directories. All blocks are packed to
825 minimize the data overhead, and block sizes of between 4K and 1M are supported.
826 It is intended to be used for archival use, for live CDs, and for embedded
827 systems where low overhead is needed. This package allows you to create and
828 extract such file systems.")
829 (license license:gpl2+)))
837 (uri (string-append "http://zlib.net/pigz/"
838 name "-" version ".tar.gz"))
841 "0wsgw5vwl23jrnpsvd8v3xcp5k4waw5mk0164fynjhkv58i1dy54"))))
842 (build-system gnu-build-system)
845 (modify-phases %standard-phases
848 (lambda* (#:key outputs #:allow-other-keys)
849 (let* ((out (assoc-ref outputs "out"))
850 (bin (string-append out "/bin"))
851 (man (string-append out "/share/man/man1")))
852 (install-file "pigz" bin)
853 (symlink "pigz" (string-append bin "/unpigz"))
854 (install-file "pigz.1" man)
856 #:make-flags (list "CC=gcc")
857 #:test-target "tests"))
858 (inputs `(("zlib" ,zlib)))
859 (home-page "https://zlib.net/pigz/")
860 (synopsis "Parallel implementation of gzip")
862 "This package provides a parallel implementation of gzip that exploits
863 multiple processors and multiple cores when compressing data.")
865 ;; Things under zopfli/ are under ASL2.0, but 4 files at the top-level,
866 ;; written by Mark Adler, are under another non-copyleft license.
867 (license license:asl2.0)))
876 "https://github.com/vasi/pixz/releases/download/v" version
877 "/pixz-" version ".tar.xz"))
880 "1s3j7zw6j5zi3fhdxg287ndr3wf6swac7z21mqd1pyiln530gi82"))))
881 (build-system gnu-build-system)
883 `(("pkg-config" ,pkg-config)
884 ("libarchive" ,libarchive)))
885 (home-page "https://github.com/vasi/pixz")
886 (synopsis "Parallel indexing implementation of LZMA")
888 "The existing XZ Utils provide great compression in the .xz file format,
889 but they produce just one big block of compressed data. Pixz instead produces
890 a collection of smaller blocks which makes random access to the original data
891 possible and can compress in parallel. This is especially useful for large
893 (license license:bsd-2)))
895 (define-public bsdiff
899 (home-page "https://www.daemonology.net/bsdiff/")
902 (uri (string-append home-page name "-" version ".tar.gz"))
905 "0j2zm3z271x5aw63mwhr3vymzn45p2vvrlrpm9cz2nywna41b0hq"))))
906 (build-system gnu-build-system)
908 `(#:make-flags (list "INSTALL=install" "CC=gcc"
909 (string-append "PREFIX=" (assoc-ref %outputs "out")))
910 #:phases (modify-phases %standard-phases
912 (add-before 'build 'fix-Makefile
914 (substitute* "Makefile"
915 ;; Adjust syntax to make it compatible with GNU Make.
917 ;; Help install(1) create the target directory.
918 (("\\$\\{PREFIX\\}") "-D -t ${PREFIX}"))
920 #:tests? #f)) ;no tests
923 (synopsis "Patch binary files")
925 "@command{bsdiff} and @command{bspatch} are tools for building and
926 applying patches to binary files. By using suffix sorting (specifically
927 Larsson and Sadakane's @code{qsufsort}) and taking advantage of how
928 executable files change, bsdiff routinely produces binary patches 50-80%
929 smaller than those produced by @code{Xdelta}.")
930 (license license:bsd-2)))
932 (define-public cabextract
935 (home-page "https://cabextract.org.uk/")
939 (uri (string-append home-page "cabextract-" version ".tar.gz"))
942 "19qwhl2r8ip95q4vxzxg2kp4p125hjmc9762sns1dwwf7ikm7hmg"))
943 (modules '((guix build utils)))
946 ;; Delete bundled libmspack.
947 (delete-file-recursively "mspack")
949 (build-system gnu-build-system)
951 '(#:configure-flags '("--with-external-libmspack")
953 (modify-phases %standard-phases
954 ;; cabextract needs some of libmspack's header files.
955 ;; These are located in the "mspack" directory of libmspack.
956 (add-before 'build 'unpack-libmspack
957 (lambda* (#:key inputs #:allow-other-keys)
958 (let ((dir-name "libmspack-src"))
960 (invoke "tar" "-xvf" (assoc-ref inputs "libmspack-source")
961 "-C" dir-name "--strip-components" "1")
962 (rename-file (string-append dir-name "/mspack")
964 (delete-file-recursively dir-name)
967 `(("pkg-config" ,pkg-config)))
969 `(("libmspack" ,libmspack)
970 ("libmspack-source" ,(package-source libmspack))))
971 (synopsis "Tool to unpack Cabinet archives")
972 (description "Extracts files out of Microsoft Cabinet (.cab) archives")
973 ;; Some source files specify gpl2+, lgpl2+, however COPYING is gpl3.
974 (license license:gpl3+)))
976 (define-public xdelta
984 (url "https://github.com/jmacd/xdelta.git")
985 (commit (string-append "v" version))))
986 (file-name (git-file-name name version))
989 "09mmsalc7dwlvgrda56s2k927rpl3a5dzfa88aslkqcjnr790wjy"))
991 ;; This file isn't freely distributable and has no effect on building.
993 (delete-file "xdelta3/draft-korn-vcdiff.txt")
995 (build-system gnu-build-system)
997 `(("autoconf" ,autoconf)
998 ("automake" ,automake)))
1001 (modify-phases %standard-phases
1002 (add-after 'unpack 'enter-build-directory
1003 (lambda _ (chdir "xdelta3") #t)))))
1004 (home-page "http://xdelta.org")
1005 (synopsis "Delta encoder for binary files")
1006 (description "xdelta encodes only the differences between two binary files
1007 using the VCDIFF algorithm and patch file format described in RFC 3284. It can
1008 also be used to apply such patches. xdelta is similar to @command{diff} and
1009 @command{patch}, but is not limited to plain text and does not generate
1010 human-readable output.")
1011 (license license:asl2.0)))
1013 (define-public lrzip
1021 "http://ck.kolivas.org/apps/lrzip/lrzip-" version ".tar.bz2"))
1024 "0mb449vmmwpkalq732jdyginvql57nxyd31sszb108yps1lf448d"))
1025 (patches (search-patches "lrzip-CVE-2017-8842.patch"))))
1026 (build-system gnu-build-system)
1028 `(;; nasm is only required when building for 32-bit x86 platforms
1029 ,@(if (string-prefix? "i686" (or (%current-target-system)
1038 (home-page "http://ck.kolivas.org/apps/lrzip/")
1039 (synopsis "Large file compressor with a very high compression ratio")
1040 (description "lrzip is a compression utility that uses long-range
1041 redundancy reduction to improve the subsequent compression ratio of
1042 larger files. It can then further compress the result with the ZPAQ or
1043 LZMA algorithms for maximum compression, or LZO for maximum speed. This
1044 choice between size or speed allows for either better compression than
1045 even LZMA can provide, or a higher speed than gzip while compressing as
1047 (license (list license:gpl3+
1048 license:public-domain)))) ; most files in lzma/
1050 (define-public snappy
1058 (url "https://github.com/google/snappy.git")
1060 (file-name (git-file-name name version))
1062 (base32 "1j0kslq2dvxgkcxl1gakhvsa731yrcvcaipcp5k8k7ayicvkv9jv"))
1063 (patches (search-patches "snappy-add-O2-flag-in-CmakeLists.txt.patch"))))
1064 (build-system cmake-build-system)
1066 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
1067 (home-page "https://github.com/google/snappy")
1068 (synopsis "Fast compressor/decompressor")
1069 (description "Snappy is a compression/decompression library. It does not
1070 aim for maximum compression, or compatibility with any other compression library;
1071 instead, it aims for very high speeds and reasonable compression. For instance,
1072 compared to the fastest mode of zlib, Snappy is an order of magnitude faster
1073 for most inputs, but the resulting compressed files are anywhere from 20% to
1075 (license license:asl2.0)))
1077 (define-public p7zip
1083 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1084 version "/" name "_" version
1085 "_src_all.tar.bz2"))
1088 "07rlwbbgszq8i7m8jh3x6j2w2hc9a72dc7fmqawnqkwlwb00mcjy"))
1089 (modules '((guix build utils)))
1092 ;; Remove non-free source files
1093 (for-each delete-file
1095 (find-files "CPP/7zip/Compress" "Rar.*")
1096 (find-files "CPP/7zip/Crypto" "Rar.*")
1097 (find-files "DOC/unRarLicense.txt")
1098 (find-files "Utils/file_Codecs_Rar_so.py")))
1099 (delete-file-recursively "CPP/7zip/Archive/Rar")
1100 (delete-file-recursively "CPP/7zip/Compress/Rar")
1102 (patches (search-patches "p7zip-CVE-2016-9296.patch"
1103 "p7zip-CVE-2017-17969.patch"
1104 "p7zip-remove-unused-code.patch"))))
1105 (build-system gnu-build-system)
1108 (list (string-append "DEST_HOME=" (assoc-ref %outputs "out")) "all3")
1110 (modify-phases %standard-phases
1112 (lambda* (#:key system outputs #:allow-other-keys)
1114 (let ((system ,(or (%current-target-system)
1115 (%current-system))))
1117 ((string-prefix? "x86_64" system)
1118 "makefile.linux_amd64_asm")
1119 ((string-prefix? "i686" system)
1120 "makefile.linux_x86_asm_gcc_4.X")
1122 "makefile.linux_any_cpu_gcc_4.X")))
1123 "makefile.machine")))
1126 (invoke "make" "test")
1127 (invoke "make" "test_7z")
1128 (invoke "make" "test_7zr"))))))
1130 (let ((system (or (%current-target-system)
1131 (%current-system))))
1132 `(,@(cond ((string-prefix? "x86_64" system)
1134 ((string-prefix? "i686" system)
1137 (home-page "http://p7zip.sourceforge.net/")
1138 (synopsis "Command-line file archiver with high compression ratio")
1139 (description "p7zip is a command-line port of 7-Zip, a file archiver that
1140 handles the 7z format which features very high compression ratios.")
1141 (license (list license:lgpl2.1+
1143 license:public-domain))))
1145 (define-public gzstream
1152 ;; No versioned URL, but last release was in 2003.
1153 "http://www.cs.unc.edu/Research/compgeom/gzstream/gzstream.tgz")
1154 (file-name (string-append name "-" version ".tgz"))
1157 "00y19pqjsdj5zcrx4p9j56pl73vayfwnb7y2hvp423nx0cwv5b4r"))
1158 (modules '((guix build utils)))
1160 ;; Remove pre-compiled object.
1162 (delete-file "gzstream.o")
1164 (build-system gnu-build-system)
1166 `(#:test-target "test"
1168 (modify-phases %standard-phases
1171 (lambda* (#:key outputs #:allow-other-keys)
1172 (let* ((out (assoc-ref outputs "out"))
1173 (lib (string-append out "/lib"))
1174 (include (string-append out "/include")))
1175 (install-file "libgzstream.a" lib)
1176 (install-file "gzstream.h" include)
1178 (propagated-inputs `(("zlib" ,zlib)))
1179 (home-page "http://www.cs.unc.edu/Research/compgeom/gzstream/")
1180 (synopsis "Compressed C++ iostream")
1181 (description "gzstream is a small library for providing zlib
1182 functionality in a C++ iostream.")
1183 (license license:lgpl2.1+)))
1191 (method url-fetch/zipbomb)
1192 (uri (string-append "http://mattmahoney.net/dc/zpaq"
1193 (string-delete #\. version) ".zip"))
1196 "066l94yyladlfzri877nh2dhkvspagjn3m5bmv725fmhkr9c4pp8"))
1197 (modules '((guix build utils)))
1199 ;; Delete irrelevant pre-compiled binaries.
1201 (for-each delete-file (find-files "." "\\.exe$"))
1203 (build-system gnu-build-system)
1206 (modify-phases %standard-phases
1207 (delete 'configure)) ; no ‘configure’ script
1210 (string-append "CPPFLAGS=-Dunix"
1211 ,(match (or (%current-target-system)
1216 ;; These should be safe, lowest-common-denominator instruction sets,
1217 ;; allowing for some optimisation while remaining reproducible.
1218 (string-append "CXXFLAGS=-O3 -DNDEBUG"
1219 ,(match (or (%current-target-system)
1221 ("x86_64-linux" " -march=nocona -mtune=generic")
1222 ("i686-linux" " -march=i686 -mtune=generic")
1223 ("armhf-linux" " -mtune=generic-armv7-a")
1225 (string-append "PREFIX="
1226 (assoc-ref %outputs "out")))))
1228 `(("perl" ,perl))) ; for pod2man
1229 (home-page "http://mattmahoney.net/dc/zpaq.html")
1230 (synopsis "Incremental journaling archiver")
1231 (description "ZPAQ is a command-line archiver for realistic situations with
1232 many duplicate and already compressed files. It backs up only those files
1233 modified since the last update. All previous versions remain untouched and can
1234 be independently recovered. Identical files are only stored once (known as
1235 @dfn{de-duplication}). Archives can also be encrypted.
1237 ZPAQ is intended to back up user data, not entire operating systems. It ignores
1238 owner and group IDs, ACLs, extended attributes, or special file types like
1239 devices, sockets, or named pipes. It does not follow or restore symbolic links
1240 or junctions, and always follows hard links.")
1241 (license (list license:public-domain
1242 ;; libzpaq.cpp contains a mix of public-domain and
1243 ;; expat-licenced (or ‘MIT’) code.
1246 (define-public unshield
1251 (origin (method git-fetch)
1253 (url "http://github.com/twogood/unshield.git")
1255 (file-name (git-file-name name version))
1258 "19wn22vszhci8dfcixx5rliz7phx3lv5ablvhjlclvj75k2vsdqd"))))
1259 (build-system cmake-build-system)
1262 ("openssl" ,openssl)
1263 ;; Test data that is otherwise downloaded with curl.
1264 ("unshield-avigomanager11b22.zip"
1268 "https://www.dropbox.com/s/8r4b6752swe3nhu/"
1269 "unshield-avigomanager11b22.zip?dl=1"))
1271 (base32 "0fwq7lih04if68wpwpsk5wjqyvh32db76a41sq6gbx4dn1lc3ddn"))
1272 (file-name "unshield-avigomanager11b22.zip")))
1273 ("unshield-baldurs_gate_patch_v1_1_4315_international.zip"
1277 "https://www.dropbox.com/s/9ruil8oi6amjbbk/"
1278 "unshield-baldurs_gate_patch_v1_1_4315_international.zip?dl=1"))
1280 (base32 "0spaxf6dardlhqxz3ys09fzamj007q3nfyw4xng6gh3qp9780maj"))
1281 (file-name "unshield-baldurs_gate_patch_v1_1_4315_international.zip")))
1282 ("unshield-the-feeble-files-spanish.zip"
1286 "https://www.dropbox.com/s/1ng0z9kfxc7eb1e/"
1287 "unshield-the-feeble-files-spanish.zip?dl=1"))
1289 (base32 "1k5cw6vnpja8yjlnhx5124xrw9i8s1l539hfdqqrqz3l5gn0bnyd"))
1290 (file-name "unshield-the-feeble-files-spanish.zip")))))
1292 `(("unzip" ,unzip)))
1294 `(#:out-of-source? #f
1296 (modify-phases %standard-phases
1297 (add-before 'check 'pre-check
1298 (lambda* (#:key inputs #:allow-other-keys)
1299 (for-each (lambda (i)
1300 (copy-file (assoc-ref inputs i)
1301 (string-append "test/v0/" i)))
1302 '("unshield-avigomanager11b22.zip"
1303 "unshield-baldurs_gate_patch_v1_1_4315_international.zip"
1304 "unshield-the-feeble-files-spanish.zip"))
1305 (substitute* (find-files "test/" "/*\\.sh")
1306 ;; Tests expect the unshield binary in a specific
1308 (("/var/tmp/unshield/bin/unshield")
1309 (string-append (getcwd) "/src/unshield"))
1310 ;; We no longer need to download the data.
1312 (("curl -(|f)sSL -o test.zip .*") ""))
1313 (substitute* "test/v0/avigomanager.sh"
1315 (string-append (getcwd)
1316 "/test/v0/unshield-avigomanager11b22.zip")))
1317 (substitute* "test/v0/baldurs_gate_patch_v1_1_4315_international.sh"
1321 "/test/v0/unshield-baldurs_gate_patch_v1_1_4315_international.zip")))
1322 (substitute* "test/v0/the-feeble-files-spanish.sh"
1324 (string-append (getcwd)
1325 "/test/v0/unshield-the-feeble-files-spanish.zip")))
1329 (invoke "./run-tests.sh"))))))
1330 (home-page "https://github.com/twogood/unshield")
1331 (synopsis "Extract CAB files from InstallShield installers")
1333 "@command{unshield} is a tool and library for extracting @file{.cab}
1334 archives from InstallShield installers.")
1335 (license license:expat)))
1344 (uri (string-append "https://github.com/facebook/zstd/releases/download/"
1345 "v" version "/zstd-" version ".tar.gz"))
1347 (base32 "1ja3nrjynmiwwdjrf6crraizkbagp7y414bqqq2ady91nn1hjwqj"))))
1348 (build-system gnu-build-system)
1349 (outputs '("out" ;1.1MiB executables and documentation
1350 "lib" ;1MiB shared library and headers
1351 "static")) ;1MiB static library
1354 (modify-phases %standard-phases
1355 (delete 'configure) ;no configure script
1356 (add-after 'install 'adjust-library-locations
1357 (lambda* (#:key outputs #:allow-other-keys)
1358 (let* ((out (assoc-ref outputs "out"))
1359 (lib (assoc-ref outputs "lib"))
1360 (static (assoc-ref outputs "static"))
1361 (shared-libs (string-append lib "/lib"))
1362 (static-libs (string-append static "/lib")))
1363 ;; Move the static library to its own output to save ~1MiB.
1364 (mkdir-p static-libs)
1365 (for-each (lambda (ar)
1366 (link ar (string-append static-libs "/"
1369 (find-files shared-libs "\\.a$"))
1371 ;; While here, remove prefix= from the pkg-config file because it
1372 ;; is unused, and because it contains a needless reference to $out.
1373 ;; XXX: It would be great if #:disallow-references worked between
1375 (substitute* (string-append shared-libs "/pkgconfig/libzstd.pc")
1376 (("^prefix=.*") ""))
1381 (string-append "PREFIX=" (assoc-ref %outputs "out"))
1382 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib")
1383 (string-append "INCLUDEDIR=" (assoc-ref %outputs "lib") "/include")
1384 ;; Skip auto-detection of, and creating a dependency on, the build
1385 ;; environment's ‘xz’ for what amounts to a dubious feature anyway.
1387 ;; Not currently detected, but be explicit & avoid surprises later.
1390 (home-page "https://facebook.github.io/zstd/")
1391 (synopsis "Zstandard real-time compression algorithm")
1392 (description "Zstandard (@command{zstd}) is a lossless compression algorithm
1393 that combines very fast operation with a compression ratio comparable to that of
1394 zlib. In most scenarios, both compression and decompression can be performed in
1395 ‘real time’. The compressor can be configured to provide the most suitable
1396 trade-off between compression ratio and speed, without affecting decompression
1398 (license (list license:bsd-3 ; the main top-level LICENSE file
1399 license:bsd-2 ; many files explicitly state 2-Clause
1400 license:gpl2 ; the main top-level COPYING file
1401 license:gpl3+ ; tests/gzip/*.sh
1402 license:expat ; lib/dictBuilder/divsufsort.[ch]
1403 license:public-domain ; zlibWrapper/examples/fitblk*
1404 license:zlib)))) ; zlibWrapper/{gz*.c,gzguts.h}
1406 (define-public pzstd
1409 (version (package-version zstd))
1410 (source (package-source zstd))
1411 (build-system gnu-build-system)
1413 `(("googletest" ,googletest)))
1416 (modify-phases %standard-phases
1417 (add-after 'unpack 'enter-subdirectory
1418 (lambda _ (chdir "contrib/pzstd") #t))
1419 (delete 'configure) ; no configure script
1420 (add-before 'check 'compile-tests
1421 (lambda* (#:key make-flags #:allow-other-keys)
1422 (apply invoke "make" "tests" make-flags)))
1423 (add-after 'install 'install-documentation
1424 (lambda* (#:key outputs #:allow-other-keys)
1425 (let* ((out (assoc-ref outputs "out"))
1426 (doc (string-append out "/share/doc/" ,name)))
1428 (install-file "README.md" doc)
1432 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1433 (home-page (package-home-page zstd))
1434 (synopsis "Threaded implementation of the Zstandard compression algorithm")
1435 (description "Parallel Zstandard (PZstandard or @command{pzstd}) is a
1436 multi-threaded implementation of the @uref{http://zstd.net/, Zstandard
1437 compression algorithm}. It is fully compatible with the original Zstandard file
1438 format and command-line interface, and can be used as a drop-in replacement.
1440 Compression is distributed over multiple processor cores to improve performance,
1441 as is the decompression of data compressed in this manner. Data compressed by
1442 other implementations will only be decompressed by two threads: one performing
1443 the actual decompression, the other input and output.")
1444 (license (package-license zstd))))
1453 (uri (string-append "mirror://sourceforge/infozip"
1454 "/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz"))
1457 "0sb3h3067pzf3a7mlxn1hikpcjrsvycjcnj9hl9b1c3ykcgvps7h"))))
1458 (build-system gnu-build-system)
1459 (inputs `(("bzip2" ,bzip2)))
1461 `(#:tests? #f ; no test target
1462 #:make-flags (let ((out (assoc-ref %outputs "out")))
1463 (list "-f" "unix/Makefile"
1464 (string-append "prefix=" out)
1465 (string-append "MANDIR=" out "/share/man/man1")))
1467 (modify-phases %standard-phases
1469 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1470 (apply invoke "make" "generic_gcc" make-flags)))
1471 (delete 'configure))))
1472 (home-page "http://www.info-zip.org/Zip.html")
1473 (synopsis "Compression and file packing utility")
1475 "Zip is a compression and file packaging/archive utility. Zip is useful
1476 for packaging a set of files for distribution, for archiving files, and for
1477 saving disk space by temporarily compressing unused files or directories.
1478 Zip puts one or more compressed files into a single ZIP archive, along with
1479 information about the files (name, path, date, time of last modification,
1480 protection, and check information to verify file integrity). An entire
1481 directory structure can be packed into a ZIP archive with a single command.
1483 Zip has one compression method (deflation) and can also store files without
1484 compression. Zip automatically chooses the better of the two for each file.
1485 Compression ratios of 2:1 to 3:1 are common for text files.")
1486 (license (license:non-copyleft "file://LICENSE"
1487 "See LICENSE in the distribution."))))
1489 (define-public unzip
1490 (package (inherit zip)
1496 (uri (string-append "mirror://sourceforge/infozip"
1497 "/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz"))
1500 "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83"))
1501 (patches (search-patches "unzip-CVE-2014-8139.patch"
1502 "unzip-CVE-2014-8140.patch"
1503 "unzip-CVE-2014-8141.patch"
1504 "unzip-CVE-2014-9636.patch"
1505 "unzip-CVE-2015-7696.patch"
1506 "unzip-CVE-2015-7697.patch"
1507 "unzip-allow-greater-hostver-values.patch"
1508 "unzip-initialize-symlink-flag.patch"
1509 "unzip-remove-build-date.patch"
1510 "unzip-attribs-overflow.patch"
1511 "unzip-overflow-on-invalid-input.patch"
1512 "unzip-format-secure.patch"
1513 "unzip-overflow-long-fsize.patch"))))
1514 (build-system gnu-build-system)
1515 ;; no inputs; bzip2 is not supported, since not compiled with BZ_NO_STDIO
1517 `(#:phases (modify-phases %standard-phases
1519 (add-after 'unpack 'fortify
1521 ;; Mitigate CVE-2018-1000035, an exploitable buffer overflow.
1522 ;; This environment variable is recommended in 'unix/Makefile'
1523 ;; for passing flags to the C compiler.
1524 (setenv "LOCAL_UNZIP" "-D_FORTIFY_SOURCE=1")
1527 (lambda* (#:key make-flags #:allow-other-keys)
1528 (apply invoke "make"
1529 `("-j" ,(number->string
1530 (parallel-job-count))
1533 #:make-flags (list "-f" "unix/Makefile"
1534 (string-append "prefix=" %output)
1535 (string-append "MANDIR=" %output "/share/man/man1"))))
1536 (home-page "http://www.info-zip.org/UnZip.html")
1537 (synopsis "Decompression and file extraction utility")
1539 "UnZip is an extraction utility for archives compressed in .zip format,
1540 also called \"zipfiles\".
1542 UnZip lists, tests, or extracts files from a .zip archive. The default
1543 behaviour (with no options) is to extract into the current directory, and
1544 subdirectories below it, all files from the specified zipfile. UnZip
1545 recreates the stored directory structure by default.")
1546 (license (license:non-copyleft "file://LICENSE"
1547 "See LICENSE in the distribution."))))
1549 (define-public zziplib
1553 (replacement zziplib/fixed)
1554 (home-page "https://github.com/gdraheim/zziplib")
1557 (uri (git-reference (url home-page)
1558 (commit (string-append "v" version))))
1559 (file-name (git-file-name name version))
1562 "0fbk9k7ryas2wh2ykwkvm1pbi40i88rfvc3dydh9xyd7w2jcki92"))))
1563 (build-system gnu-build-system)
1565 `(#:phases (modify-phases %standard-phases
1566 (add-before 'check 'make-files-writable
1568 (for-each make-file-writable
1569 (find-files "test" #:directories? #t))
1572 ;; XXX: The default test target attempts to download external resources and
1573 ;; fails without error: <https://github.com/gdraheim/zziplib/issues/53>.
1574 ;; To prevent confusing log messages, just run a simple zip test that works.
1575 #:test-target "check-readme"))
1578 (native-inputs `(("perl" ,perl) ; for the documentation
1579 ("pkg-config" ,pkg-config)
1580 ;; for the documentation; Python 3 not supported,
1581 ;; http://forums.gentoo.org/viewtopic-t-863161-start-0.html
1582 ("python" ,python-2)
1583 ("zip" ,zip))) ; to create test files
1584 (synopsis "Library for accessing zip files")
1586 "ZZipLib is a library based on zlib for accessing zip files.")
1587 ;; zziplib is dual licensed under LGPL2.0+ and MPL1.1. Some example source
1588 ;; files carry the Zlib license; see "docs/copying.html" for details.
1589 (license (list license:lgpl2.0+ license:mpl1.1))))
1591 (define zziplib/fixed
1595 (inherit (package-source zziplib))
1596 (patches (search-patches "zziplib-CVE-2018-16548.patch"))))))
1598 (define-public libzip
1605 "https://libzip.org/download/libzip-" version ".tar.xz"))
1608 "0h9nsgkw0dk4srsvmz6xy6f9l4h815xn07j8h40l8gqvcxxaqpbh"))))
1612 `(("gnutls" ,gnutls)
1614 ("openssl" ,openssl)
1616 (build-system cmake-build-system)
1617 (home-page "https://libzip.org")
1618 (synopsis "C library for reading, creating, and modifying zip archives")
1619 (description "Libzip is a C library for reading, creating, and modifying
1620 zip archives. Files can be added from data buffers, files, or compressed data
1621 copied directly from other zip archives. Changes made without closing the
1622 archive can be reverted.")
1623 (license license:bsd-3)))
1625 (define-public atool
1632 (uri (string-append "http://savannah.nongnu.org/download/atool/atool-"
1636 "0fvhzip2v08jgnlfpyj6rapan39xlsl1ksgq4lp8gfsai2ah1xma"))))
1637 (build-system gnu-build-system)
1640 (modify-phases %standard-phases
1641 (add-after 'unpack 'embed-absolute-file-name
1642 (lambda* (#:key inputs #:allow-other-keys)
1643 (substitute* "atool"
1644 (("(^\\$::cfg_path_file.*= )'file'" _ pre)
1645 (string-append pre "'" (assoc-ref inputs "file")
1651 (home-page "https://www.nongnu.org/atool/")
1652 (synopsis "Universal tool to manage file archives of various types")
1653 (description "The main command is @command{aunpack} which extracts files
1654 from an archive. The other commands provided are @command{apack} (to create
1655 archives), @command{als} (to list files in archives), and @command{acat} (to
1656 extract files to standard out). As @command{atool} invokes external programs
1657 to handle the archives, not all commands may be supported for a certain type
1659 (license license:gpl2+)))
1661 (define-public lunzip
1668 (uri (string-append "mirror://savannah/lzip/lunzip/"
1669 "lunzip-" version ".tar.gz"))
1671 (base32 "19zq3gmlbia2krq4k4zs1j0xjdv7nsdzqvfb0pyca5n53h2mzb91"))))
1672 (build-system gnu-build-system)
1676 (home-page "https://www.nongnu.org/lzip/lunzip.html")
1677 (synopsis "Small, stand-alone lzip decompressor")
1679 "Lunzip is a decompressor for files in the lzip compression format (.lz),
1680 written as a single small C tool with no dependencies. This makes it
1681 well-suited to embedded and other systems without a C++ compiler, or for use in
1682 applications such as software installers that need only to decompress files,
1684 Lunzip is intended to be fully compatible with the regular lzip package.")
1685 (license (list license:bsd-2 ; carg_parser.[ch]
1686 license:gpl2+)))) ; everything else
1688 (define-public clzip
1695 (uri (string-append "mirror://savannah/lzip/clzip/"
1696 "clzip-" version ".tar.gz"))
1698 (base32 "1h14dmc9fi10gcdpdpbgq1bwvcxvivppilj64pf720x8mw915mfr"))))
1699 (build-system gnu-build-system)
1703 (home-page "https://www.nongnu.org/lzip/clzip.html")
1704 (synopsis "Small, stand-alone lzip compressor and decompressor")
1706 "Clzip is a compressor and decompressor for files in the lzip compression
1707 format (.lz), written as a single small C tool with no dependencies. This makes
1708 it well-suited to embedded and other systems without a C++ compiler, or for use
1709 in other applications like package managers.
1710 Clzip is intended to be fully compatible with the regular lzip package.")
1711 (license (list license:bsd-2 ; carg_parser.[ch], lzd in clzip.texi
1714 (define-public lzlib
1721 (uri (string-append "mirror://savannah/lzip/lzlib/"
1722 "lzlib-" version ".tar.gz"))
1724 (base32 "0djdj4sg33rzi4k84cygvnp09bfsv6i8wy2k7i67rayib63myp3c"))))
1725 (build-system gnu-build-system)
1729 "--enable-shared"))) ; only static (.a) is built by default
1730 (home-page "https://www.nongnu.org/lzip/lzlib.html")
1731 (synopsis "Lzip data compression C library")
1733 "Lzlib is a C library for in-memory LZMA compression and decompression in
1734 the lzip format. It supports integrity checking of the decompressed data, and
1735 all functions are thread-safe. The library should never crash, even in case of
1737 (license (list license:bsd-2 ; the library itself
1738 license:gpl2+)))) ; main.c (i.e. minilzip used by tests)
1740 (define-public plzip
1747 (uri (string-append "mirror://savannah/lzip/plzip/"
1748 "plzip-" version ".tar.gz"))
1750 (base32 "04indil809qgfmz776imb3dnhkysh7zk28jcv3mw0ahl2lyaxbzd"))))
1751 (build-system gnu-build-system)
1753 `(("lzlib" ,lzlib)))
1754 (home-page "https://www.nongnu.org/lzip/plzip.html")
1755 (synopsis "Parallel lossless data compressor for the lzip format")
1757 "Plzip is a massively parallel (multi-threaded) lossless data compressor
1758 and decompressor that uses the lzip file format (.lz). Files produced by plzip
1759 are fully compatible with lzip and can be rescued with lziprecover.
1760 On multiprocessor machines, plzip can compress and decompress large files much
1761 faster than lzip, at the cost of a slightly reduced compression ratio (0.4% to
1762 2%). The number of usable threads is limited by file size: on files of only a
1763 few MiB, plzip is no faster than lzip.
1764 Files that were compressed with regular lzip will also not be decompressed
1765 faster by plzip, unless the @code{-b} option was used: lzip usually produces
1766 single-member files which can't be decompressed in parallel.")
1767 (license (list license:bsd-2 ; arg_parser.{cc,h}
1768 license:gpl2+)))) ; everything else
1770 (define-public innoextract
1772 (name "innoextract")
1777 (uri (string-append "https://github.com/dscharrer/innoextract/releases"
1778 "/download/" version
1779 "/innoextract-" version ".tar.gz"))
1782 "0saj50n8ds85shygy4mq1h6s99510r9wgjjdll4dmvhra4lzcy2y"))))
1783 (build-system cmake-build-system)
1786 #:phases (modify-phases %standard-phases
1787 (add-before 'configure 'glibc-is-already-a-system-library
1789 ;; Prevent the build system from passing the glibc
1790 ;; header files to GCC as "system headers", because
1791 ;; it conflicts with the system headers already known
1792 ;; to GCC, causing #include_next failures.
1793 (substitute* "CMakeLists.txt"
1794 (("include_directories\\(SYSTEM \\$\\{iconv")
1795 "include_directories(${iconv"))
1797 (inputs `(("boost" ,boost)
1798 ("libiconv" ,libiconv)
1800 (native-inputs `(("pkg-config" ,pkg-config)))
1801 (home-page "https://constexpr.org/innoextract/")
1802 (synopsis "Tool for extracting Inno Setup installers")
1803 (description "innoextract allows extracting Inno Setup installers under
1804 non-Windows systems without running the actual installer using wine.")
1805 (license license:zlib)))
1807 (define-public google-brotli
1809 (name "google-brotli")
1815 (url "https://github.com/google/brotli.git")
1816 (commit (string-append "v" version))))
1817 (file-name (git-file-name name version))
1819 (base32 "1811b55wdfg4kbsjcgh1kc938g118jpvif97ilgrmbls25dfpvvw"))))
1820 (build-system cmake-build-system)
1823 (modify-phases %standard-phases
1824 (add-after 'install 'rename-static-libraries
1825 ;; The build tools put a 'static' suffix on the static libraries, but
1826 ;; other applications don't know how to find these.
1827 (lambda* (#:key outputs #:allow-other-keys)
1828 (let ((lib (string-append (assoc-ref %outputs "out") "/lib/")))
1829 (rename-file (string-append lib "libbrotlicommon-static.a")
1830 (string-append lib "libbrotlicommon.a"))
1831 (rename-file (string-append lib "libbrotlidec-static.a")
1832 (string-append lib "libbrotlidec.a"))
1833 (rename-file (string-append lib "libbrotlienc-static.a")
1834 (string-append lib "libbrotlienc.a"))
1837 (list ;; Defaults to "lib64" on 64-bit archs.
1838 (string-append "-DCMAKE_INSTALL_LIBDIR="
1839 (assoc-ref %outputs "out") "/lib"))))
1840 (home-page "https://github.com/google/brotli")
1841 (synopsis "General-purpose lossless compression")
1842 (description "This package provides the reference implementation of Brotli,
1843 a generic-purpose lossless compression algorithm that compresses data using a
1844 combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd
1845 order context modeling, with a compression ratio comparable to the best
1846 currently available general-purpose compression methods. It is similar in speed
1847 with @code{deflate} but offers more dense compression.
1849 The specification of the Brotli Compressed Data Format is defined in RFC 7932.")
1850 (license license:expat)))
1852 (define-public brotli
1853 ;; We used to provide an older version under the name "brotli".
1854 (deprecated-package "brotli" google-brotli))
1856 (define-public python-google-brotli
1858 (inherit google-brotli)
1859 (name "python-google-brotli")
1860 (build-system python-build-system)
1862 (synopsis "Python interface to google-brotli")
1863 (description "@code{python-google-brotli} provides a Python interface to
1864 @code{google-brotli}, an implementation of the Brotli lossless compression
1873 (uri (string-append "https://www.oberhumer.com/opensource/"
1874 name "/download/" name "-" version ".tar.gz"))
1877 "0j036lkwsxvm15gr29n8wn07cqq79dswjs9k54939ms5zngjjrdq"))))
1878 (build-system gnu-build-system)
1880 `(;; UCL 1.03 fails to build with newer C standards.
1881 #:configure-flags '("CFLAGS=-std=gnu90"
1882 "--enable-shared" "--disable-static")))
1883 (home-page "https://www.oberhumer.com/opensource/ucl/")
1884 (synopsis "Portable lossless data compression library")
1885 (description "UCL implements a number of compression algorithms that
1886 achieve an excellent compression ratio while allowing fast decompression.
1887 Decompression requires no additional memory.
1889 Compared to LZO, the UCL algorithms achieve a better compression ratio but
1890 decompression is a little bit slower.")
1891 (license license:gpl2+)))
1899 (uri (string-append "https://github.com/upx/upx/releases/download/v"
1900 version "/upx-" version "-src.tar.xz"))
1903 "051pk5jk8fcfg5mpgzj43z5p4cn7jy5jbyshyn78dwjqr7slsxs7"))))
1904 (build-system gnu-build-system)
1914 (modify-phases %standard-phases
1915 (delete 'configure) ; no configure script
1916 (delete 'check) ; no test suite
1917 (add-before 'build 'patch-exec-bin-sh
1919 (substitute* (list "Makefile"
1921 (("/bin/sh") (which "sh")))
1924 (lambda* (#:key outputs #:allow-other-keys)
1925 (let* ((out (assoc-ref outputs "out"))
1926 (bin (string-append out "/bin")))
1928 (copy-file "src/upx.out" (string-append bin "/upx")))
1930 (home-page "https://upx.github.io/")
1931 (synopsis "Compression tool for executables")
1933 "The Ultimate Packer for eXecutables (UPX) is an executable file
1934 compressor. UPX typically reduces the file size of programs and shared
1935 libraries by around 50%--70%, thus reducing disk space, network load times,
1936 download times, and other distribution and storage costs.")
1937 (license license:gpl2+)))
1939 (define-public quazip
1946 (url "https://github.com/stachenov/quazip.git")
1947 (commit (string-append "v" version))))
1948 (file-name (git-file-name name version))
1951 "1g473gnsbkvxpsv8lbsmhspn7jnq86b05zzgqh11r581v8ndvz5s"))))
1952 (build-system cmake-build-system)
1954 `(#:tests? #f)) ;no test
1956 `(("doxygen" ,doxygen)))
1958 `(("qtbase" ,qtbase)
1960 (home-page "https://stachenov.github.io/quazip/index.html")
1961 (synopsis "Qt/C++ wrapper for Minizip")
1962 (description "QuaZIP is a simple C++ wrapper over Gilles Vollant's
1963 ZIP/UNZIP package that can be used to access ZIP archives. It uses
1964 Trolltech's Qt toolkit.
1966 QuaZIP allows you to access files inside ZIP archives using QIODevice
1967 API, and that means that you can also use QTextStream, QDataStream or
1968 whatever you would like to use on your zipped files.
1970 QuaZIP provides complete abstraction of the ZIP/UNZIP API, for both
1971 reading from and writing to ZIP archives. ")
1972 ;; Project is distributed under LGPL, but "quazip/z*" "quazip/unzip.*" are
1973 ;; distributed under zlib terms.
1974 (license (list license:lgpl2.1+ license:zlib))))
1976 (define-public zutils
1979 ;; Check and remove the lint-hidden-cve property when updating.
1984 (uri (string-append "mirror://savannah/zutils/zutils-" version ".tar.lz"))
1986 (base32 "0dx35mv78fgqgz6sszs05ng8ipz2xy09ry9vpmka2rmy08b7x907"))))
1987 (build-system gnu-build-system)
1990 (list "--sysconfdir=/etc")
1992 (modify-phases %standard-phases
1994 (lambda* (#:key make-flags outputs #:allow-other-keys)
1995 (apply invoke "make" "install"
1996 (string-append "sysconfdir=" (assoc-ref outputs "out")
2000 ;; Needed to extract the source tarball and run the test suite.
2002 (properties `((lint-hidden-cve . ("CVE-2018-1000637"))))
2003 (home-page "https://www.nongnu.org/zutils/zutils.html")
2004 (synopsis "Utilities that transparently operate on compressed files")
2006 "Zutils is a collection of utilities able to process any combination of
2007 compressed and uncompressed files transparently. If any given file, including
2008 standard input, is compressed, its decompressed content is used instead.
2010 @command{zcat}, @command{zcmp}, @command{zdiff}, and @command{zgrep} are
2011 improved replacements for the shell scripts provided by GNU gzip.
2012 @command{ztest} tests the integrity of supported compressed files.
2013 @command{zupdate} recompresses files with lzip, similar to gzip's
2016 Supported compression formats are bzip2, gzip, lzip, and xz. Zutils uses
2017 external compressors: the compressor to be used for each format is configurable
2018 at run time, and must be installed separately.")
2019 (license (list license:bsd-2 ; arg_parser.{cc,h}
2020 license:gpl2+)))) ; the rest
2022 (define-public makeself-safeextract
2023 (let ((commit "1a95e121fa8e3c02d307ae37b9b7834e616c3683"))
2025 (name "makeself-safeextract")
2026 (version (git-version "0.0.0" "1" commit))
2027 (home-page "https://github.com/ssokolow/makeself_safeextract")
2034 (file-name (git-file-name name version))
2037 "1anlinaj9lvfi8bn00wp11vzqq0f9sig4fm9yrspisx31v0z4a2c"))))
2038 (build-system trivial-build-system)
2040 `(("python" ,python-2)
2044 `(#:modules ((guix build utils))
2047 (use-modules (guix build utils))
2048 (let* ((name "makeself_safeextract")
2049 (source (string-append (assoc-ref %build-inputs "source")
2051 (bin (string-append (assoc-ref %outputs "out") "/bin"))
2052 (target (string-append bin "/" name))
2053 (python (string-append (assoc-ref %build-inputs "python") "/bin"))
2054 (7z (string-append (assoc-ref %build-inputs "p7zip") "/bin/7z"))
2055 (unzip (string-append (assoc-ref %build-inputs "unzip") "/bin/unzip")))
2056 (setenv "PATH" (string-append (getenv "PATH") ":" python))
2058 (copy-file source target)
2060 (("'7z'") (format #f "'~a'" 7z))
2061 (("'unzip'") (format #f "'~a'" unzip)))
2062 (patch-shebang target)))))
2063 (synopsis "Extract makeself and mojo archives without running untrusted code")
2064 (description "This package provides a script to unpack self-extracting
2065 archives generated by @command{makeself} or @command{mojo} without running the
2066 possibly untrusted extraction shell script.")
2067 (license license:gpl3+))))
2069 (define-public ncompress
2076 (url "https://github.com/vapier/ncompress")
2077 (commit (string-append "v" version))))
2078 (patches (search-patches "ncompress-fix-softlinks.patch"))
2079 (file-name (string-append name "-" version ".tar.gz"))
2082 "1a4yir1ilafz0nzxdwigj204j4yy2zljbc501nsaqqm3dxdap8zn"))))
2084 '(#:make-flags (list "CC=gcc"
2085 (string-append "BINDIR=" %output "/bin")
2086 (string-append "MANDIR=" %output "/share/man/man1"))
2087 #:phases (modify-phases %standard-phases
2088 (delete 'configure))))
2089 (build-system gnu-build-system)
2090 (home-page "https://github.com/vapier/ncompress/")
2091 (synopsis "Original Lempel-Ziv compress/uncompress programs")
2092 (description "(N)compress provides the original compress and uncompress
2093 programs that used to be the de facto UNIX standard for compressing and
2094 uncompressing files. These programs implement a fast, simple Lempel-Ziv (LZW)
2095 file compression algorithm.")
2096 (license license:gpl2+)))