1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2017, 2019, 2020 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, 2020 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, 2020, 2021 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–2021 Tobias Geerinckx-Rice <me@tobias.gr>
14 ;;; Copyright © 2016 David Craven <david@craven.ch>
15 ;;; Copyright © 2016, 2019, 2020 Kei Kebreau <kkebreau@posteo.net>
16 ;;; Copyright © 2016, 2018, 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
17 ;;; Copyright © 2017 Nikita <nikita@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>
30 ;;; Copyright © 2020, 2021 Lars-Dominik Braun <lars@6xq.net>
31 ;;; Copyright © 2020 Guillaume Le Vaillant <glv@posteo.net>
32 ;;; Copyright © 2020 Léo Le Bouter <lle-bout@zaclys.net>
33 ;;; Copyright © 2021 Antoine Côté <antoine.cote@posteo.net>
34 ;;; Copyright © 2021 Vincent Legoll <vincent.legoll@gmail.com>
36 ;;; This file is part of GNU Guix.
38 ;;; GNU Guix is free software; you can redistribute it and/or modify it
39 ;;; under the terms of the GNU General Public License as published by
40 ;;; the Free Software Foundation; either version 3 of the License, or (at
41 ;;; your option) any later version.
43 ;;; GNU Guix is distributed in the hope that it will be useful, but
44 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
45 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46 ;;; GNU General Public License for more details.
48 ;;; You should have received a copy of the GNU General Public License
49 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
51 (define-module (gnu packages compression)
52 #:use-module ((guix licenses) #:prefix license:)
53 #:use-module (guix utils)
54 #:use-module (guix packages)
55 #:use-module (guix download)
56 #:use-module (guix git-download)
57 #:use-module (guix build-system cmake)
58 #:use-module (guix build-system glib-or-gtk)
59 #:use-module (guix build-system gnu)
60 #:use-module (guix build-system go)
61 #:use-module (guix build-system meson)
62 #:use-module (guix build-system python)
63 #:use-module (guix build-system trivial)
64 #:use-module (gnu packages)
65 #:use-module (gnu packages assembly)
66 #:use-module (gnu packages autotools)
67 #:use-module (gnu packages backup)
68 #:use-module (gnu packages base)
69 #:use-module (gnu packages benchmark)
70 #:use-module (gnu packages boost)
71 #:use-module (gnu packages check)
72 #:use-module (gnu packages curl)
73 #:use-module (gnu packages documentation)
74 #:use-module (gnu packages file)
75 #:use-module (gnu packages gettext)
76 #:use-module (gnu packages glib)
77 #:use-module (gnu packages gnome)
78 #:use-module (gnu packages gnupg)
79 #:use-module (gnu packages gtk)
80 #:use-module (gnu packages man)
81 #:use-module (gnu packages maths)
82 #:use-module (gnu packages perl)
83 #:use-module (gnu packages pkg-config)
84 #:use-module (gnu packages python)
85 #:use-module (gnu packages qt)
86 #:use-module (gnu packages tls)
87 #:use-module (gnu packages valgrind)
88 #:use-module (gnu packages version-control)
89 #:use-module (gnu packages xml)
90 #:use-module (ice-9 match)
91 #:use-module (srfi srfi-1))
100 (uri (list (string-append "http://zlib.net/zlib-"
102 (string-append "mirror://sourceforge/libpng/zlib/"
103 version "/zlib-" version ".tar.gz")))
106 "18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3"))))
107 (build-system gnu-build-system)
108 (outputs '("out" "static"))
111 (modify-phases %standard-phases
113 (lambda* (#:key outputs #:allow-other-keys)
114 ;; Zlib's home-made `configure' fails when passed
115 ;; extra flags like `--enable-fast-install', so we need to
116 ;; invoke it with just what it understand.
117 (let ((out (assoc-ref outputs "out")))
118 ;; 'configure' doesn't understand '--host'.
119 ,@(if (%current-target-system)
120 `((setenv "CHOST" ,(%current-target-system)))
122 (invoke "./configure"
123 (string-append "--prefix=" out)))))
124 (add-after 'install 'move-static-library
125 (lambda* (#:key outputs #:allow-other-keys)
126 (let ((out (assoc-ref outputs "out"))
127 (static (assoc-ref outputs "static")))
128 (with-directory-excursion (string-append out "/lib")
129 (install-file "libz.a" (string-append static "/lib"))
130 (delete-file "libz.a")
132 (home-page "https://zlib.net/")
133 (synopsis "Compression library")
135 "zlib is designed to be a free, general-purpose, legally unencumbered --
136 that is, not covered by any patents -- lossless data-compression library for
137 use on virtually any computer hardware and operating system. The zlib data
138 format is itself portable across platforms. Unlike the LZW compression method
139 used in Unix compress(1) and in the GIF image format, the compression method
140 currently used in zlib essentially never expands the data. (LZW can double or
141 triple the file size in extreme cases.) zlib's memory footprint is also
142 independent of the input data and can be reduced, if necessary, at some cost
144 (license license:zlib)))
146 (define-public minizip
149 (version (package-version zlib))
150 (source (package-source zlib))
151 (build-system gnu-build-system)
154 (modify-phases %standard-phases
155 (add-after 'unpack 'enter-source
156 (lambda _ (chdir "contrib/minizip") #t))
157 (add-after 'install 'remove-crypt-h
158 (lambda* (#:key outputs #:allow-other-keys)
159 ;; Remove <minizip/crypt.h> because it interferes with libc's
160 ;; <crypt.h> given that 'minizip.pc' says "-I…/include/minizip".
161 ;; Fedora does the same:
162 ;; <https://src.fedoraproject.org/rpms/zlib/c/4d2785ec3116947872f6f32dc4104e6d36d8a7a4?branch=master>.
163 (let ((out (assoc-ref outputs "out")))
164 (delete-file (string-append out "/include/minizip/crypt.h"))
167 `(("autoconf" ,autoconf)
168 ("automake" ,automake)
169 ("libtool" ,libtool)))
170 (propagated-inputs `(("zlib" ,zlib)))
171 (home-page (package-home-page zlib))
172 (synopsis "Zip Compression library")
174 "Minizip is a minimalistic library that supports compressing,
175 extracting and viewing ZIP archives. This version is extracted from
176 the @code{zlib} source.")
177 (license (package-license zlib))))
179 (define-public fastjar
185 (uri (string-append "mirror://savannah/fastjar/fastjar-"
189 "0iginbz2m15hcsa3x4y7v3mhk54gr1r7m3ghx0pg4n46vv2snmpi"))))
190 (build-system gnu-build-system)
191 (inputs `(("zlib" ,zlib)))
192 (home-page "https://savannah.nongnu.org/projects/fastjar")
193 (synopsis "Replacement for Sun's 'jar' utility")
195 "FastJar is an attempt to create a much faster replacement for Sun's
196 @code{jar} utility. Instead of being written in Java, FastJar is written in C.")
197 (license license:gpl2+)))
199 (define-public libtar
207 "ftp://ftp.feep.net/pub/software/libtar/libtar-"
210 "mirror://debian/pool/main/libt/libtar/libtar_"
211 version ".orig.tar.gz")))
214 "02cihzl77ia0dcz7z2cga2412vyhhs5pa2355q4wpwbyga2lrwjh"))
215 (patches (search-patches "libtar-CVE-2013-4420.patch"))))
216 (build-system gnu-build-system)
217 (arguments `(#:tests? #f)) ; no "check" target
219 `(("autoconf" ,autoconf)
220 ("automake" ,automake)
221 ("libtool" ,libtool)))
224 (synopsis "C library for manipulating POSIX tar files")
226 "libtar is a C library for manipulating POSIX tar files. It handles
227 adding and extracting files to/from a tar archive.")
228 (home-page "https://repo.or.cz/libtar.git")
229 (license license:bsd-3)))
237 (uri (string-append "mirror://gnu/gzip/gzip-"
241 "1h6p374d3j8d4cdfydzls021xa2yby8myc0h8d6m8bc7k6ncq9c4"))))
242 (build-system gnu-build-system)
243 (synopsis "General file (de)compression (using lzw)")
245 ;; FIXME: The test suite wants `less', and optionally Perl.
248 (modify-phases %standard-phases
249 (add-after 'unpack 'patch-for-glibc-2.28
251 ;; Adjust the bundled gnulib to work with glibc 2.28. See e.g.
252 ;; "m4-gnulib-libio.patch". This is a phase rather than patch
253 ;; or snippet to work around <https://bugs.gnu.org/32347>.
254 (substitute* (find-files "lib" "\\.c$")
255 (("#if defined _IO_ftrylockfile")
256 "#if defined _IO_EOF_SEEN"))
257 (substitute* "lib/stdio-impl.h"
258 (("^/\\* BSD stdio derived implementations")
259 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
260 "# define _IO_IN_BACKUP 0x100\n"
262 "/* BSD stdio derived implementations")))
264 (add-after 'unpack 'use-absolute-name-of-gzip
265 (lambda* (#:key outputs #:allow-other-keys)
266 (substitute* "gunzip.in"
268 (string-append "exec " (assoc-ref outputs "out")
272 "GNU Gzip provides data compression and decompression utilities; the
273 typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
274 file; as a result, it is often used in conjunction with \"tar\", resulting in
275 \".tar.gz\" or \".tgz\", etc.")
276 (license license:gpl3+)
277 (home-page "https://www.gnu.org/software/gzip/")))
285 (uri (string-append "https://sourceware.org/pub/bzip2/bzip2-"
289 "0s92986cv0p692icqlw1j42y9nld8zd83qwhzbqd61p1dqbh6nmb"))))
290 (build-system gnu-build-system)
292 `(#:modules ((guix build gnu-build-system)
297 (modify-phases %standard-phases
298 (add-after 'set-paths 'hide-input-bzip2
299 (lambda* (#:key inputs #:allow-other-keys)
300 (let ((bzip2 (assoc-ref inputs "bzip2")))
302 ;; Prevent the build system from retaining a reference to
303 ;; BZIP2 from INPUTS.
305 (setenv "LIBRARY_PATH"
306 (string-join (delete (string-append bzip2 "/lib")
307 (string-split (getenv "LIBRARY_PATH")
310 (format #t "environment variable `LIBRARY_PATH' set to `~a'~%"
311 (getenv "LIBRARY_PATH")))
312 (format #t "no bzip2 found, nothing done~%"))
315 (lambda* (#:key target #:allow-other-keys)
316 (when ,(%current-target-system)
317 ;; Cross-compilation: use the cross tools.
318 (substitute* (find-files "." "Makefile")
320 (string-append "CC = " target "-gcc\n"))
322 (string-append "AR = " target "-ar\n"))
324 (string-append "RANLIB = " target "-ranlib\n"))
325 (("^all:(.*)test" _ prerequisites)
326 ;; Remove 'all' -> 'test' dependency.
327 (string-append "all:" prerequisites "\n"))))
329 (add-before 'build 'build-shared-lib
330 (lambda* (#:key inputs #:allow-other-keys)
331 (patch-makefile-SHELL "Makefile-libbz2_so")
332 (invoke "make" "-f" "Makefile-libbz2_so")))
333 (add-after 'install 'install-shared-lib
334 (lambda* (#:key outputs #:allow-other-keys)
335 ;; The Makefile above does not have an 'install' target, nor does
336 ;; it create all the (un)versioned symlinks, so we handle it here.
337 (let* ((out (assoc-ref outputs "out"))
338 (libdir (string-append out "/lib"))
340 ;; Locate the built library (e.g. "libbz2.so.1.0.6").
341 (lib (car (scandir "."
343 (and (string-prefix? soname file)
345 (stat:type (lstat file))))))))
346 (soversion (string-drop lib (+ 1 (string-length soname)))))
347 (install-file lib libdir)
348 (with-directory-excursion libdir
349 ;; Create symlinks libbz2.so.1 -> libbz2.so.1.0, etc.
350 (let loop ((base soname)
351 (numbers (string-split soversion #\.)))
352 (unless (null? numbers)
353 (let ((so-file (string-append base "." (car numbers))))
354 (symlink so-file base)
355 (loop so-file (cdr numbers))))))
357 (add-after 'install-shared-lib 'move-static-lib
358 (lambda* (#:key outputs #:allow-other-keys)
359 (let ((out (assoc-ref outputs "out"))
360 (static (assoc-ref outputs "static")))
361 (with-directory-excursion (string-append out "/lib")
362 (install-file "libbz2.a" (string-append static "/lib"))
363 (delete-file "libbz2.a")
365 (add-after 'install-shared-lib 'patch-scripts
366 (lambda* (#:key outputs inputs #:allow-other-keys)
367 (let* ((out (assoc-ref outputs "out")))
368 (substitute* (string-append out "/bin/bzdiff")
372 #:make-flags (list (string-append "PREFIX="
373 (assoc-ref %outputs "out")))
375 ;; Don't attempt to run the tests when cross-compiling.
376 ,@(if (%current-target-system)
379 (outputs '("out" "static"))
380 (synopsis "High-quality data compression program")
382 "bzip2 is a freely available, patent free (see below), high-quality data
383 compressor. It typically compresses files to within 10% to 15% of the best
384 available techniques (the PPM family of statistical compressors), whilst
385 being around twice as fast at compression and six times faster at
387 (license (license:non-copyleft "file://LICENSE"
388 "See LICENSE in the distribution."))
389 (home-page "https://web.archive.org/web/20180801004107/http://www.bzip.org/")))
391 (define-public lbzip2
392 ;; The last 2.5 release is 4 years behind the newest commit (from 2018) and
393 ;; may create files that can't even be decompressed by newer bzip2 versions.
394 (let ((commit "b6dc48a7b9bfe6b340ed1f6d72133608ad57144b")
398 (version (git-version "2.5" revision commit))
403 (url "https://github.com/kjn/lbzip2")
406 (base32 "140xp00dmjsr6c3dwb4dwf0pzlgf159igri321inbinsjiclkngy"))
407 (file-name (git-file-name name version))))
408 (build-system gnu-build-system)
411 (modify-phases %standard-phases
412 (add-after 'unpack 'unpack-gnulib
413 (lambda* (#:key inputs #:allow-other-keys)
414 (let ((gnulib (assoc-ref inputs "gnulib")))
415 (copy-recursively gnulib "lib")
416 (setenv "PATH" (string-append "lib:" (getenv "PATH")))
418 (delete 'bootstrap) ; gnulib still has unpatched shebangs
419 (add-after 'patch-source-shebangs 'bootstrap
421 (invoke "sh" "build-aux/autogen.sh")
424 `(("autoconf" ,autoconf)
425 ("automake" ,automake)
427 ,(let ((commit "2d431ac35c4943a3655c07ba91870d2323321b43"))
431 (url "git://git.savannah.gnu.org/gnulib.git")
434 (base32 "1f0xr4w89bqvhzsfcflcagdixidrk41k00k7kpr91w9lazfis4kf"))
435 (file-name (git-file-name "gnulib" commit)))))
437 (synopsis "Parallel bzip2 compression utility")
439 "lbzip2 is a multi-threaded compression utility with support for the
440 bzip2 compressed file format. lbzip2 can process standard bz2 files in
441 parallel. It uses POSIX threading model (pthreads), which allows it to take
442 full advantage of symmetric multiprocessing (SMP) systems. It has been proven
443 to scale linearly, even to over one hundred processor cores. lbzip2 is fully
444 compatible with bzip2 – both at file format and command line level.")
445 ;; lbzip2.org now looks fishy. There is no source code to be found.
446 ;; Reported upstream: <https://github.com/kjn/lbzip2/issues/26>.
447 (home-page "https://github.com/kjn/lbzip2")
448 (license license:gpl3+))))
450 (define-public pbzip2
456 (uri (string-append "https://launchpad.net/pbzip2/"
457 (version-major+minor version) "/" version
458 "/+download/" name "-" version ".tar.gz"))
461 "1rnvgcdixjzbrmcr1nv9b6ccrjfrhryaj7jwz28yxxv6lam3xlcg"))))
462 (build-system gnu-build-system)
466 `(#:tests? #f ; no tests
467 #:phases (modify-phases %standard-phases
468 (delete 'configure)) ; no configure script
469 #:make-flags (list (string-append "PREFIX=" %output))))
470 (home-page (string-append "https://web.archive.org/web/20180412020219/"
471 "http://compression.ca/pbzip2/"))
472 (synopsis "Parallel bzip2 implementation")
474 "Pbzip2 is a parallel implementation of the bzip2 block-sorting file
475 compressor that uses pthreads and achieves near-linear speedup on SMP machines.
476 The output of this version is fully compatible with bzip2 v1.0.2 (i.e. anything
477 compressed with pbzip2 can be decompressed with bzip2).")
478 (license (license:non-copyleft "file://COPYING"
479 "See COPYING in the distribution."))))
487 (uri (list (string-append "http://tukaani.org/xz/xz-" version
489 (string-append "http://multiprecision.org/guix/xz-"
493 "0ibi2zsfaz6l756spjwc5rayf4ckgc9hwmy8qinppcyk4svz64mm"))))
494 (build-system gnu-build-system)
497 (modify-phases %standard-phases
498 (add-after 'install 'move-static-lib
499 (lambda* (#:key outputs #:allow-other-keys)
500 (let ((out (assoc-ref outputs "out"))
501 (static (assoc-ref outputs "static")))
502 (mkdir-p (string-append static "/lib"))
503 (rename-file (string-append out "/lib/liblzma.a")
504 (string-append static "/lib/liblzma.a"))
505 ;; Remove reference to the static library from the .la file
506 ;; so Libtool does the right thing when both the shared and
507 ;; static library is available.
508 (substitute* (string-append out "/lib/liblzma.la")
509 (("^old_library='liblzma.a'") "old_library=''"))
511 (outputs '("out" "static"))
512 (synopsis "General-purpose data compression")
514 "XZ Utils is free general-purpose data compression software with high
515 compression ratio. XZ Utils were written for POSIX-like systems, but also
516 work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
518 The core of the XZ Utils compression code is based on LZMA SDK, but it has
519 been modified quite a lot to be suitable for XZ Utils. The primary
520 compression algorithm is currently LZMA2, which is used inside the .xz
521 container format. With typical files, XZ Utils create 30 % smaller output
522 than gzip and 15 % smaller output than bzip2.")
523 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
524 (home-page "https://tukaani.org/xz/")))
533 "https://github.com/fragglet/lhasa/releases/download/v"
534 version "/lhasa-" version ".tar.gz"))
537 "092zi9av18ma20c6h9448k0bapvx2plnp292741dvfd9hmgqxc1z"))))
538 (build-system gnu-build-system)
541 (modify-phases %standard-phases
542 (add-before 'check 'set-up-test-environment
543 (lambda* (#:key inputs #:allow-other-keys)
544 (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata")
548 `(("tzdata" ,tzdata-for-tests)))
549 (home-page "https://fragglet.github.com/lhasa/")
550 (synopsis "LHA archive decompressor")
551 (description "Lhasa is a replacement for the Unix LHA tool, for
552 decompressing .lzh (LHA / LHarc) and .lzs (LArc) archives. The backend for the
553 tool is a library, so that it can be reused for other purposes. Lhasa aims to
554 be compatible with as many types of lzh/lzs archives as possible. It also aims
555 to generate the same output as the (non-free) Unix LHA tool, so that it will
556 act as a free drop-in replacement.")
557 (license license:isc)))
566 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
570 "0wm04519pd3g8hqpjqhfr72q8qmbiwqaxcs3cndny9h86aa95y60"))))
571 (build-system gnu-build-system)
572 (arguments '(#:configure-flags '("--enable-shared")))
573 (home-page "http://www.oberhumer.com/opensource/lzo")
575 "Data compression library suitable for real-time data de-/compression")
577 "LZO is a data compression library which is suitable for data
578 de-/compression in real-time. This means it favours speed over
581 LZO is written in ANSI C. Both the source code and the compressed data
582 format are designed to be portable across platforms.")
583 (license license:gpl2+)))
592 (uri (string-append "http://www.lzop.org/download/lzop-"
596 "0h9gb8q7y54m9mvy3jvsmxf21yx8fc3ylzh418hgbbv0i8mbcwky"))))
597 (build-system gnu-build-system)
598 (inputs `(("lzo" ,lzo)))
599 (home-page "https://www.lzop.org/")
600 (synopsis "Compress or expand files")
602 "Lzop is a file compressor which is very similar to gzip. Lzop uses the
603 LZO data compression library for compression services, and its main advantages
604 over gzip are much higher compression and decompression speed (at the cost of
605 some compression ratio).")
606 (license license:gpl2+)))
614 (uri (string-append "mirror://savannah/lzip/lzip-"
618 "12qdcw5k1cx77brv9yxi1h4dzwibhfmdpigrj43nfk8nscwm12z4"))))
619 (build-system gnu-build-system)
620 (home-page "https://www.nongnu.org/lzip/lzip.html")
621 (synopsis "Lossless data compressor based on the LZMA algorithm")
623 "Lzip is a lossless data compressor with a user interface similar to the
624 one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
625 more than bzip2, which makes it well-suited for software distribution and data
626 archiving. Lzip is a clean implementation of the LZMA algorithm.")
627 (license license:gpl3+)))
629 (define-public lziprecover
635 (uri (string-append "mirror://savannah/lzip/lziprecover/"
636 "lziprecover-" version ".tar.gz"))
639 "0qh8dnhr5rly2k9dnx43qqynqwqzi5kfb15pyd29qwppfl4qm5gx"))))
640 (build-system gnu-build-system)
641 (home-page "https://www.nongnu.org/lzip/lziprecover.html")
642 (synopsis "Recover and decompress data from damaged lzip files")
644 "Lziprecover is a data recovery tool and decompressor for files in the lzip
645 compressed data format (.lz). It can test the integrity of lzip files, extract
646 data from damaged ones, and repair most files with small errors (up to one
647 single-byte error per member) entirely.
649 Lziprecover is not a replacement for regular backups, but a last line of defence
650 when even the backups are corrupt. It can recover files by merging the good
651 parts of two or more damaged copies, such as can be easily produced by running
652 @command{ddrescue} on a failing device.
654 This package also includes @command{unzcrash}, a tool to test the robustness of
655 decompressors when faced with corrupted input.")
656 (license (list license:bsd-2 ; arg_parser.{cc,h}
657 license:gpl2+)))) ; everything else
659 (define-public sharutils
666 (uri (string-append "mirror://gnu/sharutils/sharutils-"
668 (patches (search-patches "sharutils-CVE-2018-1000097.patch"))
671 "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))
672 (modules '((guix build utils)))
675 ;; Adjust for newer libc versions.
676 (substitute* (find-files "lib" "\\.c$")
677 (("#if defined _IO_ftrylockfile")
678 "#if defined _IO_EOF_SEEN"))
679 (substitute* "lib/stdio-impl.h"
680 (("^/\\* BSD stdio derived implementations")
681 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
682 "# define _IO_IN_BACKUP 0x100\n"
684 "/* BSD stdio derived implementations")))
685 ;; ... and for newer GCC with -fno-common.
686 (substitute* '("src/shar-opts.h"
688 "src/uudecode-opts.h"
689 "src/uuencode-opts.h")
690 (("char const \\* const program_name" all)
691 (string-append "extern " all)))))))
692 (build-system gnu-build-system)
697 (modify-phases %standard-phases
698 (add-after 'patch-source-shebangs 'unpatch-source-shebang
699 ;; revert the patch-shebang phase on a script which is
702 (substitute* "tests/shar-1.ok"
703 (((which "sh")) "/bin/sh")))))))
704 (home-page "https://www.gnu.org/software/sharutils/")
705 (synopsis "Archives in shell scripts, uuencode/uudecode")
707 "GNU sharutils is a package for creating and manipulating shell
708 archives that can be readily emailed. A shell archive is a file that can be
709 processed by a Bourne-type shell to unpack the original collection of files.
710 This package is mostly for compatibility and historical interest.")
711 (license license:gpl3+)))
713 (define-public sfarklib
720 (url "https://github.com/raboof/sfArkLib")
722 (file-name (git-file-name name version))
725 "0jrxy24gak7q5ml06p5jjgzk9i5r2mkfjk4ycirkp4kg7k5a237w"))))
726 (build-system gnu-build-system)
728 `(#:tests? #f ;no "check" target
730 (modify-phases %standard-phases
732 (lambda* (#:key outputs #:allow-other-keys)
733 (substitute* "Makefile"
734 (("/usr/local") (assoc-ref outputs "out")))
738 (home-page "https://github.com/raboof/sfArkLib")
739 (synopsis "Library for SoundFont decompression")
741 "SfArkLib is a C++ library for decompressing SoundFont files compressed
742 with the sfArk algorithm.")
743 (license license:gpl3+)))
745 (define-public sfarkxtc
746 (let ((commit "13cd6f93725a90d91ec5ea75babf1dbd694ac463")
750 (version (git-version "0" revision commit))
752 ;; There are no release tarballs, so we just fetch the latest
753 ;; commit at this time.
756 (url "https://github.com/raboof/sfarkxtc")
758 (file-name (git-file-name name version))
761 "1mb1jyk1m11l1gppd9hmql9cyp55sdf7jk5rbc7acky1z4k4mv19"))))
762 (build-system gnu-build-system)
764 `(#:tests? #f ;no "check" target
766 (modify-phases %standard-phases
768 (lambda* (#:key outputs #:allow-other-keys)
769 (substitute* "Makefile"
770 (("/usr/local") (assoc-ref outputs "out")))
774 ("sfarklib" ,sfarklib)))
775 (home-page "https://github.com/raboof/sfarkxtc")
776 (synopsis "Basic sfArk decompressor")
777 (description "SfArk extractor converts SoundFonts in the compressed legacy
778 sfArk file format to the uncompressed sf2 format.")
779 (license license:gpl3+))))
781 (define-public libmspack
784 (home-page "https://cabextract.org.uk/libmspack/")
789 (uri (string-append home-page name "-" version "alpha.tar.gz"))
791 (base32 "13janaqsvm7aqc4agjgd4819pbgqv50j88bh5kci1z70wvg65j5s"))))
792 (build-system gnu-build-system)
794 `(#:configure-flags '("--disable-static")))
795 (synopsis "Compression tools for some formats used by Microsoft")
797 "The purpose of libmspack is to provide both compression and
798 decompression of some loosely related file formats used by Microsoft.")
799 (license license:lgpl2.1+)))
808 (uri (git-reference (url "https://github.com/lz4/lz4")
809 (commit (string-append "v" version))))
811 (base32 "1w02kazh1fps3sji2sn89fz862j1199c5ajrqcgl1bnlxj09kcbz"))
812 (file-name (git-file-name name version))))
813 (build-system gnu-build-system)
814 (outputs (list "out" "static"))
818 ("valgrind" ,valgrind)))
820 `(;; Not designed for parallel testing.
821 ;; See https://github.com/lz4/lz4/issues/957#issuecomment-737419821
824 #:make-flags (list (string-append "CC=" ,(cc-for-target))
825 (string-append "prefix=" (assoc-ref %outputs "out")))
827 (modify-phases %standard-phases
828 (delete 'configure) ; no configure script
829 (add-before 'check 'disable-broken-test
831 (substitute* "tests/Makefile"
832 ;; This fails when $prefix is not a single top-level directory.
833 (("^test: (.*) test-install" _ targets)
834 (string-append "test: " targets)))
836 (add-after 'install 'move-static-library
837 (lambda* (#:key outputs #:allow-other-keys)
838 (let ((out (assoc-ref outputs "out"))
839 (static (assoc-ref outputs "static")))
840 (mkdir-p (string-append static "/lib"))
841 (rename-file (string-append out "/lib/liblz4.a")
842 (string-append static "/lib/liblz4.a"))
844 (home-page "https://www.lz4.org")
845 (synopsis "Compression algorithm focused on speed")
846 (description "LZ4 is a lossless compression algorithm, providing
847 compression speed at 400 MB/s per core (0.16 Bytes/cycle). It also features an
848 extremely fast decoder, with speed in multiple GB/s per core (0.71 Bytes/cycle).
849 A high compression derivative, called LZ4_HC, is also provided. It trades CPU
850 time for compression ratio.")
851 ;; The libraries (lz4, lz4hc, and xxhash) are BSD licenced. The command
852 ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
853 (license (list license:bsd-2 license:gpl2+))))
855 (define-public squashfs-tools
857 (name "squashfs-tools")
861 (uri (string-append "mirror://sourceforge/squashfs/squashfs/"
862 "squashfs" version "/"
863 "squashfs" version ".tar.gz"))
866 "0zmhvczscqz0mzh4b9m8m42asq14db0a6lc8clp5ljq5ybrv70d9"))
867 (modules '((guix build utils)))
870 ;; Fix build with -fno-common (default in GCC 10).
871 ;; Remove for squashfs-tools > 4.4.
872 (substitute* "squashfs-tools/mksquashfs.h"
873 (("struct cache \\*bwriter_buffer" all)
874 (string-append "extern " all)))))))
875 (build-system gnu-build-system)
877 `(#:tests? #f ; no check target
879 (list (string-append "CC=" ,(cc-for-target))
883 (string-append "INSTALL_DIR=" %output "/bin"))
885 (modify-phases %standard-phases
888 (chdir "squashfs-tools")
895 (home-page "https://github.com/plougher/squashfs-tools")
896 (synopsis "Tools to create and extract squashfs file systems")
898 "Squashfs is a highly compressed read-only file system for Linux. It uses
899 zlib to compress files, inodes, and directories. All blocks are packed to
900 minimize the data overhead, and block sizes of between 4K and 1M are supported.
901 It is intended to be used for archival use, for live CDs, and for embedded
902 systems where low overhead is needed. This package allows you to create and
903 extract such file systems.")
904 (license license:gpl2+)))
912 (uri (string-append "http://zlib.net/pigz/"
913 name "-" version ".tar.gz"))
916 "0z9avc4mifwcpj3qdsf9m2rjw9jx03b2r9pj0c4xgla9fh6ppv9f"))))
917 (build-system gnu-build-system)
920 (modify-phases %standard-phases
923 (lambda* (#:key outputs #:allow-other-keys)
924 (let* ((out (assoc-ref outputs "out"))
925 (bin (string-append out "/bin"))
926 (man (string-append out "/share/man/man1")))
927 (install-file "pigz" bin)
928 (symlink "pigz" (string-append bin "/unpigz"))
929 (install-file "pigz.1" man)
932 (list ,(string-append "CC=" (cc-for-target)))
933 #:test-target "tests"))
934 (inputs `(("zlib" ,zlib)))
935 (home-page "https://zlib.net/pigz/")
936 (synopsis "Parallel implementation of gzip")
938 "This package provides a parallel implementation of gzip that exploits
939 multiple processors and multiple cores when compressing data.")
941 ;; Things under zopfli/ are under ASL2.0, but 4 files at the top-level,
942 ;; written by Mark Adler, are under another non-copyleft license.
943 (license license:asl2.0)))
952 "https://github.com/vasi/pixz/releases/download/v" version
953 "/pixz-" version ".tar.xz"))
956 "1ifxr18f2h75gkcrkx8033kwmwmrcgxshpaawyc2n4dzn1p2rqz5"))))
957 (build-system gnu-build-system)
959 `(("pkg-config" ,pkg-config)
960 ("libarchive" ,libarchive)))
961 (home-page "https://github.com/vasi/pixz")
962 (synopsis "Parallel indexing implementation of LZMA")
964 "The existing XZ Utils provide great compression in the .xz file format,
965 but they produce just one big block of compressed data. Pixz instead produces
966 a collection of smaller blocks which makes random access to the original data
967 possible and can compress in parallel. This is especially useful for large
969 (license license:bsd-2)))
971 (define-public cabextract
974 (home-page "https://cabextract.org.uk/")
978 (uri (string-append home-page "cabextract-" version ".tar.gz"))
981 "19qwhl2r8ip95q4vxzxg2kp4p125hjmc9762sns1dwwf7ikm7hmg"))
982 (modules '((guix build utils)))
985 ;; Delete bundled libmspack.
986 (delete-file-recursively "mspack")
988 (build-system gnu-build-system)
990 '(#:configure-flags '("--with-external-libmspack")
992 (modify-phases %standard-phases
993 ;; cabextract needs some of libmspack's header files.
994 ;; These are located in the "mspack" directory of libmspack.
995 (add-before 'build 'unpack-libmspack
996 (lambda* (#:key inputs #:allow-other-keys)
997 (let ((dir-name "libmspack-src"))
999 (invoke "tar" "-xvf" (assoc-ref inputs "libmspack-source")
1000 "-C" dir-name "--strip-components" "1")
1001 (rename-file (string-append dir-name "/mspack")
1003 (delete-file-recursively dir-name)
1006 `(("pkg-config" ,pkg-config)))
1008 `(("libmspack" ,libmspack)
1009 ("libmspack-source" ,(package-source libmspack))))
1010 (synopsis "Tool to unpack Cabinet archives")
1011 (description "Extracts files out of Microsoft Cabinet (.cab) archives")
1012 ;; Some source files specify gpl2+, lgpl2+, however COPYING is gpl3.
1013 (license license:gpl3+)))
1015 (define-public libjcat
1024 (url "https://github.com/hughsie/libjcat")
1026 (file-name (git-file-name name version))
1028 (base32 "18qkyg19r7fxzv93kar5n808n3582ygjmqwa7rnyg5y4b6hnwihl"))))
1029 (build-system meson-build-system)
1031 `(("gobject-introspection" ,gobject-introspection)
1032 ("help2man" ,help2man)
1033 ("pkg-config" ,pkg-config)))
1040 ("json-glib" ,json-glib)
1042 (home-page "https://github.com/hughsie/libjcat")
1043 (synopsis "Library for reading and writing Jcat files")
1045 "This library allows reading and writing gzip-compressed JSON catalog
1046 files, which can be used to store GPG, PKCS-7 and SHA-256 checksums for each
1048 (license license:lgpl2.1+)))
1050 (define-public xdelta
1058 (url "https://github.com/jmacd/xdelta")
1059 (commit (string-append "v" version))))
1060 (file-name (git-file-name name version))
1063 "09mmsalc7dwlvgrda56s2k927rpl3a5dzfa88aslkqcjnr790wjy"))
1065 ;; This file isn't freely distributable and has no effect on building.
1067 (delete-file "xdelta3/draft-korn-vcdiff.txt")
1069 (build-system gnu-build-system)
1071 `(("autoconf" ,autoconf)
1072 ("automake" ,automake)))
1075 (modify-phases %standard-phases
1076 (add-after 'unpack 'enter-build-directory
1077 (lambda _ (chdir "xdelta3") #t)))))
1078 (home-page "http://xdelta.org")
1079 (synopsis "Delta encoder for binary files")
1080 (description "xdelta encodes only the differences between two binary files
1081 using the VCDIFF algorithm and patch file format described in RFC 3284. It can
1082 also be used to apply such patches. xdelta is similar to @command{diff} and
1083 @command{patch}, but is not limited to plain text and does not generate
1084 human-readable output.")
1085 (license license:asl2.0)))
1087 (define-public lrzip
1095 "http://ck.kolivas.org/apps/lrzip/lrzip-" version ".tar.xz"))
1097 (base32 "0ziyanspd96dc3lp2qdcylc7aq8dhb511jhqrhxvlp502fjqjqrc"))))
1098 (build-system gnu-build-system)
1100 `(;; nasm is only required when building for 32-bit x86 platforms
1101 ,@(if (string-prefix? "i686" (or (%current-target-system)
1111 (home-page "http://ck.kolivas.org/apps/lrzip/")
1112 (synopsis "Large file compressor with a very high compression ratio")
1113 (description "lrzip is a compression utility that uses long-range
1114 redundancy reduction to improve the subsequent compression ratio of
1115 larger files. It can then further compress the result with the ZPAQ or
1116 LZMA algorithms for maximum compression, or LZO for maximum speed. This
1117 choice between size or speed allows for either better compression than
1118 even LZMA can provide, or a higher speed than gzip while compressing as
1120 (license (list license:gpl3+
1121 license:public-domain)))) ; most files in lzma/
1123 (define-public snappy
1131 (url "https://github.com/google/snappy")
1133 (file-name (git-file-name name version))
1135 (base32 "03zz56h79z0sgvi5sangjqn9dahhzvf645v26n1y0gwmfbmsax95"))
1137 (search-patches "snappy-add-O2-flag-in-CmakeLists.txt.patch"
1138 "snappy-add-inline-for-GCC.patch"))))
1139 (build-system cmake-build-system)
1142 (list "-DBUILD_SHARED_LIBS=ON"
1143 ;; These would be installed alongside Snappy otherwise.
1144 "-DBENCHMARK_ENABLE_INSTALL=OFF"
1145 "-DINSTALL_GTEST=OFF")
1147 (modify-phases %standard-phases
1148 (add-after 'unpack 'unpack-third_party-subprojects
1149 (lambda* (#:key inputs #:allow-other-keys)
1150 (with-directory-excursion "third_party"
1151 (for-each (lambda (subproject)
1152 (let* ((input (string-append subproject "-source"))
1153 (source (assoc-ref inputs input)))
1154 (with-directory-excursion subproject
1155 ;; Take advantage of the coincidence that both
1156 ;; use GIT-FETCH, which creates a directory.
1157 (copy-recursively source "."))))
1162 `(("benchmark-source" ,(package-source benchmark))
1163 ("googletest-source" ,(package-source googletest))))
1164 (home-page "https://github.com/google/snappy")
1165 (synopsis "Fast compressor/decompressor")
1166 (description "Snappy is a compression/decompression library. It does not
1167 aim for maximum compression, or compatibility with any other compression library;
1168 instead, it aims for very high speeds and reasonable compression. For instance,
1169 compared to the fastest mode of zlib, Snappy is an order of magnitude faster
1170 for most inputs, but the resulting compressed files are anywhere from 20% to
1172 (license license:asl2.0)))
1174 (define-public p7zip
1180 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1181 version "/" name "_" version
1182 "_src_all.tar.bz2"))
1185 "07rlwbbgszq8i7m8jh3x6j2w2hc9a72dc7fmqawnqkwlwb00mcjy"))
1186 (modules '((guix build utils)))
1189 ;; Remove non-free source files
1190 (for-each delete-file
1192 (find-files "CPP/7zip/Compress" "Rar.*")
1193 (find-files "CPP/7zip/Crypto" "Rar.*")
1194 (find-files "DOC/unRarLicense.txt")
1195 (find-files "Utils/file_Codecs_Rar_so.py")))
1196 (delete-file-recursively "CPP/7zip/Archive/Rar")
1197 (delete-file-recursively "CPP/7zip/Compress/Rar")
1199 (patches (search-patches "p7zip-CVE-2016-9296.patch"
1200 "p7zip-CVE-2017-17969.patch"
1201 "p7zip-remove-unused-code.patch"))))
1202 (build-system gnu-build-system)
1205 (list (string-append "DEST_HOME=" (assoc-ref %outputs "out")) "all3")
1207 (modify-phases %standard-phases
1209 (lambda* (#:key system outputs #:allow-other-keys)
1211 (let ((system ,(or (%current-target-system)
1212 (%current-system))))
1214 ((string-prefix? "x86_64" system)
1215 "makefile.linux_amd64_asm")
1216 ((string-prefix? "i686" system)
1217 "makefile.linux_x86_asm_gcc_4.X")
1219 "makefile.linux_any_cpu_gcc_4.X")))
1220 "makefile.machine")))
1223 (invoke "make" "test")
1224 (invoke "make" "test_7z")
1225 (invoke "make" "test_7zr"))))))
1227 (let ((system (or (%current-target-system)
1228 (%current-system))))
1229 `(,@(cond ((string-prefix? "x86_64" system)
1231 ((string-prefix? "i686" system)
1234 (home-page "http://p7zip.sourceforge.net/")
1235 (synopsis "Command-line file archiver with high compression ratio")
1236 (description "p7zip is a command-line port of 7-Zip, a file archiver that
1237 handles the 7z format which features very high compression ratios.")
1238 (license (list license:lgpl2.1+
1240 license:public-domain))))
1242 (define-public gzstream
1249 ;; No versioned URL, but last release was in 2003.
1250 "http://www.cs.unc.edu/Research/compgeom/gzstream/gzstream.tgz")
1251 (file-name (string-append name "-" version ".tgz"))
1254 "00y19pqjsdj5zcrx4p9j56pl73vayfwnb7y2hvp423nx0cwv5b4r"))
1255 (modules '((guix build utils)))
1257 ;; Remove pre-compiled object.
1259 (delete-file "gzstream.o")
1261 (build-system gnu-build-system)
1263 `(#:test-target "test"
1265 (modify-phases %standard-phases
1266 ;; Enable PIC, so it can be used in shared libraries.
1267 (add-after 'unpack 'use-pic
1269 (substitute* "Makefile"
1270 (("CPPFLAGS = " all) (string-append all "-fPIC ")))
1274 (lambda* (#:key outputs #:allow-other-keys)
1275 (let* ((out (assoc-ref outputs "out"))
1276 (lib (string-append out "/lib"))
1277 (include (string-append out "/include")))
1278 (install-file "libgzstream.a" lib)
1279 (install-file "gzstream.h" include)
1281 (propagated-inputs `(("zlib" ,zlib)))
1282 (home-page "http://www.cs.unc.edu/Research/compgeom/gzstream/")
1283 (synopsis "Compressed C++ iostream")
1284 (description "gzstream is a small library for providing zlib
1285 functionality in a C++ iostream.")
1286 (license license:lgpl2.1+)))
1294 (method url-fetch/zipbomb)
1295 (uri (string-append "http://mattmahoney.net/dc/zpaq"
1296 (string-delete #\. version) ".zip"))
1299 "066l94yyladlfzri877nh2dhkvspagjn3m5bmv725fmhkr9c4pp8"))
1300 (modules '((guix build utils)))
1302 ;; Delete irrelevant pre-compiled binaries.
1304 (for-each delete-file (find-files "." "\\.exe$"))
1306 (build-system gnu-build-system)
1309 (modify-phases %standard-phases
1310 (delete 'configure)) ; no ‘configure’ script
1313 (string-append "CPPFLAGS=-Dunix"
1314 ,(match (or (%current-target-system)
1319 ;; These should be safe, lowest-common-denominator instruction sets,
1320 ;; allowing for some optimisation while remaining reproducible.
1321 (string-append "CXXFLAGS=-O3 -DNDEBUG"
1322 ,(match (or (%current-target-system)
1324 ("x86_64-linux" " -march=nocona -mtune=generic")
1325 ("i686-linux" " -march=i686 -mtune=generic")
1326 ("armhf-linux" " -mtune=generic-armv7-a")
1328 (string-append "PREFIX="
1329 (assoc-ref %outputs "out")))))
1331 `(("perl" ,perl))) ; for pod2man
1332 (home-page "http://mattmahoney.net/dc/zpaq.html")
1333 (synopsis "Incremental journaling archiver")
1334 (description "ZPAQ is a command-line archiver for realistic situations with
1335 many duplicate and already compressed files. It backs up only those files
1336 modified since the last update. All previous versions remain untouched and can
1337 be independently recovered. Identical files are only stored once (known as
1338 @dfn{de-duplication}). Archives can also be encrypted.
1340 ZPAQ is intended to back up user data, not entire operating systems. It ignores
1341 owner and group IDs, ACLs, extended attributes, or special file types like
1342 devices, sockets, or named pipes. It does not follow or restore symbolic links
1343 or junctions, and always follows hard links.")
1344 (license (list license:public-domain
1345 ;; libzpaq.cpp contains a mix of public-domain and
1346 ;; expat-licenced (or ‘MIT’) code.
1349 (define-public unshield
1354 (origin (method git-fetch)
1356 (url "http://github.com/twogood/unshield")
1358 (file-name (git-file-name name version))
1361 "19wn22vszhci8dfcixx5rliz7phx3lv5ablvhjlclvj75k2vsdqd"))))
1362 (build-system cmake-build-system)
1365 ("openssl" ,openssl)
1366 ;; Test data that is otherwise downloaded with curl.
1367 ("unshield-avigomanager11b22.zip"
1371 "https://www.dropbox.com/s/8r4b6752swe3nhu/"
1372 "unshield-avigomanager11b22.zip?dl=1"))
1374 (base32 "0fwq7lih04if68wpwpsk5wjqyvh32db76a41sq6gbx4dn1lc3ddn"))
1375 (file-name "unshield-avigomanager11b22.zip")))
1376 ("unshield-baldurs_gate_patch_v1_1_4315_international.zip"
1380 "https://www.dropbox.com/s/9ruil8oi6amjbbk/"
1381 "unshield-baldurs_gate_patch_v1_1_4315_international.zip?dl=1"))
1383 (base32 "0spaxf6dardlhqxz3ys09fzamj007q3nfyw4xng6gh3qp9780maj"))
1384 (file-name "unshield-baldurs_gate_patch_v1_1_4315_international.zip")))
1385 ("unshield-the-feeble-files-spanish.zip"
1389 "https://www.dropbox.com/s/1ng0z9kfxc7eb1e/"
1390 "unshield-the-feeble-files-spanish.zip?dl=1"))
1392 (base32 "1k5cw6vnpja8yjlnhx5124xrw9i8s1l539hfdqqrqz3l5gn0bnyd"))
1393 (file-name "unshield-the-feeble-files-spanish.zip")))))
1395 `(("unzip" ,unzip)))
1397 `(#:out-of-source? #f
1399 (modify-phases %standard-phases
1400 (add-before 'check 'pre-check
1401 (lambda* (#:key inputs #:allow-other-keys)
1402 (for-each (lambda (i)
1403 (copy-file (assoc-ref inputs i)
1404 (string-append "test/v0/" i)))
1405 '("unshield-avigomanager11b22.zip"
1406 "unshield-baldurs_gate_patch_v1_1_4315_international.zip"
1407 "unshield-the-feeble-files-spanish.zip"))
1408 (substitute* (find-files "test/" "/*\\.sh")
1409 ;; Tests expect the unshield binary in a specific
1411 (("/var/tmp/unshield/bin/unshield")
1412 (string-append (getcwd) "/src/unshield"))
1413 ;; We no longer need to download the data.
1415 (("curl -(|f)sSL -o test.zip .*") ""))
1416 (substitute* "test/v0/avigomanager.sh"
1418 (string-append (getcwd)
1419 "/test/v0/unshield-avigomanager11b22.zip")))
1420 (substitute* "test/v0/baldurs_gate_patch_v1_1_4315_international.sh"
1424 "/test/v0/unshield-baldurs_gate_patch_v1_1_4315_international.zip")))
1425 (substitute* "test/v0/the-feeble-files-spanish.sh"
1427 (string-append (getcwd)
1428 "/test/v0/unshield-the-feeble-files-spanish.zip")))
1432 (invoke "./run-tests.sh"))))))
1433 (home-page "https://github.com/twogood/unshield")
1434 (synopsis "Extract CAB files from InstallShield installers")
1436 "@command{unshield} is a tool and library for extracting @file{.cab}
1437 archives from InstallShield installers.")
1438 (license license:expat)))
1447 (uri (string-append "https://github.com/facebook/zstd/releases/download/"
1448 "v" version "/zstd-" version ".tar.gz"))
1450 (base32 "05ckxap00qvc0j51d3ci38150cxsw82w7s9zgd5fgzspnzmp1vsr"))))
1451 (replacement zstd/fixed)
1452 (build-system gnu-build-system)
1453 (outputs '("out" ;1.2MiB executables and documentation
1454 "lib" ;1.2MiB shared library and headers
1455 "static")) ;1.2MiB static library
1458 (modify-phases %standard-phases
1459 (delete 'configure) ;no configure script
1460 (add-after 'install 'adjust-library-locations
1461 (lambda* (#:key outputs #:allow-other-keys)
1462 (let* ((out (assoc-ref outputs "out"))
1463 (lib (assoc-ref outputs "lib"))
1464 (static (assoc-ref outputs "static"))
1465 (shared-libs (string-append lib "/lib"))
1466 (static-libs (string-append static "/lib")))
1467 ;; Move the static library to its own output to save ~1MiB.
1468 (mkdir-p static-libs)
1469 (for-each (lambda (ar)
1470 (link ar (string-append static-libs "/"
1473 (find-files shared-libs "\\.a$"))
1475 ;; Make sure the pkg-config file refers to the right output.
1476 (substitute* (string-append shared-libs "/pkgconfig/libzstd.pc")
1478 (string-append "prefix=" lib "\n")))
1482 ;; TODO: Integrate in next rebuild cycle.
1483 (list ,(if (%current-target-system)
1484 (string-append "CC=" (cc-for-target))
1486 (string-append "PREFIX=" (assoc-ref %outputs "out"))
1487 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib")
1488 (string-append "INCLUDEDIR=" (assoc-ref %outputs "lib") "/include")
1489 ;; Skip auto-detection of, and creating a dependency on, the build
1490 ;; environment's ‘xz’ for what amounts to a dubious feature anyway.
1492 ;; Not currently detected, but be explicit & avoid surprises later.
1495 (home-page "https://facebook.github.io/zstd/")
1496 (synopsis "Zstandard real-time compression algorithm")
1497 (description "Zstandard (@command{zstd}) is a lossless compression algorithm
1498 that combines very fast operation with a compression ratio comparable to that of
1499 zlib. In most scenarios, both compression and decompression can be performed in
1500 ‘real time’. The compressor can be configured to provide the most suitable
1501 trade-off between compression ratio and speed, without affecting decompression
1503 (license (list license:bsd-3 ; the main top-level LICENSE file
1504 license:bsd-2 ; many files explicitly state 2-Clause
1505 license:gpl2 ; the main top-level COPYING file
1506 license:gpl3+ ; tests/gzip/*.sh
1507 license:expat ; lib/dictBuilder/divsufsort.[ch]
1508 license:public-domain ; zlibWrapper/examples/fitblk*
1509 license:zlib)))) ; zlibWrapper/{gz*.c,gzguts.h}
1516 (inherit (package-source zstd))
1519 ;; From Ubuntu focal-security
1520 "zstd-CVE-2021-24031_CVE-2021-24032.patch"))))))
1522 (define-public pzstd
1523 (package/inherit zstd
1527 `(,@(if (%current-target-system)
1528 `(("googletest" ,googletest))
1531 `(,@(if (%current-system)
1532 `(("googletest" ,googletest))
1536 (modify-phases %standard-phases
1537 (add-after 'unpack 'enter-subdirectory
1538 (lambda _ (chdir "contrib/pzstd") #t))
1539 (delete 'configure) ; no configure script
1540 (add-before 'check 'compile-tests
1541 (lambda* (#:key make-flags #:allow-other-keys)
1542 (apply invoke "make" "tests" make-flags)))
1543 (add-after 'install 'install-documentation
1544 (lambda* (#:key outputs #:allow-other-keys)
1545 (let* ((out (assoc-ref outputs "out"))
1546 (doc (string-append out "/share/doc/" ,name)))
1548 (install-file "README.md" doc)
1551 (list (string-append "CC=" ,(cc-for-target))
1552 (string-append "CXX=" ,(cxx-for-target))
1553 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1554 (home-page (package-home-page zstd))
1555 (synopsis "Threaded implementation of the Zstandard compression algorithm")
1556 (description "Parallel Zstandard (PZstandard or @command{pzstd}) is a
1557 multi-threaded implementation of the @uref{http://zstd.net/, Zstandard
1558 compression algorithm}. It is fully compatible with the original Zstandard file
1559 format and command-line interface, and can be used as a drop-in replacement.
1561 Compression is distributed over multiple processor cores to improve performance,
1562 as is the decompression of data compressed in this manner. Data compressed by
1563 other implementations will only be decompressed by two threads: one performing
1564 the actual decompression, the other input and output.")
1565 (license (package-license zstd))))
1574 (uri (string-append "mirror://sourceforge/infozip"
1575 "/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz"))
1578 "0sb3h3067pzf3a7mlxn1hikpcjrsvycjcnj9hl9b1c3ykcgvps7h"))))
1579 (build-system gnu-build-system)
1580 (inputs `(("bzip2" ,bzip2)))
1582 `(#:tests? #f ; no test target
1583 #:make-flags (let ((out (assoc-ref %outputs "out")))
1584 (list "-f" "unix/Makefile"
1585 (string-append "prefix=" out)
1586 (string-append "MANDIR=" out "/share/man/man1")))
1588 (modify-phases %standard-phases
1590 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1591 (apply invoke "make" "generic_gcc" make-flags)))
1592 (delete 'configure))))
1593 (home-page "http://www.info-zip.org/Zip.html")
1594 (synopsis "Compression and file packing utility")
1596 "Zip is a compression and file packaging/archive utility. Zip is useful
1597 for packaging a set of files for distribution, for archiving files, and for
1598 saving disk space by temporarily compressing unused files or directories.
1599 Zip puts one or more compressed files into a single ZIP archive, along with
1600 information about the files (name, path, date, time of last modification,
1601 protection, and check information to verify file integrity). An entire
1602 directory structure can be packed into a ZIP archive with a single command.
1604 Zip has one compression method (deflation) and can also store files without
1605 compression. Zip automatically chooses the better of the two for each file.
1606 Compression ratios of 2:1 to 3:1 are common for text files.")
1607 (license (license:non-copyleft "file://LICENSE"
1608 "See LICENSE in the distribution."))))
1610 (define-public unzip
1611 (package (inherit zip)
1617 (uri (string-append "mirror://sourceforge/infozip"
1618 "/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz"))
1621 "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83"))
1622 (patches (search-patches "unzip-CVE-2014-8139.patch"
1623 "unzip-CVE-2014-8140.patch"
1624 "unzip-CVE-2014-8141.patch"
1625 "unzip-CVE-2014-9636.patch"
1626 "unzip-CVE-2015-7696.patch"
1627 "unzip-CVE-2015-7697.patch"
1628 "unzip-allow-greater-hostver-values.patch"
1629 "unzip-initialize-symlink-flag.patch"
1630 "unzip-remove-build-date.patch"
1631 "unzip-attribs-overflow.patch"
1632 "unzip-overflow-on-invalid-input.patch"
1633 "unzip-format-secure.patch"
1634 "unzip-overflow-long-fsize.patch"))))
1635 (replacement unzip/fixed)
1636 (build-system gnu-build-system)
1637 ;; no inputs; bzip2 is not supported, since not compiled with BZ_NO_STDIO
1639 `(#:phases (modify-phases %standard-phases
1641 (add-after 'unpack 'fortify
1643 ;; Mitigate CVE-2018-1000035, an exploitable buffer overflow.
1644 ;; This environment variable is recommended in 'unix/Makefile'
1645 ;; for passing flags to the C compiler.
1646 (setenv "LOCAL_UNZIP" "-D_FORTIFY_SOURCE=1")
1649 (lambda* (#:key make-flags #:allow-other-keys)
1650 (apply invoke "make"
1651 `("-j" ,(number->string
1652 (parallel-job-count))
1655 #:make-flags (list "-f" "unix/Makefile"
1656 (string-append "prefix=" %output)
1657 (string-append "MANDIR=" %output "/share/man/man1"))))
1658 (home-page "http://www.info-zip.org/UnZip.html")
1659 (synopsis "Decompression and file extraction utility")
1661 "UnZip is an extraction utility for archives compressed in .zip format,
1662 also called \"zipfiles\".
1664 UnZip lists, tests, or extracts files from a .zip archive. The default
1665 behaviour (with no options) is to extract into the current directory, and
1666 subdirectories below it, all files from the specified zipfile. UnZip
1667 recreates the stored directory structure by default.")
1668 (license (license:non-copyleft "file://LICENSE"
1669 "See LICENSE in the distribution."))))
1678 (uri (string-append "mirror://sourceforge/infozip"
1679 "/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz"))
1682 "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83"))
1683 (patches (search-patches "unzip-CVE-2014-8139.patch"
1684 "unzip-CVE-2014-8140.patch"
1685 "unzip-CVE-2014-8141.patch"
1686 "unzip-CVE-2014-9636.patch"
1687 "unzip-CVE-2015-7696.patch"
1688 "unzip-CVE-2015-7697.patch"
1689 "unzip-allow-greater-hostver-values.patch"
1690 "unzip-initialize-symlink-flag.patch"
1691 "unzip-remove-build-date.patch"
1692 "unzip-attribs-overflow.patch"
1693 "unzip-overflow-on-invalid-input.patch"
1694 "unzip-format-secure.patch"
1695 "unzip-overflow-long-fsize.patch"
1698 "unzip-alt-iconv-utf8.patch"
1699 "unzip-alt-iconv-utf8-print.patch"
1700 "unzip-fix-recmatch.patch"
1701 "unzip-case-insensitive.patch"
1703 "unzip-COVSCAN-fix-unterminated-string.patch"
1704 "unzip-CVE-2016-9844.patch"
1705 "unzip-CVE-2018-1000035.patch"
1706 "unzip-CVE-2018-18384.patch"
1707 "unzip-exec-shield.patch"
1708 "unzip-manpage-fix.patch"
1709 "unzip-overflow.patch"
1710 "unzip-timestamp.patch"
1711 "unzip-valgrind.patch"
1712 "unzip-x-option.patch"
1714 "unzip-zipbomb-manpage.patch"
1715 "unzip-zipbomb-part1.patch"
1716 "unzip-zipbomb-part2.patch"
1717 "unzip-zipbomb-part3.patch"
1719 ;; https://github.com/madler/unzip/issues/2
1720 "unzip-32bit-zipbomb-fix.patch"))))))
1722 (define-public ziptime
1723 (let ((commit "2a5bc9dfbf7c6a80e5f7cb4dd05b4036741478bc")
1727 (version (git-version "0.0.0" revision commit))
1732 (url "https://android.googlesource.com/platform/build")
1734 (file-name (git-file-name name version))
1736 (base32 "0hrn61b3a97dlc4iqc28rwx8k8zf7ycbwzqqp93vj34zy5a541kn"))))
1737 (build-system gnu-build-system)
1739 `(#:tests? #f ; no test suite
1741 (modify-phases %standard-phases
1742 (add-after 'unpack 'change-directory
1744 (chdir "tools/ziptime")))
1745 (delete 'configure) ; nothing to configure
1747 ;; There is no Makefile, only an ‘Android.bp’ file. Ignore it.
1749 (let ((c++ ,(cxx-for-target)))
1750 (apply invoke c++ "-O2" "-o" "ziptime"
1751 (find-files "." "\\.cpp$")))))
1753 (lambda* (#:key outputs #:allow-other-keys)
1754 (let* ((out (assoc-ref outputs "out"))
1755 (bin (string-append out "/bin"))
1756 (doc (string-append out "/share/doc/" ,name "-" ,version)))
1757 (install-file "ziptime" bin)
1758 (install-file "README.txt" doc)))))))
1759 ;; There is no separate home page for this tiny bundled build tool.
1760 (home-page (string-append "https://android.googlesource.com/platform/build/"
1761 "+/master/tools/ziptime/README.txt"))
1762 (synopsis "Normalize @file{.zip} archive header timestamps")
1764 "Ziptime helps make @file{.zip} archives reproducible by replacing
1765 timestamps in the file header with a fixed time (1 January 2008).
1767 ``Extra fields'' are not changed, so you'll need to use the @code{-X} option to
1768 @command{zip} to prevent it from storing the ``universal time'' field.")
1769 (license license:asl2.0))))
1771 (define-public zziplib
1775 (home-page "https://github.com/gdraheim/zziplib")
1778 (uri (git-reference (url home-page)
1779 (commit (string-append "v" version))))
1780 (file-name (git-file-name name version))
1781 (patches (search-patches "zziplib-CVE-2018-16548.patch"))
1784 "0fbk9k7ryas2wh2ykwkvm1pbi40i88rfvc3dydh9xyd7w2jcki92"))))
1785 (replacement zziplib/fixed)
1786 (build-system gnu-build-system)
1788 `(#:phases (modify-phases %standard-phases
1789 (add-before 'check 'make-files-writable
1791 (for-each make-file-writable
1792 (find-files "test" #:directories? #t))
1795 ;; XXX: The default test target attempts to download external resources and
1796 ;; fails without error: <https://github.com/gdraheim/zziplib/issues/53>.
1797 ;; To prevent confusing log messages, just run a simple zip test that works.
1798 #:test-target "check-readme"))
1801 (native-inputs `(("perl" ,perl) ; for the documentation
1802 ("pkg-config" ,pkg-config)
1803 ;; for the documentation; Python 3 not supported,
1804 ;; http://forums.gentoo.org/viewtopic-t-863161-start-0.html
1805 ("python" ,python-2)
1806 ("zip" ,zip))) ; to create test files
1807 (synopsis "Library for accessing zip files")
1809 "ZZipLib is a library based on zlib for accessing zip files.")
1810 ;; zziplib is dual licensed under LGPL2.0+ and MPL1.1. Some example source
1811 ;; files carry the Zlib license; see "docs/copying.html" for details.
1812 (license (list license:lgpl2.0+ license:mpl1.1))))
1814 (define-public zziplib/fixed
1819 (home-page "https://github.com/gdraheim/zziplib")
1822 (uri (git-reference (url home-page)
1823 (commit (string-append "v" version))))
1824 (file-name (git-file-name name version))
1827 "0i6bpa2b13z19alm6ig80364dnin1w28cvif18k6wkkb0w3dzp8y"))))
1830 (modify-phases %standard-phases
1831 (add-after 'install 'install-compatibility-symlinks
1832 (lambda* (#:key outputs #:allow-other-keys)
1833 (with-directory-excursion
1834 (string-append (assoc-ref outputs "out") "/lib")
1835 (map (lambda (lib new-symlink)
1836 (symlink lib new-symlink))
1837 (list "libzzip.so.13" "libzzipfseeko.so.13"
1838 "libzzipmmapped.so.13" "libzzipwrap.so.13")
1839 (list "libzzip-0.so.13" "libzzipfseeko-0.so.13"
1840 "libzzipmmapped-0.so.13" "libzzipwrap-0.so.13")))
1843 `(("python" ,python)
1844 ,@(alist-delete "python"
1845 (package-native-inputs zziplib))))
1846 (build-system cmake-build-system)))
1848 (define-public libzip
1855 "https://libzip.org/download/libzip-" version ".tar.xz"))
1858 "0ck1dk7zn5qzpgxklg0r26nfsf04xb6c46gsig060hkvvgzp6156"))))
1862 `(("gnutls" ,gnutls)
1864 ("openssl" ,openssl)
1866 (build-system cmake-build-system)
1867 (home-page "https://libzip.org")
1868 (synopsis "C library for reading, creating, and modifying zip archives")
1869 (description "Libzip is a C library for reading, creating, and modifying
1870 zip archives. Files can be added from data buffers, files, or compressed data
1871 copied directly from other zip archives. Changes made without closing the
1872 archive can be reverted.")
1873 (license license:bsd-3)))
1875 (define-public atool
1882 (uri (string-append "mirror://savannah/atool/atool-"
1886 "0fvhzip2v08jgnlfpyj6rapan39xlsl1ksgq4lp8gfsai2ah1xma"))))
1887 (build-system gnu-build-system)
1890 (modify-phases %standard-phases
1891 (add-after 'unpack 'embed-absolute-file-name
1892 (lambda* (#:key inputs #:allow-other-keys)
1893 (substitute* "atool"
1894 (("(^\\$::cfg_path_file.*= )'file'" _ pre)
1895 (string-append pre "'" (assoc-ref inputs "file")
1901 (home-page "https://www.nongnu.org/atool/")
1902 (synopsis "Universal tool to manage file archives of various types")
1903 (description "The main command is @command{aunpack} which extracts files
1904 from an archive. The other commands provided are @command{apack} (to create
1905 archives), @command{als} (to list files in archives), and @command{acat} (to
1906 extract files to standard out). As @command{atool} invokes external programs
1907 to handle the archives, not all commands may be supported for a certain type
1909 (license license:gpl2+)))
1911 (define-public lunzip
1918 (uri (string-append "mirror://savannah/lzip/lunzip/"
1919 "lunzip-" version ".tar.gz"))
1921 (base32 "1liaynyy3qcs29hfk1pnb7i9r1mnmpw557j5v356qsv6qnm4lnz5"))))
1922 (build-system gnu-build-system)
1925 (list ,(string-append "CC=" (cc-for-target)))))
1926 (home-page "https://www.nongnu.org/lzip/lunzip.html")
1927 (synopsis "Small, stand-alone lzip decompressor")
1929 "Lunzip is a decompressor for files in the lzip compression format (.lz),
1930 written as a single small C tool with no dependencies. This makes it
1931 well-suited to embedded and other systems without a C++ compiler, or for use in
1932 applications such as software installers that need only to decompress files,
1934 Lunzip is intended to be fully compatible with the regular lzip package.")
1935 (license (list license:bsd-2 ; carg_parser.[ch]
1936 license:gpl2+)))) ; everything else
1938 (define-public clzip
1945 (uri (string-append "mirror://savannah/lzip/clzip/"
1946 "clzip-" version ".tar.gz"))
1948 (base32 "1s7yidqvmxi61hh569h5aci816l6qkffjgx0zx57qyyq0qq2pjgw"))))
1949 (build-system gnu-build-system)
1952 (list ,(string-append "CC=" (cc-for-target)))))
1953 (home-page "https://www.nongnu.org/lzip/clzip.html")
1954 (synopsis "Small, stand-alone lzip compressor and decompressor")
1956 "Clzip is a compressor and decompressor for files in the lzip compression
1957 format (.lz), written as a single small C tool with no dependencies. This makes
1958 it well-suited to embedded and other systems without a C++ compiler, or for use
1959 in other applications like package managers.
1960 Clzip is intended to be fully compatible with the regular lzip package.")
1961 (license (list license:bsd-2 ; carg_parser.[ch], lzd in clzip.texi
1964 (define-public lzlib
1971 (uri (string-append "mirror://savannah/lzip/lzlib/"
1972 "lzlib-" version ".tar.gz"))
1974 (base32 "1c9pwd6by8is4z8bs6j306jyy6pgm2dvsn4fr7fg2b5m5qj88pcf"))))
1975 (build-system gnu-build-system)
1978 (list (string-append "CC=" ,(cc-for-target))
1980 "--enable-shared"))) ; only static (.a) is built by default
1981 (home-page "https://www.nongnu.org/lzip/lzlib.html")
1982 (synopsis "Lzip data compression C library")
1984 "Lzlib is a C library for in-memory LZMA compression and decompression in
1985 the lzip format. It supports integrity checking of the decompressed data, and
1986 all functions are thread-safe. The library should never crash, even in case of
1988 (license (list license:bsd-2 ; the library itself
1989 license:gpl2+)))) ; main.c (i.e. minilzip used by tests)
1991 (define-public plzip
1998 (uri (string-append "mirror://savannah/lzip/plzip/"
1999 "plzip-" version ".tar.gz"))
2001 (base32 "19zinpx7hssl6r3vilpvq2s7wha3545xan8b0vcvsxnyipdx3n0l"))))
2002 (build-system gnu-build-system)
2004 `(("lzlib" ,lzlib)))
2005 (home-page "https://www.nongnu.org/lzip/plzip.html")
2006 (synopsis "Parallel lossless data compressor for the lzip format")
2008 "Plzip is a massively parallel (multi-threaded) lossless data compressor
2009 and decompressor that uses the lzip file format (.lz). Files produced by plzip
2010 are fully compatible with lzip and can be rescued with lziprecover.
2011 On multiprocessor machines, plzip can compress and decompress large files much
2012 faster than lzip, at the cost of a slightly reduced compression ratio (0.4% to
2013 2%). The number of usable threads is limited by file size: on files of only a
2014 few MiB, plzip is no faster than lzip.
2015 Files that were compressed with regular lzip will also not be decompressed
2016 faster by plzip, unless the @code{-b} option was used: lzip usually produces
2017 single-member files which can't be decompressed in parallel.")
2018 (license (list license:bsd-2 ; arg_parser.{cc,h}
2019 license:gpl2+)))) ; everything else
2021 (define-public innoextract
2023 (name "innoextract")
2028 (uri (string-append "https://constexpr.org/innoextract/files/"
2029 "innoextract-" version "/"
2030 "/innoextract-" version ".tar.gz"))
2032 (base32 "09l1z1nbl6ijqqwszdwch9mqr54qb7df0wp2sd77v17dq6gsci33"))))
2033 (build-system cmake-build-system)
2036 (inputs `(("boost" ,boost)
2037 ("libiconv" ,libiconv)
2039 (native-inputs `(("pkg-config" ,pkg-config)))
2040 (home-page "https://constexpr.org/innoextract/")
2041 (synopsis "Tool for extracting Inno Setup installers")
2042 (description "innoextract allows extracting Inno Setup installers under
2043 non-Windows systems without running the actual installer using wine.")
2044 (license license:zlib)))
2046 (define-public google-brotli
2048 (name "google-brotli")
2054 (url "https://github.com/google/brotli")
2055 (commit (string-append "v" version))))
2056 (file-name (git-file-name name version))
2058 (base32 "1fikasxf7r2dwlk8mv8w7nmjkn0jw5ic31ky3mvpkdzwgd4xfndl"))
2059 (modules '((guix build utils)))
2062 ;; Cherry-picked from upstream since the latest release
2063 ;; https://github.com/google/brotli/commit/09b0992b6acb7faa6fd3b23f9bc036ea117230fc
2064 (substitute* (find-files "scripts" "^lib.*pc\\.in")
2065 (("-R\\$\\{libdir\\} ") ""))
2067 (build-system cmake-build-system)
2070 (modify-phases %standard-phases
2071 (add-after 'install 'rename-static-libraries
2072 ;; The build tools put a 'static' suffix on the static libraries, but
2073 ;; other applications don't know how to find these.
2074 (lambda* (#:key outputs #:allow-other-keys)
2075 (let ((lib (string-append (assoc-ref %outputs "out") "/lib/")))
2076 (rename-file (string-append lib "libbrotlicommon-static.a")
2077 (string-append lib "libbrotlicommon.a"))
2078 (rename-file (string-append lib "libbrotlidec-static.a")
2079 (string-append lib "libbrotlidec.a"))
2080 (rename-file (string-append lib "libbrotlienc-static.a")
2081 (string-append lib "libbrotlienc.a"))
2084 (list ;; Defaults to "lib64" on 64-bit archs.
2085 (string-append "-DCMAKE_INSTALL_LIBDIR="
2086 (assoc-ref %outputs "out") "/lib"))))
2087 (home-page "https://github.com/google/brotli")
2088 (synopsis "General-purpose lossless compression")
2089 (description "This package provides the reference implementation of Brotli,
2090 a generic-purpose lossless compression algorithm that compresses data using a
2091 combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd
2092 order context modeling, with a compression ratio comparable to the best
2093 currently available general-purpose compression methods. It is similar in speed
2094 with @code{deflate} but offers more dense compression.
2096 The specification of the Brotli Compressed Data Format is defined in RFC 7932.")
2097 (license license:expat)))
2099 (define-public brotli
2100 ;; We used to provide an older version under the name "brotli".
2101 (deprecated-package "brotli" google-brotli))
2103 (define-public python-google-brotli
2105 (inherit google-brotli)
2106 (name "python-google-brotli")
2107 (build-system python-build-system)
2109 (synopsis "Python interface to google-brotli")
2110 (description "@code{python-google-brotli} provides a Python interface to
2111 @code{google-brotli}, an implementation of the Brotli lossless compression
2120 (uri (string-append "https://www.oberhumer.com/opensource/"
2121 name "/download/" name "-" version ".tar.gz"))
2124 "0j036lkwsxvm15gr29n8wn07cqq79dswjs9k54939ms5zngjjrdq"))))
2125 (build-system gnu-build-system)
2127 `(;; UCL 1.03 fails to build with newer C standards.
2128 #:configure-flags '("CFLAGS=-std=gnu90"
2129 "--enable-shared" "--disable-static")))
2130 (home-page "https://www.oberhumer.com/opensource/ucl/")
2131 (synopsis "Portable lossless data compression library")
2132 (description "UCL implements a number of compression algorithms that
2133 achieve an excellent compression ratio while allowing fast decompression.
2134 Decompression requires no additional memory.
2136 Compared to LZO, the UCL algorithms achieve a better compression ratio but
2137 decompression is a little bit slower.")
2138 (license license:gpl2+)))
2146 (uri (string-append "https://github.com/upx/upx/releases/download/v"
2147 version "/upx-" version "-src.tar.xz"))
2150 "051pk5jk8fcfg5mpgzj43z5p4cn7jy5jbyshyn78dwjqr7slsxs7"))
2151 (patches (search-patches "upx-CVE-2021-20285.patch"))))
2152 (build-system gnu-build-system)
2162 (modify-phases %standard-phases
2163 (delete 'configure) ; no configure script
2164 (delete 'check) ; no test suite
2165 (add-before 'build 'patch-exec-bin-sh
2167 (substitute* (list "Makefile"
2169 (("/bin/sh") (which "sh")))
2172 (lambda* (#:key outputs #:allow-other-keys)
2173 (let* ((out (assoc-ref outputs "out"))
2174 (bin (string-append out "/bin")))
2176 (copy-file "src/upx.out" (string-append bin "/upx")))
2178 (home-page "https://upx.github.io/")
2179 (synopsis "Compression tool for executables")
2181 "The Ultimate Packer for eXecutables (UPX) is an executable file
2182 compressor. UPX typically reduces the file size of programs and shared
2183 libraries by around 50%--70%, thus reducing disk space, network load times,
2184 download times, and other distribution and storage costs.")
2185 (license license:gpl2+)))
2187 (define-public quazip
2194 (url "https://github.com/stachenov/quazip")
2195 (commit (string-append "v" version))))
2196 (file-name (git-file-name name version))
2199 "11icgwv2xyxhd1hm1add51xv54zwkcqkg85d1xqlgiigvbm196iq"))))
2200 (build-system cmake-build-system)
2202 `(#:tests? #f)) ;no test
2204 `(("doxygen" ,doxygen)))
2206 `(("qtbase" ,qtbase)
2208 (home-page "https://stachenov.github.io/quazip/index.html")
2209 (synopsis "Qt/C++ wrapper for Minizip")
2210 (description "QuaZIP is a simple C++ wrapper over Gilles Vollant's
2211 ZIP/UNZIP package that can be used to access ZIP archives. It uses
2212 Trolltech's Qt toolkit.
2214 QuaZIP allows you to access files inside ZIP archives using QIODevice
2215 API, and that means that you can also use QTextStream, QDataStream or
2216 whatever you would like to use on your zipped files.
2218 QuaZIP provides complete abstraction of the ZIP/UNZIP API, for both
2219 reading from and writing to ZIP archives. ")
2220 ;; Project is distributed under LGPL, but "quazip/z*" "quazip/unzip.*" are
2221 ;; distributed under zlib terms.
2222 (license (list license:lgpl2.1+ license:zlib))))
2224 (define-public zutils
2231 (uri (string-append "mirror://savannah/zutils/zutils-" version ".tar.lz"))
2233 (base32 "15dimqp8zlqaaa2l46r22srp1py38mlmn69ph1j5fmrd54w43m0d"))))
2234 (build-system gnu-build-system)
2237 (list "--sysconfdir=/etc")
2239 (modify-phases %standard-phases
2240 (add-before 'check 'disable-failing-tests
2241 ;; XXX https://lists.nongnu.org/archive/html/zutils-bug/2020-07/msg00005.html
2243 (substitute* "testsuite/check.sh"
2244 (("\"\\$\\{ZGREP\\}\" -N -L \"GNU\"") "true")
2245 (("\"\\$\\{ZGREP\\}\" -N -L \"nx_pattern\"") "false"))
2248 (lambda* (#:key make-flags outputs #:allow-other-keys)
2249 (apply invoke "make" "install"
2250 (string-append "sysconfdir=" (assoc-ref outputs "out")
2254 ;; Needed to extract the source tarball and run the test suite.
2256 (home-page "https://www.nongnu.org/zutils/zutils.html")
2257 (synopsis "Utilities that transparently operate on compressed files")
2259 "Zutils is a collection of utilities able to process any combination of
2260 compressed and uncompressed files transparently. If any given file, including
2261 standard input, is compressed, its decompressed content is used instead.
2263 @command{zcat}, @command{zcmp}, @command{zdiff}, and @command{zgrep} are
2264 improved replacements for the shell scripts provided by GNU gzip.
2265 @command{ztest} tests the integrity of supported compressed files.
2266 @command{zupdate} recompresses files with lzip, similar to gzip's
2269 Supported compression formats are bzip2, gzip, lzip, and xz. Zutils uses
2270 external compressors: the compressor to be used for each format is configurable
2271 at run time, and must be installed separately.")
2272 (license (list license:bsd-2 ; arg_parser.{cc,h}
2273 license:gpl2+)))) ; the rest
2275 (define-public makeself-safeextract
2276 (let ((commit "1a95e121fa8e3c02d307ae37b9b7834e616c3683"))
2278 (name "makeself-safeextract")
2279 (version (git-version "0.0.0" "1" commit))
2280 (home-page "https://github.com/ssokolow/makeself_safeextract")
2287 (file-name (git-file-name name version))
2290 "1anlinaj9lvfi8bn00wp11vzqq0f9sig4fm9yrspisx31v0z4a2c"))))
2291 (build-system trivial-build-system)
2293 `(("python" ,python-2)
2297 `(#:modules ((guix build utils))
2300 (use-modules (guix build utils))
2301 (let* ((name "makeself_safeextract")
2302 (source (string-append (assoc-ref %build-inputs "source")
2304 (bin (string-append (assoc-ref %outputs "out") "/bin"))
2305 (target (string-append bin "/" name))
2306 (python (string-append (assoc-ref %build-inputs "python") "/bin"))
2307 (7z (string-append (assoc-ref %build-inputs "p7zip") "/bin/7z"))
2308 (unzip (string-append (assoc-ref %build-inputs "unzip") "/bin/unzip")))
2309 (setenv "PATH" (string-append (getenv "PATH") ":" python))
2311 (copy-file source target)
2313 (("'7z'") (format #f "'~a'" 7z))
2314 (("'unzip'") (format #f "'~a'" unzip)))
2315 (patch-shebang target)))))
2316 (synopsis "Extract makeself and mojo archives without running untrusted code")
2317 (description "This package provides a script to unpack self-extracting
2318 archives generated by @command{makeself} or @command{mojo} without running the
2319 possibly untrusted extraction shell script.")
2320 (license license:gpl3+))))
2322 (define-public ncompress
2329 (url "https://github.com/vapier/ncompress")
2330 (commit (string-append "v" version))))
2331 (patches (search-patches "ncompress-fix-softlinks.patch"))
2332 (file-name (string-append name "-" version ".tar.gz"))
2335 "1a4yir1ilafz0nzxdwigj204j4yy2zljbc501nsaqqm3dxdap8zn"))))
2337 '(#:make-flags (list "CC=gcc"
2338 (string-append "BINDIR=" %output "/bin")
2339 (string-append "MANDIR=" %output "/share/man/man1"))
2340 #:phases (modify-phases %standard-phases
2341 (delete 'configure))))
2342 (build-system gnu-build-system)
2343 (home-page "https://github.com/vapier/ncompress/")
2344 (synopsis "Original Lempel-Ziv compress/uncompress programs")
2345 (description "(N)compress provides the original compress and uncompress
2346 programs that used to be the de facto UNIX standard for compressing and
2347 uncompressing files. These programs implement a fast, simple Lempel-Ziv (LZW)
2348 file compression algorithm.")
2349 (license license:gpl2+)))
2351 (define-public xarchiver
2354 (version "0.5.4.17")
2359 (url "https://github.com/ib/xarchiver")
2361 (file-name (git-file-name name version))
2363 (base32 "00adrjpxqlaccrwjf65w3vhxfswdj0as8aj263c6f9b85llypc5v"))))
2364 (build-system glib-or-gtk-build-system)
2366 `(("gettext" ,gettext-minimal)
2367 ("intltool" ,intltool)
2368 ("libxslt" ,libxslt)
2369 ("pkg-config" ,pkg-config)))
2371 `(("adwaita-icon-theme" ,adwaita-icon-theme) ; hard-coded theme
2373 (home-page "https://github.com/ib/xarchiver")
2374 (synopsis "Graphical front-end for archive operations")
2375 (description "Xarchiver is a front-end to various command line archiving
2376 tools. It uses GTK+ tool-kit and is designed to be desktop-environment
2377 independent. Supported formats are 7z, ARJ, bzip2, gzip, LHA, lzma, lzop,
2378 RAR, RPM, DEB, tar, and ZIP. It cannot perform functions for archives, whose
2379 archiver is not installed.")
2380 (license license:gpl2+)))
2382 (define-public tarsplitter
2384 (name "tarsplitter")
2389 (url "https://github.com/AQUAOSOTech/tarsplitter")
2390 (commit (string-append "v" version))))
2391 (file-name (git-file-name name version))
2394 "17qkg95r97kcrs17b0mcqswx99280ni47j5yx8xa7nl3bdhm6325"))))
2395 (build-system go-build-system)
2397 `(#:import-path "github.com/AQUAOSOTech/tarsplitter"
2398 #:install-source? #f
2400 (modify-phases %standard-phases
2401 (add-after 'install 'install-documentation
2402 (lambda* (#:key import-path outputs #:allow-other-keys)
2403 (let* ((source (string-append "src/" import-path))
2404 (out (assoc-ref outputs "out"))
2405 (doc (string-append out "/share/doc/" ,name "-" ,version)))
2406 (with-directory-excursion source
2407 (install-file "README.md" doc))
2409 (home-page "https://github.com/AQUAOSOTech/tarsplitter")
2410 (synopsis "Multithreaded tar utility")
2412 "Archive huge numbers of files, or split massive tar archives into smaller
2414 (license license:expat)))
2416 (define-public c-blosc
2423 (url "https://github.com/Blosc/c-blosc")
2424 (commit (string-append "v" version))))
2425 (file-name (git-file-name name version))
2428 "1ywq8j70149859vvs19wgjq89d6xsvvmvm2n1dmkzpchxgrvnw70"))))
2429 (build-system cmake-build-system)
2430 (home-page "https://blosc.org")
2431 (synopsis "Blocking, shuffling and lossless compression library")
2433 "Blosc is a high performance compressor optimized for binary data. It has
2434 been designed to transmit data to the processor cache faster than the
2435 traditional, non-compressed, direct memory fetch approach via a
2436 @code{memcpy()} system call. Blosc is meant not only to reduce the size of
2437 large datasets on-disk or in-memory, but also to accelerate memory-bound
2439 ;; Blosc itself is released under BSD-3 but it incorporates code under
2440 ;; other non-copyleft licenses.
2441 (license license:bsd-3)))
2450 (url "https://github.com/alucryd/ecm-tools")
2451 (commit (string-append "v" version))))
2452 (file-name (git-file-name name version))
2455 "1rvyx5gcy8lfklgj80szlz3312x45wzx0d9jsgwyvy8f6m4nnb0c"))))
2456 (build-system gnu-build-system)
2458 `(#:tests? #f ; no check target
2460 (list (string-append "CC=" ,(cc-for-target))
2461 (string-append "DESTDIR=" (assoc-ref %outputs "out")))
2463 (modify-phases %standard-phases
2466 (substitute* "Makefile"
2467 (("\\$\\(DESTDIR\\)/usr") "$(DESTDIR)"))
2469 (home-page "https://github.com/alucryd/ecm-tools")
2470 (synopsis "Error code modeler")
2471 (description "ECM is a utility that converts ECM files, i.e., CD data files
2472 with their error correction data losslessly rearranged for better compression,
2473 to their original, binary CD format.")
2474 (license license:gpl3+)))
2476 (define-public tarlz
2483 (uri (string-append "mirror://savannah/lzip/tarlz/"
2484 "tarlz-" version ".tar.lz"))
2486 (base32 "09xal55973ivzpaja93jcc1pfla8gb3vrk8dx7pj9qvvz5aynf9n"))))
2487 (build-system gnu-build-system)
2491 `(("lzlib" ,lzlib)))
2492 (home-page "https://www.nongnu.org/lzip/tarlz.html")
2493 (synopsis "Combination of the tar archiver and the lzip compressor")
2495 "Tarlz is a massively parallel (multi-threaded) combined implementation of
2496 the tar archiver and the lzip compressor. Tarlz creates, lists, and extracts
2497 archives in a simplified and safer variant of the POSIX pax format compressed
2498 with lzip, keeping the alignment between tar members and lzip members. The
2499 resulting multimember tar.lz archive is fully backward compatible with standard
2500 tar tools like GNU tar, which treat it like any other tar.lz archive. Tarlz
2501 can append files to the end of such compressed archives.")
2502 (license license:gpl2+)))