1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2017, 2019, 2020, 2021 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, 2021 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>
35 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
36 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
37 ;;; Copyright © 2021 Ahmad Jarara <git@ajarara.io>
39 ;;; This file is part of GNU Guix.
41 ;;; GNU Guix is free software; you can redistribute it and/or modify it
42 ;;; under the terms of the GNU General Public License as published by
43 ;;; the Free Software Foundation; either version 3 of the License, or (at
44 ;;; your option) any later version.
46 ;;; GNU Guix is distributed in the hope that it will be useful, but
47 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
48 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49 ;;; GNU General Public License for more details.
51 ;;; You should have received a copy of the GNU General Public License
52 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
54 (define-module (gnu packages compression)
55 #:use-module ((guix licenses) #:prefix license:)
56 #:use-module (guix utils)
57 #:use-module (guix packages)
58 #:use-module (guix download)
59 #:use-module (guix git-download)
60 #:use-module (guix build-system cmake)
61 #:use-module (guix build-system glib-or-gtk)
62 #:use-module (guix build-system gnu)
63 #:use-module (guix build-system go)
64 #:use-module (guix build-system meson)
65 #:use-module (guix build-system python)
66 #:use-module (guix build-system trivial)
67 #:use-module (gnu packages)
68 #:use-module (gnu packages assembly)
69 #:use-module (gnu packages autotools)
70 #:use-module (gnu packages backup)
71 #:use-module (gnu packages base)
72 #:use-module (gnu packages benchmark)
73 #:use-module (gnu packages boost)
74 #:use-module (gnu packages check)
75 #:use-module (gnu packages curl)
76 #:use-module (gnu packages documentation)
77 #:use-module (gnu packages file)
78 #:use-module (gnu packages gettext)
79 #:use-module (gnu packages glib)
80 #:use-module (gnu packages gnome)
81 #:use-module (gnu packages gnupg)
82 #:use-module (gnu packages gtk)
83 #:use-module (gnu packages llvm)
84 #:use-module (gnu packages man)
85 #:use-module (gnu packages maths)
86 #:use-module (gnu packages perl)
87 #:use-module (gnu packages pkg-config)
88 #:use-module (gnu packages python)
89 #:use-module (gnu packages qt)
90 #:use-module (gnu packages selinux)
91 #:use-module (gnu packages tls)
92 #:use-module (gnu packages valgrind)
93 #:use-module (gnu packages version-control)
94 #:use-module (gnu packages xml)
95 #:use-module (ice-9 match)
96 #:use-module (srfi srfi-1))
105 (uri (list (string-append "http://zlib.net/zlib-"
107 (string-append "mirror://sourceforge/libpng/zlib/"
108 version "/zlib-" version ".tar.gz")))
111 "18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3"))))
112 (build-system gnu-build-system)
113 (outputs '("out" "static"))
116 (modify-phases %standard-phases
118 (lambda* (#:key outputs #:allow-other-keys)
119 ;; Zlib's home-made `configure' fails when passed
120 ;; extra flags like `--enable-fast-install', so we need to
121 ;; invoke it with just what it understand.
122 (let ((out (assoc-ref outputs "out")))
123 ;; 'configure' doesn't understand '--host'.
124 ,@(if (%current-target-system)
125 `((setenv "CHOST" ,(%current-target-system)))
127 (invoke "./configure"
128 (string-append "--prefix=" out)))))
129 (add-after 'install 'move-static-library
130 (lambda* (#:key outputs #:allow-other-keys)
131 (let ((out (assoc-ref outputs "out"))
132 (static (assoc-ref outputs "static")))
133 (with-directory-excursion (string-append out "/lib")
134 (install-file "libz.a" (string-append static "/lib"))
135 (delete-file "libz.a")
137 (home-page "https://zlib.net/")
138 (synopsis "Compression library")
140 "zlib is designed to be a free, general-purpose, legally unencumbered --
141 that is, not covered by any patents -- lossless data-compression library for
142 use on virtually any computer hardware and operating system. The zlib data
143 format is itself portable across platforms. Unlike the LZW compression method
144 used in Unix compress(1) and in the GIF image format, the compression method
145 currently used in zlib essentially never expands the data. (LZW can double or
146 triple the file size in extreme cases.) zlib's memory footprint is also
147 independent of the input data and can be reduced, if necessary, at some cost
149 (license license:zlib)))
151 (define-public minizip
154 (version (package-version zlib))
155 (source (package-source zlib))
156 (build-system gnu-build-system)
159 (modify-phases %standard-phases
160 (add-after 'unpack 'enter-source
161 (lambda _ (chdir "contrib/minizip") #t))
162 (add-after 'install 'remove-crypt-h
163 (lambda* (#:key outputs #:allow-other-keys)
164 ;; Remove <minizip/crypt.h> because it interferes with libc's
165 ;; <crypt.h> given that 'minizip.pc' says "-I…/include/minizip".
166 ;; Fedora does the same:
167 ;; <https://src.fedoraproject.org/rpms/zlib/c/4d2785ec3116947872f6f32dc4104e6d36d8a7a4?branch=master>.
168 (let ((out (assoc-ref outputs "out")))
169 (delete-file (string-append out "/include/minizip/crypt.h"))
172 `(("autoconf" ,autoconf)
173 ("automake" ,automake)
174 ("libtool" ,libtool)))
175 (propagated-inputs `(("zlib" ,zlib)))
176 (home-page (package-home-page zlib))
177 (synopsis "Zip Compression library")
179 "Minizip is a minimalistic library that supports compressing,
180 extracting and viewing ZIP archives. This version is extracted from
181 the @code{zlib} source.")
182 (license (package-license zlib))))
184 (define-public fastjar
190 (uri (string-append "mirror://savannah/fastjar/fastjar-"
194 "0iginbz2m15hcsa3x4y7v3mhk54gr1r7m3ghx0pg4n46vv2snmpi"))))
195 (build-system gnu-build-system)
196 (inputs `(("zlib" ,zlib)))
197 (home-page "https://savannah.nongnu.org/projects/fastjar")
198 (synopsis "Replacement for Sun's 'jar' utility")
200 "FastJar is an attempt to create a much faster replacement for Sun's
201 @code{jar} utility. Instead of being written in Java, FastJar is written in C.")
202 (license license:gpl2+)))
204 (define-public libtar
212 "ftp://ftp.feep.net/pub/software/libtar/libtar-"
215 "mirror://debian/pool/main/libt/libtar/libtar_"
216 version ".orig.tar.gz")))
219 "02cihzl77ia0dcz7z2cga2412vyhhs5pa2355q4wpwbyga2lrwjh"))
220 (patches (search-patches "libtar-CVE-2013-4420.patch"))))
221 (build-system gnu-build-system)
222 (arguments `(#:tests? #f)) ; no "check" target
224 `(("autoconf" ,autoconf)
225 ("automake" ,automake)
226 ("libtool" ,libtool)))
229 (synopsis "C library for manipulating POSIX tar files")
231 "libtar is a C library for manipulating POSIX tar files. It handles
232 adding and extracting files to/from a tar archive.")
233 (home-page "https://repo.or.cz/libtar.git")
234 (license license:bsd-3)))
242 (uri (string-append "mirror://gnu/gzip/gzip-"
246 "1h6p374d3j8d4cdfydzls021xa2yby8myc0h8d6m8bc7k6ncq9c4"))))
247 (build-system gnu-build-system)
248 (synopsis "General file (de)compression (using lzw)")
250 ;; FIXME: The test suite wants `less', and optionally Perl.
253 (modify-phases %standard-phases
254 (add-after 'unpack 'patch-for-glibc-2.28
256 ;; Adjust the bundled gnulib to work with glibc 2.28. See e.g.
257 ;; "m4-gnulib-libio.patch". This is a phase rather than patch
258 ;; or snippet to work around <https://bugs.gnu.org/32347>.
259 (substitute* (find-files "lib" "\\.c$")
260 (("#if defined _IO_ftrylockfile")
261 "#if defined _IO_EOF_SEEN"))
262 (substitute* "lib/stdio-impl.h"
263 (("^/\\* BSD stdio derived implementations")
264 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
265 "# define _IO_IN_BACKUP 0x100\n"
267 "/* BSD stdio derived implementations")))
269 (add-after 'unpack 'use-absolute-name-of-gzip
270 (lambda* (#:key outputs #:allow-other-keys)
271 (substitute* "gunzip.in"
273 (string-append "exec " (assoc-ref outputs "out")
277 "GNU Gzip provides data compression and decompression utilities; the
278 typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
279 file; as a result, it is often used in conjunction with \"tar\", resulting in
280 \".tar.gz\" or \".tgz\", etc.")
281 (license license:gpl3+)
282 (home-page "https://www.gnu.org/software/gzip/")))
290 (uri (string-append "https://sourceware.org/pub/bzip2/bzip2-"
294 "0s92986cv0p692icqlw1j42y9nld8zd83qwhzbqd61p1dqbh6nmb"))))
295 (build-system gnu-build-system)
297 `(#:modules ((guix build gnu-build-system)
302 (modify-phases %standard-phases
303 (add-after 'set-paths 'hide-input-bzip2
304 (lambda* (#:key inputs #:allow-other-keys)
305 (let ((bzip2 (assoc-ref inputs "bzip2")))
307 ;; Prevent the build system from retaining a reference to
308 ;; BZIP2 from INPUTS.
310 (setenv "LIBRARY_PATH"
311 (string-join (delete (string-append bzip2 "/lib")
312 (string-split (getenv "LIBRARY_PATH")
315 (format #t "environment variable `LIBRARY_PATH' set to `~a'~%"
316 (getenv "LIBRARY_PATH")))
317 (format #t "no bzip2 found, nothing done~%"))
320 (lambda* (#:key target #:allow-other-keys)
321 (when ,(%current-target-system)
322 ;; Cross-compilation: use the cross tools.
323 (substitute* (find-files "." "Makefile")
325 (string-append "CC = " target "-gcc\n"))
327 (string-append "AR = " target "-ar\n"))
329 (string-append "RANLIB = " target "-ranlib\n"))
330 (("^all:(.*)test" _ prerequisites)
331 ;; Remove 'all' -> 'test' dependency.
332 (string-append "all:" prerequisites "\n"))))
334 (add-before 'build 'build-shared-lib
335 (lambda* (#:key inputs #:allow-other-keys)
336 (patch-makefile-SHELL "Makefile-libbz2_so")
337 (invoke "make" "-f" "Makefile-libbz2_so")))
338 (add-after 'install 'install-shared-lib
339 (lambda* (#:key outputs #:allow-other-keys)
340 ;; The Makefile above does not have an 'install' target, nor does
341 ;; it create all the (un)versioned symlinks, so we handle it here.
342 (let* ((out (assoc-ref outputs "out"))
343 (libdir (string-append out "/lib"))
345 ;; Locate the built library (e.g. "libbz2.so.1.0.6").
346 (lib (car (scandir "."
348 (and (string-prefix? soname file)
350 (stat:type (lstat file))))))))
351 (soversion (string-drop lib (+ 1 (string-length soname)))))
352 (install-file lib libdir)
353 (with-directory-excursion libdir
354 ;; Create symlinks libbz2.so.1 -> libbz2.so.1.0, etc.
355 (let loop ((base soname)
356 (numbers (string-split soversion #\.)))
357 (unless (null? numbers)
358 (let ((so-file (string-append base "." (car numbers))))
359 (symlink so-file base)
360 (loop so-file (cdr numbers))))))
362 (add-after 'install-shared-lib 'move-static-lib
363 (lambda* (#:key outputs #:allow-other-keys)
364 (let ((out (assoc-ref outputs "out"))
365 (static (assoc-ref outputs "static")))
366 (with-directory-excursion (string-append out "/lib")
367 (install-file "libbz2.a" (string-append static "/lib"))
368 (delete-file "libbz2.a")
370 (add-after 'install-shared-lib 'patch-scripts
371 (lambda* (#:key outputs inputs #:allow-other-keys)
372 (let* ((out (assoc-ref outputs "out")))
373 (substitute* (string-append out "/bin/bzdiff")
377 #:make-flags (list (string-append "PREFIX="
378 (assoc-ref %outputs "out")))
380 ;; Don't attempt to run the tests when cross-compiling.
381 ,@(if (%current-target-system)
384 (outputs '("out" "static"))
385 (synopsis "High-quality data compression program")
387 "bzip2 is a freely available, patent free (see below), high-quality data
388 compressor. It typically compresses files to within 10% to 15% of the best
389 available techniques (the PPM family of statistical compressors), whilst
390 being around twice as fast at compression and six times faster at
392 (license (license:non-copyleft "file://LICENSE"
393 "See LICENSE in the distribution."))
394 (home-page "https://web.archive.org/web/20180801004107/http://www.bzip.org/")))
396 (define-public lbzip2
397 ;; The last 2.5 release is 4 years behind the newest commit (from 2018) and
398 ;; may create files that can't even be decompressed by newer bzip2 versions.
399 (let ((commit "b6dc48a7b9bfe6b340ed1f6d72133608ad57144b")
403 (version (git-version "2.5" revision commit))
408 (url "https://github.com/kjn/lbzip2")
411 (base32 "140xp00dmjsr6c3dwb4dwf0pzlgf159igri321inbinsjiclkngy"))
412 (file-name (git-file-name name version))))
413 (build-system gnu-build-system)
416 (modify-phases %standard-phases
417 (add-after 'unpack 'unpack-gnulib
418 (lambda* (#:key inputs #:allow-other-keys)
419 (let ((gnulib (assoc-ref inputs "gnulib")))
420 (copy-recursively gnulib "lib")
421 (setenv "PATH" (string-append "lib:" (getenv "PATH")))
423 (delete 'bootstrap) ; gnulib still has unpatched shebangs
424 (add-after 'patch-source-shebangs 'bootstrap
426 (invoke "sh" "build-aux/autogen.sh")
429 `(("autoconf" ,autoconf)
430 ("automake" ,automake)
432 ,(let ((commit "2d431ac35c4943a3655c07ba91870d2323321b43"))
436 (url "git://git.savannah.gnu.org/gnulib.git")
439 (base32 "1f0xr4w89bqvhzsfcflcagdixidrk41k00k7kpr91w9lazfis4kf"))
440 (file-name (git-file-name "gnulib" commit)))))
442 (synopsis "Parallel bzip2 compression utility")
444 "lbzip2 is a multi-threaded compression utility with support for the
445 bzip2 compressed file format. lbzip2 can process standard bz2 files in
446 parallel. It uses POSIX threading model (pthreads), which allows it to take
447 full advantage of symmetric multiprocessing (SMP) systems. It has been proven
448 to scale linearly, even to over one hundred processor cores. lbzip2 is fully
449 compatible with bzip2 – both at file format and command line level.")
450 ;; lbzip2.org now looks fishy. There is no source code to be found.
451 ;; Reported upstream: <https://github.com/kjn/lbzip2/issues/26>.
452 (home-page "https://github.com/kjn/lbzip2")
453 (license license:gpl3+))))
455 (define-public pbzip2
461 (uri (string-append "https://launchpad.net/pbzip2/"
462 (version-major+minor version) "/" version
463 "/+download/" name "-" version ".tar.gz"))
466 "1rnvgcdixjzbrmcr1nv9b6ccrjfrhryaj7jwz28yxxv6lam3xlcg"))))
467 (build-system gnu-build-system)
471 `(#:tests? #f ; no tests
472 #:phases (modify-phases %standard-phases
473 (delete 'configure)) ; no configure script
474 #:make-flags (list (string-append "PREFIX=" %output))))
475 (home-page (string-append "https://web.archive.org/web/20180412020219/"
476 "http://compression.ca/pbzip2/"))
477 (synopsis "Parallel bzip2 implementation")
479 "Pbzip2 is a parallel implementation of the bzip2 block-sorting file
480 compressor that uses pthreads and achieves near-linear speedup on SMP machines.
481 The output of this version is fully compatible with bzip2 v1.0.2 (i.e. anything
482 compressed with pbzip2 can be decompressed with bzip2).")
483 (license (license:non-copyleft "file://COPYING"
484 "See COPYING in the distribution."))))
492 (uri (list (string-append "http://tukaani.org/xz/xz-" version
494 (string-append "http://multiprecision.org/guix/xz-"
498 "045s9agl3bpv3swlwydhgsqh7791957vmgw2plw8f1rks07r3x7n"))))
499 (build-system gnu-build-system)
502 (modify-phases %standard-phases
503 (add-after 'install 'move-static-lib
504 (lambda* (#:key outputs #:allow-other-keys)
505 (let ((out (assoc-ref outputs "out"))
506 (static (assoc-ref outputs "static")))
507 (mkdir-p (string-append static "/lib"))
508 (rename-file (string-append out "/lib/liblzma.a")
509 (string-append static "/lib/liblzma.a"))
510 ;; Remove reference to the static library from the .la file
511 ;; so Libtool does the right thing when both the shared and
512 ;; static library is available.
513 (substitute* (string-append out "/lib/liblzma.la")
514 (("^old_library='liblzma.a'") "old_library=''"))
516 (outputs '("out" "static"))
517 (synopsis "General-purpose data compression")
519 "XZ Utils is free general-purpose data compression software with high
520 compression ratio. XZ Utils were written for POSIX-like systems, but also
521 work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
523 The core of the XZ Utils compression code is based on LZMA SDK, but it has
524 been modified quite a lot to be suitable for XZ Utils. The primary
525 compression algorithm is currently LZMA2, which is used inside the .xz
526 container format. With typical files, XZ Utils create 30 % smaller output
527 than gzip and 15 % smaller output than bzip2.")
528 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
529 (home-page "https://tukaani.org/xz/")))
538 "https://github.com/fragglet/lhasa/releases/download/v"
539 version "/lhasa-" version ".tar.gz"))
542 "092zi9av18ma20c6h9448k0bapvx2plnp292741dvfd9hmgqxc1z"))))
543 (build-system gnu-build-system)
546 (modify-phases %standard-phases
547 (add-before 'check 'set-up-test-environment
548 (lambda* (#:key inputs #:allow-other-keys)
550 (search-input-directory inputs
551 "share/zoneinfo")))))))
553 `(("tzdata" ,tzdata-for-tests)))
554 (home-page "https://fragglet.github.com/lhasa/")
555 (synopsis "LHA archive decompressor")
556 (description "Lhasa is a replacement for the Unix LHA tool, for
557 decompressing .lzh (LHA / LHarc) and .lzs (LArc) archives. The backend for the
558 tool is a library, so that it can be reused for other purposes. Lhasa aims to
559 be compatible with as many types of lzh/lzs archives as possible. It also aims
560 to generate the same output as the (non-free) Unix LHA tool, so that it will
561 act as a free drop-in replacement.")
562 (license license:isc)))
571 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
575 "0wm04519pd3g8hqpjqhfr72q8qmbiwqaxcs3cndny9h86aa95y60"))))
576 (build-system gnu-build-system)
577 (arguments '(#:configure-flags '("--enable-shared")))
578 (home-page "http://www.oberhumer.com/opensource/lzo")
580 "Data compression library suitable for real-time data de-/compression")
582 "LZO is a data compression library which is suitable for data
583 de-/compression in real-time. This means it favours speed over
586 LZO is written in ANSI C. Both the source code and the compressed data
587 format are designed to be portable across platforms.")
588 (license license:gpl2+)))
597 (uri (string-append "http://www.lzop.org/download/lzop-"
601 "0h9gb8q7y54m9mvy3jvsmxf21yx8fc3ylzh418hgbbv0i8mbcwky"))))
602 (build-system gnu-build-system)
603 (inputs `(("lzo" ,lzo)))
604 (home-page "https://www.lzop.org/")
605 (synopsis "Compress or expand files")
607 "Lzop is a file compressor which is very similar to gzip. Lzop uses the
608 LZO data compression library for compression services, and its main advantages
609 over gzip are much higher compression and decompression speed (at the cost of
610 some compression ratio).")
611 (license license:gpl2+)))
619 (uri (string-append "mirror://savannah/lzip/lzip-"
623 "0j59hx72258334rmkwn57ahr6s69nlrx0a5ip1jw2fbiwr12sd63"))))
624 (build-system gnu-build-system)
625 (home-page "https://www.nongnu.org/lzip/lzip.html")
626 (synopsis "Lossless data compressor based on the LZMA algorithm")
628 "Lzip is a lossless data compressor with a user interface similar to the
629 one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
630 more than bzip2, which makes it well-suited for software distribution and data
631 archiving. Lzip is a clean implementation of the LZMA algorithm.")
632 (license license:gpl3+)))
634 (define-public lziprecover
640 (uri (string-append "mirror://savannah/lzip/lziprecover/"
641 "lziprecover-" version ".tar.gz"))
644 "0qh8dnhr5rly2k9dnx43qqynqwqzi5kfb15pyd29qwppfl4qm5gx"))))
645 (build-system gnu-build-system)
646 (home-page "https://www.nongnu.org/lzip/lziprecover.html")
647 (synopsis "Recover and decompress data from damaged lzip files")
649 "Lziprecover is a data recovery tool and decompressor for files in the lzip
650 compressed data format (.lz). It can test the integrity of lzip files, extract
651 data from damaged ones, and repair most files with small errors (up to one
652 single-byte error per member) entirely.
654 Lziprecover is not a replacement for regular backups, but a last line of defence
655 when even the backups are corrupt. It can recover files by merging the good
656 parts of two or more damaged copies, such as can be easily produced by running
657 @command{ddrescue} on a failing device.
659 This package also includes @command{unzcrash}, a tool to test the robustness of
660 decompressors when faced with corrupted input.")
661 (license (list license:bsd-2 ; arg_parser.{cc,h}
662 license:gpl2+)))) ; everything else
664 (define-public sharutils
671 (uri (string-append "mirror://gnu/sharutils/sharutils-"
673 (patches (search-patches "sharutils-CVE-2018-1000097.patch"))
676 "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))
677 (modules '((guix build utils)))
680 ;; Adjust for newer libc versions.
681 (substitute* (find-files "lib" "\\.c$")
682 (("#if defined _IO_ftrylockfile")
683 "#if defined _IO_EOF_SEEN"))
684 (substitute* "lib/stdio-impl.h"
685 (("^/\\* BSD stdio derived implementations")
686 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
687 "# define _IO_IN_BACKUP 0x100\n"
689 "/* BSD stdio derived implementations")))
690 ;; ... and for newer GCC with -fno-common.
691 (substitute* '("src/shar-opts.h"
693 "src/uudecode-opts.h"
694 "src/uuencode-opts.h")
695 (("char const \\* const program_name" all)
696 (string-append "extern " all)))))))
697 (build-system gnu-build-system)
702 (modify-phases %standard-phases
703 (add-after 'patch-source-shebangs 'unpatch-source-shebang
704 ;; revert the patch-shebang phase on a script which is
707 (substitute* "tests/shar-1.ok"
708 (((which "sh")) "/bin/sh")))))))
709 (home-page "https://www.gnu.org/software/sharutils/")
710 (synopsis "Archives in shell scripts, uuencode/uudecode")
712 "GNU sharutils is a package for creating and manipulating shell
713 archives that can be readily emailed. A shell archive is a file that can be
714 processed by a Bourne-type shell to unpack the original collection of files.
715 This package is mostly for compatibility and historical interest.")
716 (license license:gpl3+)))
718 (define-public sfarklib
725 (url "https://github.com/raboof/sfArkLib")
727 (file-name (git-file-name name version))
730 "0jrxy24gak7q5ml06p5jjgzk9i5r2mkfjk4ycirkp4kg7k5a237w"))))
731 (build-system gnu-build-system)
733 `(#:tests? #f ;no "check" target
735 (modify-phases %standard-phases
737 (lambda* (#:key outputs #:allow-other-keys)
738 (substitute* "Makefile"
739 (("/usr/local") (assoc-ref outputs "out")))
743 (home-page "https://github.com/raboof/sfArkLib")
744 (synopsis "Library for SoundFont decompression")
746 "SfArkLib is a C++ library for decompressing SoundFont files compressed
747 with the sfArk algorithm.")
748 (license license:gpl3+)))
750 (define-public sfarkxtc
751 (let ((commit "13cd6f93725a90d91ec5ea75babf1dbd694ac463")
755 (version (git-version "0" revision commit))
757 ;; There are no release tarballs, so we just fetch the latest
758 ;; commit at this time.
761 (url "https://github.com/raboof/sfarkxtc")
763 (file-name (git-file-name name version))
766 "1mb1jyk1m11l1gppd9hmql9cyp55sdf7jk5rbc7acky1z4k4mv19"))))
767 (build-system gnu-build-system)
769 `(#:tests? #f ;no "check" target
771 (modify-phases %standard-phases
773 (lambda* (#:key outputs #:allow-other-keys)
774 (substitute* "Makefile"
775 (("/usr/local") (assoc-ref outputs "out")))
779 ("sfarklib" ,sfarklib)))
780 (home-page "https://github.com/raboof/sfarkxtc")
781 (synopsis "Basic sfArk decompressor")
782 (description "SfArk extractor converts SoundFonts in the compressed legacy
783 sfArk file format to the uncompressed sf2 format.")
784 (license license:gpl3+))))
786 (define-public libmspack
789 (home-page "https://cabextract.org.uk/libmspack/")
794 (uri (string-append home-page name "-" version "alpha.tar.gz"))
796 (base32 "13janaqsvm7aqc4agjgd4819pbgqv50j88bh5kci1z70wvg65j5s"))))
797 (build-system gnu-build-system)
799 `(#:configure-flags '("--disable-static")))
800 (synopsis "Compression tools for some formats used by Microsoft")
802 "The purpose of libmspack is to provide both compression and
803 decompression of some loosely related file formats used by Microsoft.")
804 (license license:lgpl2.1+)))
813 (uri (git-reference (url "https://github.com/lz4/lz4")
814 (commit (string-append "v" version))))
816 (base32 "1w02kazh1fps3sji2sn89fz862j1199c5ajrqcgl1bnlxj09kcbz"))
817 (file-name (git-file-name name version))))
818 (build-system gnu-build-system)
819 (outputs (list "out" "static"))
823 ("valgrind" ,valgrind)))
825 `(;; Not designed for parallel testing.
826 ;; See https://github.com/lz4/lz4/issues/957#issuecomment-737419821
829 #:make-flags (list (string-append "CC=" ,(cc-for-target))
830 (string-append "prefix=" (assoc-ref %outputs "out")))
832 (modify-phases %standard-phases
833 (delete 'configure) ; no configure script
834 (add-before 'check 'disable-broken-test
836 (substitute* "tests/Makefile"
837 ;; This fails when $prefix is not a single top-level directory.
838 (("^test: (.*) test-install" _ targets)
839 (string-append "test: " targets)))
841 (add-after 'install 'move-static-library
842 (lambda* (#:key outputs #:allow-other-keys)
843 (let ((out (assoc-ref outputs "out"))
844 (static (assoc-ref outputs "static")))
845 (mkdir-p (string-append static "/lib"))
846 (rename-file (string-append out "/lib/liblz4.a")
847 (string-append static "/lib/liblz4.a"))
849 (home-page "https://www.lz4.org")
850 (synopsis "Compression algorithm focused on speed")
851 (description "LZ4 is a lossless compression algorithm, providing
852 compression speed at 400 MB/s per core (0.16 Bytes/cycle). It also features an
853 extremely fast decoder, with speed in multiple GB/s per core (0.71 Bytes/cycle).
854 A high compression derivative, called LZ4_HC, is also provided. It trades CPU
855 time for compression ratio.")
856 ;; The libraries (lz4, lz4hc, and xxhash) are BSD licenced. The command
857 ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
858 (license (list license:bsd-2 license:gpl2+))))
860 (define-public squashfs-tools
862 (name "squashfs-tools")
868 (url "https://github.com/plougher/squashfs-tools")
870 (file-name (git-file-name name version))
872 (base32 "18d4nwa22vgb8j2badngjngw63f0lj501cvlh3920wqy2mqxwav6"))))
873 (build-system gnu-build-system)
875 `(#:tests? #f ; no check target
877 (list (string-append "CC=" ,(cc-for-target))
882 (string-append "INSTALL_DIR=" %output "/bin"))
884 (modify-phases %standard-phases
887 (chdir "squashfs-tools")))
888 (add-after 'install 'install-documentation
889 ;; Install what very little usage documentation is provided.
890 (lambda* (#:key outputs #:allow-other-keys)
891 (let* ((out (assoc-ref outputs "out"))
892 (doc (string-append out "/share/doc/" ,name)))
893 (install-file "../USAGE" doc)))))))
899 ("zstd:lib" ,zstd "lib")))
900 (home-page "https://github.com/plougher/squashfs-tools")
901 (synopsis "Tools to create and extract squashfs file systems")
903 "Squashfs is a highly compressed read-only file system for Linux. It
904 compresses files, inodes, and directories with one of several compressors.
905 All blocks are packed to minimize the data overhead, and block sizes of
906 between 4K and 1M are supported. It is intended to be used for archival use,
907 for live media, and for embedded systems where low overhead is needed.
908 This package allows you to create and extract such file systems.")
909 (license license:gpl2+)))
911 (define-public squashfs-tools-ng
913 (name "squashfs-tools-ng")
919 (url "https://github.com/AgentD/squashfs-tools-ng")
920 (commit (string-append "v" version))))
921 (file-name (git-file-name name version))
923 (base32 "12ipqmjp10574sz64ls8qbgzkxz5dcbzk0l2fxyh2yrrhnjp34mi"))
924 (modules '((guix build utils)))
927 ;; Delete bundled third-party libraries.
928 (for-each (lambda (directory)
929 (substitute* "Makefile.am"
930 (((format #f "^include ~a.*" directory)) ""))
931 (delete-file-recursively directory))
934 (build-system gnu-build-system)
937 (list "--disable-static")))
939 `(("autoconf" ,autoconf)
940 ("automake" ,automake)
942 ("pkg-config" ,pkg-config)))
944 `(("libselinux" ,libselinux)
946 ;; Compression algorithms.
952 ("zstd:lib" ,zstd "lib")))
953 (home-page "https://github.com/AgentD/squashfs-tools-ng")
954 (synopsis "Tools to create and extract squashfs file systems")
956 "Squashfs is a highly compressed read-only file system for Linux. It
957 compresses files, inodes, and directories with one of several compressors.
958 All blocks are packed to minimize the data overhead, and block sizes of
959 between 4K and 1M are supported. It is intended to be used for archival use,
960 for live media, and for embedded systems where low overhead is needed.
962 The squashfs-tools-ng package offers alternative tooling to create and extract
963 such file systems. It is not based on the older squashfs-tools package and
964 its tools have different names:
967 @item @command{gensquashfs} produces SquashFS images from a directory or
968 @command{gen_init_cpio}-like file listings and can generate SELinux labels.
969 @item @command{rdsquashfs} inspects and unpacks SquashFS images.
970 @item @command{sqfs2tar} and @command{tar2sqfs} convert between SquashFS and
972 @item @command{sqfsdiff} compares the contents of two SquashFS images.
975 These commands are largely command-line wrappers around the included
976 @code{libsquashfs} library that intends to make SquashFS available to other
977 applications as an embeddable, extensible archive format.
979 Both the library and tools operate deterministically: same input will produce
980 byte-for-byte identical output.")
981 ;; Upstream goes to some lengths to ensure that libsquashfs is LGPL3+.
982 (license license:gpl3+)))
990 (uri (string-append "http://zlib.net/pigz/"
991 name "-" version ".tar.gz"))
994 "0z9avc4mifwcpj3qdsf9m2rjw9jx03b2r9pj0c4xgla9fh6ppv9f"))))
995 (build-system gnu-build-system)
998 (modify-phases %standard-phases
1001 (lambda* (#:key outputs #:allow-other-keys)
1002 (let* ((out (assoc-ref outputs "out"))
1003 (bin (string-append out "/bin"))
1004 (man (string-append out "/share/man/man1")))
1005 (install-file "pigz" bin)
1006 (symlink "pigz" (string-append bin "/unpigz"))
1007 (install-file "pigz.1" man)
1010 (list ,(string-append "CC=" (cc-for-target)))
1011 #:test-target "tests"))
1012 (inputs `(("zlib" ,zlib)))
1013 (home-page "https://zlib.net/pigz/")
1014 (synopsis "Parallel implementation of gzip")
1016 "This package provides a parallel implementation of gzip that exploits
1017 multiple processors and multiple cores when compressing data.")
1019 ;; Things under zopfli/ are under ASL2.0, but 4 files at the top-level,
1020 ;; written by Mark Adler, are under another non-copyleft license.
1021 (license license:asl2.0)))
1030 "https://github.com/vasi/pixz/releases/download/v" version
1031 "/pixz-" version ".tar.xz"))
1034 "1ifxr18f2h75gkcrkx8033kwmwmrcgxshpaawyc2n4dzn1p2rqz5"))))
1035 (build-system gnu-build-system)
1037 `(("pkg-config" ,pkg-config)
1038 ("libarchive" ,libarchive)))
1039 (home-page "https://github.com/vasi/pixz")
1040 (synopsis "Parallel indexing implementation of LZMA")
1042 "The existing XZ Utils provide great compression in the .xz file format,
1043 but they produce just one big block of compressed data. Pixz instead produces
1044 a collection of smaller blocks which makes random access to the original data
1045 possible and can compress in parallel. This is especially useful for large
1047 (license license:bsd-2)))
1049 (define-public cabextract
1052 (home-page "https://cabextract.org.uk/")
1056 (uri (string-append home-page "cabextract-" version ".tar.gz"))
1059 "19qwhl2r8ip95q4vxzxg2kp4p125hjmc9762sns1dwwf7ikm7hmg"))
1060 (modules '((guix build utils)))
1063 ;; Delete bundled libmspack.
1064 (delete-file-recursively "mspack")
1066 (build-system gnu-build-system)
1068 '(#:configure-flags '("--with-external-libmspack")
1070 (modify-phases %standard-phases
1071 ;; cabextract needs some of libmspack's header files.
1072 ;; These are located in the "mspack" directory of libmspack.
1073 (add-before 'build 'unpack-libmspack
1074 (lambda* (#:key inputs #:allow-other-keys)
1075 (let ((dir-name "libmspack-src"))
1077 (invoke "tar" "-xvf" (assoc-ref inputs "libmspack-source")
1078 "-C" dir-name "--strip-components" "1")
1079 (rename-file (string-append dir-name "/mspack")
1081 (delete-file-recursively dir-name)
1084 `(("pkg-config" ,pkg-config)))
1086 `(("libmspack" ,libmspack)
1087 ("libmspack-source" ,(package-source libmspack))))
1088 (synopsis "Tool to unpack Cabinet archives")
1089 (description "Extracts files out of Microsoft Cabinet (.cab) archives")
1090 ;; Some source files specify gpl2+, lgpl2+, however COPYING is gpl3.
1091 (license license:gpl3+)))
1093 (define-public libjcat
1102 (url "https://github.com/hughsie/libjcat")
1104 (file-name (git-file-name name version))
1106 (base32 "18qkyg19r7fxzv93kar5n808n3582ygjmqwa7rnyg5y4b6hnwihl"))))
1107 (build-system meson-build-system)
1109 `(("gobject-introspection" ,gobject-introspection)
1110 ("help2man" ,help2man)
1111 ("pkg-config" ,pkg-config)))
1118 ("json-glib" ,json-glib)
1120 (home-page "https://github.com/hughsie/libjcat")
1121 (synopsis "Library for reading and writing Jcat files")
1123 "This library allows reading and writing gzip-compressed JSON catalog
1124 files, which can be used to store GPG, PKCS-7 and SHA-256 checksums for each
1126 (license license:lgpl2.1+)))
1128 (define-public xdelta
1136 (url "https://github.com/jmacd/xdelta")
1137 (commit (string-append "v" version))))
1138 (file-name (git-file-name name version))
1141 "09mmsalc7dwlvgrda56s2k927rpl3a5dzfa88aslkqcjnr790wjy"))
1143 ;; This file isn't freely distributable and has no effect on building.
1145 (delete-file "xdelta3/draft-korn-vcdiff.txt")
1147 (build-system gnu-build-system)
1149 `(("autoconf" ,autoconf)
1150 ("automake" ,automake)))
1153 (modify-phases %standard-phases
1154 (add-after 'unpack 'enter-build-directory
1155 (lambda _ (chdir "xdelta3") #t)))))
1156 (home-page "http://xdelta.org")
1157 (synopsis "Delta encoder for binary files")
1158 (description "xdelta encodes only the differences between two binary files
1159 using the VCDIFF algorithm and patch file format described in RFC 3284. It can
1160 also be used to apply such patches. xdelta is similar to @command{diff} and
1161 @command{patch}, but is not limited to plain text and does not generate
1162 human-readable output.")
1163 (license license:asl2.0)))
1165 (define-public lrzip
1173 "http://ck.kolivas.org/apps/lrzip/lrzip-" version ".tar.xz"))
1175 (base32 "0ziyanspd96dc3lp2qdcylc7aq8dhb511jhqrhxvlp502fjqjqrc"))))
1176 (build-system gnu-build-system)
1178 `(;; nasm is only required when building for 32-bit x86 platforms
1179 ,@(if (string-prefix? "i686" (or (%current-target-system)
1189 (home-page "http://ck.kolivas.org/apps/lrzip/")
1190 (synopsis "Large file compressor with a very high compression ratio")
1191 (description "lrzip is a compression utility that uses long-range
1192 redundancy reduction to improve the subsequent compression ratio of
1193 larger files. It can then further compress the result with the ZPAQ or
1194 LZMA algorithms for maximum compression, or LZO for maximum speed. This
1195 choice between size or speed allows for either better compression than
1196 even LZMA can provide, or a higher speed than gzip while compressing as
1198 (license (list license:gpl3+
1199 license:public-domain)))) ; most files in lzma/
1201 (define-public snappy
1209 (url "https://github.com/google/snappy")
1211 (file-name (git-file-name name version))
1213 (base32 "03zz56h79z0sgvi5sangjqn9dahhzvf645v26n1y0gwmfbmsax95"))
1215 (search-patches "snappy-add-O2-flag-in-CmakeLists.txt.patch"
1216 "snappy-add-inline-for-GCC.patch"))))
1217 (build-system cmake-build-system)
1220 (list "-DBUILD_SHARED_LIBS=ON"
1221 ;; These would be installed alongside Snappy otherwise.
1222 "-DBENCHMARK_ENABLE_INSTALL=OFF"
1223 "-DINSTALL_GTEST=OFF")
1225 (modify-phases %standard-phases
1226 (add-after 'unpack 'unpack-third_party-subprojects
1227 (lambda* (#:key native-inputs inputs #:allow-other-keys)
1228 (with-directory-excursion "third_party"
1229 (for-each (lambda (subproject)
1230 (let* ((input (string-append subproject "-source"))
1231 (source (assoc-ref (or native-inputs inputs)
1233 (with-directory-excursion subproject
1234 ;; Take advantage of the coincidence that both
1235 ;; use GIT-FETCH, which creates a directory.
1236 (copy-recursively source "."))))
1241 `(("benchmark-source" ,(package-source benchmark))
1242 ("googletest-source" ,(package-source googletest))))
1243 (home-page "https://github.com/google/snappy")
1244 (synopsis "Fast compressor/decompressor")
1245 (description "Snappy is a compression/decompression library. It does not
1246 aim for maximum compression, or compatibility with any other compression library;
1247 instead, it aims for very high speeds and reasonable compression. For instance,
1248 compared to the fastest mode of zlib, Snappy is an order of magnitude faster
1249 for most inputs, but the resulting compressed files are anywhere from 20% to
1251 (license license:asl2.0)))
1253 ;; We need this for irods.
1254 (define-public snappy-with-clang6
1257 (name "snappy-with-clang")
1258 ;; XXX 1.1.9 fails to build with clang with
1259 ;; error: invalid output constraint '=@ccz' in asm
1265 (url "https://github.com/google/snappy")
1267 (file-name (git-file-name name version))
1269 (base32 "1j0kslq2dvxgkcxl1gakhvsa731yrcvcaipcp5k8k7ayicvkv9jv"))))
1272 '("-DBUILD_SHARED_LIBS=ON"
1273 "-DCMAKE_CXX_COMPILER=clang++"
1274 "-DCMAKE_CXX_FLAGS=-stdlib=libc++"
1275 "-DCMAKE_EXE_LINKER_FLAGS=-lc++abi")
1277 (modify-phases %standard-phases
1278 (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
1279 (lambda* (#:key native-inputs inputs #:allow-other-keys)
1280 (let ((gcc (assoc-ref (or native-inputs inputs) "gcc")))
1281 (setenv "CPLUS_INCLUDE_PATH"
1283 (cons* (search-input-directory inputs
1285 ;; Hide GCC's C++ headers so that they do not interfere with
1286 ;; the Clang headers.
1287 (delete (string-append gcc "/include/c++")
1288 (string-split (getenv "CPLUS_INCLUDE_PATH")
1292 "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
1293 (getenv "CPLUS_INCLUDE_PATH"))))))))
1294 (properties `((hidden? . #true)))
1296 `(("clang" ,clang-toolchain-6)))
1298 `(("libcxx+libcxxabi" ,libcxx+libcxxabi-6)
1299 ("libcxxabi" ,libcxxabi-6)))))
1301 (define-public p7zip
1307 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1308 version "/" name "_" version
1309 "_src_all.tar.bz2"))
1312 "07rlwbbgszq8i7m8jh3x6j2w2hc9a72dc7fmqawnqkwlwb00mcjy"))
1313 (modules '((guix build utils)))
1316 ;; Remove non-free source files
1317 (for-each delete-file
1319 (find-files "CPP/7zip/Compress" "Rar.*")
1320 (find-files "CPP/7zip/Crypto" "Rar.*")
1321 (find-files "DOC/unRarLicense.txt")
1322 (find-files "Utils/file_Codecs_Rar_so.py")))
1323 (delete-file-recursively "CPP/7zip/Archive/Rar")
1324 (delete-file-recursively "CPP/7zip/Compress/Rar")
1325 ;; Fix FTBFS with gcc-10.
1326 (substitute* "CPP/Windows/ErrorMsg.cpp"
1327 (("switch\\(errorCode\\) \\{")
1328 "switch(static_cast<HRESULT>(errorCode)) {"))))
1329 (patches (search-patches "p7zip-CVE-2016-9296.patch"
1330 "p7zip-CVE-2017-17969.patch"
1331 "p7zip-remove-unused-code.patch"))))
1332 (build-system gnu-build-system)
1335 (list (string-append "DEST_HOME=" (assoc-ref %outputs "out")) "all3")
1337 (modify-phases %standard-phases
1341 ,(cond ((target-x86-64?)
1342 "makefile.linux_amd64_asm")
1344 "makefile.linux_x86_asm_gcc_4.X")
1346 "makefile.linux_any_cpu_gcc_4.X"))
1347 "makefile.machine")))
1349 (lambda* (#:key tests? #:allow-other-keys)
1351 (invoke "make" "test")
1352 (invoke "make" "test_7z")
1353 (invoke "make" "test_7zr")))))))
1355 (cond ((target-x86-64?)
1360 (home-page "http://p7zip.sourceforge.net/")
1361 (synopsis "Command-line file archiver with high compression ratio")
1362 (description "p7zip is a command-line port of 7-Zip, a file archiver that
1363 handles the 7z format which features very high compression ratios.")
1364 (license (list license:lgpl2.1+
1366 license:public-domain))))
1368 (define-public gzstream
1375 ;; No versioned URL, but last release was in 2003.
1376 "http://www.cs.unc.edu/Research/compgeom/gzstream/gzstream.tgz")
1377 (file-name (string-append name "-" version ".tgz"))
1380 "00y19pqjsdj5zcrx4p9j56pl73vayfwnb7y2hvp423nx0cwv5b4r"))
1381 (modules '((guix build utils)))
1383 ;; Remove pre-compiled object.
1385 (delete-file "gzstream.o")
1387 (build-system gnu-build-system)
1389 `(#:test-target "test"
1391 (modify-phases %standard-phases
1392 ;; Enable PIC, so it can be used in shared libraries.
1393 (add-after 'unpack 'use-pic
1395 (substitute* "Makefile"
1396 (("CPPFLAGS = " all) (string-append all "-fPIC ")))
1400 (lambda* (#:key outputs #:allow-other-keys)
1401 (let* ((out (assoc-ref outputs "out"))
1402 (lib (string-append out "/lib"))
1403 (include (string-append out "/include")))
1404 (install-file "libgzstream.a" lib)
1405 (install-file "gzstream.h" include)
1407 (propagated-inputs `(("zlib" ,zlib)))
1408 (home-page "http://www.cs.unc.edu/Research/compgeom/gzstream/")
1409 (synopsis "Compressed C++ iostream")
1410 (description "gzstream is a small library for providing zlib
1411 functionality in a C++ iostream.")
1412 (license license:lgpl2.1+)))
1420 (method url-fetch/zipbomb)
1421 (uri (string-append "http://mattmahoney.net/dc/zpaq"
1422 (string-delete #\. version) ".zip"))
1425 "066l94yyladlfzri877nh2dhkvspagjn3m5bmv725fmhkr9c4pp8"))
1426 (modules '((guix build utils)))
1428 ;; Delete irrelevant pre-compiled binaries.
1430 (for-each delete-file (find-files "." "\\.exe$"))
1432 (build-system gnu-build-system)
1435 (modify-phases %standard-phases
1436 (delete 'configure)) ; no ‘configure’ script
1439 (string-append "CPPFLAGS=-Dunix"
1440 ,(match (or (%current-target-system)
1445 ;; These should be safe, lowest-common-denominator instruction sets,
1446 ;; allowing for some optimisation while remaining reproducible.
1447 (string-append "CXXFLAGS=-O3 -DNDEBUG"
1448 ,(match (or (%current-target-system)
1450 ("x86_64-linux" " -march=nocona -mtune=generic")
1451 ("i686-linux" " -march=i686 -mtune=generic")
1452 ("armhf-linux" " -mtune=generic-armv7-a")
1454 (string-append "PREFIX="
1455 (assoc-ref %outputs "out")))))
1457 `(("perl" ,perl))) ; for pod2man
1458 (home-page "http://mattmahoney.net/dc/zpaq.html")
1459 (synopsis "Incremental journaling archiver")
1460 (description "ZPAQ is a command-line archiver for realistic situations with
1461 many duplicate and already compressed files. It backs up only those files
1462 modified since the last update. All previous versions remain untouched and can
1463 be independently recovered. Identical files are only stored once (known as
1464 @dfn{de-duplication}). Archives can also be encrypted.
1466 ZPAQ is intended to back up user data, not entire operating systems. It ignores
1467 owner and group IDs, ACLs, extended attributes, or special file types like
1468 devices, sockets, or named pipes. It does not follow or restore symbolic links
1469 or junctions, and always follows hard links.")
1470 (license (list license:public-domain
1471 ;; libzpaq.cpp contains a mix of public-domain and
1472 ;; expat-licenced (or ‘MIT’) code.
1475 (define-public unshield
1480 (origin (method git-fetch)
1482 (url "http://github.com/twogood/unshield")
1484 (file-name (git-file-name name version))
1487 "19wn22vszhci8dfcixx5rliz7phx3lv5ablvhjlclvj75k2vsdqd"))))
1488 (build-system cmake-build-system)
1491 ("openssl" ,openssl)
1492 ;; Test data that is otherwise downloaded with curl.
1493 ("unshield-avigomanager11b22.zip"
1497 "https://www.dropbox.com/s/8r4b6752swe3nhu/"
1498 "unshield-avigomanager11b22.zip?dl=1"))
1500 (base32 "0fwq7lih04if68wpwpsk5wjqyvh32db76a41sq6gbx4dn1lc3ddn"))
1501 (file-name "unshield-avigomanager11b22.zip")))
1502 ("unshield-baldurs_gate_patch_v1_1_4315_international.zip"
1506 "https://www.dropbox.com/s/9ruil8oi6amjbbk/"
1507 "unshield-baldurs_gate_patch_v1_1_4315_international.zip?dl=1"))
1509 (base32 "0spaxf6dardlhqxz3ys09fzamj007q3nfyw4xng6gh3qp9780maj"))
1510 (file-name "unshield-baldurs_gate_patch_v1_1_4315_international.zip")))
1511 ("unshield-the-feeble-files-spanish.zip"
1515 "https://www.dropbox.com/s/1ng0z9kfxc7eb1e/"
1516 "unshield-the-feeble-files-spanish.zip?dl=1"))
1518 (base32 "1k5cw6vnpja8yjlnhx5124xrw9i8s1l539hfdqqrqz3l5gn0bnyd"))
1519 (file-name "unshield-the-feeble-files-spanish.zip")))))
1521 `(("unzip" ,unzip)))
1523 `(#:out-of-source? #f
1525 (modify-phases %standard-phases
1526 (add-before 'check 'pre-check
1527 (lambda* (#:key inputs #:allow-other-keys)
1528 (for-each (lambda (i)
1529 (copy-file (assoc-ref inputs i)
1530 (string-append "test/v0/" i)))
1531 '("unshield-avigomanager11b22.zip"
1532 "unshield-baldurs_gate_patch_v1_1_4315_international.zip"
1533 "unshield-the-feeble-files-spanish.zip"))
1534 (substitute* (find-files "test/" "/*\\.sh")
1535 ;; Tests expect the unshield binary in a specific
1537 (("/var/tmp/unshield/bin/unshield")
1538 (string-append (getcwd) "/src/unshield"))
1539 ;; We no longer need to download the data.
1541 (("curl -(|f)sSL -o test.zip .*") ""))
1542 (substitute* "test/v0/avigomanager.sh"
1544 (string-append (getcwd)
1545 "/test/v0/unshield-avigomanager11b22.zip")))
1546 (substitute* "test/v0/baldurs_gate_patch_v1_1_4315_international.sh"
1550 "/test/v0/unshield-baldurs_gate_patch_v1_1_4315_international.zip")))
1551 (substitute* "test/v0/the-feeble-files-spanish.sh"
1553 (string-append (getcwd)
1554 "/test/v0/unshield-the-feeble-files-spanish.zip")))
1558 (invoke "./run-tests.sh"))))))
1559 (home-page "https://github.com/twogood/unshield")
1560 (synopsis "Extract CAB files from InstallShield installers")
1562 "@command{unshield} is a tool and library for extracting @file{.cab}
1563 archives from InstallShield installers.")
1564 (license license:expat)))
1573 (uri (string-append "https://github.com/facebook/zstd/releases/download/"
1574 "v" version "/zstd-" version ".tar.gz"))
1576 (base32 "150y541303vnvfhd8wkbih00lfvvm98rd12yijwlbkqzg3xgp52i"))))
1577 (build-system gnu-build-system)
1578 (outputs '("out" ;1.2MiB executables and documentation
1579 "lib" ;1.2MiB shared library and headers
1580 "static")) ;1.2MiB static library
1583 (modify-phases %standard-phases
1584 (add-after 'unpack 'remove-bogus-check
1586 ;; lib/Makefile falsely claims that no .pc file can be created.
1587 (substitute* "lib/Makefile"
1588 (("error configured .*dir ")
1591 (add-after 'unpack 'patch-command-file-names
1592 ;; Don't require hard requirements to be in $PATH.
1593 (lambda* (#:key outputs #:allow-other-keys)
1594 (let* ((out (assoc-ref outputs "out"))
1595 (our (lambda (name) (string-append out "/bin/" name))))
1596 (substitute* "programs/zstdgrep"
1597 (("(:-)(grep)" _ prefix command)
1598 (string-append prefix (which command)))
1599 (("(:-)(zstdcat)" _ prefix command)
1600 (string-append prefix (our command))))
1601 (substitute* "programs/zstdless"
1602 (("zstdcat" command)
1604 (delete 'configure) ;no configure script
1605 (add-after 'install 'adjust-library-locations
1606 (lambda* (#:key outputs #:allow-other-keys)
1607 (let* ((out (assoc-ref outputs "out"))
1608 (lib (assoc-ref outputs "lib"))
1609 (static (assoc-ref outputs "static"))
1610 (shared-libs (string-append lib "/lib"))
1611 (static-libs (string-append static "/lib")))
1612 ;; Move the static library to its own output to save ~1MiB.
1613 (mkdir-p static-libs)
1614 (for-each (lambda (ar)
1615 (link ar (string-append static-libs "/"
1618 (find-files shared-libs "\\.a$"))
1620 ;; Make sure the pkg-config file refers to the right output.
1621 (substitute* (string-append shared-libs "/pkgconfig/libzstd.pc")
1623 ;; Note: The .pc file expects a trailing slash for 'prefix'.
1624 (string-append "prefix=" lib "/\n")))))))
1626 (list ,(string-append "CC=" (cc-for-target))
1627 (string-append "prefix=" (assoc-ref %outputs "out"))
1628 (string-append "libdir=" (assoc-ref %outputs "lib") "/lib")
1629 (string-append "includedir=" (assoc-ref %outputs "lib") "/include")
1630 ;; Auto-detection is over-engineered and buggy.
1633 ;; Skip auto-detection of, and creating a dependency on, the build
1634 ;; environment's ‘xz’ for what amounts to a dubious feature anyway.
1636 ;; Not currently detected, but be explicit & avoid surprises later.
1639 (home-page "https://facebook.github.io/zstd/")
1640 (synopsis "Zstandard real-time compression algorithm")
1641 (description "Zstandard (@command{zstd}) is a lossless compression algorithm
1642 that combines very fast operation with a compression ratio comparable to that of
1643 zlib. In most scenarios, both compression and decompression can be performed in
1644 ‘real time’. The compressor can be configured to provide the most suitable
1645 trade-off between compression ratio and speed, without affecting decompression
1647 (license (list license:bsd-3 ; the main top-level LICENSE file
1648 license:bsd-2 ; many files explicitly state 2-Clause
1649 license:gpl2 ; the main top-level COPYING file
1650 license:gpl3+ ; tests/gzip/*.sh
1651 license:expat ; lib/dictBuilder/divsufsort.[ch]
1652 license:public-domain ; zlibWrapper/examples/fitblk*
1653 license:zlib)))) ; zlibWrapper/{gz*.c,gzguts.h}
1655 (define-public pzstd
1656 (package/inherit zstd
1660 `(,@(if (%current-target-system)
1661 `(("googletest" ,googletest))
1664 `(,@(if (%current-system)
1665 `(("googletest" ,googletest))
1669 (modify-phases %standard-phases
1670 (add-after 'unpack 'enter-subdirectory
1671 (lambda _ (chdir "contrib/pzstd") #t))
1672 (delete 'configure) ; no configure script
1673 (add-before 'check 'compile-tests
1674 (lambda* (#:key make-flags #:allow-other-keys)
1675 (apply invoke "make" "tests" make-flags)))
1676 (add-after 'install 'install-documentation
1677 (lambda* (#:key outputs #:allow-other-keys)
1678 (let* ((out (assoc-ref outputs "out"))
1679 (doc (string-append out "/share/doc/" ,name)))
1681 (install-file "README.md" doc)
1684 (list (string-append "CC=" ,(cc-for-target))
1685 (string-append "CXX=" ,(cxx-for-target))
1686 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1687 (home-page (package-home-page zstd))
1688 (synopsis "Threaded implementation of the Zstandard compression algorithm")
1689 (description "Parallel Zstandard (PZstandard or @command{pzstd}) is a
1690 multi-threaded implementation of the @uref{http://zstd.net/, Zstandard
1691 compression algorithm}. It is fully compatible with the original Zstandard file
1692 format and command-line interface, and can be used as a drop-in replacement.
1694 Compression is distributed over multiple processor cores to improve performance,
1695 as is the decompression of data compressed in this manner. Data compressed by
1696 other implementations will only be decompressed by two threads: one performing
1697 the actual decompression, the other input and output.")
1698 (license (package-license zstd))))
1707 (uri (string-append "mirror://sourceforge/infozip"
1708 "/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz"))
1711 "0sb3h3067pzf3a7mlxn1hikpcjrsvycjcnj9hl9b1c3ykcgvps7h"))))
1712 (build-system gnu-build-system)
1713 (inputs `(("bzip2" ,bzip2)))
1715 `(#:tests? #f ; no test target
1716 #:make-flags (let ((out (assoc-ref %outputs "out")))
1717 (list "-f" "unix/Makefile"
1718 (string-append "prefix=" out)
1719 (string-append "MANDIR=" out "/share/man/man1")))
1721 (modify-phases %standard-phases
1723 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1724 (apply invoke "make" "generic_gcc" make-flags)))
1725 (delete 'configure))))
1726 (home-page "http://www.info-zip.org/Zip.html")
1727 (synopsis "Compression and file packing utility")
1729 "Zip is a compression and file packaging/archive utility. Zip is useful
1730 for packaging a set of files for distribution, for archiving files, and for
1731 saving disk space by temporarily compressing unused files or directories.
1732 Zip puts one or more compressed files into a single ZIP archive, along with
1733 information about the files (name, path, date, time of last modification,
1734 protection, and check information to verify file integrity). An entire
1735 directory structure can be packed into a ZIP archive with a single command.
1737 Zip has one compression method (deflation) and can also store files without
1738 compression. Zip automatically chooses the better of the two for each file.
1739 Compression ratios of 2:1 to 3:1 are common for text files.")
1740 (license (license:non-copyleft "file://LICENSE"
1741 "See LICENSE in the distribution."))))
1743 (define-public unzip
1744 (package (inherit zip)
1750 (uri (string-append "mirror://sourceforge/infozip"
1751 "/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz"))
1754 "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83"))
1755 (patches (search-patches "unzip-CVE-2014-8139.patch"
1756 "unzip-CVE-2014-8140.patch"
1757 "unzip-CVE-2014-8141.patch"
1758 "unzip-CVE-2014-9636.patch"
1759 "unzip-CVE-2015-7696.patch"
1760 "unzip-CVE-2015-7697.patch"
1761 "unzip-allow-greater-hostver-values.patch"
1762 "unzip-initialize-symlink-flag.patch"
1763 "unzip-remove-build-date.patch"
1764 "unzip-attribs-overflow.patch"
1765 "unzip-overflow-on-invalid-input.patch"
1766 "unzip-format-secure.patch"
1767 "unzip-overflow-long-fsize.patch"
1770 "unzip-alt-iconv-utf8.patch"
1771 "unzip-alt-iconv-utf8-print.patch"
1772 "unzip-fix-recmatch.patch"
1773 "unzip-case-insensitive.patch"
1775 "unzip-COVSCAN-fix-unterminated-string.patch"
1776 "unzip-CVE-2016-9844.patch"
1777 "unzip-CVE-2018-1000035.patch"
1778 "unzip-CVE-2018-18384.patch"
1779 "unzip-exec-shield.patch"
1780 "unzip-manpage-fix.patch"
1781 "unzip-overflow.patch"
1782 "unzip-timestamp.patch"
1783 "unzip-valgrind.patch"
1784 "unzip-x-option.patch"
1786 "unzip-zipbomb-manpage.patch"
1787 "unzip-zipbomb-part1.patch"
1788 "unzip-zipbomb-part2.patch"
1789 "unzip-zipbomb-part3.patch"
1791 ;; https://github.com/madler/unzip/issues/2
1792 "unzip-32bit-zipbomb-fix.patch"))))
1793 (build-system gnu-build-system)
1794 ;; no inputs; bzip2 is not supported, since not compiled with BZ_NO_STDIO
1796 `(#:phases (modify-phases %standard-phases
1798 (add-after 'unpack 'fortify
1800 ;; Mitigate CVE-2018-1000035, an exploitable buffer overflow.
1801 ;; This environment variable is recommended in 'unix/Makefile'
1802 ;; for passing flags to the C compiler.
1803 (setenv "LOCAL_UNZIP" "-D_FORTIFY_SOURCE=1")
1806 (lambda* (#:key make-flags #:allow-other-keys)
1807 (apply invoke "make"
1808 `("-j" ,(number->string
1809 (parallel-job-count))
1812 #:make-flags (list "-f" "unix/Makefile"
1813 (string-append "prefix=" %output)
1814 (string-append "MANDIR=" %output "/share/man/man1"))))
1815 (home-page "http://www.info-zip.org/UnZip.html")
1816 (synopsis "Decompression and file extraction utility")
1818 "UnZip is an extraction utility for archives compressed in .zip format,
1819 also called \"zipfiles\".
1821 UnZip lists, tests, or extracts files from a .zip archive. The default
1822 behaviour (with no options) is to extract into the current directory, and
1823 subdirectories below it, all files from the specified zipfile. UnZip
1824 recreates the stored directory structure by default.")
1825 (license (license:non-copyleft "file://LICENSE"
1826 "See LICENSE in the distribution."))))
1828 (define-public ziptime
1829 (let ((commit "2a5bc9dfbf7c6a80e5f7cb4dd05b4036741478bc")
1833 (version (git-version "0.0.0" revision commit))
1838 (url "https://android.googlesource.com/platform/build")
1840 (file-name (git-file-name name version))
1842 (base32 "0hrn61b3a97dlc4iqc28rwx8k8zf7ycbwzqqp93vj34zy5a541kn"))))
1843 (build-system gnu-build-system)
1845 `(#:tests? #f ; no test suite
1847 (modify-phases %standard-phases
1848 (add-after 'unpack 'change-directory
1850 (chdir "tools/ziptime")))
1851 (delete 'configure) ; nothing to configure
1853 ;; There is no Makefile, only an ‘Android.bp’ file. Ignore it.
1855 (let ((c++ ,(cxx-for-target)))
1856 (apply invoke c++ "-O2" "-o" "ziptime"
1857 (find-files "." "\\.cpp$")))))
1859 (lambda* (#:key outputs #:allow-other-keys)
1860 (let* ((out (assoc-ref outputs "out"))
1861 (bin (string-append out "/bin"))
1862 (doc (string-append out "/share/doc/" ,name "-" ,version)))
1863 (install-file "ziptime" bin)
1864 (install-file "README.txt" doc)))))))
1865 ;; There is no separate home page for this tiny bundled build tool.
1866 (home-page (string-append "https://android.googlesource.com/platform/build/"
1867 "+/master/tools/ziptime/README.txt"))
1868 (synopsis "Normalize @file{.zip} archive header timestamps")
1870 "Ziptime helps make @file{.zip} archives reproducible by replacing
1871 timestamps in the file header with a fixed time (1 January 2008).
1873 ``Extra fields'' are not changed, so you'll need to use the @code{-X} option to
1874 @command{zip} to prevent it from storing the ``universal time'' field.")
1875 (license license:asl2.0))))
1877 (define-public zziplib
1881 (home-page "https://github.com/gdraheim/zziplib")
1884 (uri (git-reference (url home-page)
1885 (commit (string-append "v" version))))
1886 (file-name (git-file-name name version))
1889 "0i6bpa2b13z19alm6ig80364dnin1w28cvif18k6wkkb0w3dzp8y"))))
1890 (build-system cmake-build-system)
1893 (native-inputs `(("perl" ,perl) ; for the documentation
1894 ("pkg-config" ,pkg-config)
1896 ("zip" ,zip))) ; to create test files
1897 (synopsis "Library for accessing zip files")
1899 "ZZipLib is a library based on zlib for accessing zip files.")
1900 ;; zziplib is dual licensed under LGPL2.0+ and MPL1.1. Some example source
1901 ;; files carry the Zlib license; see "docs/copying.html" for details.
1902 (license (list license:lgpl2.0+ license:mpl1.1))))
1904 (define-public libzip
1911 "https://libzip.org/download/libzip-" version ".tar.xz"))
1914 "0zn9vaiwy2izj8cnm8i7c2mbdn38n328grqb8f07x55s4kd3nxph"))))
1917 ("pkg-config" ,pkg-config)))
1919 `(("gnutls" ,gnutls)
1921 ("openssl" ,openssl)
1923 ("zstd:lib" ,zstd "lib")))
1924 (build-system cmake-build-system)
1925 (home-page "https://libzip.org")
1926 (synopsis "C library for reading, creating, and modifying zip archives")
1927 (description "Libzip is a C library for reading, creating, and modifying
1928 zip archives. Files can be added from data buffers, files, or compressed data
1929 copied directly from other zip archives. Changes made without closing the
1930 archive can be reverted.")
1931 (license license:bsd-3)))
1933 (define-public atool
1940 (uri (string-append "mirror://savannah/atool/atool-"
1944 "0fvhzip2v08jgnlfpyj6rapan39xlsl1ksgq4lp8gfsai2ah1xma"))))
1945 (build-system gnu-build-system)
1948 (modify-phases %standard-phases
1949 (add-after 'unpack 'embed-absolute-file-name
1950 (lambda* (#:key inputs #:allow-other-keys)
1951 (substitute* "atool"
1952 (("(^\\$::cfg_path_file.*= )'file'" _ pre)
1953 (string-append pre "'" (assoc-ref inputs "file")
1959 (home-page "https://www.nongnu.org/atool/")
1960 (synopsis "Universal tool to manage file archives of various types")
1961 (description "The main command is @command{aunpack} which extracts files
1962 from an archive. The other commands provided are @command{apack} (to create
1963 archives), @command{als} (to list files in archives), and @command{acat} (to
1964 extract files to standard out). As @command{atool} invokes external programs
1965 to handle the archives, not all commands may be supported for a certain type
1967 (license license:gpl2+)))
1969 (define-public lunzip
1976 (uri (string-append "mirror://savannah/lzip/lunzip/"
1977 "lunzip-" version ".tar.gz"))
1979 (base32 "1liaynyy3qcs29hfk1pnb7i9r1mnmpw557j5v356qsv6qnm4lnz5"))))
1980 (build-system gnu-build-system)
1983 (list ,(string-append "CC=" (cc-for-target)))))
1984 (home-page "https://www.nongnu.org/lzip/lunzip.html")
1985 (synopsis "Small, stand-alone lzip decompressor")
1987 "Lunzip is a decompressor for files in the lzip compression format (.lz),
1988 written as a single small C tool with no dependencies. This makes it
1989 well-suited to embedded and other systems without a C++ compiler, or for use in
1990 applications such as software installers that need only to decompress files,
1992 Lunzip is intended to be fully compatible with the regular lzip package.")
1993 (license (list license:bsd-2 ; carg_parser.[ch]
1994 license:gpl2+)))) ; everything else
1996 (define-public clzip
2003 (uri (string-append "mirror://savannah/lzip/clzip/"
2004 "clzip-" version ".tar.gz"))
2006 (base32 "1s7yidqvmxi61hh569h5aci816l6qkffjgx0zx57qyyq0qq2pjgw"))))
2007 (build-system gnu-build-system)
2010 (list ,(string-append "CC=" (cc-for-target)))))
2011 (home-page "https://www.nongnu.org/lzip/clzip.html")
2012 (synopsis "Small, stand-alone lzip compressor and decompressor")
2014 "Clzip is a compressor and decompressor for files in the lzip compression
2015 format (.lz), written as a single small C tool with no dependencies. This makes
2016 it well-suited to embedded and other systems without a C++ compiler, or for use
2017 in other applications like package managers.
2018 Clzip is intended to be fully compatible with the regular lzip package.")
2019 (license (list license:bsd-2 ; carg_parser.[ch], lzd in clzip.texi
2022 (define-public lzlib
2029 (uri (string-append "mirror://savannah/lzip/lzlib/"
2030 "lzlib-" version ".tar.gz"))
2032 (base32 "1c9pwd6by8is4z8bs6j306jyy6pgm2dvsn4fr7fg2b5m5qj88pcf"))))
2033 (build-system gnu-build-system)
2036 (list (string-append "CC=" ,(cc-for-target))
2038 "--enable-shared"))) ; only static (.a) is built by default
2039 (home-page "https://www.nongnu.org/lzip/lzlib.html")
2040 (synopsis "Lzip data compression C library")
2042 "Lzlib is a C library for in-memory LZMA compression and decompression in
2043 the lzip format. It supports integrity checking of the decompressed data, and
2044 all functions are thread-safe. The library should never crash, even in case of
2046 (license (list license:bsd-2 ; the library itself
2047 license:gpl2+)))) ; main.c (i.e. minilzip used by tests)
2049 (define-public plzip
2056 (uri (string-append "mirror://savannah/lzip/plzip/"
2057 "plzip-" version ".tar.gz"))
2059 (base32 "19zinpx7hssl6r3vilpvq2s7wha3545xan8b0vcvsxnyipdx3n0l"))))
2060 (build-system gnu-build-system)
2062 `(("lzlib" ,lzlib)))
2063 (home-page "https://www.nongnu.org/lzip/plzip.html")
2064 (synopsis "Parallel lossless data compressor for the lzip format")
2066 "Plzip is a massively parallel (multi-threaded) lossless data compressor
2067 and decompressor that uses the lzip file format (.lz). Files produced by plzip
2068 are fully compatible with lzip and can be rescued with lziprecover.
2069 On multiprocessor machines, plzip can compress and decompress large files much
2070 faster than lzip, at the cost of a slightly reduced compression ratio (0.4% to
2071 2%). The number of usable threads is limited by file size: on files of only a
2072 few MiB, plzip is no faster than lzip.
2073 Files that were compressed with regular lzip will also not be decompressed
2074 faster by plzip, unless the @code{-b} option was used: lzip usually produces
2075 single-member files which can't be decompressed in parallel.")
2076 (license (list license:bsd-2 ; arg_parser.{cc,h}
2077 license:gpl2+)))) ; everything else
2079 (define-public innoextract
2081 (name "innoextract")
2086 (uri (string-append "https://constexpr.org/innoextract/files/"
2087 "innoextract-" version "/"
2088 "/innoextract-" version ".tar.gz"))
2090 (base32 "09l1z1nbl6ijqqwszdwch9mqr54qb7df0wp2sd77v17dq6gsci33"))))
2091 (build-system cmake-build-system)
2094 (inputs `(("boost" ,boost)
2095 ("libiconv" ,libiconv)
2097 (native-inputs `(("pkg-config" ,pkg-config)))
2098 (home-page "https://constexpr.org/innoextract/")
2099 (synopsis "Tool for extracting Inno Setup installers")
2100 (description "innoextract allows extracting Inno Setup installers under
2101 non-Windows systems without running the actual installer using wine.")
2102 (license license:zlib)))
2104 (define-public brotli
2112 (url "https://github.com/google/brotli")
2113 (commit (string-append "v" version))))
2114 (file-name (git-file-name name version))
2116 (base32 "1fikasxf7r2dwlk8mv8w7nmjkn0jw5ic31ky3mvpkdzwgd4xfndl"))
2117 (modules '((guix build utils)))
2120 ;; Cherry-picked from upstream since the latest release
2121 ;; https://github.com/google/brotli/commit/09b0992b6acb7faa6fd3b23f9bc036ea117230fc
2122 (substitute* (find-files "scripts" "^lib.*pc\\.in")
2123 (("-R\\$\\{libdir\\} ") ""))
2125 (build-system cmake-build-system)
2128 (modify-phases %standard-phases
2129 (add-after 'install 'rename-static-libraries
2130 ;; The build tools put a 'static' suffix on the static libraries, but
2131 ;; other applications don't know how to find these.
2132 (lambda* (#:key outputs #:allow-other-keys)
2133 (let ((lib (string-append (assoc-ref %outputs "out") "/lib/")))
2134 (rename-file (string-append lib "libbrotlicommon-static.a")
2135 (string-append lib "libbrotlicommon.a"))
2136 (rename-file (string-append lib "libbrotlidec-static.a")
2137 (string-append lib "libbrotlidec.a"))
2138 (rename-file (string-append lib "libbrotlienc-static.a")
2139 (string-append lib "libbrotlienc.a"))
2142 (list ;; Defaults to "lib64" on 64-bit archs.
2143 (string-append "-DCMAKE_INSTALL_LIBDIR="
2144 (assoc-ref %outputs "out") "/lib"))))
2145 (home-page "https://github.com/google/brotli")
2146 (synopsis "General-purpose lossless compression")
2147 (description "This package provides the reference implementation of Brotli,
2148 a generic-purpose lossless compression algorithm that compresses data using a
2149 combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd
2150 order context modeling, with a compression ratio comparable to the best
2151 currently available general-purpose compression methods. It is similar in speed
2152 with @code{deflate} but offers more dense compression.
2154 The specification of the Brotli Compressed Data Format is defined in RFC 7932.")
2155 (license license:expat)))
2157 (define-public google-brotli
2158 (deprecated-package "google-brotli" brotli))
2160 (define-public python-brotli
2163 (name "python-brotli")
2164 (build-system python-build-system)
2166 (synopsis "Python interface to Brotli")
2167 (description "This package provides a Python interface to the @code{brotli}
2168 package, an implementation of the Brotli lossless compression algorithm.")))
2170 (define-public python-google-brotli
2171 (deprecated-package "python-google-brotli" python-brotli))
2179 (uri (string-append "https://www.oberhumer.com/opensource/"
2180 name "/download/" name "-" version ".tar.gz"))
2183 "0j036lkwsxvm15gr29n8wn07cqq79dswjs9k54939ms5zngjjrdq"))))
2184 (build-system gnu-build-system)
2186 `(;; UCL 1.03 fails to build with newer C standards.
2187 #:configure-flags '("CFLAGS=-std=gnu90"
2188 "--enable-shared" "--disable-static")))
2189 (home-page "https://www.oberhumer.com/opensource/ucl/")
2190 (synopsis "Portable lossless data compression library")
2191 (description "UCL implements a number of compression algorithms that
2192 achieve an excellent compression ratio while allowing fast decompression.
2193 Decompression requires no additional memory.
2195 Compared to LZO, the UCL algorithms achieve a better compression ratio but
2196 decompression is a little bit slower.")
2197 (license license:gpl2+)))
2205 (uri (string-append "https://github.com/upx/upx/releases/download/v"
2206 version "/upx-" version "-src.tar.xz"))
2209 "051pk5jk8fcfg5mpgzj43z5p4cn7jy5jbyshyn78dwjqr7slsxs7"))
2210 (patches (search-patches "upx-CVE-2021-20285.patch"))))
2211 (build-system gnu-build-system)
2221 (modify-phases %standard-phases
2222 (delete 'configure) ; no configure script
2223 (delete 'check) ; no test suite
2224 (add-before 'build 'patch-exec-bin-sh
2226 (substitute* (list "Makefile"
2228 (("/bin/sh") (which "sh")))
2231 (lambda* (#:key outputs #:allow-other-keys)
2232 (let* ((out (assoc-ref outputs "out"))
2233 (bin (string-append out "/bin")))
2235 (copy-file "src/upx.out" (string-append bin "/upx")))
2237 (home-page "https://upx.github.io/")
2238 (synopsis "Compression tool for executables")
2240 "The Ultimate Packer for eXecutables (UPX) is an executable file
2241 compressor. UPX typically reduces the file size of programs and shared
2242 libraries by around 50%--70%, thus reducing disk space, network load times,
2243 download times, and other distribution and storage costs.")
2244 (license license:gpl2+)))
2246 (define-public quazip-0
2253 (url "https://github.com/stachenov/quazip")
2254 (commit (string-append "v" version))))
2255 (file-name (git-file-name name version))
2258 "11icgwv2xyxhd1hm1add51xv54zwkcqkg85d1xqlgiigvbm196iq"))))
2259 (build-system cmake-build-system)
2261 `(#:tests? #f)) ;no test
2263 `(("doxygen" ,doxygen)))
2265 `(("qtbase" ,qtbase-5)
2267 (home-page "https://stachenov.github.io/quazip/index.html")
2268 (synopsis "Qt/C++ wrapper for Minizip")
2269 (description "QuaZIP is a simple C++ wrapper over Gilles Vollant's
2270 ZIP/UNZIP package that can be used to access ZIP archives. It uses
2271 Trolltech's Qt toolkit.
2273 QuaZIP allows you to access files inside ZIP archives using QIODevice
2274 API, and that means that you can also use QTextStream, QDataStream or
2275 whatever you would like to use on your zipped files.
2277 QuaZIP provides complete abstraction of the ZIP/UNZIP API, for both
2278 reading from and writing to ZIP archives. ")
2279 ;; Project is distributed under LGPL, but "quazip/z*" "quazip/unzip.*" are
2280 ;; distributed under zlib terms.
2281 (license (list license:lgpl2.1+ license:zlib))))
2283 (define-public quazip
2292 (url "https://github.com/stachenov/quazip")
2293 (commit (string-append "v" version))))
2294 (file-name (git-file-name name version))
2296 (base32 "1dwld7jxhjz9l33lrqwvklazdy7ygi6n1m4ry1n1sk5dnschrhby"))))))
2298 (define-public zchunk
2305 (url "https://github.com/zchunk/zchunk")
2307 (file-name (git-file-name name version))
2310 "0nlzwnv6wh2yjyyv27f81jnvmk7psgpbnw7dsdp7frfkya569hgv"))))
2311 (build-system meson-build-system)
2313 `(#:phases (modify-phases %standard-phases
2314 (add-after 'unpack 'patch-paths
2315 (lambda* (#:key inputs #:allow-other-keys)
2316 (substitute* "src/zck_gen_zdict.c"
2318 (string-append (assoc-ref inputs "zstd")
2321 `(("pkg-config" ,pkg-config)))
2326 `(("zstd:lib" ,zstd "lib"))) ;in Requires.private of zck.pc
2327 (home-page "https://github.com/zchunk/zchunk")
2328 (synopsis "Compressed file format for efficient deltas")
2329 (description "The zchunk compressed file format allows splitting a file
2330 into independent chunks. This makes it possible to retrieve only changed
2331 chunks when downloading a new version of the file, and also makes zchunk files
2332 efficient over rsync. Along with the library, this package provides the
2333 following utilities:
2336 To decompress a zchunk file.
2338 To compress a new zchunk file, or re-compress an existing one.
2339 @item zck_delta_size
2340 To calculate the difference between two zchunk files.
2342 To create a dictionary for a zchunk file.
2343 @item zck_read_header
2344 To read a zchunk header.
2346 To download a zchunk file.
2348 (license license:bsd-2)))
2350 (define-public zutils
2357 (uri (string-append "mirror://savannah/zutils/zutils-" version ".tar.lz"))
2359 (base32 "15dimqp8zlqaaa2l46r22srp1py38mlmn69ph1j5fmrd54w43m0d"))))
2360 (build-system gnu-build-system)
2363 (list "--sysconfdir=/etc")
2365 (modify-phases %standard-phases
2366 (add-before 'check 'disable-failing-tests
2367 ;; XXX https://lists.nongnu.org/archive/html/zutils-bug/2020-07/msg00005.html
2369 (substitute* "testsuite/check.sh"
2370 (("\"\\$\\{ZGREP\\}\" -N -L \"GNU\"") "true")
2371 (("\"\\$\\{ZGREP\\}\" -N -L \"nx_pattern\"") "false"))
2374 (lambda* (#:key make-flags outputs #:allow-other-keys)
2375 (apply invoke "make" "install"
2376 (string-append "sysconfdir=" (assoc-ref outputs "out")
2380 ;; Needed to extract the source tarball and run the test suite.
2382 (home-page "https://www.nongnu.org/zutils/zutils.html")
2383 (synopsis "Utilities that transparently operate on compressed files")
2385 "Zutils is a collection of utilities able to process any combination of
2386 compressed and uncompressed files transparently. If any given file, including
2387 standard input, is compressed, its decompressed content is used instead.
2389 @command{zcat}, @command{zcmp}, @command{zdiff}, and @command{zgrep} are
2390 improved replacements for the shell scripts provided by GNU gzip.
2391 @command{ztest} tests the integrity of supported compressed files.
2392 @command{zupdate} recompresses files with lzip, similar to gzip's
2395 Supported compression formats are bzip2, gzip, lzip, and xz. Zutils uses
2396 external compressors: the compressor to be used for each format is configurable
2397 at run time, and must be installed separately.")
2398 (license (list license:bsd-2 ; arg_parser.{cc,h}
2399 license:gpl2+)))) ; the rest
2401 (define-public makeself-safeextract
2402 (let ((commit "1a95e121fa8e3c02d307ae37b9b7834e616c3683"))
2404 (name "makeself-safeextract")
2405 (version (git-version "0.0.0" "1" commit))
2406 (home-page "https://github.com/ssokolow/makeself_safeextract")
2413 (file-name (git-file-name name version))
2416 "1anlinaj9lvfi8bn00wp11vzqq0f9sig4fm9yrspisx31v0z4a2c"))))
2417 (build-system trivial-build-system)
2419 `(("python" ,python-2)
2423 `(#:modules ((guix build utils))
2426 (use-modules (guix build utils))
2427 (let* ((name "makeself_safeextract")
2428 (source (string-append (assoc-ref %build-inputs "source")
2430 (bin (string-append (assoc-ref %outputs "out") "/bin"))
2431 (target (string-append bin "/" name))
2432 (python (string-append (assoc-ref %build-inputs "python") "/bin"))
2433 (7z (search-input-file %build-inputs "/bin/7z"))
2434 (unzip (search-input-file %build-inputs "/bin/unzip")))
2435 (setenv "PATH" (string-append (getenv "PATH") ":" python))
2437 (copy-file source target)
2439 (("'7z'") (format #f "'~a'" 7z))
2440 (("'unzip'") (format #f "'~a'" unzip)))
2441 (patch-shebang target)))))
2442 (synopsis "Extract makeself and mojo archives without running untrusted code")
2443 (description "This package provides a script to unpack self-extracting
2444 archives generated by @command{makeself} or @command{mojo} without running the
2445 possibly untrusted extraction shell script.")
2446 (license license:gpl3+))))
2448 (define-public ncompress
2455 (url "https://github.com/vapier/ncompress")
2456 (commit (string-append "v" version))))
2457 (patches (search-patches "ncompress-fix-softlinks.patch"))
2458 (file-name (string-append name "-" version ".tar.gz"))
2461 "090kksxrlqnsdc76fzz2j2ajc98mhmfwyn163ca2ia9niqmlpcm0"))))
2463 `(#:make-flags (list (string-append "CC=" ,(cc-for-target))
2464 (string-append "BINDIR=" %output "/bin")
2465 (string-append "MANDIR=" %output "/share/man/man1"))
2466 #:phases (modify-phases %standard-phases
2467 (delete 'configure)))) ; no configure script
2468 (build-system gnu-build-system)
2469 (home-page "https://github.com/vapier/ncompress/")
2470 (synopsis "Original Lempel-Ziv compress/uncompress programs")
2471 (description "(N)compress provides the original compress and uncompress
2472 programs that used to be the de facto UNIX standard for compressing and
2473 uncompressing files. These programs implement a fast, simple Lempel-Ziv (LZW)
2474 file compression algorithm.")
2475 (license license:gpl2+)))
2477 (define-public xarchiver
2480 (version "0.5.4.17")
2485 (url "https://github.com/ib/xarchiver")
2487 (file-name (git-file-name name version))
2489 (base32 "00adrjpxqlaccrwjf65w3vhxfswdj0as8aj263c6f9b85llypc5v"))))
2490 (build-system glib-or-gtk-build-system)
2492 `(("gettext" ,gettext-minimal)
2493 ("intltool" ,intltool)
2494 ("libxslt" ,libxslt)
2495 ("pkg-config" ,pkg-config)))
2497 `(("adwaita-icon-theme" ,adwaita-icon-theme) ; hard-coded theme
2499 (home-page "https://github.com/ib/xarchiver")
2500 (synopsis "Graphical front-end for archive operations")
2501 (description "Xarchiver is a front-end to various command line archiving
2502 tools. It uses GTK+ tool-kit and is designed to be desktop-environment
2503 independent. Supported formats are 7z, ARJ, bzip2, gzip, LHA, lzma, lzop,
2504 RAR, RPM, DEB, tar, and ZIP. It cannot perform functions for archives, whose
2505 archiver is not installed.")
2506 (license license:gpl2+)))
2508 (define-public tarsplitter
2510 (name "tarsplitter")
2515 (url "https://github.com/AQUAOSOTech/tarsplitter")
2516 (commit (string-append "v" version))))
2517 (file-name (git-file-name name version))
2520 "17qkg95r97kcrs17b0mcqswx99280ni47j5yx8xa7nl3bdhm6325"))))
2521 (build-system go-build-system)
2523 `(#:import-path "github.com/AQUAOSOTech/tarsplitter"
2524 #:install-source? #f
2526 (modify-phases %standard-phases
2527 (add-after 'install 'install-documentation
2528 (lambda* (#:key import-path outputs #:allow-other-keys)
2529 (let* ((source (string-append "src/" import-path))
2530 (out (assoc-ref outputs "out"))
2531 (doc (string-append out "/share/doc/" ,name "-" ,version)))
2532 (with-directory-excursion source
2533 (install-file "README.md" doc))
2535 (home-page "https://github.com/AQUAOSOTech/tarsplitter")
2536 (synopsis "Multithreaded tar utility")
2538 "Archive huge numbers of files, or split massive tar archives into smaller
2540 (license license:expat)))
2542 (define-public c-blosc
2549 (url "https://github.com/Blosc/c-blosc")
2550 (commit (string-append "v" version))))
2551 (file-name (git-file-name name version))
2554 "1ywq8j70149859vvs19wgjq89d6xsvvmvm2n1dmkzpchxgrvnw70"))))
2555 (build-system cmake-build-system)
2558 '("-DDEACTIVATE_AVX2=ON"
2559 "-DPREFER_EXTERNAL_LZ4=ON"
2560 "-DPREFER_EXTERNAL_SNAPPY=ON"
2561 "-DPREFER_EXTERNAL_ZLIB=ON"
2562 "-DPREFER_EXTERNAL_ZSTD=ON")))
2567 ("zstd:lib" ,zstd "lib")))
2568 (home-page "https://blosc.org")
2569 (synopsis "Blocking, shuffling and lossless compression library")
2571 "Blosc is a high performance compressor optimized for binary data. It has
2572 been designed to transmit data to the processor cache faster than the
2573 traditional, non-compressed, direct memory fetch approach via a
2574 @code{memcpy()} system call. Blosc is meant not only to reduce the size of
2575 large datasets on-disk or in-memory, but also to accelerate memory-bound
2577 ;; Blosc itself is released under BSD-3 but it incorporates code under
2578 ;; other non-copyleft licenses.
2579 (license license:bsd-3)))
2588 (url "https://github.com/alucryd/ecm-tools")
2589 (commit (string-append "v" version))))
2590 (file-name (git-file-name name version))
2593 "1rvyx5gcy8lfklgj80szlz3312x45wzx0d9jsgwyvy8f6m4nnb0c"))))
2594 (build-system gnu-build-system)
2596 `(#:tests? #f ; no check target
2598 (list (string-append "CC=" ,(cc-for-target))
2599 (string-append "DESTDIR=" (assoc-ref %outputs "out")))
2601 (modify-phases %standard-phases
2604 (substitute* "Makefile"
2605 (("\\$\\(DESTDIR\\)/usr") "$(DESTDIR)"))
2607 (home-page "https://github.com/alucryd/ecm-tools")
2608 (synopsis "Error code modeler")
2609 (description "ECM is a utility that converts ECM files, i.e., CD data files
2610 with their error correction data losslessly rearranged for better compression,
2611 to their original, binary CD format.")
2612 (license license:gpl3+)))
2614 (define-public libdeflate
2621 (url "https://github.com/ebiggers/libdeflate")
2622 (commit (string-append "v" version))))
2623 (file-name (git-file-name name version))
2626 "0nw1zhr2s6ffcc3s0n5wsshvjb6pmybwapagli135zzn2fx1pdiz"))))
2627 (build-system gnu-build-system)
2630 (list (string-append "CC=" ,(cc-for-target))
2631 (string-append "PREFIX=" (assoc-ref %outputs "out")))
2633 (modify-phases %standard-phases
2634 (delete 'configure))))
2637 (home-page "https://github.com/ebiggers/libdeflate")
2638 (synopsis "Library for DEFLATE/zlib/gzip compression and decompression")
2639 (description "Libdeflate is a library for fast, whole-buffer DEFLATE-based
2640 compression and decompression. The supported formats are:
2644 @item zlib (a.k.a. DEFLATE with a zlib wrapper)
2645 @item gzip (a.k.a. DEFLATE with a gzip wrapper)
2648 (license license:expat)))
2650 (define-public tarlz
2657 (uri (string-append "mirror://savannah/lzip/tarlz/"
2658 "tarlz-" version ".tar.lz"))
2660 (base32 "1x5dw03lcwfigcv97cg70gkbkfycjmv1012s9lwnl4izvl9235qg"))))
2661 (build-system gnu-build-system)
2665 `(("lzlib" ,lzlib)))
2666 (home-page "https://www.nongnu.org/lzip/tarlz.html")
2667 (synopsis "Combination of the tar archiver and the lzip compressor")
2669 "Tarlz is a massively parallel (multi-threaded) combined implementation of
2670 the tar archiver and the lzip compressor. Tarlz creates, lists, and extracts
2671 archives in a simplified and safer variant of the POSIX pax format compressed
2672 with lzip, keeping the alignment between tar members and lzip members. The
2673 resulting multimember tar.lz archive is fully backward compatible with standard
2674 tar tools like GNU tar, which treat it like any other tar.lz archive. Tarlz
2675 can append files to the end of such compressed archives.")
2676 (license license:gpl2+)))
2678 (define-public libcbor
2686 (url "https://github.com/PJK/libcbor")
2687 (commit (string-append "v" version))))
2688 (file-name (git-file-name name version))
2689 (sha256 (base32 "01dv4vxcmbvpphqy16vqiwh25wx11x630js5wfnx7cryarsh9ld7"))))
2690 (build-system cmake-build-system)
2693 (let* ((out (assoc-ref %outputs "out"))
2694 (lib (string-append out "/lib")))
2696 "-DCMAKE_BUILD_TYPE=Release"
2697 "-DBUILD_SHARED_LIBS=ON"
2698 "-DCBOR_CUSTOM_ALLOC=ON"
2699 (string-append "-DCMAKE_INSTALL_LIBDIR=" lib)
2700 (string-append "-DCMAKE_INSTALL_RPATH=" lib)))))
2701 (synopsis "The C library for parsing and generating CBOR")
2703 "The Concise Binary Object Representation (CBOR) is a data format whose
2704 design goals include the possibility of extremely small code size, fairly
2705 small message size, and extensibility without the need for version
2706 negotiation. These design goals make it different from earlier binary
2707 serializations such as ASN.1 and MessagePack.")
2708 (license license:expat)
2709 (home-page "https://github.com/PJK/libcbor")))