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>
37 ;;; This file is part of GNU Guix.
39 ;;; GNU Guix is free software; you can redistribute it and/or modify it
40 ;;; under the terms of the GNU General Public License as published by
41 ;;; the Free Software Foundation; either version 3 of the License, or (at
42 ;;; your option) any later version.
44 ;;; GNU Guix is distributed in the hope that it will be useful, but
45 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
46 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
47 ;;; GNU General Public License for more details.
49 ;;; You should have received a copy of the GNU General Public License
50 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
52 (define-module (gnu packages compression)
53 #:use-module ((guix licenses) #:prefix license:)
54 #:use-module (guix utils)
55 #:use-module (guix packages)
56 #:use-module (guix download)
57 #:use-module (guix git-download)
58 #:use-module (guix build-system cmake)
59 #:use-module (guix build-system glib-or-gtk)
60 #:use-module (guix build-system gnu)
61 #:use-module (guix build-system go)
62 #:use-module (guix build-system meson)
63 #:use-module (guix build-system python)
64 #:use-module (guix build-system trivial)
65 #:use-module (gnu packages)
66 #:use-module (gnu packages assembly)
67 #:use-module (gnu packages autotools)
68 #:use-module (gnu packages backup)
69 #:use-module (gnu packages base)
70 #:use-module (gnu packages benchmark)
71 #:use-module (gnu packages boost)
72 #:use-module (gnu packages check)
73 #:use-module (gnu packages curl)
74 #:use-module (gnu packages documentation)
75 #:use-module (gnu packages file)
76 #:use-module (gnu packages gettext)
77 #:use-module (gnu packages glib)
78 #:use-module (gnu packages gnome)
79 #:use-module (gnu packages gnupg)
80 #:use-module (gnu packages gtk)
81 #:use-module (gnu packages llvm)
82 #:use-module (gnu packages man)
83 #:use-module (gnu packages maths)
84 #:use-module (gnu packages perl)
85 #:use-module (gnu packages pkg-config)
86 #:use-module (gnu packages python)
87 #:use-module (gnu packages qt)
88 #:use-module (gnu packages selinux)
89 #:use-module (gnu packages tls)
90 #:use-module (gnu packages valgrind)
91 #:use-module (gnu packages version-control)
92 #:use-module (gnu packages xml)
93 #:use-module (ice-9 match)
94 #:use-module (srfi srfi-1))
103 (uri (list (string-append "http://zlib.net/zlib-"
105 (string-append "mirror://sourceforge/libpng/zlib/"
106 version "/zlib-" version ".tar.gz")))
109 "18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3"))))
110 (build-system gnu-build-system)
111 (outputs '("out" "static"))
114 (modify-phases %standard-phases
116 (lambda* (#:key outputs #:allow-other-keys)
117 ;; Zlib's home-made `configure' fails when passed
118 ;; extra flags like `--enable-fast-install', so we need to
119 ;; invoke it with just what it understand.
120 (let ((out (assoc-ref outputs "out")))
121 ;; 'configure' doesn't understand '--host'.
122 ,@(if (%current-target-system)
123 `((setenv "CHOST" ,(%current-target-system)))
125 (invoke "./configure"
126 (string-append "--prefix=" out)))))
127 (add-after 'install 'move-static-library
128 (lambda* (#:key outputs #:allow-other-keys)
129 (let ((out (assoc-ref outputs "out"))
130 (static (assoc-ref outputs "static")))
131 (with-directory-excursion (string-append out "/lib")
132 (install-file "libz.a" (string-append static "/lib"))
133 (delete-file "libz.a")
135 (home-page "https://zlib.net/")
136 (synopsis "Compression library")
138 "zlib is designed to be a free, general-purpose, legally unencumbered --
139 that is, not covered by any patents -- lossless data-compression library for
140 use on virtually any computer hardware and operating system. The zlib data
141 format is itself portable across platforms. Unlike the LZW compression method
142 used in Unix compress(1) and in the GIF image format, the compression method
143 currently used in zlib essentially never expands the data. (LZW can double or
144 triple the file size in extreme cases.) zlib's memory footprint is also
145 independent of the input data and can be reduced, if necessary, at some cost
147 (license license:zlib)))
149 (define-public minizip
152 (version (package-version zlib))
153 (source (package-source zlib))
154 (build-system gnu-build-system)
157 (modify-phases %standard-phases
158 (add-after 'unpack 'enter-source
159 (lambda _ (chdir "contrib/minizip") #t))
160 (add-after 'install 'remove-crypt-h
161 (lambda* (#:key outputs #:allow-other-keys)
162 ;; Remove <minizip/crypt.h> because it interferes with libc's
163 ;; <crypt.h> given that 'minizip.pc' says "-I…/include/minizip".
164 ;; Fedora does the same:
165 ;; <https://src.fedoraproject.org/rpms/zlib/c/4d2785ec3116947872f6f32dc4104e6d36d8a7a4?branch=master>.
166 (let ((out (assoc-ref outputs "out")))
167 (delete-file (string-append out "/include/minizip/crypt.h"))
170 `(("autoconf" ,autoconf)
171 ("automake" ,automake)
172 ("libtool" ,libtool)))
173 (propagated-inputs `(("zlib" ,zlib)))
174 (home-page (package-home-page zlib))
175 (synopsis "Zip Compression library")
177 "Minizip is a minimalistic library that supports compressing,
178 extracting and viewing ZIP archives. This version is extracted from
179 the @code{zlib} source.")
180 (license (package-license zlib))))
182 (define-public fastjar
188 (uri (string-append "mirror://savannah/fastjar/fastjar-"
192 "0iginbz2m15hcsa3x4y7v3mhk54gr1r7m3ghx0pg4n46vv2snmpi"))))
193 (build-system gnu-build-system)
194 (inputs `(("zlib" ,zlib)))
195 (home-page "https://savannah.nongnu.org/projects/fastjar")
196 (synopsis "Replacement for Sun's 'jar' utility")
198 "FastJar is an attempt to create a much faster replacement for Sun's
199 @code{jar} utility. Instead of being written in Java, FastJar is written in C.")
200 (license license:gpl2+)))
202 (define-public libtar
210 "ftp://ftp.feep.net/pub/software/libtar/libtar-"
213 "mirror://debian/pool/main/libt/libtar/libtar_"
214 version ".orig.tar.gz")))
217 "02cihzl77ia0dcz7z2cga2412vyhhs5pa2355q4wpwbyga2lrwjh"))
218 (patches (search-patches "libtar-CVE-2013-4420.patch"))))
219 (build-system gnu-build-system)
220 (arguments `(#:tests? #f)) ; no "check" target
222 `(("autoconf" ,autoconf)
223 ("automake" ,automake)
224 ("libtool" ,libtool)))
227 (synopsis "C library for manipulating POSIX tar files")
229 "libtar is a C library for manipulating POSIX tar files. It handles
230 adding and extracting files to/from a tar archive.")
231 (home-page "https://repo.or.cz/libtar.git")
232 (license license:bsd-3)))
240 (uri (string-append "mirror://gnu/gzip/gzip-"
244 "1h6p374d3j8d4cdfydzls021xa2yby8myc0h8d6m8bc7k6ncq9c4"))))
245 (build-system gnu-build-system)
246 (synopsis "General file (de)compression (using lzw)")
248 ;; FIXME: The test suite wants `less', and optionally Perl.
251 (modify-phases %standard-phases
252 (add-after 'unpack 'patch-for-glibc-2.28
254 ;; Adjust the bundled gnulib to work with glibc 2.28. See e.g.
255 ;; "m4-gnulib-libio.patch". This is a phase rather than patch
256 ;; or snippet to work around <https://bugs.gnu.org/32347>.
257 (substitute* (find-files "lib" "\\.c$")
258 (("#if defined _IO_ftrylockfile")
259 "#if defined _IO_EOF_SEEN"))
260 (substitute* "lib/stdio-impl.h"
261 (("^/\\* BSD stdio derived implementations")
262 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
263 "# define _IO_IN_BACKUP 0x100\n"
265 "/* BSD stdio derived implementations")))
267 (add-after 'unpack 'use-absolute-name-of-gzip
268 (lambda* (#:key outputs #:allow-other-keys)
269 (substitute* "gunzip.in"
271 (string-append "exec " (assoc-ref outputs "out")
275 "GNU Gzip provides data compression and decompression utilities; the
276 typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
277 file; as a result, it is often used in conjunction with \"tar\", resulting in
278 \".tar.gz\" or \".tgz\", etc.")
279 (license license:gpl3+)
280 (home-page "https://www.gnu.org/software/gzip/")))
288 (uri (string-append "https://sourceware.org/pub/bzip2/bzip2-"
292 "0s92986cv0p692icqlw1j42y9nld8zd83qwhzbqd61p1dqbh6nmb"))))
293 (build-system gnu-build-system)
295 `(#:modules ((guix build gnu-build-system)
300 (modify-phases %standard-phases
301 (add-after 'set-paths 'hide-input-bzip2
302 (lambda* (#:key inputs #:allow-other-keys)
303 (let ((bzip2 (assoc-ref inputs "bzip2")))
305 ;; Prevent the build system from retaining a reference to
306 ;; BZIP2 from INPUTS.
308 (setenv "LIBRARY_PATH"
309 (string-join (delete (string-append bzip2 "/lib")
310 (string-split (getenv "LIBRARY_PATH")
313 (format #t "environment variable `LIBRARY_PATH' set to `~a'~%"
314 (getenv "LIBRARY_PATH")))
315 (format #t "no bzip2 found, nothing done~%"))
318 (lambda* (#:key target #:allow-other-keys)
319 (when ,(%current-target-system)
320 ;; Cross-compilation: use the cross tools.
321 (substitute* (find-files "." "Makefile")
323 (string-append "CC = " target "-gcc\n"))
325 (string-append "AR = " target "-ar\n"))
327 (string-append "RANLIB = " target "-ranlib\n"))
328 (("^all:(.*)test" _ prerequisites)
329 ;; Remove 'all' -> 'test' dependency.
330 (string-append "all:" prerequisites "\n"))))
332 (add-before 'build 'build-shared-lib
333 (lambda* (#:key inputs #:allow-other-keys)
334 (patch-makefile-SHELL "Makefile-libbz2_so")
335 (invoke "make" "-f" "Makefile-libbz2_so")))
336 (add-after 'install 'install-shared-lib
337 (lambda* (#:key outputs #:allow-other-keys)
338 ;; The Makefile above does not have an 'install' target, nor does
339 ;; it create all the (un)versioned symlinks, so we handle it here.
340 (let* ((out (assoc-ref outputs "out"))
341 (libdir (string-append out "/lib"))
343 ;; Locate the built library (e.g. "libbz2.so.1.0.6").
344 (lib (car (scandir "."
346 (and (string-prefix? soname file)
348 (stat:type (lstat file))))))))
349 (soversion (string-drop lib (+ 1 (string-length soname)))))
350 (install-file lib libdir)
351 (with-directory-excursion libdir
352 ;; Create symlinks libbz2.so.1 -> libbz2.so.1.0, etc.
353 (let loop ((base soname)
354 (numbers (string-split soversion #\.)))
355 (unless (null? numbers)
356 (let ((so-file (string-append base "." (car numbers))))
357 (symlink so-file base)
358 (loop so-file (cdr numbers))))))
360 (add-after 'install-shared-lib 'move-static-lib
361 (lambda* (#:key outputs #:allow-other-keys)
362 (let ((out (assoc-ref outputs "out"))
363 (static (assoc-ref outputs "static")))
364 (with-directory-excursion (string-append out "/lib")
365 (install-file "libbz2.a" (string-append static "/lib"))
366 (delete-file "libbz2.a")
368 (add-after 'install-shared-lib 'patch-scripts
369 (lambda* (#:key outputs inputs #:allow-other-keys)
370 (let* ((out (assoc-ref outputs "out")))
371 (substitute* (string-append out "/bin/bzdiff")
375 #:make-flags (list (string-append "PREFIX="
376 (assoc-ref %outputs "out")))
378 ;; Don't attempt to run the tests when cross-compiling.
379 ,@(if (%current-target-system)
382 (outputs '("out" "static"))
383 (synopsis "High-quality data compression program")
385 "bzip2 is a freely available, patent free (see below), high-quality data
386 compressor. It typically compresses files to within 10% to 15% of the best
387 available techniques (the PPM family of statistical compressors), whilst
388 being around twice as fast at compression and six times faster at
390 (license (license:non-copyleft "file://LICENSE"
391 "See LICENSE in the distribution."))
392 (home-page "https://web.archive.org/web/20180801004107/http://www.bzip.org/")))
394 (define-public lbzip2
395 ;; The last 2.5 release is 4 years behind the newest commit (from 2018) and
396 ;; may create files that can't even be decompressed by newer bzip2 versions.
397 (let ((commit "b6dc48a7b9bfe6b340ed1f6d72133608ad57144b")
401 (version (git-version "2.5" revision commit))
406 (url "https://github.com/kjn/lbzip2")
409 (base32 "140xp00dmjsr6c3dwb4dwf0pzlgf159igri321inbinsjiclkngy"))
410 (file-name (git-file-name name version))))
411 (build-system gnu-build-system)
414 (modify-phases %standard-phases
415 (add-after 'unpack 'unpack-gnulib
416 (lambda* (#:key inputs #:allow-other-keys)
417 (let ((gnulib (assoc-ref inputs "gnulib")))
418 (copy-recursively gnulib "lib")
419 (setenv "PATH" (string-append "lib:" (getenv "PATH")))
421 (delete 'bootstrap) ; gnulib still has unpatched shebangs
422 (add-after 'patch-source-shebangs 'bootstrap
424 (invoke "sh" "build-aux/autogen.sh")
427 `(("autoconf" ,autoconf)
428 ("automake" ,automake)
430 ,(let ((commit "2d431ac35c4943a3655c07ba91870d2323321b43"))
434 (url "git://git.savannah.gnu.org/gnulib.git")
437 (base32 "1f0xr4w89bqvhzsfcflcagdixidrk41k00k7kpr91w9lazfis4kf"))
438 (file-name (git-file-name "gnulib" commit)))))
440 (synopsis "Parallel bzip2 compression utility")
442 "lbzip2 is a multi-threaded compression utility with support for the
443 bzip2 compressed file format. lbzip2 can process standard bz2 files in
444 parallel. It uses POSIX threading model (pthreads), which allows it to take
445 full advantage of symmetric multiprocessing (SMP) systems. It has been proven
446 to scale linearly, even to over one hundred processor cores. lbzip2 is fully
447 compatible with bzip2 – both at file format and command line level.")
448 ;; lbzip2.org now looks fishy. There is no source code to be found.
449 ;; Reported upstream: <https://github.com/kjn/lbzip2/issues/26>.
450 (home-page "https://github.com/kjn/lbzip2")
451 (license license:gpl3+))))
453 (define-public pbzip2
459 (uri (string-append "https://launchpad.net/pbzip2/"
460 (version-major+minor version) "/" version
461 "/+download/" name "-" version ".tar.gz"))
464 "1rnvgcdixjzbrmcr1nv9b6ccrjfrhryaj7jwz28yxxv6lam3xlcg"))))
465 (build-system gnu-build-system)
469 `(#:tests? #f ; no tests
470 #:phases (modify-phases %standard-phases
471 (delete 'configure)) ; no configure script
472 #:make-flags (list (string-append "PREFIX=" %output))))
473 (home-page (string-append "https://web.archive.org/web/20180412020219/"
474 "http://compression.ca/pbzip2/"))
475 (synopsis "Parallel bzip2 implementation")
477 "Pbzip2 is a parallel implementation of the bzip2 block-sorting file
478 compressor that uses pthreads and achieves near-linear speedup on SMP machines.
479 The output of this version is fully compatible with bzip2 v1.0.2 (i.e. anything
480 compressed with pbzip2 can be decompressed with bzip2).")
481 (license (license:non-copyleft "file://COPYING"
482 "See COPYING in the distribution."))))
490 (uri (list (string-append "http://tukaani.org/xz/xz-" version
492 (string-append "http://multiprecision.org/guix/xz-"
496 "045s9agl3bpv3swlwydhgsqh7791957vmgw2plw8f1rks07r3x7n"))))
497 (build-system gnu-build-system)
500 (modify-phases %standard-phases
501 (add-after 'install 'move-static-lib
502 (lambda* (#:key outputs #:allow-other-keys)
503 (let ((out (assoc-ref outputs "out"))
504 (static (assoc-ref outputs "static")))
505 (mkdir-p (string-append static "/lib"))
506 (rename-file (string-append out "/lib/liblzma.a")
507 (string-append static "/lib/liblzma.a"))
508 ;; Remove reference to the static library from the .la file
509 ;; so Libtool does the right thing when both the shared and
510 ;; static library is available.
511 (substitute* (string-append out "/lib/liblzma.la")
512 (("^old_library='liblzma.a'") "old_library=''"))
514 (outputs '("out" "static"))
515 (synopsis "General-purpose data compression")
517 "XZ Utils is free general-purpose data compression software with high
518 compression ratio. XZ Utils were written for POSIX-like systems, but also
519 work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
521 The core of the XZ Utils compression code is based on LZMA SDK, but it has
522 been modified quite a lot to be suitable for XZ Utils. The primary
523 compression algorithm is currently LZMA2, which is used inside the .xz
524 container format. With typical files, XZ Utils create 30 % smaller output
525 than gzip and 15 % smaller output than bzip2.")
526 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
527 (home-page "https://tukaani.org/xz/")))
536 "https://github.com/fragglet/lhasa/releases/download/v"
537 version "/lhasa-" version ".tar.gz"))
540 "092zi9av18ma20c6h9448k0bapvx2plnp292741dvfd9hmgqxc1z"))))
541 (build-system gnu-build-system)
544 (modify-phases %standard-phases
545 (add-before 'check 'set-up-test-environment
546 (lambda* (#:key inputs #:allow-other-keys)
547 (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata")
551 `(("tzdata" ,tzdata-for-tests)))
552 (home-page "https://fragglet.github.com/lhasa/")
553 (synopsis "LHA archive decompressor")
554 (description "Lhasa is a replacement for the Unix LHA tool, for
555 decompressing .lzh (LHA / LHarc) and .lzs (LArc) archives. The backend for the
556 tool is a library, so that it can be reused for other purposes. Lhasa aims to
557 be compatible with as many types of lzh/lzs archives as possible. It also aims
558 to generate the same output as the (non-free) Unix LHA tool, so that it will
559 act as a free drop-in replacement.")
560 (license license:isc)))
569 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
573 "0wm04519pd3g8hqpjqhfr72q8qmbiwqaxcs3cndny9h86aa95y60"))))
574 (build-system gnu-build-system)
575 (arguments '(#:configure-flags '("--enable-shared")))
576 (home-page "http://www.oberhumer.com/opensource/lzo")
578 "Data compression library suitable for real-time data de-/compression")
580 "LZO is a data compression library which is suitable for data
581 de-/compression in real-time. This means it favours speed over
584 LZO is written in ANSI C. Both the source code and the compressed data
585 format are designed to be portable across platforms.")
586 (license license:gpl2+)))
595 (uri (string-append "http://www.lzop.org/download/lzop-"
599 "0h9gb8q7y54m9mvy3jvsmxf21yx8fc3ylzh418hgbbv0i8mbcwky"))))
600 (build-system gnu-build-system)
601 (inputs `(("lzo" ,lzo)))
602 (home-page "https://www.lzop.org/")
603 (synopsis "Compress or expand files")
605 "Lzop is a file compressor which is very similar to gzip. Lzop uses the
606 LZO data compression library for compression services, and its main advantages
607 over gzip are much higher compression and decompression speed (at the cost of
608 some compression ratio).")
609 (license license:gpl2+)))
617 (uri (string-append "mirror://savannah/lzip/lzip-"
621 "0j59hx72258334rmkwn57ahr6s69nlrx0a5ip1jw2fbiwr12sd63"))))
622 (build-system gnu-build-system)
623 (home-page "https://www.nongnu.org/lzip/lzip.html")
624 (synopsis "Lossless data compressor based on the LZMA algorithm")
626 "Lzip is a lossless data compressor with a user interface similar to the
627 one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
628 more than bzip2, which makes it well-suited for software distribution and data
629 archiving. Lzip is a clean implementation of the LZMA algorithm.")
630 (license license:gpl3+)))
632 (define-public lziprecover
638 (uri (string-append "mirror://savannah/lzip/lziprecover/"
639 "lziprecover-" version ".tar.gz"))
642 "0qh8dnhr5rly2k9dnx43qqynqwqzi5kfb15pyd29qwppfl4qm5gx"))))
643 (build-system gnu-build-system)
644 (home-page "https://www.nongnu.org/lzip/lziprecover.html")
645 (synopsis "Recover and decompress data from damaged lzip files")
647 "Lziprecover is a data recovery tool and decompressor for files in the lzip
648 compressed data format (.lz). It can test the integrity of lzip files, extract
649 data from damaged ones, and repair most files with small errors (up to one
650 single-byte error per member) entirely.
652 Lziprecover is not a replacement for regular backups, but a last line of defence
653 when even the backups are corrupt. It can recover files by merging the good
654 parts of two or more damaged copies, such as can be easily produced by running
655 @command{ddrescue} on a failing device.
657 This package also includes @command{unzcrash}, a tool to test the robustness of
658 decompressors when faced with corrupted input.")
659 (license (list license:bsd-2 ; arg_parser.{cc,h}
660 license:gpl2+)))) ; everything else
662 (define-public sharutils
669 (uri (string-append "mirror://gnu/sharutils/sharutils-"
671 (patches (search-patches "sharutils-CVE-2018-1000097.patch"))
674 "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))
675 (modules '((guix build utils)))
678 ;; Adjust for newer libc versions.
679 (substitute* (find-files "lib" "\\.c$")
680 (("#if defined _IO_ftrylockfile")
681 "#if defined _IO_EOF_SEEN"))
682 (substitute* "lib/stdio-impl.h"
683 (("^/\\* BSD stdio derived implementations")
684 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
685 "# define _IO_IN_BACKUP 0x100\n"
687 "/* BSD stdio derived implementations")))
688 ;; ... and for newer GCC with -fno-common.
689 (substitute* '("src/shar-opts.h"
691 "src/uudecode-opts.h"
692 "src/uuencode-opts.h")
693 (("char const \\* const program_name" all)
694 (string-append "extern " all)))))))
695 (build-system gnu-build-system)
700 (modify-phases %standard-phases
701 (add-after 'patch-source-shebangs 'unpatch-source-shebang
702 ;; revert the patch-shebang phase on a script which is
705 (substitute* "tests/shar-1.ok"
706 (((which "sh")) "/bin/sh")))))))
707 (home-page "https://www.gnu.org/software/sharutils/")
708 (synopsis "Archives in shell scripts, uuencode/uudecode")
710 "GNU sharutils is a package for creating and manipulating shell
711 archives that can be readily emailed. A shell archive is a file that can be
712 processed by a Bourne-type shell to unpack the original collection of files.
713 This package is mostly for compatibility and historical interest.")
714 (license license:gpl3+)))
716 (define-public sfarklib
723 (url "https://github.com/raboof/sfArkLib")
725 (file-name (git-file-name name version))
728 "0jrxy24gak7q5ml06p5jjgzk9i5r2mkfjk4ycirkp4kg7k5a237w"))))
729 (build-system gnu-build-system)
731 `(#:tests? #f ;no "check" target
733 (modify-phases %standard-phases
735 (lambda* (#:key outputs #:allow-other-keys)
736 (substitute* "Makefile"
737 (("/usr/local") (assoc-ref outputs "out")))
741 (home-page "https://github.com/raboof/sfArkLib")
742 (synopsis "Library for SoundFont decompression")
744 "SfArkLib is a C++ library for decompressing SoundFont files compressed
745 with the sfArk algorithm.")
746 (license license:gpl3+)))
748 (define-public sfarkxtc
749 (let ((commit "13cd6f93725a90d91ec5ea75babf1dbd694ac463")
753 (version (git-version "0" revision commit))
755 ;; There are no release tarballs, so we just fetch the latest
756 ;; commit at this time.
759 (url "https://github.com/raboof/sfarkxtc")
761 (file-name (git-file-name name version))
764 "1mb1jyk1m11l1gppd9hmql9cyp55sdf7jk5rbc7acky1z4k4mv19"))))
765 (build-system gnu-build-system)
767 `(#:tests? #f ;no "check" target
769 (modify-phases %standard-phases
771 (lambda* (#:key outputs #:allow-other-keys)
772 (substitute* "Makefile"
773 (("/usr/local") (assoc-ref outputs "out")))
777 ("sfarklib" ,sfarklib)))
778 (home-page "https://github.com/raboof/sfarkxtc")
779 (synopsis "Basic sfArk decompressor")
780 (description "SfArk extractor converts SoundFonts in the compressed legacy
781 sfArk file format to the uncompressed sf2 format.")
782 (license license:gpl3+))))
784 (define-public libmspack
787 (home-page "https://cabextract.org.uk/libmspack/")
792 (uri (string-append home-page name "-" version "alpha.tar.gz"))
794 (base32 "13janaqsvm7aqc4agjgd4819pbgqv50j88bh5kci1z70wvg65j5s"))))
795 (build-system gnu-build-system)
797 `(#:configure-flags '("--disable-static")))
798 (synopsis "Compression tools for some formats used by Microsoft")
800 "The purpose of libmspack is to provide both compression and
801 decompression of some loosely related file formats used by Microsoft.")
802 (license license:lgpl2.1+)))
811 (uri (git-reference (url "https://github.com/lz4/lz4")
812 (commit (string-append "v" version))))
814 (base32 "1w02kazh1fps3sji2sn89fz862j1199c5ajrqcgl1bnlxj09kcbz"))
815 (file-name (git-file-name name version))))
816 (build-system gnu-build-system)
817 (outputs (list "out" "static"))
821 ("valgrind" ,valgrind)))
823 `(;; Not designed for parallel testing.
824 ;; See https://github.com/lz4/lz4/issues/957#issuecomment-737419821
827 #:make-flags (list (string-append "CC=" ,(cc-for-target))
828 (string-append "prefix=" (assoc-ref %outputs "out")))
830 (modify-phases %standard-phases
831 (delete 'configure) ; no configure script
832 (add-before 'check 'disable-broken-test
834 (substitute* "tests/Makefile"
835 ;; This fails when $prefix is not a single top-level directory.
836 (("^test: (.*) test-install" _ targets)
837 (string-append "test: " targets)))
839 (add-after 'install 'move-static-library
840 (lambda* (#:key outputs #:allow-other-keys)
841 (let ((out (assoc-ref outputs "out"))
842 (static (assoc-ref outputs "static")))
843 (mkdir-p (string-append static "/lib"))
844 (rename-file (string-append out "/lib/liblz4.a")
845 (string-append static "/lib/liblz4.a"))
847 (home-page "https://www.lz4.org")
848 (synopsis "Compression algorithm focused on speed")
849 (description "LZ4 is a lossless compression algorithm, providing
850 compression speed at 400 MB/s per core (0.16 Bytes/cycle). It also features an
851 extremely fast decoder, with speed in multiple GB/s per core (0.71 Bytes/cycle).
852 A high compression derivative, called LZ4_HC, is also provided. It trades CPU
853 time for compression ratio.")
854 ;; The libraries (lz4, lz4hc, and xxhash) are BSD licenced. The command
855 ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
856 (license (list license:bsd-2 license:gpl2+))))
858 (define-public squashfs-tools
860 (name "squashfs-tools")
861 (version "4.4-git.1") ; ‘A point release of […] 4.4’
866 (url "https://github.com/plougher/squashfs-tools")
868 (file-name (git-file-name name version))
870 (base32 "1hb95iy445hs2p3f7hg51jkrpkfi3bphddk60p2la0qmcdjkgbbm"))))
871 (build-system gnu-build-system)
873 `(#:tests? #f ; no check target
875 (list (string-append "CC=" ,(cc-for-target))
880 (string-append "INSTALL_DIR=" %output "/bin"))
882 (modify-phases %standard-phases
885 (chdir "squashfs-tools")))
886 (add-after 'install 'install-documentation
887 ;; Install what very little usage documentation is provided.
888 (lambda* (#:key outputs #:allow-other-keys)
889 (let* ((out (assoc-ref outputs "out"))
890 (doc (string-append out "/share/doc/" ,name)))
891 (install-file "../USAGE" doc)))))))
897 ("zstd:lib" ,zstd "lib")))
898 (home-page "https://github.com/plougher/squashfs-tools")
899 (synopsis "Tools to create and extract squashfs file systems")
901 "Squashfs is a highly compressed read-only file system for Linux. It
902 compresses files, inodes, and directories with one of several compressors.
903 All blocks are packed to minimize the data overhead, and block sizes of
904 between 4K and 1M are supported. It is intended to be used for archival use,
905 for live media, and for embedded systems where low overhead is needed.
906 This package allows you to create and extract such file systems.")
907 (license license:gpl2+)))
909 (define-public squashfs-tools-ng
911 (name "squashfs-tools-ng")
917 (url "https://github.com/AgentD/squashfs-tools-ng")
918 (commit (string-append "v" version))))
919 (file-name (git-file-name name version))
921 (base32 "13gx6mc57wjjnrpnkb74zi2wiqazz2q715y1zz7rff02wh1vb5k9"))
922 (modules '((guix build utils)))
925 ;; Delete bundled third-party libraries.
926 (for-each (lambda (directory)
927 (substitute* "Makefile.am"
928 (((format #f "^include ~a.*" directory)) ""))
929 (delete-file-recursively directory))
932 (build-system gnu-build-system)
935 (list "--disable-static")))
937 `(("autoconf" ,autoconf)
938 ("automake" ,automake)
940 ("pkg-config" ,pkg-config)))
942 `(("libselinux" ,libselinux)
944 ;; Compression algorithms.
950 ("zstd:lib" ,zstd "lib")))
951 (home-page "https://github.com/AgentD/squashfs-tools-ng")
952 (synopsis "Tools to create and extract squashfs file systems")
954 "Squashfs is a highly compressed read-only file system for Linux. It
955 compresses files, inodes, and directories with one of several compressors.
956 All blocks are packed to minimize the data overhead, and block sizes of
957 between 4K and 1M are supported. It is intended to be used for archival use,
958 for live media, and for embedded systems where low overhead is needed.
960 The squashfs-tools-ng package offers alternative tooling to create and extract
961 such file systems. It is not based on the older squashfs-tools package and
962 its tools have different names:
965 @item @command{gensquashfs} produces SquashFS images from a directory or
966 @command{gen_init_cpio}-like file listings and can generate SELinux labels.
967 @item @command{rdsquashfs} inspects and unpacks SquashFS images.
968 @item @command{sqfs2tar} and @command{tar2sqfs} convert between SquashFS and
970 @item @command{sqfsdiff} compares the contents of two SquashFS images.
973 These commands are largely command-line wrappers around the included
974 @code{libsquashfs} library that intends to make SquashFS available to other
975 applications as an embeddable, extensible archive format.
977 Both the library and tools operate deterministically: same input will produce
978 byte-for-byte identical output.")
979 ;; Upstream goes to some lengths to ensure that libsquashfs is LGPL3+.
980 (license license:gpl3+)))
988 (uri (string-append "http://zlib.net/pigz/"
989 name "-" version ".tar.gz"))
992 "0z9avc4mifwcpj3qdsf9m2rjw9jx03b2r9pj0c4xgla9fh6ppv9f"))))
993 (build-system gnu-build-system)
996 (modify-phases %standard-phases
999 (lambda* (#:key outputs #:allow-other-keys)
1000 (let* ((out (assoc-ref outputs "out"))
1001 (bin (string-append out "/bin"))
1002 (man (string-append out "/share/man/man1")))
1003 (install-file "pigz" bin)
1004 (symlink "pigz" (string-append bin "/unpigz"))
1005 (install-file "pigz.1" man)
1008 (list ,(string-append "CC=" (cc-for-target)))
1009 #:test-target "tests"))
1010 (inputs `(("zlib" ,zlib)))
1011 (home-page "https://zlib.net/pigz/")
1012 (synopsis "Parallel implementation of gzip")
1014 "This package provides a parallel implementation of gzip that exploits
1015 multiple processors and multiple cores when compressing data.")
1017 ;; Things under zopfli/ are under ASL2.0, but 4 files at the top-level,
1018 ;; written by Mark Adler, are under another non-copyleft license.
1019 (license license:asl2.0)))
1028 "https://github.com/vasi/pixz/releases/download/v" version
1029 "/pixz-" version ".tar.xz"))
1032 "1ifxr18f2h75gkcrkx8033kwmwmrcgxshpaawyc2n4dzn1p2rqz5"))))
1033 (build-system gnu-build-system)
1035 `(("pkg-config" ,pkg-config)
1036 ("libarchive" ,libarchive)))
1037 (home-page "https://github.com/vasi/pixz")
1038 (synopsis "Parallel indexing implementation of LZMA")
1040 "The existing XZ Utils provide great compression in the .xz file format,
1041 but they produce just one big block of compressed data. Pixz instead produces
1042 a collection of smaller blocks which makes random access to the original data
1043 possible and can compress in parallel. This is especially useful for large
1045 (license license:bsd-2)))
1047 (define-public cabextract
1050 (home-page "https://cabextract.org.uk/")
1054 (uri (string-append home-page "cabextract-" version ".tar.gz"))
1057 "19qwhl2r8ip95q4vxzxg2kp4p125hjmc9762sns1dwwf7ikm7hmg"))
1058 (modules '((guix build utils)))
1061 ;; Delete bundled libmspack.
1062 (delete-file-recursively "mspack")
1064 (build-system gnu-build-system)
1066 '(#:configure-flags '("--with-external-libmspack")
1068 (modify-phases %standard-phases
1069 ;; cabextract needs some of libmspack's header files.
1070 ;; These are located in the "mspack" directory of libmspack.
1071 (add-before 'build 'unpack-libmspack
1072 (lambda* (#:key inputs #:allow-other-keys)
1073 (let ((dir-name "libmspack-src"))
1075 (invoke "tar" "-xvf" (assoc-ref inputs "libmspack-source")
1076 "-C" dir-name "--strip-components" "1")
1077 (rename-file (string-append dir-name "/mspack")
1079 (delete-file-recursively dir-name)
1082 `(("pkg-config" ,pkg-config)))
1084 `(("libmspack" ,libmspack)
1085 ("libmspack-source" ,(package-source libmspack))))
1086 (synopsis "Tool to unpack Cabinet archives")
1087 (description "Extracts files out of Microsoft Cabinet (.cab) archives")
1088 ;; Some source files specify gpl2+, lgpl2+, however COPYING is gpl3.
1089 (license license:gpl3+)))
1091 (define-public libjcat
1100 (url "https://github.com/hughsie/libjcat")
1102 (file-name (git-file-name name version))
1104 (base32 "18qkyg19r7fxzv93kar5n808n3582ygjmqwa7rnyg5y4b6hnwihl"))))
1105 (build-system meson-build-system)
1107 `(("gobject-introspection" ,gobject-introspection)
1108 ("help2man" ,help2man)
1109 ("pkg-config" ,pkg-config)))
1116 ("json-glib" ,json-glib)
1118 (home-page "https://github.com/hughsie/libjcat")
1119 (synopsis "Library for reading and writing Jcat files")
1121 "This library allows reading and writing gzip-compressed JSON catalog
1122 files, which can be used to store GPG, PKCS-7 and SHA-256 checksums for each
1124 (license license:lgpl2.1+)))
1126 (define-public xdelta
1134 (url "https://github.com/jmacd/xdelta")
1135 (commit (string-append "v" version))))
1136 (file-name (git-file-name name version))
1139 "09mmsalc7dwlvgrda56s2k927rpl3a5dzfa88aslkqcjnr790wjy"))
1141 ;; This file isn't freely distributable and has no effect on building.
1143 (delete-file "xdelta3/draft-korn-vcdiff.txt")
1145 (build-system gnu-build-system)
1147 `(("autoconf" ,autoconf)
1148 ("automake" ,automake)))
1151 (modify-phases %standard-phases
1152 (add-after 'unpack 'enter-build-directory
1153 (lambda _ (chdir "xdelta3") #t)))))
1154 (home-page "http://xdelta.org")
1155 (synopsis "Delta encoder for binary files")
1156 (description "xdelta encodes only the differences between two binary files
1157 using the VCDIFF algorithm and patch file format described in RFC 3284. It can
1158 also be used to apply such patches. xdelta is similar to @command{diff} and
1159 @command{patch}, but is not limited to plain text and does not generate
1160 human-readable output.")
1161 (license license:asl2.0)))
1163 (define-public lrzip
1171 "http://ck.kolivas.org/apps/lrzip/lrzip-" version ".tar.xz"))
1173 (base32 "0ziyanspd96dc3lp2qdcylc7aq8dhb511jhqrhxvlp502fjqjqrc"))))
1174 (build-system gnu-build-system)
1176 `(;; nasm is only required when building for 32-bit x86 platforms
1177 ,@(if (string-prefix? "i686" (or (%current-target-system)
1187 (home-page "http://ck.kolivas.org/apps/lrzip/")
1188 (synopsis "Large file compressor with a very high compression ratio")
1189 (description "lrzip is a compression utility that uses long-range
1190 redundancy reduction to improve the subsequent compression ratio of
1191 larger files. It can then further compress the result with the ZPAQ or
1192 LZMA algorithms for maximum compression, or LZO for maximum speed. This
1193 choice between size or speed allows for either better compression than
1194 even LZMA can provide, or a higher speed than gzip while compressing as
1196 (license (list license:gpl3+
1197 license:public-domain)))) ; most files in lzma/
1199 (define-public snappy
1207 (url "https://github.com/google/snappy")
1209 (file-name (git-file-name name version))
1211 (base32 "03zz56h79z0sgvi5sangjqn9dahhzvf645v26n1y0gwmfbmsax95"))
1213 (search-patches "snappy-add-O2-flag-in-CmakeLists.txt.patch"
1214 "snappy-add-inline-for-GCC.patch"))))
1215 (build-system cmake-build-system)
1218 (list "-DBUILD_SHARED_LIBS=ON"
1219 ;; These would be installed alongside Snappy otherwise.
1220 "-DBENCHMARK_ENABLE_INSTALL=OFF"
1221 "-DINSTALL_GTEST=OFF")
1223 (modify-phases %standard-phases
1224 (add-after 'unpack 'unpack-third_party-subprojects
1225 (lambda* (#:key inputs #:allow-other-keys)
1226 (with-directory-excursion "third_party"
1227 (for-each (lambda (subproject)
1228 (let* ((input (string-append subproject "-source"))
1229 (source (assoc-ref inputs input)))
1230 (with-directory-excursion subproject
1231 ;; Take advantage of the coincidence that both
1232 ;; use GIT-FETCH, which creates a directory.
1233 (copy-recursively source "."))))
1238 `(("benchmark-source" ,(package-source benchmark))
1239 ("googletest-source" ,(package-source googletest))))
1240 (home-page "https://github.com/google/snappy")
1241 (synopsis "Fast compressor/decompressor")
1242 (description "Snappy is a compression/decompression library. It does not
1243 aim for maximum compression, or compatibility with any other compression library;
1244 instead, it aims for very high speeds and reasonable compression. For instance,
1245 compared to the fastest mode of zlib, Snappy is an order of magnitude faster
1246 for most inputs, but the resulting compressed files are anywhere from 20% to
1248 (license license:asl2.0)))
1250 ;; We need this for irods.
1251 (define-public snappy-with-clang6
1254 (name "snappy-with-clang")
1255 ;; XXX 1.1.9 fails to build with clang with
1256 ;; error: invalid output constraint '=@ccz' in asm
1262 (url "https://github.com/google/snappy")
1264 (file-name (git-file-name name version))
1266 (base32 "1j0kslq2dvxgkcxl1gakhvsa731yrcvcaipcp5k8k7ayicvkv9jv"))))
1269 '("-DBUILD_SHARED_LIBS=ON"
1270 "-DCMAKE_CXX_COMPILER=clang++"
1271 "-DCMAKE_CXX_FLAGS=-stdlib=libc++"
1272 "-DCMAKE_EXE_LINKER_FLAGS=-lc++abi")
1274 (modify-phases %standard-phases
1275 (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
1276 (lambda* (#:key native-inputs inputs #:allow-other-keys)
1277 (let ((gcc (assoc-ref (or native-inputs inputs) "gcc")))
1278 (setenv "CPLUS_INCLUDE_PATH"
1280 (cons* (string-append (assoc-ref inputs "libcxx+libcxxabi")
1282 ;; Hide GCC's C++ headers so that they do not interfere with
1283 ;; the Clang headers.
1284 (delete (string-append gcc "/include/c++")
1285 (string-split (getenv "CPLUS_INCLUDE_PATH")
1289 "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
1290 (getenv "CPLUS_INCLUDE_PATH"))))))))
1291 (properties `((hidden? . #true)))
1293 `(("clang" ,clang-toolchain-6)))
1295 `(("libcxx+libcxxabi" ,libcxx+libcxxabi-6)
1296 ("libcxxabi" ,libcxxabi-6)))))
1298 (define-public p7zip
1304 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1305 version "/" name "_" version
1306 "_src_all.tar.bz2"))
1309 "07rlwbbgszq8i7m8jh3x6j2w2hc9a72dc7fmqawnqkwlwb00mcjy"))
1310 (modules '((guix build utils)))
1313 ;; Remove non-free source files
1314 (for-each delete-file
1316 (find-files "CPP/7zip/Compress" "Rar.*")
1317 (find-files "CPP/7zip/Crypto" "Rar.*")
1318 (find-files "DOC/unRarLicense.txt")
1319 (find-files "Utils/file_Codecs_Rar_so.py")))
1320 (delete-file-recursively "CPP/7zip/Archive/Rar")
1321 (delete-file-recursively "CPP/7zip/Compress/Rar")
1323 (patches (search-patches "p7zip-CVE-2016-9296.patch"
1324 "p7zip-CVE-2017-17969.patch"
1325 "p7zip-remove-unused-code.patch"))))
1326 (build-system gnu-build-system)
1329 (list (string-append "DEST_HOME=" (assoc-ref %outputs "out")) "all3")
1331 (modify-phases %standard-phases
1333 (lambda* (#:key system outputs #:allow-other-keys)
1335 (let ((system ,(or (%current-target-system)
1336 (%current-system))))
1338 ((string-prefix? "x86_64" system)
1339 "makefile.linux_amd64_asm")
1340 ((string-prefix? "i686" system)
1341 "makefile.linux_x86_asm_gcc_4.X")
1343 "makefile.linux_any_cpu_gcc_4.X")))
1344 "makefile.machine")))
1347 (invoke "make" "test")
1348 (invoke "make" "test_7z")
1349 (invoke "make" "test_7zr"))))))
1351 (let ((system (or (%current-target-system)
1352 (%current-system))))
1353 `(,@(cond ((string-prefix? "x86_64" system)
1355 ((string-prefix? "i686" system)
1358 (home-page "http://p7zip.sourceforge.net/")
1359 (synopsis "Command-line file archiver with high compression ratio")
1360 (description "p7zip is a command-line port of 7-Zip, a file archiver that
1361 handles the 7z format which features very high compression ratios.")
1362 (license (list license:lgpl2.1+
1364 license:public-domain))))
1366 (define-public gzstream
1373 ;; No versioned URL, but last release was in 2003.
1374 "http://www.cs.unc.edu/Research/compgeom/gzstream/gzstream.tgz")
1375 (file-name (string-append name "-" version ".tgz"))
1378 "00y19pqjsdj5zcrx4p9j56pl73vayfwnb7y2hvp423nx0cwv5b4r"))
1379 (modules '((guix build utils)))
1381 ;; Remove pre-compiled object.
1383 (delete-file "gzstream.o")
1385 (build-system gnu-build-system)
1387 `(#:test-target "test"
1389 (modify-phases %standard-phases
1390 ;; Enable PIC, so it can be used in shared libraries.
1391 (add-after 'unpack 'use-pic
1393 (substitute* "Makefile"
1394 (("CPPFLAGS = " all) (string-append all "-fPIC ")))
1398 (lambda* (#:key outputs #:allow-other-keys)
1399 (let* ((out (assoc-ref outputs "out"))
1400 (lib (string-append out "/lib"))
1401 (include (string-append out "/include")))
1402 (install-file "libgzstream.a" lib)
1403 (install-file "gzstream.h" include)
1405 (propagated-inputs `(("zlib" ,zlib)))
1406 (home-page "http://www.cs.unc.edu/Research/compgeom/gzstream/")
1407 (synopsis "Compressed C++ iostream")
1408 (description "gzstream is a small library for providing zlib
1409 functionality in a C++ iostream.")
1410 (license license:lgpl2.1+)))
1418 (method url-fetch/zipbomb)
1419 (uri (string-append "http://mattmahoney.net/dc/zpaq"
1420 (string-delete #\. version) ".zip"))
1423 "066l94yyladlfzri877nh2dhkvspagjn3m5bmv725fmhkr9c4pp8"))
1424 (modules '((guix build utils)))
1426 ;; Delete irrelevant pre-compiled binaries.
1428 (for-each delete-file (find-files "." "\\.exe$"))
1430 (build-system gnu-build-system)
1433 (modify-phases %standard-phases
1434 (delete 'configure)) ; no ‘configure’ script
1437 (string-append "CPPFLAGS=-Dunix"
1438 ,(match (or (%current-target-system)
1443 ;; These should be safe, lowest-common-denominator instruction sets,
1444 ;; allowing for some optimisation while remaining reproducible.
1445 (string-append "CXXFLAGS=-O3 -DNDEBUG"
1446 ,(match (or (%current-target-system)
1448 ("x86_64-linux" " -march=nocona -mtune=generic")
1449 ("i686-linux" " -march=i686 -mtune=generic")
1450 ("armhf-linux" " -mtune=generic-armv7-a")
1452 (string-append "PREFIX="
1453 (assoc-ref %outputs "out")))))
1455 `(("perl" ,perl))) ; for pod2man
1456 (home-page "http://mattmahoney.net/dc/zpaq.html")
1457 (synopsis "Incremental journaling archiver")
1458 (description "ZPAQ is a command-line archiver for realistic situations with
1459 many duplicate and already compressed files. It backs up only those files
1460 modified since the last update. All previous versions remain untouched and can
1461 be independently recovered. Identical files are only stored once (known as
1462 @dfn{de-duplication}). Archives can also be encrypted.
1464 ZPAQ is intended to back up user data, not entire operating systems. It ignores
1465 owner and group IDs, ACLs, extended attributes, or special file types like
1466 devices, sockets, or named pipes. It does not follow or restore symbolic links
1467 or junctions, and always follows hard links.")
1468 (license (list license:public-domain
1469 ;; libzpaq.cpp contains a mix of public-domain and
1470 ;; expat-licenced (or ‘MIT’) code.
1473 (define-public unshield
1478 (origin (method git-fetch)
1480 (url "http://github.com/twogood/unshield")
1482 (file-name (git-file-name name version))
1485 "19wn22vszhci8dfcixx5rliz7phx3lv5ablvhjlclvj75k2vsdqd"))))
1486 (build-system cmake-build-system)
1489 ("openssl" ,openssl)
1490 ;; Test data that is otherwise downloaded with curl.
1491 ("unshield-avigomanager11b22.zip"
1495 "https://www.dropbox.com/s/8r4b6752swe3nhu/"
1496 "unshield-avigomanager11b22.zip?dl=1"))
1498 (base32 "0fwq7lih04if68wpwpsk5wjqyvh32db76a41sq6gbx4dn1lc3ddn"))
1499 (file-name "unshield-avigomanager11b22.zip")))
1500 ("unshield-baldurs_gate_patch_v1_1_4315_international.zip"
1504 "https://www.dropbox.com/s/9ruil8oi6amjbbk/"
1505 "unshield-baldurs_gate_patch_v1_1_4315_international.zip?dl=1"))
1507 (base32 "0spaxf6dardlhqxz3ys09fzamj007q3nfyw4xng6gh3qp9780maj"))
1508 (file-name "unshield-baldurs_gate_patch_v1_1_4315_international.zip")))
1509 ("unshield-the-feeble-files-spanish.zip"
1513 "https://www.dropbox.com/s/1ng0z9kfxc7eb1e/"
1514 "unshield-the-feeble-files-spanish.zip?dl=1"))
1516 (base32 "1k5cw6vnpja8yjlnhx5124xrw9i8s1l539hfdqqrqz3l5gn0bnyd"))
1517 (file-name "unshield-the-feeble-files-spanish.zip")))))
1519 `(("unzip" ,unzip)))
1521 `(#:out-of-source? #f
1523 (modify-phases %standard-phases
1524 (add-before 'check 'pre-check
1525 (lambda* (#:key inputs #:allow-other-keys)
1526 (for-each (lambda (i)
1527 (copy-file (assoc-ref inputs i)
1528 (string-append "test/v0/" i)))
1529 '("unshield-avigomanager11b22.zip"
1530 "unshield-baldurs_gate_patch_v1_1_4315_international.zip"
1531 "unshield-the-feeble-files-spanish.zip"))
1532 (substitute* (find-files "test/" "/*\\.sh")
1533 ;; Tests expect the unshield binary in a specific
1535 (("/var/tmp/unshield/bin/unshield")
1536 (string-append (getcwd) "/src/unshield"))
1537 ;; We no longer need to download the data.
1539 (("curl -(|f)sSL -o test.zip .*") ""))
1540 (substitute* "test/v0/avigomanager.sh"
1542 (string-append (getcwd)
1543 "/test/v0/unshield-avigomanager11b22.zip")))
1544 (substitute* "test/v0/baldurs_gate_patch_v1_1_4315_international.sh"
1548 "/test/v0/unshield-baldurs_gate_patch_v1_1_4315_international.zip")))
1549 (substitute* "test/v0/the-feeble-files-spanish.sh"
1551 (string-append (getcwd)
1552 "/test/v0/unshield-the-feeble-files-spanish.zip")))
1556 (invoke "./run-tests.sh"))))))
1557 (home-page "https://github.com/twogood/unshield")
1558 (synopsis "Extract CAB files from InstallShield installers")
1560 "@command{unshield} is a tool and library for extracting @file{.cab}
1561 archives from InstallShield installers.")
1562 (license license:expat)))
1571 (uri (string-append "https://github.com/facebook/zstd/releases/download/"
1572 "v" version "/zstd-" version ".tar.gz"))
1574 (base32 "150y541303vnvfhd8wkbih00lfvvm98rd12yijwlbkqzg3xgp52i"))))
1575 (build-system gnu-build-system)
1576 (outputs '("out" ;1.2MiB executables and documentation
1577 "lib" ;1.2MiB shared library and headers
1578 "static")) ;1.2MiB static library
1581 (modify-phases %standard-phases
1582 (add-after 'unpack 'remove-bogus-check
1584 ;; lib/Makefile falsely claims that no .pc file can be created.
1585 (substitute* "lib/Makefile"
1586 (("error configured .*dir ")
1589 (add-after 'unpack 'patch-command-file-names
1590 ;; Don't require hard requirements to be in $PATH.
1591 (lambda* (#:key outputs #:allow-other-keys)
1592 (let* ((out (assoc-ref outputs "out"))
1593 (our (lambda (name) (string-append out "/bin/" name))))
1594 (substitute* "programs/zstdgrep"
1595 (("(:-)(grep)" _ prefix command)
1596 (string-append prefix (which command)))
1597 (("(:-)(zstdcat)" _ prefix command)
1598 (string-append prefix (our command))))
1599 (substitute* "programs/zstdless"
1600 (("zstdcat" command)
1602 (delete 'configure) ;no configure script
1603 (add-after 'install 'adjust-library-locations
1604 (lambda* (#:key outputs #:allow-other-keys)
1605 (let* ((out (assoc-ref outputs "out"))
1606 (lib (assoc-ref outputs "lib"))
1607 (static (assoc-ref outputs "static"))
1608 (shared-libs (string-append lib "/lib"))
1609 (static-libs (string-append static "/lib")))
1610 ;; Move the static library to its own output to save ~1MiB.
1611 (mkdir-p static-libs)
1612 (for-each (lambda (ar)
1613 (link ar (string-append static-libs "/"
1616 (find-files shared-libs "\\.a$"))
1618 ;; Make sure the pkg-config file refers to the right output.
1619 (substitute* (string-append shared-libs "/pkgconfig/libzstd.pc")
1621 ;; Note: The .pc file expects a trailing slash for 'prefix'.
1622 (string-append "prefix=" lib "/\n")))))))
1624 (list ,(string-append "CC=" (cc-for-target))
1625 (string-append "prefix=" (assoc-ref %outputs "out"))
1626 (string-append "libdir=" (assoc-ref %outputs "lib") "/lib")
1627 (string-append "includedir=" (assoc-ref %outputs "lib") "/include")
1628 ;; Auto-detection is over-engineered and buggy.
1631 ;; Skip auto-detection of, and creating a dependency on, the build
1632 ;; environment's ‘xz’ for what amounts to a dubious feature anyway.
1634 ;; Not currently detected, but be explicit & avoid surprises later.
1637 (home-page "https://facebook.github.io/zstd/")
1638 (synopsis "Zstandard real-time compression algorithm")
1639 (description "Zstandard (@command{zstd}) is a lossless compression algorithm
1640 that combines very fast operation with a compression ratio comparable to that of
1641 zlib. In most scenarios, both compression and decompression can be performed in
1642 ‘real time’. The compressor can be configured to provide the most suitable
1643 trade-off between compression ratio and speed, without affecting decompression
1645 (license (list license:bsd-3 ; the main top-level LICENSE file
1646 license:bsd-2 ; many files explicitly state 2-Clause
1647 license:gpl2 ; the main top-level COPYING file
1648 license:gpl3+ ; tests/gzip/*.sh
1649 license:expat ; lib/dictBuilder/divsufsort.[ch]
1650 license:public-domain ; zlibWrapper/examples/fitblk*
1651 license:zlib)))) ; zlibWrapper/{gz*.c,gzguts.h}
1653 (define-public pzstd
1654 (package/inherit zstd
1658 `(,@(if (%current-target-system)
1659 `(("googletest" ,googletest))
1662 `(,@(if (%current-system)
1663 `(("googletest" ,googletest))
1667 (modify-phases %standard-phases
1668 (add-after 'unpack 'enter-subdirectory
1669 (lambda _ (chdir "contrib/pzstd") #t))
1670 (delete 'configure) ; no configure script
1671 (add-before 'check 'compile-tests
1672 (lambda* (#:key make-flags #:allow-other-keys)
1673 (apply invoke "make" "tests" make-flags)))
1674 (add-after 'install 'install-documentation
1675 (lambda* (#:key outputs #:allow-other-keys)
1676 (let* ((out (assoc-ref outputs "out"))
1677 (doc (string-append out "/share/doc/" ,name)))
1679 (install-file "README.md" doc)
1682 (list (string-append "CC=" ,(cc-for-target))
1683 (string-append "CXX=" ,(cxx-for-target))
1684 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1685 (home-page (package-home-page zstd))
1686 (synopsis "Threaded implementation of the Zstandard compression algorithm")
1687 (description "Parallel Zstandard (PZstandard or @command{pzstd}) is a
1688 multi-threaded implementation of the @uref{http://zstd.net/, Zstandard
1689 compression algorithm}. It is fully compatible with the original Zstandard file
1690 format and command-line interface, and can be used as a drop-in replacement.
1692 Compression is distributed over multiple processor cores to improve performance,
1693 as is the decompression of data compressed in this manner. Data compressed by
1694 other implementations will only be decompressed by two threads: one performing
1695 the actual decompression, the other input and output.")
1696 (license (package-license zstd))))
1705 (uri (string-append "mirror://sourceforge/infozip"
1706 "/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz"))
1709 "0sb3h3067pzf3a7mlxn1hikpcjrsvycjcnj9hl9b1c3ykcgvps7h"))))
1710 (build-system gnu-build-system)
1711 (inputs `(("bzip2" ,bzip2)))
1713 `(#:tests? #f ; no test target
1714 #:make-flags (let ((out (assoc-ref %outputs "out")))
1715 (list "-f" "unix/Makefile"
1716 (string-append "prefix=" out)
1717 (string-append "MANDIR=" out "/share/man/man1")))
1719 (modify-phases %standard-phases
1721 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1722 (apply invoke "make" "generic_gcc" make-flags)))
1723 (delete 'configure))))
1724 (home-page "http://www.info-zip.org/Zip.html")
1725 (synopsis "Compression and file packing utility")
1727 "Zip is a compression and file packaging/archive utility. Zip is useful
1728 for packaging a set of files for distribution, for archiving files, and for
1729 saving disk space by temporarily compressing unused files or directories.
1730 Zip puts one or more compressed files into a single ZIP archive, along with
1731 information about the files (name, path, date, time of last modification,
1732 protection, and check information to verify file integrity). An entire
1733 directory structure can be packed into a ZIP archive with a single command.
1735 Zip has one compression method (deflation) and can also store files without
1736 compression. Zip automatically chooses the better of the two for each file.
1737 Compression ratios of 2:1 to 3:1 are common for text files.")
1738 (license (license:non-copyleft "file://LICENSE"
1739 "See LICENSE in the distribution."))))
1741 (define-public unzip
1742 (package (inherit zip)
1748 (uri (string-append "mirror://sourceforge/infozip"
1749 "/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz"))
1752 "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83"))
1753 (patches (search-patches "unzip-CVE-2014-8139.patch"
1754 "unzip-CVE-2014-8140.patch"
1755 "unzip-CVE-2014-8141.patch"
1756 "unzip-CVE-2014-9636.patch"
1757 "unzip-CVE-2015-7696.patch"
1758 "unzip-CVE-2015-7697.patch"
1759 "unzip-allow-greater-hostver-values.patch"
1760 "unzip-initialize-symlink-flag.patch"
1761 "unzip-remove-build-date.patch"
1762 "unzip-attribs-overflow.patch"
1763 "unzip-overflow-on-invalid-input.patch"
1764 "unzip-format-secure.patch"
1765 "unzip-overflow-long-fsize.patch"
1768 "unzip-alt-iconv-utf8.patch"
1769 "unzip-alt-iconv-utf8-print.patch"
1770 "unzip-fix-recmatch.patch"
1771 "unzip-case-insensitive.patch"
1773 "unzip-COVSCAN-fix-unterminated-string.patch"
1774 "unzip-CVE-2016-9844.patch"
1775 "unzip-CVE-2018-1000035.patch"
1776 "unzip-CVE-2018-18384.patch"
1777 "unzip-exec-shield.patch"
1778 "unzip-manpage-fix.patch"
1779 "unzip-overflow.patch"
1780 "unzip-timestamp.patch"
1781 "unzip-valgrind.patch"
1782 "unzip-x-option.patch"
1784 "unzip-zipbomb-manpage.patch"
1785 "unzip-zipbomb-part1.patch"
1786 "unzip-zipbomb-part2.patch"
1787 "unzip-zipbomb-part3.patch"
1789 ;; https://github.com/madler/unzip/issues/2
1790 "unzip-32bit-zipbomb-fix.patch"))))
1791 (build-system gnu-build-system)
1792 ;; no inputs; bzip2 is not supported, since not compiled with BZ_NO_STDIO
1794 `(#:phases (modify-phases %standard-phases
1796 (add-after 'unpack 'fortify
1798 ;; Mitigate CVE-2018-1000035, an exploitable buffer overflow.
1799 ;; This environment variable is recommended in 'unix/Makefile'
1800 ;; for passing flags to the C compiler.
1801 (setenv "LOCAL_UNZIP" "-D_FORTIFY_SOURCE=1")
1804 (lambda* (#:key make-flags #:allow-other-keys)
1805 (apply invoke "make"
1806 `("-j" ,(number->string
1807 (parallel-job-count))
1810 #:make-flags (list "-f" "unix/Makefile"
1811 (string-append "prefix=" %output)
1812 (string-append "MANDIR=" %output "/share/man/man1"))))
1813 (home-page "http://www.info-zip.org/UnZip.html")
1814 (synopsis "Decompression and file extraction utility")
1816 "UnZip is an extraction utility for archives compressed in .zip format,
1817 also called \"zipfiles\".
1819 UnZip lists, tests, or extracts files from a .zip archive. The default
1820 behaviour (with no options) is to extract into the current directory, and
1821 subdirectories below it, all files from the specified zipfile. UnZip
1822 recreates the stored directory structure by default.")
1823 (license (license:non-copyleft "file://LICENSE"
1824 "See LICENSE in the distribution."))))
1826 (define-public ziptime
1827 (let ((commit "2a5bc9dfbf7c6a80e5f7cb4dd05b4036741478bc")
1831 (version (git-version "0.0.0" revision commit))
1836 (url "https://android.googlesource.com/platform/build")
1838 (file-name (git-file-name name version))
1840 (base32 "0hrn61b3a97dlc4iqc28rwx8k8zf7ycbwzqqp93vj34zy5a541kn"))))
1841 (build-system gnu-build-system)
1843 `(#:tests? #f ; no test suite
1845 (modify-phases %standard-phases
1846 (add-after 'unpack 'change-directory
1848 (chdir "tools/ziptime")))
1849 (delete 'configure) ; nothing to configure
1851 ;; There is no Makefile, only an ‘Android.bp’ file. Ignore it.
1853 (let ((c++ ,(cxx-for-target)))
1854 (apply invoke c++ "-O2" "-o" "ziptime"
1855 (find-files "." "\\.cpp$")))))
1857 (lambda* (#:key outputs #:allow-other-keys)
1858 (let* ((out (assoc-ref outputs "out"))
1859 (bin (string-append out "/bin"))
1860 (doc (string-append out "/share/doc/" ,name "-" ,version)))
1861 (install-file "ziptime" bin)
1862 (install-file "README.txt" doc)))))))
1863 ;; There is no separate home page for this tiny bundled build tool.
1864 (home-page (string-append "https://android.googlesource.com/platform/build/"
1865 "+/master/tools/ziptime/README.txt"))
1866 (synopsis "Normalize @file{.zip} archive header timestamps")
1868 "Ziptime helps make @file{.zip} archives reproducible by replacing
1869 timestamps in the file header with a fixed time (1 January 2008).
1871 ``Extra fields'' are not changed, so you'll need to use the @code{-X} option to
1872 @command{zip} to prevent it from storing the ``universal time'' field.")
1873 (license license:asl2.0))))
1875 (define-public zziplib
1879 (home-page "https://github.com/gdraheim/zziplib")
1882 (uri (git-reference (url home-page)
1883 (commit (string-append "v" version))))
1884 (file-name (git-file-name name version))
1887 "0i6bpa2b13z19alm6ig80364dnin1w28cvif18k6wkkb0w3dzp8y"))))
1888 (build-system cmake-build-system)
1891 (native-inputs `(("perl" ,perl) ; for the documentation
1892 ("pkg-config" ,pkg-config)
1894 ("zip" ,zip))) ; to create test files
1895 (synopsis "Library for accessing zip files")
1897 "ZZipLib is a library based on zlib for accessing zip files.")
1898 ;; zziplib is dual licensed under LGPL2.0+ and MPL1.1. Some example source
1899 ;; files carry the Zlib license; see "docs/copying.html" for details.
1900 (license (list license:lgpl2.0+ license:mpl1.1))))
1902 (define-public libzip
1909 "https://libzip.org/download/libzip-" version ".tar.xz"))
1912 "0zn9vaiwy2izj8cnm8i7c2mbdn38n328grqb8f07x55s4kd3nxph"))))
1915 ("pkg-config" ,pkg-config)))
1917 `(("gnutls" ,gnutls)
1919 ("openssl" ,openssl)
1921 ("zstd:lib" ,zstd "lib")))
1922 (build-system cmake-build-system)
1923 (home-page "https://libzip.org")
1924 (synopsis "C library for reading, creating, and modifying zip archives")
1925 (description "Libzip is a C library for reading, creating, and modifying
1926 zip archives. Files can be added from data buffers, files, or compressed data
1927 copied directly from other zip archives. Changes made without closing the
1928 archive can be reverted.")
1929 (license license:bsd-3)))
1931 (define-public atool
1938 (uri (string-append "mirror://savannah/atool/atool-"
1942 "0fvhzip2v08jgnlfpyj6rapan39xlsl1ksgq4lp8gfsai2ah1xma"))))
1943 (build-system gnu-build-system)
1946 (modify-phases %standard-phases
1947 (add-after 'unpack 'embed-absolute-file-name
1948 (lambda* (#:key inputs #:allow-other-keys)
1949 (substitute* "atool"
1950 (("(^\\$::cfg_path_file.*= )'file'" _ pre)
1951 (string-append pre "'" (assoc-ref inputs "file")
1957 (home-page "https://www.nongnu.org/atool/")
1958 (synopsis "Universal tool to manage file archives of various types")
1959 (description "The main command is @command{aunpack} which extracts files
1960 from an archive. The other commands provided are @command{apack} (to create
1961 archives), @command{als} (to list files in archives), and @command{acat} (to
1962 extract files to standard out). As @command{atool} invokes external programs
1963 to handle the archives, not all commands may be supported for a certain type
1965 (license license:gpl2+)))
1967 (define-public lunzip
1974 (uri (string-append "mirror://savannah/lzip/lunzip/"
1975 "lunzip-" version ".tar.gz"))
1977 (base32 "1liaynyy3qcs29hfk1pnb7i9r1mnmpw557j5v356qsv6qnm4lnz5"))))
1978 (build-system gnu-build-system)
1981 (list ,(string-append "CC=" (cc-for-target)))))
1982 (home-page "https://www.nongnu.org/lzip/lunzip.html")
1983 (synopsis "Small, stand-alone lzip decompressor")
1985 "Lunzip is a decompressor for files in the lzip compression format (.lz),
1986 written as a single small C tool with no dependencies. This makes it
1987 well-suited to embedded and other systems without a C++ compiler, or for use in
1988 applications such as software installers that need only to decompress files,
1990 Lunzip is intended to be fully compatible with the regular lzip package.")
1991 (license (list license:bsd-2 ; carg_parser.[ch]
1992 license:gpl2+)))) ; everything else
1994 (define-public clzip
2001 (uri (string-append "mirror://savannah/lzip/clzip/"
2002 "clzip-" version ".tar.gz"))
2004 (base32 "1s7yidqvmxi61hh569h5aci816l6qkffjgx0zx57qyyq0qq2pjgw"))))
2005 (build-system gnu-build-system)
2008 (list ,(string-append "CC=" (cc-for-target)))))
2009 (home-page "https://www.nongnu.org/lzip/clzip.html")
2010 (synopsis "Small, stand-alone lzip compressor and decompressor")
2012 "Clzip is a compressor and decompressor for files in the lzip compression
2013 format (.lz), written as a single small C tool with no dependencies. This makes
2014 it well-suited to embedded and other systems without a C++ compiler, or for use
2015 in other applications like package managers.
2016 Clzip is intended to be fully compatible with the regular lzip package.")
2017 (license (list license:bsd-2 ; carg_parser.[ch], lzd in clzip.texi
2020 (define-public lzlib
2027 (uri (string-append "mirror://savannah/lzip/lzlib/"
2028 "lzlib-" version ".tar.gz"))
2030 (base32 "1c9pwd6by8is4z8bs6j306jyy6pgm2dvsn4fr7fg2b5m5qj88pcf"))))
2031 (build-system gnu-build-system)
2034 (list (string-append "CC=" ,(cc-for-target))
2036 "--enable-shared"))) ; only static (.a) is built by default
2037 (home-page "https://www.nongnu.org/lzip/lzlib.html")
2038 (synopsis "Lzip data compression C library")
2040 "Lzlib is a C library for in-memory LZMA compression and decompression in
2041 the lzip format. It supports integrity checking of the decompressed data, and
2042 all functions are thread-safe. The library should never crash, even in case of
2044 (license (list license:bsd-2 ; the library itself
2045 license:gpl2+)))) ; main.c (i.e. minilzip used by tests)
2047 (define-public plzip
2054 (uri (string-append "mirror://savannah/lzip/plzip/"
2055 "plzip-" version ".tar.gz"))
2057 (base32 "19zinpx7hssl6r3vilpvq2s7wha3545xan8b0vcvsxnyipdx3n0l"))))
2058 (build-system gnu-build-system)
2060 `(("lzlib" ,lzlib)))
2061 (home-page "https://www.nongnu.org/lzip/plzip.html")
2062 (synopsis "Parallel lossless data compressor for the lzip format")
2064 "Plzip is a massively parallel (multi-threaded) lossless data compressor
2065 and decompressor that uses the lzip file format (.lz). Files produced by plzip
2066 are fully compatible with lzip and can be rescued with lziprecover.
2067 On multiprocessor machines, plzip can compress and decompress large files much
2068 faster than lzip, at the cost of a slightly reduced compression ratio (0.4% to
2069 2%). The number of usable threads is limited by file size: on files of only a
2070 few MiB, plzip is no faster than lzip.
2071 Files that were compressed with regular lzip will also not be decompressed
2072 faster by plzip, unless the @code{-b} option was used: lzip usually produces
2073 single-member files which can't be decompressed in parallel.")
2074 (license (list license:bsd-2 ; arg_parser.{cc,h}
2075 license:gpl2+)))) ; everything else
2077 (define-public innoextract
2079 (name "innoextract")
2084 (uri (string-append "https://constexpr.org/innoextract/files/"
2085 "innoextract-" version "/"
2086 "/innoextract-" version ".tar.gz"))
2088 (base32 "09l1z1nbl6ijqqwszdwch9mqr54qb7df0wp2sd77v17dq6gsci33"))))
2089 (build-system cmake-build-system)
2092 (inputs `(("boost" ,boost)
2093 ("libiconv" ,libiconv)
2095 (native-inputs `(("pkg-config" ,pkg-config)))
2096 (home-page "https://constexpr.org/innoextract/")
2097 (synopsis "Tool for extracting Inno Setup installers")
2098 (description "innoextract allows extracting Inno Setup installers under
2099 non-Windows systems without running the actual installer using wine.")
2100 (license license:zlib)))
2102 (define-public google-brotli
2104 (name "google-brotli")
2110 (url "https://github.com/google/brotli")
2111 (commit (string-append "v" version))))
2112 (file-name (git-file-name name version))
2114 (base32 "1fikasxf7r2dwlk8mv8w7nmjkn0jw5ic31ky3mvpkdzwgd4xfndl"))
2115 (modules '((guix build utils)))
2118 ;; Cherry-picked from upstream since the latest release
2119 ;; https://github.com/google/brotli/commit/09b0992b6acb7faa6fd3b23f9bc036ea117230fc
2120 (substitute* (find-files "scripts" "^lib.*pc\\.in")
2121 (("-R\\$\\{libdir\\} ") ""))
2123 (build-system cmake-build-system)
2126 (modify-phases %standard-phases
2127 (add-after 'install 'rename-static-libraries
2128 ;; The build tools put a 'static' suffix on the static libraries, but
2129 ;; other applications don't know how to find these.
2130 (lambda* (#:key outputs #:allow-other-keys)
2131 (let ((lib (string-append (assoc-ref %outputs "out") "/lib/")))
2132 (rename-file (string-append lib "libbrotlicommon-static.a")
2133 (string-append lib "libbrotlicommon.a"))
2134 (rename-file (string-append lib "libbrotlidec-static.a")
2135 (string-append lib "libbrotlidec.a"))
2136 (rename-file (string-append lib "libbrotlienc-static.a")
2137 (string-append lib "libbrotlienc.a"))
2140 (list ;; Defaults to "lib64" on 64-bit archs.
2141 (string-append "-DCMAKE_INSTALL_LIBDIR="
2142 (assoc-ref %outputs "out") "/lib"))))
2143 (home-page "https://github.com/google/brotli")
2144 (synopsis "General-purpose lossless compression")
2145 (description "This package provides the reference implementation of Brotli,
2146 a generic-purpose lossless compression algorithm that compresses data using a
2147 combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd
2148 order context modeling, with a compression ratio comparable to the best
2149 currently available general-purpose compression methods. It is similar in speed
2150 with @code{deflate} but offers more dense compression.
2152 The specification of the Brotli Compressed Data Format is defined in RFC 7932.")
2153 (license license:expat)))
2155 (define-public brotli
2156 ;; We used to provide an older version under the name "brotli".
2157 (deprecated-package "brotli" google-brotli))
2159 (define-public python-google-brotli
2161 (inherit google-brotli)
2162 (name "python-google-brotli")
2163 (build-system python-build-system)
2165 (synopsis "Python interface to google-brotli")
2166 (description "@code{python-google-brotli} provides a Python interface to
2167 @code{google-brotli}, an implementation of the Brotli lossless compression
2176 (uri (string-append "https://www.oberhumer.com/opensource/"
2177 name "/download/" name "-" version ".tar.gz"))
2180 "0j036lkwsxvm15gr29n8wn07cqq79dswjs9k54939ms5zngjjrdq"))))
2181 (build-system gnu-build-system)
2183 `(;; UCL 1.03 fails to build with newer C standards.
2184 #:configure-flags '("CFLAGS=-std=gnu90"
2185 "--enable-shared" "--disable-static")))
2186 (home-page "https://www.oberhumer.com/opensource/ucl/")
2187 (synopsis "Portable lossless data compression library")
2188 (description "UCL implements a number of compression algorithms that
2189 achieve an excellent compression ratio while allowing fast decompression.
2190 Decompression requires no additional memory.
2192 Compared to LZO, the UCL algorithms achieve a better compression ratio but
2193 decompression is a little bit slower.")
2194 (license license:gpl2+)))
2202 (uri (string-append "https://github.com/upx/upx/releases/download/v"
2203 version "/upx-" version "-src.tar.xz"))
2206 "051pk5jk8fcfg5mpgzj43z5p4cn7jy5jbyshyn78dwjqr7slsxs7"))
2207 (patches (search-patches "upx-CVE-2021-20285.patch"))))
2208 (build-system gnu-build-system)
2218 (modify-phases %standard-phases
2219 (delete 'configure) ; no configure script
2220 (delete 'check) ; no test suite
2221 (add-before 'build 'patch-exec-bin-sh
2223 (substitute* (list "Makefile"
2225 (("/bin/sh") (which "sh")))
2228 (lambda* (#:key outputs #:allow-other-keys)
2229 (let* ((out (assoc-ref outputs "out"))
2230 (bin (string-append out "/bin")))
2232 (copy-file "src/upx.out" (string-append bin "/upx")))
2234 (home-page "https://upx.github.io/")
2235 (synopsis "Compression tool for executables")
2237 "The Ultimate Packer for eXecutables (UPX) is an executable file
2238 compressor. UPX typically reduces the file size of programs and shared
2239 libraries by around 50%--70%, thus reducing disk space, network load times,
2240 download times, and other distribution and storage costs.")
2241 (license license:gpl2+)))
2243 (define-public quazip
2250 (url "https://github.com/stachenov/quazip")
2251 (commit (string-append "v" version))))
2252 (file-name (git-file-name name version))
2255 "11icgwv2xyxhd1hm1add51xv54zwkcqkg85d1xqlgiigvbm196iq"))))
2256 (build-system cmake-build-system)
2258 `(#:tests? #f)) ;no test
2260 `(("doxygen" ,doxygen)))
2262 `(("qtbase" ,qtbase-5)
2264 (home-page "https://stachenov.github.io/quazip/index.html")
2265 (synopsis "Qt/C++ wrapper for Minizip")
2266 (description "QuaZIP is a simple C++ wrapper over Gilles Vollant's
2267 ZIP/UNZIP package that can be used to access ZIP archives. It uses
2268 Trolltech's Qt toolkit.
2270 QuaZIP allows you to access files inside ZIP archives using QIODevice
2271 API, and that means that you can also use QTextStream, QDataStream or
2272 whatever you would like to use on your zipped files.
2274 QuaZIP provides complete abstraction of the ZIP/UNZIP API, for both
2275 reading from and writing to ZIP archives. ")
2276 ;; Project is distributed under LGPL, but "quazip/z*" "quazip/unzip.*" are
2277 ;; distributed under zlib terms.
2278 (license (list license:lgpl2.1+ license:zlib))))
2280 (define-public zutils
2287 (uri (string-append "mirror://savannah/zutils/zutils-" version ".tar.lz"))
2289 (base32 "15dimqp8zlqaaa2l46r22srp1py38mlmn69ph1j5fmrd54w43m0d"))))
2290 (build-system gnu-build-system)
2293 (list "--sysconfdir=/etc")
2295 (modify-phases %standard-phases
2296 (add-before 'check 'disable-failing-tests
2297 ;; XXX https://lists.nongnu.org/archive/html/zutils-bug/2020-07/msg00005.html
2299 (substitute* "testsuite/check.sh"
2300 (("\"\\$\\{ZGREP\\}\" -N -L \"GNU\"") "true")
2301 (("\"\\$\\{ZGREP\\}\" -N -L \"nx_pattern\"") "false"))
2304 (lambda* (#:key make-flags outputs #:allow-other-keys)
2305 (apply invoke "make" "install"
2306 (string-append "sysconfdir=" (assoc-ref outputs "out")
2310 ;; Needed to extract the source tarball and run the test suite.
2312 (home-page "https://www.nongnu.org/zutils/zutils.html")
2313 (synopsis "Utilities that transparently operate on compressed files")
2315 "Zutils is a collection of utilities able to process any combination of
2316 compressed and uncompressed files transparently. If any given file, including
2317 standard input, is compressed, its decompressed content is used instead.
2319 @command{zcat}, @command{zcmp}, @command{zdiff}, and @command{zgrep} are
2320 improved replacements for the shell scripts provided by GNU gzip.
2321 @command{ztest} tests the integrity of supported compressed files.
2322 @command{zupdate} recompresses files with lzip, similar to gzip's
2325 Supported compression formats are bzip2, gzip, lzip, and xz. Zutils uses
2326 external compressors: the compressor to be used for each format is configurable
2327 at run time, and must be installed separately.")
2328 (license (list license:bsd-2 ; arg_parser.{cc,h}
2329 license:gpl2+)))) ; the rest
2331 (define-public makeself-safeextract
2332 (let ((commit "1a95e121fa8e3c02d307ae37b9b7834e616c3683"))
2334 (name "makeself-safeextract")
2335 (version (git-version "0.0.0" "1" commit))
2336 (home-page "https://github.com/ssokolow/makeself_safeextract")
2343 (file-name (git-file-name name version))
2346 "1anlinaj9lvfi8bn00wp11vzqq0f9sig4fm9yrspisx31v0z4a2c"))))
2347 (build-system trivial-build-system)
2349 `(("python" ,python-2)
2353 `(#:modules ((guix build utils))
2356 (use-modules (guix build utils))
2357 (let* ((name "makeself_safeextract")
2358 (source (string-append (assoc-ref %build-inputs "source")
2360 (bin (string-append (assoc-ref %outputs "out") "/bin"))
2361 (target (string-append bin "/" name))
2362 (python (string-append (assoc-ref %build-inputs "python") "/bin"))
2363 (7z (string-append (assoc-ref %build-inputs "p7zip") "/bin/7z"))
2364 (unzip (string-append (assoc-ref %build-inputs "unzip") "/bin/unzip")))
2365 (setenv "PATH" (string-append (getenv "PATH") ":" python))
2367 (copy-file source target)
2369 (("'7z'") (format #f "'~a'" 7z))
2370 (("'unzip'") (format #f "'~a'" unzip)))
2371 (patch-shebang target)))))
2372 (synopsis "Extract makeself and mojo archives without running untrusted code")
2373 (description "This package provides a script to unpack self-extracting
2374 archives generated by @command{makeself} or @command{mojo} without running the
2375 possibly untrusted extraction shell script.")
2376 (license license:gpl3+))))
2378 (define-public ncompress
2385 (url "https://github.com/vapier/ncompress")
2386 (commit (string-append "v" version))))
2387 (patches (search-patches "ncompress-fix-softlinks.patch"))
2388 (file-name (string-append name "-" version ".tar.gz"))
2391 "1a4yir1ilafz0nzxdwigj204j4yy2zljbc501nsaqqm3dxdap8zn"))))
2393 '(#:make-flags (list "CC=gcc"
2394 (string-append "BINDIR=" %output "/bin")
2395 (string-append "MANDIR=" %output "/share/man/man1"))
2396 #:phases (modify-phases %standard-phases
2397 (delete 'configure))))
2398 (build-system gnu-build-system)
2399 (home-page "https://github.com/vapier/ncompress/")
2400 (synopsis "Original Lempel-Ziv compress/uncompress programs")
2401 (description "(N)compress provides the original compress and uncompress
2402 programs that used to be the de facto UNIX standard for compressing and
2403 uncompressing files. These programs implement a fast, simple Lempel-Ziv (LZW)
2404 file compression algorithm.")
2405 (license license:gpl2+)))
2407 (define-public xarchiver
2410 (version "0.5.4.17")
2415 (url "https://github.com/ib/xarchiver")
2417 (file-name (git-file-name name version))
2419 (base32 "00adrjpxqlaccrwjf65w3vhxfswdj0as8aj263c6f9b85llypc5v"))))
2420 (build-system glib-or-gtk-build-system)
2422 `(("gettext" ,gettext-minimal)
2423 ("intltool" ,intltool)
2424 ("libxslt" ,libxslt)
2425 ("pkg-config" ,pkg-config)))
2427 `(("adwaita-icon-theme" ,adwaita-icon-theme) ; hard-coded theme
2429 (home-page "https://github.com/ib/xarchiver")
2430 (synopsis "Graphical front-end for archive operations")
2431 (description "Xarchiver is a front-end to various command line archiving
2432 tools. It uses GTK+ tool-kit and is designed to be desktop-environment
2433 independent. Supported formats are 7z, ARJ, bzip2, gzip, LHA, lzma, lzop,
2434 RAR, RPM, DEB, tar, and ZIP. It cannot perform functions for archives, whose
2435 archiver is not installed.")
2436 (license license:gpl2+)))
2438 (define-public tarsplitter
2440 (name "tarsplitter")
2445 (url "https://github.com/AQUAOSOTech/tarsplitter")
2446 (commit (string-append "v" version))))
2447 (file-name (git-file-name name version))
2450 "17qkg95r97kcrs17b0mcqswx99280ni47j5yx8xa7nl3bdhm6325"))))
2451 (build-system go-build-system)
2453 `(#:import-path "github.com/AQUAOSOTech/tarsplitter"
2454 #:install-source? #f
2456 (modify-phases %standard-phases
2457 (add-after 'install 'install-documentation
2458 (lambda* (#:key import-path outputs #:allow-other-keys)
2459 (let* ((source (string-append "src/" import-path))
2460 (out (assoc-ref outputs "out"))
2461 (doc (string-append out "/share/doc/" ,name "-" ,version)))
2462 (with-directory-excursion source
2463 (install-file "README.md" doc))
2465 (home-page "https://github.com/AQUAOSOTech/tarsplitter")
2466 (synopsis "Multithreaded tar utility")
2468 "Archive huge numbers of files, or split massive tar archives into smaller
2470 (license license:expat)))
2472 (define-public c-blosc
2479 (url "https://github.com/Blosc/c-blosc")
2480 (commit (string-append "v" version))))
2481 (file-name (git-file-name name version))
2484 "1ywq8j70149859vvs19wgjq89d6xsvvmvm2n1dmkzpchxgrvnw70"))))
2485 (build-system cmake-build-system)
2486 (home-page "https://blosc.org")
2487 (synopsis "Blocking, shuffling and lossless compression library")
2489 "Blosc is a high performance compressor optimized for binary data. It has
2490 been designed to transmit data to the processor cache faster than the
2491 traditional, non-compressed, direct memory fetch approach via a
2492 @code{memcpy()} system call. Blosc is meant not only to reduce the size of
2493 large datasets on-disk or in-memory, but also to accelerate memory-bound
2495 ;; Blosc itself is released under BSD-3 but it incorporates code under
2496 ;; other non-copyleft licenses.
2497 (license license:bsd-3)))
2506 (url "https://github.com/alucryd/ecm-tools")
2507 (commit (string-append "v" version))))
2508 (file-name (git-file-name name version))
2511 "1rvyx5gcy8lfklgj80szlz3312x45wzx0d9jsgwyvy8f6m4nnb0c"))))
2512 (build-system gnu-build-system)
2514 `(#:tests? #f ; no check target
2516 (list (string-append "CC=" ,(cc-for-target))
2517 (string-append "DESTDIR=" (assoc-ref %outputs "out")))
2519 (modify-phases %standard-phases
2522 (substitute* "Makefile"
2523 (("\\$\\(DESTDIR\\)/usr") "$(DESTDIR)"))
2525 (home-page "https://github.com/alucryd/ecm-tools")
2526 (synopsis "Error code modeler")
2527 (description "ECM is a utility that converts ECM files, i.e., CD data files
2528 with their error correction data losslessly rearranged for better compression,
2529 to their original, binary CD format.")
2530 (license license:gpl3+)))
2532 (define-public tarlz
2539 (uri (string-append "mirror://savannah/lzip/tarlz/"
2540 "tarlz-" version ".tar.lz"))
2542 (base32 "1x5dw03lcwfigcv97cg70gkbkfycjmv1012s9lwnl4izvl9235qg"))))
2543 (build-system gnu-build-system)
2547 `(("lzlib" ,lzlib)))
2548 (home-page "https://www.nongnu.org/lzip/tarlz.html")
2549 (synopsis "Combination of the tar archiver and the lzip compressor")
2551 "Tarlz is a massively parallel (multi-threaded) combined implementation of
2552 the tar archiver and the lzip compressor. Tarlz creates, lists, and extracts
2553 archives in a simplified and safer variant of the POSIX pax format compressed
2554 with lzip, keeping the alignment between tar members and lzip members. The
2555 resulting multimember tar.lz archive is fully backward compatible with standard
2556 tar tools like GNU tar, which treat it like any other tar.lz archive. Tarlz
2557 can append files to the end of such compressed archives.")
2558 (license license:gpl2+)))