projects/guix·blob java-team · refs

3415 lines · 139.9 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013, 2014, 2015, 2017, 2019, 2020, 2021, 2023 Ludovic Courtès <[email protected]>
3;;; Copyright © 2013 Andreas Enge <[email protected]>
4;;; Copyright © 2014, 2015, 2018 Mark H Weaver <[email protected]>
5;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <[email protected]>
6;;; Copyright © 2015, 2016 Eric Bavier <[email protected]>
7;;; Copyright © 2015, 2016, 2017, 2018, 2020, 2021, 2022, 2024, 2025 Ricardo Wurmus <[email protected]>
8;;; Copyright © 2015, 2017, 2018 Leo Famulari <[email protected]>
9;;; Copyright © 2015 Jeff Mickey <[email protected]>
10;;; Copyright © 2015-2024 Efraim Flashner <[email protected]>
11;;; Copyright © 2016 Ben Woodcroft <[email protected]>
12;;; Copyright © 2016 Danny Milosavljevic <[email protected]>
13;;; Copyright © 2016–2022 Tobias Geerinckx-Rice <[email protected]>
14;;; Copyright © 2016 David Craven <[email protected]>
15;;; Copyright © 2016, 2019, 2020 Kei Kebreau <[email protected]>
16;;; Copyright © 2016, 2018-2022 Marius Bakke <[email protected]>
17;;; Copyright © 2017 Nikita <[email protected]>
18;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <[email protected]>
19;;; Copyright © 2017 Theodoros Foradis <[email protected]>
20;;; Copyright © 2017 Stefan Reichör <[email protected]>
21;;; Copyright © 2017 Petter <[email protected]>
22;;; Copyright © 2017 Julien Lepiller <[email protected]>
23;;; Copyright © 2018 Rutger Helling <[email protected]>
24;;; Copyright © 2018 Joshua Sierles, Nextjournal <[email protected]>
25;;; Copyright © 2018, 2019 Pierre Neidhardt <[email protected]>
26;;; Copyright © 2019 Nicolas Goaziou <[email protected]>
27;;; Copyright © 2019, 2023, 2024 Janneke Nieuwenhuizen <[email protected]>
28;;; Copyright © 2020 Björn Höfling <[email protected]>
29;;; Copyright © 2020 Arun Isaac <[email protected]>
30;;; Copyright © 2020, 2021 Lars-Dominik Braun <[email protected]>
31;;; Copyright © 2020 Guillaume Le Vaillant <[email protected]>
32;;; Copyright © 2020 Léo Le Bouter <[email protected]>
33;;; Copyright © 2021 Antoine Côté <[email protected]>
34;;; Copyright © 2021 Vincent Legoll <[email protected]>
35;;; Copyright © 2021 Simon Tournier <[email protected]>
36;;; Copyright © 2021, 2024-2025 Maxim Cournoyer <[email protected]>
37;;; Copyright © 2021, 2026 Ahmad Jarara <[email protected]>
38;;; Copyright © 2022 Greg Hogan <[email protected]>
39;;; Copyright © 2022 Zhu Zihao <[email protected]>
40;;; Copyright © 2021 Foo Chuan Wei <[email protected]>
41;;; Copyright © 2024 Vinicius Monego <[email protected]>
42;;; Copyright © 2024 David Elsing <[email protected]>
43;;; Copyright © 2024 Artyom V. Poptsov <[email protected]>
44;;; Copyright © 2024, 2025 Zheng Junjie <[email protected]>
45;;; Copyright © 2026 Jake Forster <[email protected]>
46;;;
47;;; This file is part of GNU Guix.
48;;;
49;;; GNU Guix is free software; you can redistribute it and/or modify it
50;;; under the terms of the GNU General Public License as published by
51;;; the Free Software Foundation; either version 3 of the License, or (at
52;;; your option) any later version.
53;;;
54;;; GNU Guix is distributed in the hope that it will be useful, but
55;;; WITHOUT ANY WARRANTY; without even the implied warranty of
56;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
57;;; GNU General Public License for more details.
58;;;
59;;; You should have received a copy of the GNU General Public License
60;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
61
62(define-module (gnu packages compression)
63 #:use-module (guix gexp)
64 #:use-module ((guix licenses) #:prefix license:)
65 #:use-module (guix utils)
66 #:use-module (guix packages)
67 #:use-module (guix download)
68 #:use-module (guix git-download)
69 #:use-module (guix build-system ant)
70 #:use-module (guix build-system cmake)
71 #:use-module (guix build-system copy)
72 #:use-module (guix build-system glib-or-gtk)
73 #:use-module (guix build-system gnu)
74 #:use-module (guix build-system go)
75 #:use-module (guix build-system meson)
76 #:use-module (guix build-system trivial)
77 #:use-module (gnu packages)
78 #:use-module (gnu packages algebra)
79 #:use-module (gnu packages assembly)
80 #:use-module (gnu packages autotools)
81 #:use-module (gnu packages backup)
82 #:use-module (gnu packages base)
83 #:use-module (gnu packages bash)
84 #:use-module (gnu packages benchmark)
85 #:use-module (gnu packages boost)
86 #:use-module (gnu packages c)
87 #:use-module (gnu packages check)
88 #:use-module (gnu packages cpp)
89 #:use-module (gnu packages crypto)
90 #:use-module (gnu packages curl)
91 #:use-module (gnu packages documentation)
92 #:use-module (gnu packages digest)
93 #:use-module (gnu packages file)
94 #:use-module (gnu packages gcc)
95 #:use-module (gnu packages gettext)
96 #:use-module (gnu packages glib)
97 #:use-module (gnu packages gnome)
98 #:use-module (gnu packages gnupg)
99 #:use-module (gnu packages graphics)
100 #:use-module (gnu packages gtk)
101 #:use-module (gnu packages java)
102 #:use-module (gnu packages linux)
103 #:use-module (gnu packages llvm)
104 #:use-module (gnu packages man)
105 #:use-module (gnu packages maths)
106 #:use-module (gnu packages perl)
107 #:use-module (gnu packages pkg-config)
108 #:use-module (gnu packages python)
109 #:use-module (gnu packages qt)
110 #:use-module (gnu packages selinux)
111 #:use-module (gnu packages tls)
112 #:use-module (gnu packages valgrind)
113 #:use-module (gnu packages version-control)
114 #:use-module (gnu packages xml)
115 #:use-module (ice-9 match)
116 #:use-module (srfi srfi-1))
117
118(define-public zlib
119 (package
120 (name "zlib")
121 (version "1.3.1")
122 (source
123 (origin
124 (method url-fetch)
125 (uri (list (string-append "http://zlib.net/zlib-"
126 version ".tar.gz")
127 (string-append "mirror://sourceforge/libpng/zlib/"
128 version "/zlib-" version ".tar.gz")))
129 (sha256
130 (base32
131 "08yzf8xz0q7vxs8mnn74xmpxsrs6wy0aan55lpmpriysvyvv54ws"))))
132 (build-system gnu-build-system)
133 (outputs '("out" "static"))
134 (arguments
135 (list
136 #:make-flags
137 (if (target-mingw?)
138 #~(list #$(string-append "PREFIX=" (%current-target-system) "-")
139 "BINARY_PATH = $(prefix)/bin"
140 "INCLUDE_PATH = $(prefix)/include"
141 "LIBRARY_PATH = $(prefix)/lib"
142 "SHARED_MODE = 1"
143 (string-append "prefix = " #$output))
144 #~'())
145 #:phases
146 #~(modify-phases %standard-phases
147 (replace 'configure
148 (lambda _
149 ;; Zlib's home-made `configure' fails when passed
150 ;; extra flags like `--enable-fast-install', so we need to
151 ;; invoke it with just what it understand.
152 (setenv "CC" #$(cc-for-target))
153 ;; 'configure' doesn't understand '--host'.
154 #$@(if (%current-target-system)
155 #~((setenv "CHOST" #$(%current-target-system)))
156 #~())
157
158 #$@(if (target-mingw?)
159 #~((rename-file "win32/Makefile.gcc" "Makefile"))
160 #~((invoke "./configure"
161 (string-append "--prefix=" #$output))))))
162 (add-after 'install 'move-static-library
163 (lambda _
164 (with-directory-excursion (string-append #$output "/lib")
165 (install-file "libz.a" (string-append #$output:static
166 "/lib"))
167 (delete-file "libz.a")))))))
168 (home-page "https://zlib.net/")
169 (synopsis "Compression library")
170 (description
171 "zlib is designed to be a free, general-purpose, legally unencumbered --
172that is, not covered by any patents -- lossless data-compression library for
173use on virtually any computer hardware and operating system. The zlib data
174format is itself portable across platforms. Unlike the LZW compression method
175used in Unix compress(1) and in the GIF image format, the compression method
176currently used in zlib essentially never expands the data. (LZW can double or
177triple the file size in extreme cases.) zlib's memory footprint is also
178independent of the input data and can be reduced, if necessary, at some cost
179in compression.")
180 (license license:zlib)))
181
182(define-public minizip
183 (package
184 (name "minizip")
185 (version (package-version zlib))
186 (source (package-source zlib))
187 (build-system gnu-build-system)
188 (arguments
189 `(#:phases
190 (modify-phases %standard-phases
191 (add-after 'unpack 'enter-source
192 (lambda _ (chdir "contrib/minizip"))))))
193 (native-inputs
194 (list autoconf automake libtool))
195 (propagated-inputs (list zlib))
196 (home-page (package-home-page zlib))
197 (synopsis "Zip Compression library")
198 (description
199 "Minizip is a minimalistic library that supports compressing,
200extracting and viewing ZIP archives. This version is extracted from
201the @code{zlib} source.")
202 (license (package-license zlib))))
203
204(define-public kubazip
205 (package
206 (name "kubazip")
207 (version "0.3.3")
208 (source (origin
209 (method git-fetch)
210 (uri (git-reference
211 (url "https://github.com/kuba--/zip")
212 (commit (string-append "v" version))))
213 (file-name (git-file-name name version))
214 (sha256
215 (base32
216 "182p059nvs5vpdzmmkn2g6mphsvkjdcxq6gpbh58dcsjj507j9ab"))))
217 (build-system cmake-build-system)
218 (synopsis "Simple zip library")
219 (home-page "https://github.com/kuba--/zip")
220 (description
221 "This package provides a simple zip library based on miniz.")
222 (license license:unlicense)))
223
224(define-public fastjar
225 (package
226 (name "fastjar")
227 (version "0.98")
228 (source (origin
229 (method url-fetch)
230 (uri (string-append "mirror://savannah/fastjar/fastjar-"
231 version ".tar.gz"))
232 (sha256
233 (base32
234 "0iginbz2m15hcsa3x4y7v3mhk54gr1r7m3ghx0pg4n46vv2snmpi"))))
235 (build-system gnu-build-system)
236 (inputs (list zlib))
237 (home-page "https://savannah.nongnu.org/projects/fastjar")
238 (synopsis "Replacement for Sun's 'jar' utility")
239 (description
240 "FastJar is an attempt to create a much faster replacement for Sun's
241@code{jar} utility. Instead of being written in Java, FastJar is written in C.")
242 (license license:gpl2+)))
243
244(define-public liblzf
245 (package
246 (name "liblzf")
247 (version "3.6")
248 (source
249 (origin
250 (method url-fetch)
251 (uri (string-append "https://dist.schmorp.de/liblzf/liblzf-"
252 version ".tar.gz" ))
253 (sha256
254 (base32 "0smlkyw09pffg70n1lindk08d6gcmfkjd7b17w6f9jlwgcgy0pcw"))))
255 (build-system gnu-build-system)
256 (arguments
257 (list #:tests? #f)) ;no tests
258 (home-page "https://oldhome.schmorp.de/marc/liblzf.html")
259 (synopsis "Very small data compression library")
260 (description
261 "LibLZF is a very small data compression library. It consists of only
262two .c and two .h files and is very easy to incorporate into your own
263programs. The compression algorithm is very, very fast, yet still written in
264portable C.
265
266Last not least, it is freely usable, unlike most other compression libraries
267which are under the GPL, this library uses a BSD-type license, so you can
268include it in your programs without worrying.")
269 (license license:gpl2)))
270
271(define-public libtar
272 (package
273 (name "libtar")
274 (version "1.2.20")
275 (source (origin
276 (method url-fetch)
277 (uri (list
278 (string-append
279 "ftp://ftp.feep.net/pub/software/libtar/libtar-"
280 version ".tar.gz")
281 (string-append
282 "mirror://debian/pool/main/libt/libtar/libtar_"
283 version ".orig.tar.gz")))
284 (sha256
285 (base32
286 "02cihzl77ia0dcz7z2cga2412vyhhs5pa2355q4wpwbyga2lrwjh"))
287 (patches
288 (search-patches "libtar-CVE-2013-4420.patch"
289 "libtar-CVE-2021-33643-CVE-2021-33644.patch"
290 "libtar-CVE-2021-33645-CVE-2021-33646.patch"))))
291 (build-system gnu-build-system)
292 (arguments `(#:tests? #f)) ; no "check" target
293 (native-inputs
294 (list autoconf automake libtool))
295 (inputs
296 (list zlib))
297 (synopsis "C library for manipulating POSIX tar files")
298 (description
299 "libtar is a C library for manipulating POSIX tar files. It handles
300adding and extracting files to/from a tar archive.")
301 (home-page "https://repo.or.cz/libtar.git")
302 (license license:bsd-3)))
303
304(define-public ls-qpack
305 (package
306 (name "ls-qpack")
307 (version "2.6.2")
308 (source
309 (origin
310 (method git-fetch)
311 (uri (git-reference
312 (url "https://github.com/litespeedtech/ls-qpack")
313 (commit (string-append "v" version))))
314 (file-name (git-file-name name version))
315 (sha256
316 (base32 "1gipc7lvxxj8wnzbx4mrw4c78x78qf9j6k4j4pnfsanvin219vmi"))
317 (snippet
318 #~(begin
319 (use-modules (guix build utils))
320 (delete-file-recursively "deps/xxhash")))))
321 (build-system cmake-build-system)
322 (arguments
323 (list
324 #:configure-flags
325 #~(list "-DLSQPACK_XXH=OFF"
326 "-DLSQPACK_TESTS=ON")))
327 (native-inputs
328 (list pkg-config))
329 (inputs
330 (list xxhash))
331 (home-page "https://github.com/litespeedtech/ls-qpack")
332 (synopsis "QPACK compression library for use with HTTP/3")
333 (description
334 "QPACK is the compression mechanism used by
335@url{https://en.wikipedia.org/wiki/HTTP/3, HTTP/3} to compress HTTP headers.
336It's based on specification
337@url{https://tools.ietf.org/html/draft-ietf-quic-qpack-11, QPACK
338Internet-Draft}.")
339 (license license:expat)))
340
341(define-public gzip
342 (package
343 (name "gzip")
344 (version "1.14")
345 (source (origin
346 (method url-fetch)
347 (uri (string-append "mirror://gnu/gzip/gzip-"
348 version ".tar.xz"))
349 (sha256
350 (base32
351 "1ihaii7d3vznvj9vk1fkmpvd7pqbz0c8fyzr2pvgs2r2pn0vi9q1"))))
352 (build-system gnu-build-system)
353 (synopsis "General file (de)compression (using lzw)")
354 (arguments
355 ;; FIXME: The test suite wants `less', and optionally Perl.
356 '(#:tests? #f
357 #:configure-flags '("ac_cv_prog_LESS=\"less\"")
358 #:phases
359 (modify-phases %standard-phases
360 (add-after 'unpack 'use-absolute-name-of-gzip
361 (lambda* (#:key outputs #:allow-other-keys)
362 (substitute* "gunzip.in"
363 (("exec 'gzip'")
364 (string-append "exec " (assoc-ref outputs "out")
365 "/bin/gzip"))))))))
366 (inputs
367 `(,@(if (%current-target-system)
368 `(("bash" ,bash-minimal))
369 '())))
370 (description
371 "GNU Gzip provides data compression and decompression utilities; the
372typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
373file; as a result, it is often used in conjunction with \"tar\", resulting in
374\".tar.gz\" or \".tgz\", etc.")
375 (license license:gpl3+)
376 (home-page "https://www.gnu.org/software/gzip/")))
377
378(define-public bzip2
379 (package
380 (name "bzip2")
381 (version "1.0.8")
382 (source (origin
383 (method url-fetch)
384 (uri (string-append "https://sourceware.org/pub/bzip2/bzip2-"
385 version ".tar.gz"))
386 (sha256
387 (base32
388 "0s92986cv0p692icqlw1j42y9nld8zd83qwhzbqd61p1dqbh6nmb"))))
389 (build-system gnu-build-system)
390 (arguments
391 (list #:modules '((guix build gnu-build-system)
392 (guix build utils)
393 (ice-9 ftw)
394 (srfi srfi-1))
395 #:phases
396 #~(modify-phases %standard-phases
397 (add-after 'set-paths 'hide-input-bzip2
398 (lambda* (#:key inputs #:allow-other-keys)
399 (let ((bzip2 (assoc-ref inputs "bzip2")))
400 (if bzip2
401 ;; Prevent the build system from retaining a reference to
402 ;; BZIP2 from INPUTS.
403 (begin
404 (setenv "LIBRARY_PATH"
405 (string-join (delete (string-append bzip2 "/lib")
406 (string-split (getenv "LIBRARY_PATH")
407 #\:))
408 ":"))
409 (format #t "environment variable `LIBRARY_PATH' set to `~a'~%"
410 (getenv "LIBRARY_PATH")))
411 (format #t "no bzip2 found, nothing done~%"))
412 #t)))
413 (replace 'configure
414 (lambda* (#:key target #:allow-other-keys)
415 (when #$(%current-target-system)
416 ;; Cross-compilation: use the cross tools.
417 (substitute* (find-files "." "Makefile")
418 (("CC=.*$")
419 (string-append "CC = " target "-gcc\n"))
420 (("AR=.*$")
421 (string-append "AR = " target "-ar\n"))
422 (("RANLIB=.*$")
423 (string-append "RANLIB = " target "-ranlib\n"))
424 (("^all:(.*)test" _ prerequisites)
425 ;; Remove 'all' -> 'test' dependency.
426 (string-append "all:" prerequisites "\n"))))
427 #t))
428 (add-before 'build 'build-shared-lib
429 (lambda* (#:key inputs #:allow-other-keys)
430 (patch-makefile-SHELL "Makefile-libbz2_so")
431 (invoke "make" "-f" "Makefile-libbz2_so")))
432 (add-after 'install 'install-shared-lib
433 (lambda* (#:key outputs #:allow-other-keys)
434 ;; The Makefile above does not have an 'install' target, nor does
435 ;; it create all the (un)versioned symlinks, so we handle it here.
436 (let* ((out (assoc-ref outputs "out"))
437 (libdir (string-append out "/lib"))
438 (soname "libbz2.so")
439 ;; Locate the built library (e.g. "libbz2.so.1.0.6").
440 (lib (car (scandir "."
441 (lambda (file)
442 (and (string-prefix? soname file)
443 (eq? 'regular
444 (stat:type (lstat file))))))))
445 (soversion (string-drop lib (+ 1 (string-length soname)))))
446 (install-file lib libdir)
447 (with-directory-excursion libdir
448 ;; Create symlinks libbz2.so.1 -> libbz2.so.1.0, etc.
449 (let loop ((base soname)
450 (numbers (string-split soversion #\.)))
451 (unless (null? numbers)
452 (let ((so-file (string-append base "." (car numbers))))
453 (symlink so-file base)
454 (loop so-file (cdr numbers))))))
455 #t)))
456 (add-after 'install-shared-lib 'move-static-lib
457 (lambda* (#:key outputs #:allow-other-keys)
458 (let ((out (assoc-ref outputs "out"))
459 (static (assoc-ref outputs "static")))
460 (with-directory-excursion (string-append out "/lib")
461 (install-file "libbz2.a" (string-append static "/lib"))
462 (delete-file "libbz2.a")
463 #t))))
464 (add-after 'install-shared-lib 'patch-scripts
465 (lambda* (#:key outputs inputs #:allow-other-keys)
466 (let* ((out (assoc-ref outputs "out")))
467 (substitute* (string-append out "/bin/bzdiff")
468 (("/bin/rm") "rm")))
469 #t)))
470
471 #:make-flags #~(list (string-append "PREFIX="
472 (assoc-ref %outputs "out")))
473
474 ;; Don't attempt to run the tests when cross-compiling.
475 #:tests? (not (%current-target-system))))
476 (inputs
477 `(,@(if (%current-target-system)
478 `(("bash" ,bash-minimal))
479 '())))
480 (outputs '("out" "static"))
481 (synopsis "High-quality data compression program")
482 (description
483 "bzip2 is a freely available, patent free (see below), high-quality data
484compressor. It typically compresses files to within 10% to 15% of the best
485available techniques (the PPM family of statistical compressors), whilst
486being around twice as fast at compression and six times faster at
487decompression.")
488 (license (license:non-copyleft "file://LICENSE"
489 "See LICENSE in the distribution."))
490 (home-page "https://web.archive.org/web/20180801004107/http://www.bzip.org/")))
491
492(define-public lbzip2
493 ;; The last 2.5 release is 4 years behind the newest commit (from 2018) and
494 ;; may create files that can't even be decompressed by newer bzip2 versions.
495 (let ((commit "b6dc48a7b9bfe6b340ed1f6d72133608ad57144b")
496 (revision "0"))
497 (package
498 (name "lbzip2")
499 (version (git-version "2.5" revision commit))
500 (source
501 (origin
502 (method git-fetch)
503 (uri (git-reference
504 (url "https://github.com/kjn/lbzip2")
505 (commit commit)))
506 (sha256
507 (base32 "140xp00dmjsr6c3dwb4dwf0pzlgf159igri321inbinsjiclkngy"))
508 (file-name (git-file-name name version))))
509 (build-system gnu-build-system)
510 (arguments
511 `(#:phases
512 (modify-phases %standard-phases
513 (add-after 'unpack 'unpack-gnulib
514 (lambda* (#:key inputs native-inputs #:allow-other-keys)
515 (let ((gnulib
516 (dirname (search-input-file (or native-inputs inputs)
517 "gnulib-tool.py"))))
518 (copy-recursively gnulib "lib")
519 (setenv "PATH" (string-append "lib:" (getenv "PATH")))
520 #t)))
521 (delete 'bootstrap) ; gnulib still has unpatched shebangs
522 (add-after 'patch-source-shebangs 'bootstrap
523 (lambda _
524 (invoke "sh" "build-aux/autogen.sh")
525 #t)))))
526 (native-inputs
527 `(("autoconf" ,autoconf)
528 ("automake" ,automake)
529 ("gnulib"
530 ,(let ((commit "2d431ac35c4943a3655c07ba91870d2323321b43"))
531 (origin
532 (method git-fetch)
533 (uri (git-reference
534 (url "git://git.savannah.gnu.org/gnulib.git")
535 (commit commit)))
536 (sha256
537 (base32 "1f0xr4w89bqvhzsfcflcagdixidrk41k00k7kpr91w9lazfis4kf"))
538 (file-name (git-file-name "gnulib" commit)))))
539 ("perl" ,perl)))
540 (synopsis "Parallel bzip2 compression utility")
541 (description
542 "lbzip2 is a multi-threaded compression utility with support for the
543bzip2 compressed file format. lbzip2 can process standard bz2 files in
544parallel. It uses POSIX threading model (pthreads), which allows it to take
545full advantage of symmetric multiprocessing (SMP) systems. It has been proven
546to scale linearly, even to over one hundred processor cores. lbzip2 is fully
547compatible with bzip2 – both at file format and command line level.")
548 ;; lbzip2.org now looks fishy. There is no source code to be found.
549 ;; Reported upstream: <https://github.com/kjn/lbzip2/issues/26>.
550 (home-page "https://github.com/kjn/lbzip2")
551 (license license:gpl3+))))
552
553(define-public pbzip2
554 (package
555 (name "pbzip2")
556 (version "1.1.13")
557 (source (origin
558 (method url-fetch)
559 (uri (string-append "https://launchpad.net/pbzip2/"
560 (version-major+minor version) "/" version
561 "/+download/" name "-" version ".tar.gz"))
562 (sha256
563 (base32
564 "1rnvgcdixjzbrmcr1nv9b6ccrjfrhryaj7jwz28yxxv6lam3xlcg"))))
565 (build-system gnu-build-system)
566 (inputs
567 (list bzip2))
568 (arguments
569 `(#:tests? #f ; no tests
570 #:phases (modify-phases %standard-phases
571 (delete 'configure)) ; no configure script
572 #:make-flags (list (string-append "PREFIX=" %output))))
573 (home-page (string-append "https://web.archive.org/web/20180412020219/"
574 "http://compression.ca/pbzip2/"))
575 (synopsis "Parallel bzip2 implementation")
576 (description
577 "Pbzip2 is a parallel implementation of the bzip2 block-sorting file
578compressor that uses pthreads and achieves near-linear speedup on SMP machines.
579The output of this version is fully compatible with bzip2 v1.0.2 (i.e. anything
580compressed with pbzip2 can be decompressed with bzip2).")
581 (license (license:non-copyleft "file://COPYING"
582 "See COPYING in the distribution."))))
583
584;; We call this streambuf-shrinkwrap because a Python package with the name
585;; "shrinkwrap" already exists.
586(define-public streambuf-shrinkwrap
587 (package
588 (name "streambuf-shrinkwrap")
589 (version "1.2.0")
590 (source (origin
591 (method git-fetch)
592 (uri (git-reference
593 (url "https://github.com/jonathonl/shrinkwrap")
594 (commit (string-append "v" version))))
595 (file-name (git-file-name name version))
596 (sha256
597 (base32
598 "1819va068kp68ks52f7h0dq74xq059a4m86zls2k7dj5zxhs8qs2"))))
599 (build-system cmake-build-system)
600 (arguments
601 (list
602 #:configure-flags
603 '(list "-DSHRINKWRAP_PREFER_STATIC=OFF"
604 "-DBUILD_TESTS=ON")
605 #:phases
606 '(modify-phases %standard-phases
607 (add-after 'unpack 'add-missing-header
608 (lambda _
609 (substitute* "include/shrinkwrap/xz.hpp"
610 (("#include <cstring>")
611 "#include <cstring>\n#include <cstdint>")))))))
612 (propagated-inputs (list bzip2 xz zlib `(,zstd "lib")))
613 (native-inputs (list pkg-config))
614 (home-page "https://github.com/jonathonl/shrinkwrap")
615 (synopsis "Wrapper around std::streambuf for zstd, xz, gzip, and bgzf files")
616 (description
617 "Shrinkwrap provides a @code{std::streambuf} wrapper for various compression
618formats, including zstd, xz, gzip, and bgzf.")
619 (license license:expat)))
620
621(define-public bzip3
622 (package
623 (name "bzip3")
624 (version "1.5.3")
625 (source
626 (origin
627 (method git-fetch)
628 (uri (git-reference
629 (url "https://github.com/iczelia/bzip3")
630 (commit version)))
631 (file-name (git-file-name name version))
632 (sha256
633 (base32 "1jbnx381jq3myr3p96caf7dwl9k886rf4z2bfq4w1iid8wqjxsj8"))
634 (modules '((guix build utils)))
635 (snippet
636 #~(begin
637 ;; unbundle libsais
638 (delete-file "include/libsais.h")
639 (delete-file-recursively "3rdparty/")
640 (substitute* "src/libbz3.c"
641 (("^#include \"libsais.h\".*$" include-libsais)
642 (string-append "#include \"common.h\"\n" include-libsais)))
643 (substitute* "CMakeLists.txt"
644 (("^set\\(PACKAGE_VERSION.*$" line)
645 (string-append line "find_package(libsais REQUIRED)\n"
646 "find_package(OpenMP REQUIRED)\n"))
647 (("^target_sources\\(bz3.*$" line)
648 (string-append line
649 "target_link_libraries(bz3 PRIVATE OpenMP::OpenMP_C libsais)
650"))
651 (("(target_link_libraries\\(bz3) (Threads::Threads\\))" _ prefix
652 suffix)
653 (string-append prefix " PRIVATE " suffix)))
654 ;; set MAN_DATE
655 (let ((release-date "13 August 2025"))
656 (substitute* "CMakeLists.txt"
657 (("set\\(MAN_DATE.*\\)")
658 (string-append "set(MAN_DATE \"" release-date "\")"))))
659 ;; fix out-of-source build
660 ;; see https://github.com/iczelia/bzip3/commit/2b9b3b504bdfe16e8cc08addd8f7931f66c9cd59
661 (substitute* "CMakeLists.txt"
662 (("(if\\(EXISTS\\s)\\$\\{BZIP3_MAN\\}" _ prefix)
663 (string-append prefix
664 "${CMAKE_CURRENT_SOURCE_DIR}/${BZIP3_MAN}"))
665 (("(configure_file\\()\\$\\{BZIP3_MAN\\}" _ prefix)
666 (string-append prefix
667 "${CMAKE_CURRENT_SOURCE_DIR}/${BZIP3_MAN}")))
668 ;; fix shared-object version
669 ;; see https://github.com/iczelia/bzip3/commit/3ac85a6c4ee44573f6d8932d9d5d1bc3351f81db
670 (substitute* "CMakeLists.txt"
671 (("(SOVERSION\\s\").*(\")" _ prefix suffix)
672 (string-append prefix "1" suffix))
673 (("(VERSION\\s\").*(\"\\))" _ prefix suffix)
674 (string-append prefix "1.0.0" suffix)))))))
675 (build-system cmake-build-system)
676 (arguments
677 (list
678 ;; no tests
679 #:tests? #f))
680 (inputs (list bash-minimal libsais))
681 (home-page "https://github.com/iczelia/bzip3")
682 (synopsis "Text compression program")
683 (description
684 "BZip3 is a spiritual successor to BZip2. Features higher compression
685ratios and better performance thanks to a order-0 context mixing entropy coder,
686a fast Burrows-Wheeler transform code making use of suffix arrays and a RLE with
687Lempel Ziv+Prediction pass based on LZ77-style string matching and PPM-style
688context modeling.
689
690Like its ancestor, BZip3 excels at compressing text or code.")
691 (properties '((tunable? . #t)))
692 (license license:lgpl3)))
693
694(define-public bzip3-1.4
695 (package
696 (inherit bzip3)
697 (name "bzip3")
698 (version "1.4.0")
699 (source
700 (origin
701 (method git-fetch)
702 (uri (git-reference
703 (url "https://github.com/iczelia/bzip3")
704 (commit version)))
705 (file-name (git-file-name name version))
706 (sha256
707 (base32 "1jg2mcymk0i77g4gwnp45bzbp6174ax9p7ca369f5fg5r1crjl2i"))
708 (modules '((guix build utils)))
709 (snippet
710 #~(begin
711 ;; unbundle libsais
712 (delete-file "include/libsais.h")
713 (substitute* "src/libbz3.c"
714 (("^#include \"libsais.h\".*$" include-libsais)
715 (string-append "#include \"common.h\"\n" include-libsais)))
716 (substitute* "CMakeLists.txt"
717 (("^set\\(PACKAGE_VERSION.*$" line)
718 (string-append line "find_package(libsais REQUIRED)\n"
719 "find_package(OpenMP REQUIRED)\n"))
720 (("^target_sources\\(bz3.*$" line)
721 (string-append line
722 "target_link_libraries(bz3 PRIVATE OpenMP::OpenMP_C libsais)
723"))
724 (("(target_link_libraries\\(bz3) (Threads::Threads\\))" _ prefix
725 suffix)
726 (string-append prefix " PRIVATE " suffix)))
727 ;; set MAN_DATE
728 (let ((release-date "06 December 2023"))
729 (substitute* "CMakeLists.txt"
730 (("set\\(MAN_DATE.*\\)")
731 (string-append "set(MAN_DATE \"" release-date "\")"))))
732 ;; fix out-of-source build
733 ;; see https://github.com/iczelia/bzip3/commit/2b9b3b504bdfe16e8cc08addd8f7931f66c9cd59
734 (substitute* "CMakeLists.txt"
735 (("(if\\(EXISTS\\s)\\$\\{BZIP3_MAN\\}" _ prefix)
736 (string-append prefix
737 "${CMAKE_CURRENT_SOURCE_DIR}/${BZIP3_MAN}"))
738 (("(configure_file\\()\\$\\{BZIP3_MAN\\}" _ prefix)
739 (string-append prefix
740 "${CMAKE_CURRENT_SOURCE_DIR}/${BZIP3_MAN}")))
741 ;; fix shared-object version
742 ;; see https://github.com/iczelia/bzip3/commit/3ac85a6c4ee44573f6d8932d9d5d1bc3351f81db
743 (substitute* "CMakeLists.txt"
744 (("(SOVERSION\\s\").*(\")" _ prefix suffix)
745 (string-append prefix "1" suffix))
746 (("(VERSION\\s\").*(\"\\))" _ prefix suffix)
747 (string-append prefix "1.0.0" suffix)))))))
748 (properties '((tunable? . #t)
749 (hidden? . #t)))))
750
751(define-public xz
752 (package
753 (name "xz")
754 (version "5.4.5")
755 (source (origin
756 (method url-fetch)
757 (uri (list (string-append "http://tukaani.org/xz/xz-" version
758 ".tar.gz")
759 (string-append "http://multiprecision.org/guix/xz-"
760 version ".tar.gz")))
761 (sha256
762 (base32
763 "1mmpwl4kg1vs6n653gkaldyn43dpbjh8gpk7sk0gps5f6jwr0p0k"))))
764 (build-system gnu-build-system)
765 (arguments
766 `(#:phases
767 (modify-phases %standard-phases
768 (add-after 'install 'move-static-lib
769 (lambda* (#:key outputs #:allow-other-keys)
770 (let ((out (assoc-ref outputs "out"))
771 (static (assoc-ref outputs "static")))
772 (mkdir-p (string-append static "/lib"))
773 (rename-file (string-append out "/lib/liblzma.a")
774 (string-append static "/lib/liblzma.a"))
775 ;; Remove reference to the static library from the .la file
776 ;; so Libtool does the right thing when both the shared and
777 ;; static library is available.
778 (substitute* (string-append out "/lib/liblzma.la")
779 (("^old_library='liblzma.a'") "old_library=''"))
780 #t))))))
781 (outputs '("out" "static"))
782 (inputs
783 `(,@(if (%current-target-system)
784 `(("bash" ,bash-minimal))
785 '())))
786 (synopsis "General-purpose data compression")
787 (description
788 "XZ Utils is free general-purpose data compression software with high
789compression ratio. XZ Utils were written for POSIX-like systems, but also
790work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
791
792The core of the XZ Utils compression code is based on LZMA SDK, but it has
793been modified quite a lot to be suitable for XZ Utils. The primary
794compression algorithm is currently LZMA2, which is used inside the .xz
795container format. With typical files, XZ Utils create 30 % smaller output
796than gzip and 15 % smaller output than bzip2.")
797 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
798 (home-page "https://tukaani.org/xz/")))
799
800(define-public heatshrink
801 (package
802 (name "heatshrink")
803 (version "0.4.1")
804 (source
805 (origin
806 (method git-fetch)
807 (uri (git-reference
808 (url "https://github.com/atomicobject/heatshrink/")
809 (commit (string-append "v" version))))
810 (file-name (git-file-name name version))
811 (sha256
812 (base32 "0sdhvk27yz8kahw18j8pddbpkgl78v8rh8fx6wspc3acj7w7yvrn"))
813 ;; Add CMake build script, wanted by prusa-slicer and libbgcode, which are the
814 ;; only users of this library (see
815 ;; <https://github.com/NixOS/nixpkgs/pull/269758/commits/fa36136ceed0e2c58e0c9e21492a7e60c3a64470>.)
816 (patches (search-patches "heatshrink-add-cmake.patch"))))
817 (build-system cmake-build-system)
818 (arguments
819 (list
820 ;; XXX: No tests available with CMake (see
821 ;; <https://github.com/atomicobject/heatshrink/pull/77>.)
822 #:tests? #f))
823 (home-page "https://github.com/atomicobject/heatshrink/")
824 (synopsis "Data compression library for embedded/real-time systems")
825 (description
826 "A data compression/decompression library for embedded/real-time systems.
827
828Among its features are:
829@itemize
830@item Low memory usage (as low as 50 bytes.) It is useful for some cases with less
831than 50 bytes, and useful for many general cases with less than 300 bytes.
832@item Incremental, bounded CPU use. It can be used to chew on input data in
833arbitrarily tiny bites. This is a useful property in hard real-time environments.
834@item Can use either static or dynamic memory allocation.
835@end itemize
836")
837 (license license:isc)))
838
839(define-public lhasa
840 (package
841 (name "lhasa")
842 (version "0.4.0")
843 (source (origin
844 (method url-fetch)
845 (uri (string-append
846 "https://github.com/fragglet/lhasa/releases/download/v"
847 version "/lhasa-" version ".tar.gz"))
848 (sha256
849 (base32
850 "1cy5429c7h1dp4l5y9ncdy40qarl9ix31ylkzdi8al2c60y8iz57"))))
851 (build-system gnu-build-system)
852 (arguments
853 (list #:phases #~(modify-phases %standard-phases
854 (add-before 'check 'set-up-test-environment
855 (lambda* (#:key inputs #:allow-other-keys)
856 (setenv "TZDIR"
857 (search-input-directory inputs
858 "share/zoneinfo")))))))
859 (native-inputs (list tzdata-for-tests))
860 (home-page "https://fragglet.github.io/lhasa/")
861 (synopsis "LHA archive decompressor")
862 (description
863 "Lhasa is a replacement for the Unix LHa tool, for decompressing
864@file{.lzh} (LHA / LHarc) and .lzs (LArc) archives. The backend for the tool is
865a library, so that it can be reused for other purposes. Lhasa aims to be
866compatible with as many types of @file{.lzh}/@file{lzs} archives as possible.
867It also aims to generate the same output as the (non-free) Unix @command{lha}
868tool, so that it will act as a free drop-in replacement.")
869 (license license:isc)))
870
871(define-public lzo
872 (package
873 (name "lzo")
874 (version "2.10")
875 (source
876 (origin
877 (method url-fetch)
878 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
879 version ".tar.gz"))
880 (sha256
881 (base32
882 "0wm04519pd3g8hqpjqhfr72q8qmbiwqaxcs3cndny9h86aa95y60"))))
883 (build-system gnu-build-system)
884 (arguments '(#:configure-flags '("--enable-shared")))
885 (home-page "http://www.oberhumer.com/opensource/lzo")
886 (synopsis
887 "Data compression library suitable for real-time data de-/compression")
888 (description
889 "LZO is a data compression library which is suitable for data
890de-/compression in real-time. This means it favours speed over
891compression ratio.
892
893LZO is written in ANSI C. Both the source code and the compressed data
894format are designed to be portable across platforms.")
895 (license license:gpl2+)))
896
897(define-public lzop
898 (package
899 (name "lzop")
900 (version "1.04")
901 (source
902 (origin
903 (method url-fetch)
904 (uri (string-append "http://www.lzop.org/download/lzop-"
905 version ".tar.gz"))
906 (sha256
907 (base32
908 "0h9gb8q7y54m9mvy3jvsmxf21yx8fc3ylzh418hgbbv0i8mbcwky"))))
909 (build-system gnu-build-system)
910 (inputs (list lzo))
911 (home-page "https://www.lzop.org/")
912 (synopsis "Compress or expand files")
913 (description
914 "Lzop is a file compressor which is very similar to gzip. Lzop uses the
915LZO data compression library for compression services, and its main advantages
916over gzip are much higher compression and decompression speed (at the cost of
917some compression ratio).")
918 (license license:gpl2+)))
919
920(define-public lzip
921 (package
922 (name "lzip")
923 (version "1.25")
924 (source (origin
925 (method url-fetch)
926 (uri (string-append "mirror://savannah/lzip/lzip-"
927 version ".tar.gz"))
928 (sha256
929 (base32
930 "0vx5y39y6ipks1lcc203mrxx7x9xf04nx1dxyl9m2gxqixnqlh89"))))
931 (build-system gnu-build-system)
932 (arguments
933 ;; The configure script doesn't recognise the --build or --host
934 ;; arguments, so set CXX here
935 `(,@(if (%current-target-system)
936 `(#:make-flags (list ,(string-append "CXX=" (cxx-for-target))))
937 '())))
938 (home-page "https://www.nongnu.org/lzip/lzip.html")
939 (synopsis "Lossless data compressor based on the LZMA algorithm")
940 (description
941 "Lzip is a lossless data compressor with a user interface similar to the
942one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
943more than bzip2, which makes it well-suited for software distribution and data
944archiving. Lzip is a clean implementation of the LZMA algorithm.")
945 (license license:gpl3+)))
946
947(define-public lziprecover
948 (package
949 (name "lziprecover")
950 (version "1.25")
951 (source (origin
952 (method url-fetch)
953 (uri (string-append "mirror://savannah/lzip/lziprecover/"
954 "lziprecover-" version ".tar.gz"))
955 (sha256
956 (base32
957 "0icbzw7kmp4rn711sh3f0w3sxlxly6q6dc8d7pp6dqhag2f2yfag"))))
958 (build-system gnu-build-system)
959 (arguments
960 ;; The configure script doesn't recognise the --build or --host
961 ;; arguments, so set CXX here
962 `(,@(if (%current-target-system)
963 `(#:make-flags (list ,(string-append "CXX=" (cxx-for-target))))
964 '())))
965 (native-inputs (list lzip))
966 (home-page "https://www.nongnu.org/lzip/lziprecover.html")
967 (synopsis "Recover and decompress data from damaged lzip files")
968 (description
969 "Lziprecover is a data recovery tool and decompressor for files in the lzip
970compressed data format (.lz). It can test the integrity of lzip files, extract
971data from damaged ones, and repair most files with small errors (up to one
972single-byte error per member) entirely.
973
974Lziprecover is not a replacement for regular backups, but a last line of defence
975when even the backups are corrupt. It can recover files by merging the good
976parts of two or more damaged copies, such as can be easily produced by running
977@command{ddrescue} on a failing device.
978
979This package also includes @command{unzcrash}, a tool to test the robustness of
980decompressors when faced with corrupted input.")
981 (license (list license:bsd-2 ; arg_parser.{cc,h}
982 license:gpl2+)))) ; everything else
983
984(define-public sharutils
985 (package
986 (name "sharutils")
987 (version "4.15.2")
988 (source
989 (origin
990 (method url-fetch)
991 (uri (string-append "mirror://gnu/sharutils/sharutils-"
992 version ".tar.xz"))
993 (patches (search-patches "sharutils-CVE-2018-1000097.patch"))
994 (sha256
995 (base32
996 "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))
997 (modules '((guix build utils)))
998 (snippet
999 '(begin
1000 ;; Adjust for newer libc versions.
1001 (substitute* (find-files "lib" "\\.c$")
1002 (("#if defined _IO_ftrylockfile")
1003 "#if defined _IO_EOF_SEEN"))
1004 (substitute* "lib/stdio-impl.h"
1005 (("^/\\* BSD stdio derived implementations")
1006 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
1007 "# define _IO_IN_BACKUP 0x100\n"
1008 "#endif\n\n"
1009 "/* BSD stdio derived implementations")))
1010 ;; ... and for newer GCC with -fno-common.
1011 (substitute* '("src/shar-opts.h"
1012 "src/unshar-opts.h"
1013 "src/uudecode-opts.h"
1014 "src/uuencode-opts.h")
1015 (("char const \\* const program_name" all)
1016 (string-append "extern " all)))))))
1017 (build-system gnu-build-system)
1018 (native-inputs
1019 (list which))
1020 (arguments
1021 `(#:phases
1022 (modify-phases %standard-phases
1023 (add-after 'patch-source-shebangs 'unpatch-source-shebang
1024 ;; revert the patch-shebang phase on a script which is
1025 ;; in fact test data
1026 (lambda _
1027 (substitute* "tests/shar-1.ok"
1028 (((which "sh")) "/bin/sh")))))))
1029 (home-page "https://www.gnu.org/software/sharutils/")
1030 (synopsis "Archives in shell scripts, uuencode/uudecode")
1031 (description
1032 "GNU sharutils is a package for creating and manipulating shell
1033archives that can be readily emailed. A shell archive is a file that can be
1034processed by a Bourne-type shell to unpack the original collection of files.
1035This package is mostly for compatibility and historical interest.")
1036 (license license:gpl3+)))
1037
1038(define-public sfarklib
1039 (package
1040 (name "sfarklib")
1041 (version "2.24")
1042 (source (origin
1043 (method git-fetch)
1044 (uri (git-reference
1045 (url "https://github.com/raboof/sfArkLib")
1046 (commit version)))
1047 (file-name (git-file-name name version))
1048 (sha256
1049 (base32
1050 "0jrxy24gak7q5ml06p5jjgzk9i5r2mkfjk4ycirkp4kg7k5a237w"))))
1051 (build-system gnu-build-system)
1052 (arguments
1053 `(#:tests? #f ;no "check" target
1054 #:phases
1055 (modify-phases %standard-phases
1056 (replace 'configure
1057 (lambda* (#:key outputs #:allow-other-keys)
1058 (substitute* "Makefile"
1059 (("/usr/local") (assoc-ref outputs "out")))
1060 #t)))))
1061 (inputs
1062 (list zlib))
1063 (home-page "https://github.com/raboof/sfArkLib")
1064 (synopsis "Library for SoundFont decompression")
1065 (description
1066 "SfArkLib is a C++ library for decompressing SoundFont files compressed
1067with the sfArk algorithm.")
1068 (license license:gpl3+)))
1069
1070(define-public minizip-ng
1071 (package
1072 (name "minizip-ng")
1073 (version "4.0.10")
1074 (source (origin
1075 (method git-fetch)
1076 (uri (git-reference
1077 (url "https://github.com/zlib-ng/minizip-ng")
1078 (commit version)))
1079 (file-name (git-file-name name version))
1080 (sha256
1081 (base32
1082 "1y6yvswzl1gzrv1am3yhr6r2zpsh50d1l7g381ccccn9sz19jw13"))))
1083 (build-system cmake-build-system)
1084 (arguments
1085 (list
1086 #:parallel-tests? #f
1087 #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON"
1088 "-DMZ_BUILD_TESTS=ON"
1089 "-DMZ_BUILD_UNIT_TESTS=ON"
1090 "-DMZ_COMPAT=OFF")
1091 #:phases
1092 #~(modify-phases %standard-phases
1093 (add-after 'install 'sanitize-config-file
1094 (lambda* (#:key outputs #:allow-other-keys)
1095 (let ((minizip-config
1096 (or (false-if-exception
1097 (search-input-file
1098 outputs
1099 "lib/cmake/minizip-ng/minizip-ng-config.cmake"))
1100 (search-input-file ;for the minizip variant
1101 outputs
1102 "lib/cmake/minizip/minizip-config.cmake"))))
1103 (substitute* minizip-config
1104 ;; The find_dependency calls appear useful only in a
1105 ;; static library context, to ensure the transitive
1106 ;; dependencies are available for linking. Remove these to
1107 ;; avoid having to propagate all optional inputs (see:
1108 ;; <https://github.com/zlib-ng/minizip-ng/issues/898>).
1109 ((".*CMakeFindDependencyMacro.*") "")
1110 ((".*find_dependency.*") ""))))))))
1111 (native-inputs (list googletest pkg-config))
1112 (inputs (list openssl zlib `(,zstd "lib")))
1113 (home-page "https://github.com/zlib-ng/minizip-ng")
1114 (synopsis "Zip manipulation library")
1115 (description "@code{minizip-ng} is a zip manipulation library written in
1116C, forked from the zip manipulation library found in the zlib distribution.")
1117 (license license:bsd-3)))
1118
1119(define-public minizip-ng-compat
1120 (package/inherit minizip-ng
1121 (name "minizip-ng-compat")
1122 (arguments
1123 (substitute-keyword-arguments arguments
1124 ((#:configure-flags flags)
1125 #~(delete "-DMZ_COMPAT=OFF" #$flags))))))
1126
1127;; The following package is needed for [email protected], see
1128;; https://github.com/AcademySoftwareFoundation/OpenColorIO/issues/2157
1129;; https://github.com/NixOS/nixpkgs/pull/406607
1130(define-public minizip-ng-4.0.9
1131 (package/inherit minizip-ng
1132 (name "minizip-ng")
1133 (version "4.0.9")
1134 (source (origin
1135 (method git-fetch)
1136 (uri (git-reference
1137 (url "https://github.com/zlib-ng/minizip-ng")
1138 (commit version)))
1139 (file-name (git-file-name name version))
1140 (sha256
1141 (base32
1142 "0bychb3ysbxdhgfvjvmy0rkzjd0ngfkha7d5jy6w8zam53xb0248"))))))
1143
1144(define-public sfarkxtc
1145 (let ((commit "13cd6f93725a90d91ec5ea75babf1dbd694ac463")
1146 (revision "1"))
1147 (package
1148 (name "sfarkxtc")
1149 (version (git-version "0" revision commit))
1150 (source (origin
1151 ;; There are no release tarballs, so we just fetch the latest
1152 ;; commit at this time.
1153 (method git-fetch)
1154 (uri (git-reference
1155 (url "https://github.com/raboof/sfarkxtc")
1156 (commit commit)))
1157 (file-name (git-file-name name version))
1158 (sha256
1159 (base32
1160 "1mb1jyk1m11l1gppd9hmql9cyp55sdf7jk5rbc7acky1z4k4mv19"))))
1161 (build-system gnu-build-system)
1162 (arguments
1163 `(#:tests? #f ;no "check" target
1164 #:phases
1165 (modify-phases %standard-phases
1166 (replace 'configure
1167 (lambda* (#:key outputs #:allow-other-keys)
1168 (substitute* "Makefile"
1169 (("/usr/local") (assoc-ref outputs "out")))
1170 #t)))))
1171 (inputs
1172 (list zlib sfarklib))
1173 (home-page "https://github.com/raboof/sfarkxtc")
1174 (synopsis "Basic sfArk decompressor")
1175 (description "SfArk extractor converts SoundFonts in the compressed legacy
1176sfArk file format to the uncompressed sf2 format.")
1177 (license license:gpl3+))))
1178
1179(define-public draco
1180 (package
1181 (name "draco")
1182 (version "1.5.7")
1183 (source (origin
1184 (method git-fetch)
1185 (uri (git-reference
1186 (url "https://github.com/google/draco")
1187 (commit version)))
1188 (file-name (git-file-name name version))
1189 (sha256
1190 (base32
1191 "1v1idvqr9mww9wi36yzb10lq66ls78dlrgnxchjjjv5paw2g0mk3"))))
1192 (build-system cmake-build-system)
1193 (arguments
1194 ;; There is a testdata directory but apparently no actual tests.
1195 ;; src/draco/tools/install_test contains a sanity check, but this
1196 ;; check is useless here.
1197 (list #:tests? #f
1198 #:configure-flags
1199 #~(list "-DBUILD_SHARED_LIBS=true"
1200 (string-append "-DDRACO_EIGEN_PATH="
1201 #$(this-package-input "eigen"))
1202 (string-append "-DDRACO_FILESYSTEM_PATH="
1203 #$(this-package-input "gulrak-filesystem"))
1204 (string-append "-DDRACO_TINYGLTF_PATH="
1205 #$(this-package-input "tinygltf")))
1206 #:phases
1207 #~(modify-phases %standard-phases
1208 (add-after 'install 'delete-static-lib
1209 (lambda _
1210 (delete-file (string-append #$output
1211 "/lib/libdraco.a")))))))
1212 (inputs (list eigen gulrak-filesystem tinygltf))
1213 (home-page "https://google.github.io/draco/")
1214 (synopsis "Compress and decompress 3D geometric meshes and point clouds")
1215 (description "Draco is a library for compressing and decompressing 3D
1216geometric meshes and point clouds. It is intended to improve the storage and
1217transmission of 3D graphics.")
1218 (license license:asl2.0)))
1219
1220(define-public libmspack
1221 (package
1222 (name "libmspack")
1223 (home-page "https://cabextract.org.uk/libmspack/")
1224 (version "0.11")
1225 (source
1226 (origin
1227 (method url-fetch)
1228 (uri (string-append home-page name "-" version "alpha.tar.gz"))
1229 (sha256
1230 (base32 "06x2xq73lchw5lcq386sx9wk05v21s2f38bi3dwkdk5fy2r1zpbh"))))
1231 (build-system gnu-build-system)
1232 (arguments
1233 `(#:configure-flags '("--disable-static")))
1234 (synopsis "Compression tools for some formats used by Microsoft")
1235 (description
1236 "The purpose of libmspack is to provide both compression and
1237decompression of some loosely related file formats used by Microsoft.")
1238 (license license:lgpl2.1+)))
1239
1240(define-public lz4
1241 (package
1242 (name "lz4")
1243 (version "1.10.0")
1244 (source
1245 (origin
1246 (method git-fetch)
1247 (uri (git-reference (url "https://github.com/lz4/lz4")
1248 (commit (string-append "v" version))))
1249 (sha256
1250 (base32 "12sfwid95zhk2r2ijpwwknc5a2xlll2s9xhf0s21ca2jkygvblgx"))
1251 (file-name (git-file-name name version))))
1252 (build-system gnu-build-system)
1253 (outputs (list "out" "static"))
1254 (native-inputs
1255 (list python)) ;; For tests.
1256 (arguments
1257 `(;; Not designed for parallel testing.
1258 ;; See https://github.com/lz4/lz4/issues/957#issuecomment-737419821
1259 #:parallel-tests? #f
1260 #:test-target "test"
1261 #:make-flags (list (string-append "CC=" ,(cc-for-target))
1262 (string-append "prefix=" (assoc-ref %outputs "out")))
1263 #:phases
1264 (modify-phases %standard-phases
1265 (delete 'configure) ; no configure script
1266 (add-before 'check 'disable-broken-test
1267 (lambda _
1268 (substitute* "tests/Makefile"
1269 ;; This fails when $prefix is not a single top-level directory.
1270 (("^test: (.*) test-install" _ targets)
1271 (string-append "test: " targets)))))
1272 (add-after 'install 'move-static-library
1273 (lambda* (#:key outputs #:allow-other-keys)
1274 (let ((out (assoc-ref outputs "out"))
1275 (static (assoc-ref outputs "static")))
1276 (mkdir-p (string-append static "/lib"))
1277 (rename-file (string-append out "/lib/liblz4.a")
1278 (string-append static "/lib/liblz4.a"))))))))
1279 (home-page "https://www.lz4.org")
1280 (synopsis "Compression algorithm focused on speed")
1281 (description "LZ4 is a lossless compression algorithm, providing
1282compression speed at 400 MB/s per core (0.16 Bytes/cycle). It also features an
1283extremely fast decoder, with speed in multiple GB/s per core (0.71 Bytes/cycle).
1284A high compression derivative, called LZ4_HC, is also provided. It trades CPU
1285time for compression ratio.")
1286 ;; The libraries (lz4, lz4hc, and xxhash) are BSD licenced. The command
1287 ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
1288 (license (list license:bsd-2 license:gpl2+))))
1289
1290(define-public squashfs-tools
1291 (package
1292 (name "squashfs-tools")
1293 (version "4.6.1")
1294 (source
1295 (origin
1296 (method git-fetch)
1297 (uri (git-reference
1298 (url "https://github.com/plougher/squashfs-tools")
1299 (commit version)))
1300 (file-name (git-file-name name version))
1301 (sha256
1302 (base32 "14nisidxx2d2qivyv7xfcg59qkj4fjiniir7nvymazdsng63gcr1"))))
1303 (build-system gnu-build-system)
1304 (arguments
1305 (list
1306 #:tests? #f ; no check target
1307 #:make-flags
1308 #~(list
1309 (string-append "CC=" #$(cc-for-target))
1310 "XZ_SUPPORT=1"
1311 "LZO_SUPPORT=1"
1312 "LZ4_SUPPORT=1"
1313 "ZSTD_SUPPORT=1"
1314 (string-append "INSTALL_DIR=" #$output "/bin")
1315 (string-append "INSTALL_MANPAGES_DIR=" #$output "/share/man/man1"))
1316 #:phases
1317 #~(modify-phases %standard-phases
1318 (replace 'configure
1319 (lambda _
1320 (chdir "squashfs-tools")))
1321 (add-after 'patch-source-shebangs 'patch-generated-source-shebangs
1322 (lambda _
1323 (substitute* (find-files "generate-manpages" "\\.sh")
1324 (("print \"#!/bin/sh")
1325 (string-append "print \"#!" (which "sh")))))))))
1326 (native-inputs
1327 (list coreutils-minimal help2man which))
1328 (inputs
1329 (list lz4 lzo xz zlib `(,zstd "lib")))
1330 (home-page "https://github.com/plougher/squashfs-tools")
1331 (synopsis "Tools to create and extract squashfs file systems")
1332 (description
1333 "Squashfs is a highly compressed read-only file system for Linux. It
1334compresses files, inodes, and directories with one of several compressors.
1335All blocks are packed to minimize the data overhead, and block sizes of
1336between 4K and 1M are supported. It is intended to be used for archival use,
1337for live media, and for embedded systems where low overhead is needed.
1338This package allows you to create and extract such file systems.")
1339 (license license:gpl2+)))
1340
1341(define-public squashfs-tools-ng
1342 (package
1343 (name "squashfs-tools-ng")
1344 (version "1.1.3")
1345 (source
1346 (origin
1347 (method git-fetch)
1348 (uri (git-reference
1349 (url "https://github.com/AgentD/squashfs-tools-ng")
1350 (commit (string-append "v" version))))
1351 (file-name (git-file-name name version))
1352 (sha256
1353 (base32 "12ipqmjp10574sz64ls8qbgzkxz5dcbzk0l2fxyh2yrrhnjp34mi"))
1354 (modules '((guix build utils)))
1355 (snippet
1356 '(begin
1357 ;; Delete bundled third-party libraries.
1358 (for-each (lambda (directory)
1359 (substitute* "Makefile.am"
1360 (((format #f "^include ~a.*" directory)) ""))
1361 (delete-file-recursively directory))
1362 (list "lib/lz4"
1363 "lib/zlib"))))))
1364 (build-system gnu-build-system)
1365 (arguments
1366 `(#:configure-flags
1367 (list "--disable-static")))
1368 (native-inputs
1369 (list autoconf automake libtool pkg-config))
1370 (inputs
1371 `(("libselinux" ,libselinux)
1372
1373 ;; Compression algorithms.
1374 ("bzip2" ,bzip2)
1375 ("lz4" ,lz4)
1376 ("lzo" ,lzo)
1377 ("xz" ,xz)
1378 ("zlib" ,zlib)
1379 ("zstd:lib" ,zstd "lib")))
1380 (home-page "https://github.com/AgentD/squashfs-tools-ng")
1381 (synopsis "Tools to create and extract squashfs file systems")
1382 (description
1383 "Squashfs is a highly compressed read-only file system for Linux. It
1384compresses files, inodes, and directories with one of several compressors.
1385All blocks are packed to minimize the data overhead, and block sizes of
1386between 4K and 1M are supported. It is intended to be used for archival use,
1387for live media, and for embedded systems where low overhead is needed.
1388
1389The squashfs-tools-ng package offers alternative tooling to create and extract
1390such file systems. It is not based on the older squashfs-tools package and
1391its tools have different names:
1392
1393@enumerate
1394@item @command{gensquashfs} produces SquashFS images from a directory or
1395@command{gen_init_cpio}-like file listings and can generate SELinux labels.
1396@item @command{rdsquashfs} inspects and unpacks SquashFS images.
1397@item @command{sqfs2tar} and @command{tar2sqfs} convert between SquashFS and
1398tarballs.
1399@item @command{sqfsdiff} compares the contents of two SquashFS images.
1400@end enumerate
1401
1402These commands are largely command-line wrappers around the included
1403@code{libsquashfs} library that intends to make SquashFS available to other
1404applications as an embeddable, extensible archive format.
1405
1406Both the library and tools operate deterministically: same input will produce
1407byte-for-byte identical output.")
1408 ;; Upstream goes to some lengths to ensure that libsquashfs is LGPL3+.
1409 (license license:gpl3+)))
1410
1411(define-public pigz
1412 (package
1413 (name "pigz")
1414 (version "2.8")
1415 (source (origin
1416 (method url-fetch)
1417 (uri (string-append "http://zlib.net/pigz/"
1418 name "-" version ".tar.gz"))
1419 (sha256
1420 (base32
1421 "1l0g2zaz05pl3pijsjd8lqxqj122di88rggpr5cvw3hz1r7jp1zb"))))
1422 (build-system gnu-build-system)
1423 (arguments
1424 (list #:make-flags
1425 #~(list (string-append "CC=" #$(cc-for-target)))
1426 #:test-target "test"
1427 #:phases
1428 #~(modify-phases %standard-phases
1429 (delete 'configure)
1430 (replace 'install
1431 (lambda _
1432 (let* ((bin (string-append #$output "/bin"))
1433 (man (string-append #$output "/share/man/man1")))
1434 (install-file "pigz" bin)
1435 (symlink "pigz" (string-append bin "/unpigz"))
1436 (install-file "pigz.1" man)))))))
1437 (native-inputs (list which))
1438 (inputs (list zlib))
1439 (home-page "https://zlib.net/pigz/")
1440 (synopsis "Parallel implementation of gzip")
1441 (description
1442 "This package provides a parallel implementation of gzip that exploits
1443multiple processors and multiple cores when compressing data.")
1444
1445 ;; Things under zopfli/ are under ASL2.0, but 4 files at the top-level,
1446 ;; written by Mark Adler, are under another non-copyleft license.
1447 (license license:asl2.0)))
1448
1449(define-public pixz
1450 (package
1451 (name "pixz")
1452 (version "1.0.7")
1453 (source (origin
1454 (method url-fetch)
1455 (uri (string-append
1456 "https://github.com/vasi/pixz/releases/download/v" version
1457 "/pixz-" version ".tar.xz"))
1458 (sha256
1459 (base32
1460 "1ifxr18f2h75gkcrkx8033kwmwmrcgxshpaawyc2n4dzn1p2rqz5"))))
1461 (build-system gnu-build-system)
1462 (native-inputs
1463 (list pkg-config libarchive))
1464 (home-page "https://github.com/vasi/pixz")
1465 (synopsis "Parallel indexing implementation of LZMA")
1466 (description
1467 "The existing XZ Utils provide great compression in the .xz file format,
1468but they produce just one big block of compressed data. Pixz instead produces
1469a collection of smaller blocks which makes random access to the original data
1470possible and can compress in parallel. This is especially useful for large
1471tarballs.")
1472 (license license:bsd-2)))
1473
1474(define-public cabextract
1475 (package
1476 (name "cabextract")
1477 (home-page "https://cabextract.org.uk/")
1478 (version "1.11")
1479 (source (origin
1480 (method url-fetch)
1481 (uri (string-append home-page "cabextract-" version ".tar.gz"))
1482 (sha256
1483 (base32
1484 "1iis7a19n26dax3gsnrw9kb0vwq46rbpicnlyf7p2k2y2nqnsm5m"))
1485 (modules '((guix build utils)))
1486 (snippet
1487 '(begin
1488 ;; Delete bundled libmspack.
1489 (delete-file-recursively "mspack")
1490 #t))))
1491 (build-system gnu-build-system)
1492 (arguments
1493 '(#:configure-flags '("--with-external-libmspack")
1494 #:phases
1495 (modify-phases %standard-phases
1496 ;; cabextract needs some of libmspack's header files.
1497 ;; These are located in the "mspack" directory of libmspack.
1498 (add-before 'build 'unpack-libmspack
1499 (lambda* (#:key inputs #:allow-other-keys)
1500 (let ((dir-name "libmspack-src"))
1501 (mkdir dir-name)
1502 (invoke "tar" "-xvf" (assoc-ref inputs "libmspack-source")
1503 "-C" dir-name "--strip-components" "1")
1504 (rename-file (string-append dir-name "/mspack")
1505 "mspack")
1506 (delete-file-recursively dir-name)
1507 #t))))))
1508 (native-inputs
1509 (list pkg-config))
1510 (inputs
1511 `(("libmspack" ,libmspack)
1512 ("libmspack-source" ,(package-source libmspack))))
1513 (synopsis "Tool to unpack Cabinet archives")
1514 (description "Extracts files out of Microsoft Cabinet (.cab) archives")
1515 ;; Some source files specify gpl2+, lgpl2+, however COPYING is gpl3.
1516 (license license:gpl3+)))
1517
1518(define-public libjcat
1519 (package
1520 (name "libjcat")
1521 (version "0.1.14")
1522 (source
1523 (origin
1524 (method git-fetch)
1525 (uri
1526 (git-reference
1527 (url "https://github.com/hughsie/libjcat")
1528 (commit version)))
1529 (file-name (git-file-name name version))
1530 (sha256
1531 (base32 "0dhyqhs2lg9ka47n8d1lalvic2m3rn5k6mya9bjyw242smkgzpjw"))))
1532 (build-system meson-build-system)
1533 (native-inputs
1534 (list gobject-introspection help2man pkg-config))
1535 (inputs
1536 (list glib
1537 gnupg
1538 gnutls
1539 gpgme
1540 json-glib
1541 vala))
1542 (home-page "https://github.com/hughsie/libjcat")
1543 (synopsis "Library for reading and writing Jcat files")
1544 (description
1545 "This library allows reading and writing gzip-compressed JSON catalog
1546files, which can be used to store GPG, PKCS-7 and SHA-256 checksums for each
1547file.")
1548 (license license:lgpl2.1+)))
1549
1550(define-public xdelta
1551 (package
1552 (name "xdelta")
1553 (version "3.1.0")
1554 (source
1555 (origin
1556 (method git-fetch)
1557 (uri (git-reference
1558 (url "https://github.com/jmacd/xdelta")
1559 (commit (string-append "v" version))))
1560 (file-name (git-file-name name version))
1561 (sha256
1562 (base32
1563 "09mmsalc7dwlvgrda56s2k927rpl3a5dzfa88aslkqcjnr790wjy"))
1564 (snippet
1565 ;; This file isn't freely distributable and has no effect on building.
1566 '(begin
1567 (delete-file "xdelta3/draft-korn-vcdiff.txt")
1568 #t))))
1569 (build-system gnu-build-system)
1570 (native-inputs
1571 (list autoconf automake))
1572 (arguments
1573 `(#:phases
1574 (modify-phases %standard-phases
1575 (add-after 'unpack 'enter-build-directory
1576 (lambda _ (chdir "xdelta3") #t)))))
1577 (home-page "http://xdelta.org")
1578 (synopsis "Delta encoder for binary files")
1579 (description "xdelta encodes only the differences between two binary files
1580using the VCDIFF algorithm and patch file format described in RFC 3284. It can
1581also be used to apply such patches. xdelta is similar to @command{diff} and
1582@command{patch}, but is not limited to plain text and does not generate
1583human-readable output.")
1584 (license license:asl2.0)))
1585
1586(define-public lrzip
1587 (package
1588 (name "lrzip")
1589 (version "0.651")
1590 (source
1591 (origin
1592 (method url-fetch)
1593 (uri (string-append
1594 "http://ck.kolivas.org/apps/lrzip/lrzip-" version ".tar.xz"))
1595 (sha256
1596 (base32 "1y822rpl7ak57s1a4xzd6ja82cp3sff9axrpkdn5khcpn3n8vga8"))))
1597 (build-system gnu-build-system)
1598 (native-inputs
1599 `(;; nasm is only required when building for 32-bit x86 platforms
1600 ,@(if (string-prefix? "i686" (or (%current-target-system)
1601 (%current-system)))
1602 `(("nasm" ,nasm))
1603 '())
1604 ("perl" ,perl)))
1605 (inputs
1606 (list bzip2 lz4 lzo zlib))
1607 (home-page "http://ck.kolivas.org/apps/lrzip/")
1608 (synopsis "Large file compressor with a very high compression ratio")
1609 (description "lrzip is a compression utility that uses long-range
1610redundancy reduction to improve the subsequent compression ratio of
1611larger files. It can then further compress the result with the ZPAQ or
1612LZMA algorithms for maximum compression, or LZO for maximum speed. This
1613choice between size or speed allows for either better compression than
1614even LZMA can provide, or a higher speed than gzip while compressing as
1615well as bzip2.")
1616 (license (list license:gpl3+
1617 license:public-domain)))) ; most files in lzma/
1618
1619(define-public snappy
1620 (package
1621 (name "snappy")
1622 (version "1.1.9")
1623 (source
1624 (origin
1625 (method git-fetch)
1626 (uri (git-reference
1627 (url "https://github.com/google/snappy")
1628 (commit version)))
1629 (file-name (git-file-name name version))
1630 (sha256
1631 (base32 "03zz56h79z0sgvi5sangjqn9dahhzvf645v26n1y0gwmfbmsax95"))
1632 (patches
1633 (search-patches "snappy-add-O2-flag-in-CmakeLists.txt.patch"
1634 "snappy-add-inline-for-GCC.patch"))))
1635 (build-system cmake-build-system)
1636 (arguments
1637 `(#:configure-flags
1638 (list "-DBUILD_SHARED_LIBS=ON"
1639 ;; These would be installed alongside Snappy otherwise.
1640 "-DBENCHMARK_ENABLE_INSTALL=OFF"
1641 "-DINSTALL_GTEST=OFF")
1642 #:phases
1643 (modify-phases %standard-phases
1644 (add-after 'unpack 'unpack-third_party-subprojects
1645 (lambda* (#:key native-inputs inputs #:allow-other-keys)
1646 (with-directory-excursion "third_party"
1647 (for-each (lambda (subproject)
1648 (let* ((input (string-append subproject "-source"))
1649 (source (assoc-ref (or native-inputs inputs)
1650 input)))
1651 (with-directory-excursion subproject
1652 ;; Take advantage of the coincidence that both
1653 ;; use GIT-FETCH, which creates a directory.
1654 (copy-recursively source "."))))
1655 (list "benchmark"
1656 "googletest"))
1657 #;punt))))))
1658 (native-inputs
1659 `(("benchmark-source" ,(package-source benchmark))
1660 ("googletest-source" ,(package-source googletest))))
1661 (home-page "https://github.com/google/snappy")
1662 (synopsis "Fast compressor/decompressor")
1663 (description "Snappy is a compression/decompression library. It does not
1664aim for maximum compression, or compatibility with any other compression library;
1665instead, it aims for very high speeds and reasonable compression. For instance,
1666compared to the fastest mode of zlib, Snappy is an order of magnitude faster
1667for most inputs, but the resulting compressed files are anywhere from 20% to
1668100% bigger.")
1669 (license license:asl2.0)
1670 (properties '((cpe-vendor . "google")))))
1671
1672(define-public 7zip
1673 (package
1674 (name "7zip")
1675 (version "26.01")
1676 (source
1677 (origin
1678 (method git-fetch)
1679 (uri (git-reference
1680 (url "https://github.com/ip7z/7zip")
1681 (commit version)))
1682 (sha256
1683 (base32 "0qwzn9pz1m6f8q20cqgmfqp1qx6s7959xnyikpr60n1v8c1mj98q"))
1684 (file-name (git-file-name name version))
1685 (modules '((guix build utils)
1686 (ice-9 regex)))
1687 (snippet #~(begin
1688 (for-each
1689 delete-file
1690 (append (find-files "CPP/7zip/Compress" "^Rar.*")
1691 (find-files "DOC/unRarLicense.txt")))))))
1692 (build-system copy-build-system)
1693 (arguments
1694 (list
1695 #:install-plan
1696 #~'(("DOC/" "share/doc/7zip")
1697 ("CPP/7zip/UI/Console/_o/7z" "bin/")
1698 ("CPP/7zip/Bundles/Format7zF/_o/7z.so" "lib/")
1699 ("CPP/7zip/Bundles/SFXCon/_o/7zCon" "lib/7zCon.sfx"))
1700 #:phases
1701 #~(modify-phases %standard-phases
1702 (delete 'configure)
1703 (delete 'check)
1704 (add-after 'unpack 'patch-sources
1705 (lambda* (#:key outputs #:allow-other-keys)
1706 (let* ((out (assoc-ref outputs "out"))
1707 (lib (string-append out "/lib")))
1708 (substitute* "CPP/7zip/UI/Client7z/Client7z.cpp"
1709 (("if \\(!lib\\.Load\\(dllPrefix + FTEXT\\(kDllName\\)\\)\\)")
1710 (string-append "if (!lib.Load(FTEXT(\"" lib
1711 "\") + FTEXT(kDllName)) || "
1712 "!lib.Load(dllPrefix + FTEXT(kDllName)))")))
1713 (substitute* "CPP/7zip/UI/Common/ArchiveCommandLine.cpp"
1714 (("s = FTEXT\\(\"\\.\"\\)")
1715 (string-append "s = FTEXT(\"" lib "\")"))
1716 (("s = fas2fs\\(g_ModuleDirPrefix\\)")
1717 (string-append "s = FTEXT(\"" lib "\") "
1718 "FSTRING_PATH_SEPARATOR"))))))
1719 (add-before 'install 'build
1720 (lambda* _
1721 (define make-flags
1722 '#$(list "DISABLE_RAR=1"
1723 (string-append "CC=" (cc-for-target))
1724 (string-append "CXX=" (cxx-for-target))
1725 (string-append "PLATFORM="
1726 (cond
1727 ((target-x86-64?) "x64")
1728 ((target-x86-32?) "x86")
1729 ((target-arm32?) "arm")
1730 ((target-aarch64?) "arm64")
1731 (#t "")))))
1732 (with-directory-excursion "CPP/7zip/"
1733 (for-each
1734 (lambda (dir)
1735 (with-directory-excursion dir
1736 (apply invoke "make" "-f" "makefile.gcc" make-flags)))
1737 '("UI/Console"
1738 "Bundles/Format7zF"
1739 "Bundles/SFXCon"))))))))
1740 (home-page "https://7-zip.org")
1741 (synopsis "7-zip file archiver")
1742 (description
1743 "7-zip is a command-line file compressor that supports a number
1744of archive formats and features self-extracting archives.")
1745 (license (list license:lgpl2.1+
1746 license:bsd-2
1747 license:bsd-3
1748 license:public-domain))))
1749
1750(define-public p7zip
1751 (deprecated-package "p7zip" 7zip))
1752
1753(define-public gzstream
1754 (package
1755 (name "gzstream")
1756 (version "1.5")
1757 (source (origin
1758 (method url-fetch)
1759 (uri
1760 ;; No versioned URL, but last release was in 2003.
1761 "http://www.cs.unc.edu/Research/compgeom/gzstream/gzstream.tgz")
1762 (file-name (string-append name "-" version ".tgz"))
1763 (sha256
1764 (base32
1765 "00y19pqjsdj5zcrx4p9j56pl73vayfwnb7y2hvp423nx0cwv5b4r"))
1766 (modules '((guix build utils)))
1767 (snippet
1768 ;; Remove pre-compiled object.
1769 '(begin
1770 (delete-file "gzstream.o")
1771 #t))))
1772 (build-system gnu-build-system)
1773 (arguments
1774 `(#:test-target "test"
1775 #:phases
1776 (modify-phases %standard-phases
1777 ;; Enable PIC, so it can be used in shared libraries.
1778 (add-after 'unpack 'use-pic
1779 (lambda _
1780 (substitute* "Makefile"
1781 (("CPPFLAGS = " all) (string-append all "-fPIC ")))
1782 #t))
1783 (delete 'configure)
1784 (replace 'install
1785 (lambda* (#:key outputs #:allow-other-keys)
1786 (let* ((out (assoc-ref outputs "out"))
1787 (lib (string-append out "/lib"))
1788 (include (string-append out "/include")))
1789 (install-file "libgzstream.a" lib)
1790 (install-file "gzstream.h" include)
1791 #t))))))
1792 (propagated-inputs (list zlib))
1793 (home-page "http://www.cs.unc.edu/Research/compgeom/gzstream/")
1794 (synopsis "Compressed C++ iostream")
1795 (description "gzstream is a small library for providing zlib
1796functionality in a C++ iostream.")
1797 (license license:lgpl2.1+)))
1798
1799(define-public zopfli
1800 (package
1801 (name "zopfli")
1802 (version "1.0.3")
1803 (source (origin
1804 (method git-fetch)
1805 (uri (git-reference
1806 (url "https://github.com/google/zopfli")
1807 (commit (string-append name "-" version))))
1808 (file-name (git-file-name name version))
1809 (sha256
1810 (base32
1811 "0dr8n4j5nj2h9n208jns56wglw59gg4qm3s7c6y3hs75d0nnkhm4"))))
1812 (build-system cmake-build-system)
1813 (arguments
1814 `(#:tests? #f ;no test suite
1815 #:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
1816 (home-page "https://github.com/google/zopfli")
1817 (synopsis "Very good, but slow, deflate or zlib compression")
1818 (description "Zopfli Compression Algorithm is a compression library
1819programmed in C to perform very good, but slow, deflate or zlib compression.
1820ZopfliCompress supports the deflate, gzip and zlib output formats. This
1821library can only compress, not decompress; existing zlib or deflate libraries
1822can decompress the data.")
1823 (license license:asl2.0)))
1824
1825(define-public zpaq
1826 (package
1827 (name "zpaq")
1828 (version "7.15")
1829 (source
1830 (origin
1831 (method url-fetch/zipbomb)
1832 (uri (string-append "http://mattmahoney.net/dc/zpaq"
1833 (string-delete #\. version) ".zip"))
1834 (sha256
1835 (base32
1836 "066l94yyladlfzri877nh2dhkvspagjn3m5bmv725fmhkr9c4pp8"))
1837 (modules '((guix build utils)))
1838 (snippet
1839 ;; Delete irrelevant pre-compiled binaries.
1840 '(begin
1841 (for-each delete-file (find-files "." "\\.exe$"))
1842 #t))))
1843 (build-system gnu-build-system)
1844 (arguments
1845 `(#:phases
1846 (modify-phases %standard-phases
1847 (delete 'configure)) ; no ‘configure’ script
1848 #:make-flags
1849 (list
1850 (string-append "CPPFLAGS=-Dunix"
1851 ,(match (or (%current-target-system)
1852 (%current-system))
1853 ("x86_64-linux" "")
1854 ("i686-linux" "")
1855 (_ " -DNOJIT")))
1856 ;; These should be safe, lowest-common-denominator instruction sets,
1857 ;; allowing for some optimisation while remaining reproducible.
1858 (string-append "CXXFLAGS=-O3 -DNDEBUG"
1859 ,(match (or (%current-target-system)
1860 (%current-system))
1861 ("x86_64-linux" " -march=nocona -mtune=generic")
1862 ("i686-linux" " -march=i686 -mtune=generic")
1863 ("armhf-linux" " -mtune=generic-armv7-a")
1864 (_ "")))
1865 (string-append "PREFIX="
1866 (assoc-ref %outputs "out")))))
1867 (native-inputs
1868 (list perl)) ; for pod2man
1869 (home-page "http://mattmahoney.net/dc/zpaq.html")
1870 (synopsis "Incremental journaling archiver")
1871 (description "ZPAQ is a command-line archiver for realistic situations with
1872many duplicate and already compressed files. It backs up only those files
1873modified since the last update. All previous versions remain untouched and can
1874be independently recovered. Identical files are only stored once (known as
1875@dfn{de-duplication}). Archives can also be encrypted.
1876
1877ZPAQ is intended to back up user data, not entire operating systems. It ignores
1878owner and group IDs, ACLs, extended attributes, or special file types like
1879devices, sockets, or named pipes. It does not follow or restore symbolic links
1880or junctions, and always follows hard links.")
1881 (license (list license:public-domain
1882 ;; libzpaq.cpp contains a mix of public-domain and
1883 ;; expat-licenced (or ‘MIT’) code.
1884 license:expat))))
1885
1886(define-public unshield
1887 (package
1888 (name "unshield")
1889 (version "1.4.3")
1890 (source
1891 (origin (method git-fetch)
1892 (uri (git-reference
1893 (url "http://github.com/twogood/unshield")
1894 (commit version)))
1895 (file-name (git-file-name name version))
1896 (sha256
1897 (base32
1898 "19wn22vszhci8dfcixx5rliz7phx3lv5ablvhjlclvj75k2vsdqd"))))
1899 (build-system cmake-build-system)
1900 (inputs
1901 `(("zlib" ,zlib)
1902 ("openssl" ,openssl)
1903 ;; Test data that is otherwise downloaded with curl.
1904 ("unshield-avigomanager11b22.zip"
1905 ,(origin
1906 (method url-fetch)
1907 (uri (string-append
1908 "https://www.dropbox.com/s/8r4b6752swe3nhu/"
1909 "unshield-avigomanager11b22.zip?dl=1"))
1910 (sha256
1911 (base32 "0fwq7lih04if68wpwpsk5wjqyvh32db76a41sq6gbx4dn1lc3ddn"))
1912 (file-name "unshield-avigomanager11b22.zip")))
1913 ("unshield-baldurs_gate_patch_v1_1_4315_international.zip"
1914 ,(origin
1915 (method url-fetch)
1916 (uri (string-append
1917 "https://www.dropbox.com/s/9ruil8oi6amjbbk/"
1918 "unshield-baldurs_gate_patch_v1_1_4315_international.zip?dl=1"))
1919 (sha256
1920 (base32 "0spaxf6dardlhqxz3ys09fzamj007q3nfyw4xng6gh3qp9780maj"))
1921 (file-name "unshield-baldurs_gate_patch_v1_1_4315_international.zip")))
1922 ("unshield-the-feeble-files-spanish.zip"
1923 ,(origin
1924 (method url-fetch)
1925 (uri (string-append
1926 "https://www.dropbox.com/s/1ng0z9kfxc7eb1e/"
1927 "unshield-the-feeble-files-spanish.zip?dl=1"))
1928 (sha256
1929 (base32 "1k5cw6vnpja8yjlnhx5124xrw9i8s1l539hfdqqrqz3l5gn0bnyd"))
1930 (file-name "unshield-the-feeble-files-spanish.zip")))))
1931 (native-inputs
1932 (list unzip))
1933 (arguments
1934 `(#:out-of-source? #f
1935 #:phases
1936 (modify-phases %standard-phases
1937 (add-before 'check 'pre-check
1938 (lambda* (#:key inputs #:allow-other-keys)
1939 (for-each (lambda (i)
1940 (copy-file (assoc-ref inputs i)
1941 (string-append "test/v0/" i)))
1942 '("unshield-avigomanager11b22.zip"
1943 "unshield-baldurs_gate_patch_v1_1_4315_international.zip"
1944 "unshield-the-feeble-files-spanish.zip"))
1945 (substitute* (find-files "test/" "/*\\.sh")
1946 ;; Tests expect the unshield binary in a specific
1947 ;; location.
1948 (("/var/tmp/unshield/bin/unshield")
1949 (string-append (getcwd) "/src/unshield"))
1950 ;; We no longer need to download the data.
1951 ((".?URL=.*$") "")
1952 (("curl -(|f)sSL -o test.zip .*") ""))
1953 (substitute* "test/v0/avigomanager.sh"
1954 (("test.zip")
1955 (string-append (getcwd)
1956 "/test/v0/unshield-avigomanager11b22.zip")))
1957 (substitute* "test/v0/baldurs_gate_patch_v1_1_4315_international.sh"
1958 (("test.zip")
1959 (string-append
1960 (getcwd)
1961 "/test/v0/unshield-baldurs_gate_patch_v1_1_4315_international.zip")))
1962 (substitute* "test/v0/the-feeble-files-spanish.sh"
1963 (("test.zip")
1964 (string-append (getcwd)
1965 "/test/v0/unshield-the-feeble-files-spanish.zip")))
1966 #t))
1967 (replace 'check
1968 (lambda _
1969 (invoke "./run-tests.sh"))))))
1970 (home-page "https://github.com/twogood/unshield")
1971 (synopsis "Extract CAB files from InstallShield installers")
1972 (description
1973 "@command{unshield} is a tool and library for extracting @file{.cab}
1974 archives from InstallShield installers.")
1975 (license license:expat)))
1976
1977(define-public zstd
1978 (package
1979 (name "zstd")
1980 (version "1.5.6")
1981 (source
1982 (origin
1983 (method url-fetch)
1984 (uri (string-append "https://github.com/facebook/zstd/releases/download/"
1985 "v" version "/zstd-" version ".tar.gz"))
1986 (sha256
1987 (base32 "1h83si7s70jy7mcy0mv1c9mbkz66qqpawxs0zkmc3b1ayinf0acc"))))
1988 (build-system gnu-build-system)
1989 (outputs '("out" ;1.5MiB executables and documentation
1990 "lib" ;1.2MiB shared library and headers
1991 "static")) ;1.2MiB static library
1992 (arguments
1993 (list #:phases
1994 #~(modify-phases %standard-phases
1995 (add-after 'unpack 'patch-command-file-names
1996 ;; Don't require hard requirements to be in $PATH.
1997 (lambda _
1998 (let* ((our (lambda (name) (string-append #$output "/bin/" name))))
1999 (substitute* "programs/zstdgrep"
2000 (("(:-)(grep)" _ prefix command)
2001 (string-append prefix (which command)))
2002 (("(:-)(zstdcat)" _ prefix command)
2003 (string-append prefix (our command))))
2004 (substitute* "programs/zstdless"
2005 (("zstdcat" command)
2006 (our command))))))
2007 (delete 'configure) ;no configure script
2008 (add-after 'install 'adjust-library-locations
2009 (lambda _
2010 (let* ((out #$output)
2011 (lib #$output:lib)
2012 (static #$output:static)
2013 (shared-libs (string-append lib "/lib"))
2014 (static-libs (string-append static "/lib")))
2015 (mkdir-p static-libs)
2016 ;; This is based on the win64 release zip file from zstd.
2017 #$@(if (target-mingw?)
2018 #~((for-each delete-file (find-files out "\\.so"))
2019 (for-each delete-file (find-files shared-libs "\\.so"))
2020 (rename-file (string-append shared-libs "/libzstd.a")
2021 (string-append static-libs "/libzstd_static.lib"))
2022 (delete-file-recursively
2023 (string-append shared-libs "/pkgconfig"))
2024 ;; no binary for interpreter `sh' found in $PATH
2025 (delete-file (string-append out "/bin/zstdgrep"))
2026 (delete-file (string-append out "/bin/zstdless"))
2027 (delete-file (string-append out "/share/man/man1/zstdgrep.1"))
2028 (delete-file (string-append out "/share/man/man1/zstdless.1")))
2029 #~(;; Move the static library to its own output to save ~1MiB.
2030 (for-each (lambda (ar)
2031 (link ar (string-append static-libs "/"
2032 (basename ar)))
2033 (delete-file ar))
2034 (find-files shared-libs "\\.a$"))
2035
2036 ;; Make sure the pkg-config file refers to the right output.
2037 (substitute* (string-append shared-libs "/pkgconfig/libzstd.pc")
2038 (("^prefix=.*")
2039 ;; Note: The .pc file expects a trailing slash for 'prefix'.
2040 (string-append "prefix=" lib "/\n")))))))))
2041 #:make-flags
2042 #~(list (string-append "CC=" #$(cc-for-target))
2043 (string-append "prefix=" #$output)
2044 (string-append "libdir=" #$output:lib "/lib")
2045 (string-append "includedir=" #$output:lib "/include")
2046 #$@(if (target-mingw?)
2047 `(;; See the note in the Makefile.
2048 "TARGET_SYSTEM=Windows"
2049 ;; Don't try to link with pthread.
2050 "THREAD_LD="
2051 ;; This isn't picked up correctly in the Makefiles.
2052 "EXT=.exe")
2053 '())
2054 ;; Auto-detection is over-engineered and buggy.
2055 "PCLIBDIR=lib"
2056 "PCINCDIR=include"
2057 ;; Skip auto-detection of, and creating a dependency on, the build
2058 ;; environment's ‘xz’ for what amounts to a dubious feature anyway.
2059 "HAVE_LZMA=0"
2060 ;; Not currently detected, but be explicit & avoid surprises later.
2061 "HAVE_LZ4=0"
2062 "HAVE_ZLIB=0")
2063 #:tests? (not (or (target-hurd?)
2064 (%current-target-system)))))
2065 (home-page "https://facebook.github.io/zstd/")
2066 (synopsis "Zstandard real-time compression algorithm")
2067 (description "Zstandard (@command{zstd}) is a lossless compression algorithm
2068that combines very fast operation with a compression ratio comparable to that of
2069zlib. In most scenarios, both compression and decompression can be performed in
2070‘real time’. The compressor can be configured to provide the most suitable
2071trade-off between compression ratio and speed, without affecting decompression
2072speed.")
2073 (license (list license:bsd-3 ; the main top-level LICENSE file
2074 license:bsd-2 ; many files explicitly state 2-Clause
2075 license:gpl2 ; the main top-level COPYING file
2076 license:gpl3+ ; tests/gzip/*.sh
2077 license:expat ; lib/dictBuilder/divsufsort.[ch]
2078 license:public-domain ; zlibWrapper/examples/fitblk*
2079 license:zlib)))) ; zlibWrapper/{gz*.c,gzguts.h}
2080
2081(define-public zstd-1.5.7
2082 (package
2083 (inherit zstd)
2084 ;; Don't hide this package from the UI.
2085 (properties '())
2086 (version "1.5.7")
2087 (source
2088 (origin
2089 (method url-fetch)
2090 (uri (string-append "https://github.com/facebook/zstd/releases/download/"
2091 "v" version "/zstd-" version ".tar.gz"))
2092 (sha256
2093 (base32 "18vgkvh7w6zw4jn2aj1mp0yv98m4fk52ay6da0wh4pm194gyaczb"))))))
2094
2095(define-public pzstd
2096 (package/inherit zstd-1.5.7
2097 (name "pzstd")
2098 (outputs '("out"))
2099 (inputs
2100 `(,@(if (%current-target-system)
2101 `(("googletest" ,googletest-1.8))
2102 '())))
2103 (native-inputs
2104 `(,@(if (%current-system)
2105 `(("googletest" ,googletest-1.8))
2106 '())))
2107 (arguments
2108 `(#:phases
2109 (modify-phases %standard-phases
2110 (add-after 'unpack 'enter-subdirectory
2111 (lambda _ (chdir "contrib/pzstd") #t))
2112 (delete 'configure) ; no configure script
2113 (add-before 'check 'compile-tests
2114 (lambda* (#:key make-flags #:allow-other-keys)
2115 (apply invoke "make" "tests" make-flags)))
2116 (add-after 'install 'install-documentation
2117 (lambda* (#:key outputs #:allow-other-keys)
2118 (let* ((out (assoc-ref outputs "out"))
2119 (doc (string-append out "/share/doc/" ,name)))
2120 (mkdir-p doc)
2121 (install-file "README.md" doc)
2122 #t))))
2123 #:make-flags
2124 (list (string-append "CC=" ,(cc-for-target))
2125 (string-append "CXX=" ,(cxx-for-target))
2126 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
2127 (home-page (package-home-page zstd))
2128 (synopsis "Threaded implementation of the Zstandard compression algorithm")
2129 (description "Parallel Zstandard (PZstandard or @command{pzstd}) is a
2130multi-threaded implementation of the @uref{http://zstd.net/, Zstandard
2131compression algorithm}. It is fully compatible with the original Zstandard file
2132format and command-line interface, and can be used as a drop-in replacement.
2133
2134Compression is distributed over multiple processor cores to improve performance,
2135as is the decompression of data compressed in this manner. Data compressed by
2136other implementations will only be decompressed by two threads: one performing
2137the actual decompression, the other input and output.")
2138 (license (package-license zstd))))
2139
2140(define-public zip
2141 (package
2142 (name "zip")
2143 (version "3.0")
2144 (source
2145 (origin
2146 (method url-fetch)
2147 (uri (string-append "mirror://sourceforge/infozip"
2148 "/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz"))
2149 (sha256
2150 (base32
2151 "0sb3h3067pzf3a7mlxn1hikpcjrsvycjcnj9hl9b1c3ykcgvps7h"))))
2152 (build-system gnu-build-system)
2153 (inputs (list bzip2))
2154 (arguments
2155 `(#:tests? #f ; no test target
2156 #:make-flags (let ((out (assoc-ref %outputs "out")))
2157 (list "-f" "unix/Makefile"
2158 "CC=gcc -Wno-error=implicit-function-declaration"
2159 (string-append "prefix=" out)
2160 (string-append "MANDIR=" out "/share/man/man1")))
2161 #:phases
2162 (modify-phases %standard-phases
2163 (replace 'build
2164 (lambda* (#:key (make-flags '()) #:allow-other-keys)
2165 (apply invoke "make" "generic" make-flags)))
2166 (delete 'configure))))
2167 (home-page "http://www.info-zip.org/Zip.html")
2168 (synopsis "Compression and file packing utility")
2169 (description
2170 "Zip is a compression and file packaging/archive utility. Zip is useful
2171for packaging a set of files for distribution, for archiving files, and for
2172saving disk space by temporarily compressing unused files or directories.
2173Zip puts one or more compressed files into a single ZIP archive, along with
2174information about the files (name, path, date, time of last modification,
2175protection, and check information to verify file integrity). An entire
2176directory structure can be packed into a ZIP archive with a single command.
2177
2178Zip has one compression method (deflation) and can also store files without
2179compression. Zip automatically chooses the better of the two for each file.
2180Compression ratios of 2:1 to 3:1 are common for text files.")
2181 (license (license:non-copyleft "file://LICENSE"
2182 "See LICENSE in the distribution."))))
2183
2184(define-public unzip
2185 (package (inherit zip)
2186 (name "unzip")
2187 (version "6.0")
2188 (source
2189 (origin
2190 (method url-fetch)
2191 (uri (string-append "mirror://sourceforge/infozip"
2192 "/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz"))
2193 (sha256
2194 (base32
2195 "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83"))
2196 (patches (search-patches "unzip-CVE-2014-8139.patch"
2197 "unzip-CVE-2014-8140.patch"
2198 "unzip-CVE-2014-8141.patch"
2199 "unzip-CVE-2014-9636.patch"
2200 "unzip-CVE-2015-7696.patch"
2201 "unzip-CVE-2015-7697.patch"
2202 "unzip-allow-greater-hostver-values.patch"
2203 "unzip-initialize-symlink-flag.patch"
2204 "unzip-remove-build-date.patch"
2205 "unzip-attribs-overflow.patch"
2206 "unzip-overflow-on-invalid-input.patch"
2207 "unzip-format-secure.patch"
2208 "unzip-overflow-long-fsize.patch"
2209
2210 ;; From Fedora
2211 "unzip-alt-iconv-utf8.patch"
2212 "unzip-alt-iconv-utf8-print.patch"
2213 "unzip-fix-recmatch.patch"
2214 "unzip-case-insensitive.patch"
2215 "unzip-close.patch"
2216 "unzip-COVSCAN-fix-unterminated-string.patch"
2217 "unzip-CVE-2016-9844.patch"
2218 "unzip-CVE-2018-1000035.patch"
2219 "unzip-CVE-2018-18384.patch"
2220 "unzip-exec-shield.patch"
2221 "unzip-manpage-fix.patch"
2222 "unzip-overflow.patch"
2223 "unzip-timestamp.patch"
2224 "unzip-valgrind.patch"
2225 "unzip-x-option.patch"
2226 ;; CVE-2019-13232
2227 "unzip-zipbomb-manpage.patch"
2228 "unzip-zipbomb-part1.patch"
2229 "unzip-zipbomb-part2.patch"
2230 "unzip-zipbomb-part3.patch"
2231
2232 ;; https://github.com/madler/unzip/issues/2
2233 "unzip-32bit-zipbomb-fix.patch"
2234
2235 "unzip-CVE-2022-0529+CVE-2022-0530.patch"))))
2236 (build-system gnu-build-system)
2237 ;; no inputs; bzip2 is not supported, since not compiled with BZ_NO_STDIO
2238 (arguments
2239 (list #:phases
2240 #~(modify-phases %standard-phases
2241 (delete 'configure)
2242 (add-after 'unpack 'fortify
2243 (lambda _
2244 ;; Mitigate CVE-2018-1000035, an exploitable buffer overflow.
2245 ;; This environment variable is recommended in 'unix/Makefile'
2246 ;; for passing flags to the C compiler.
2247 (setenv "LOCAL_UNZIP" "-D_FORTIFY_SOURCE=1")
2248 #t))
2249 (replace 'build
2250 (lambda* (#:key make-flags #:allow-other-keys)
2251 (apply invoke "make"
2252 `("-j" ,(number->string
2253 (parallel-job-count))
2254 ,@make-flags
2255 "generic")))))
2256 #:make-flags
2257 ;; Fix cross-compilation without affecting native builds, as doing so
2258 ;; would trigger too many rebuilds: https://issues.guix.gnu.org/57127
2259 (if (%current-target-system)
2260 #~(list "-f" "unix/Makefile"
2261 "CC=gcc -Wno-error=implicit-function-declaration"
2262 (string-append "prefix=" #$output)
2263 (string-append "MANDIR=" #$output "/share/man/man1"))
2264 #~(list "-f" "unix/Makefile"
2265 "CC=gcc -Wno-error=implicit-function-declaration"
2266 (string-append "prefix=" %output)
2267 (string-append "MANDIR=" %output "/share/man/man1")))))
2268 (home-page "http://www.info-zip.org/UnZip.html")
2269 (synopsis "Decompression and file extraction utility")
2270 (description
2271 "UnZip is an extraction utility for archives compressed in .zip format,
2272also called \"zipfiles\".
2273
2274UnZip lists, tests, or extracts files from a .zip archive. The default
2275behaviour (with no options) is to extract into the current directory, and
2276subdirectories below it, all files from the specified zipfile. UnZip
2277recreates the stored directory structure by default.")
2278 (properties `((lint-hidden-cve . ("CVE-2019-13232"))))
2279 (license (license:non-copyleft "file://LICENSE"
2280 "See LICENSE in the distribution."))))
2281
2282(define-public ziptime
2283 (let ((commit "2a5bc9dfbf7c6a80e5f7cb4dd05b4036741478bc")
2284 (revision "0"))
2285 (package
2286 (name "ziptime")
2287 (version (git-version "0.0.0" revision commit))
2288 (source
2289 (origin
2290 (method git-fetch)
2291 (uri (git-reference
2292 (url "https://android.googlesource.com/platform/build")
2293 (commit commit)))
2294 (file-name (git-file-name name version))
2295 (sha256
2296 (base32 "0hrn61b3a97dlc4iqc28rwx8k8zf7ycbwzqqp93vj34zy5a541kn"))))
2297 (build-system gnu-build-system)
2298 (arguments
2299 `(#:tests? #f ; no test suite
2300 #:phases
2301 (modify-phases %standard-phases
2302 (add-after 'unpack 'change-directory
2303 (lambda _
2304 (chdir "tools/ziptime")))
2305 (delete 'configure) ; nothing to configure
2306 (replace 'build
2307 ;; There is no Makefile, only an ‘Android.bp’ file. Ignore it.
2308 (lambda _
2309 (let ((c++ ,(cxx-for-target)))
2310 (apply invoke c++ "-O2" "-o" "ziptime"
2311 (find-files "." "\\.cpp$")))))
2312 (replace 'install
2313 (lambda* (#:key outputs #:allow-other-keys)
2314 (let* ((out (assoc-ref outputs "out"))
2315 (bin (string-append out "/bin"))
2316 (doc (string-append out "/share/doc/" ,name "-" ,version)))
2317 (install-file "ziptime" bin)
2318 (install-file "README.txt" doc)))))))
2319 ;; There is no separate home page for this tiny bundled build tool.
2320 (home-page (string-append "https://android.googlesource.com/platform/build/"
2321 "+/master/tools/ziptime/README.txt"))
2322 (synopsis "Normalize @file{.zip} archive header timestamps")
2323 (description
2324 "Ziptime helps make @file{.zip} archives reproducible by replacing
2325timestamps in the file header with a fixed time (1 January 2008).
2326
2327``Extra fields'' are not changed, so you'll need to use the @code{-X} option to
2328@command{zip} to prevent it from storing the ``universal time'' field.")
2329 (license license:asl2.0))))
2330
2331(define-public zziplib
2332 (package
2333 (name "zziplib")
2334 (version "0.13.78")
2335 (home-page "https://github.com/gdraheim/zziplib")
2336 (source (origin
2337 (method git-fetch)
2338 (uri (git-reference (url home-page)
2339 (commit (string-append "v" version))))
2340 (file-name (git-file-name name version))
2341 (sha256
2342 (base32
2343 "18578xbzj8j89srv4bwayjm11bg56fl34sya0znq4fwq3apm037i"))))
2344 (build-system cmake-build-system)
2345 (arguments
2346 (list
2347 #:modules '((guix build cmake-build-system)
2348 ((guix build gnu-build-system) #:prefix gnu:)
2349 (guix build utils))
2350 #:phases
2351 #~(modify-phases %standard-phases
2352 ;; Avoid the integration test, which requires a system bus.
2353 (replace 'check (assoc-ref gnu:%standard-phases 'check)))))
2354 (inputs
2355 (list zlib))
2356 (native-inputs (list perl ; for the documentation
2357 pkg-config python zip)) ; to create test files
2358 (synopsis "Library for accessing zip files")
2359 (description
2360 "ZZipLib is a library based on zlib for accessing zip files.")
2361 ;; zziplib is dual licensed under LGPL2.0+ and MPL1.1. Some example source
2362 ;; files carry the Zlib license; see "docs/copying.html" for details.
2363 (license (list license:lgpl2.0+ license:mpl1.1))))
2364
2365(define-public libzip
2366 (package
2367 (name "libzip")
2368 (version "1.9.2")
2369 (source (origin
2370 (method url-fetch)
2371 (uri (string-append
2372 "https://libzip.org/download/libzip-" version ".tar.xz"))
2373 (sha256
2374 (base32
2375 "0dsrpb1faywhm0j8akx21gp7cn99wpz3h543jw8r7p5jnx99hgn9"))))
2376 (native-inputs
2377 (list perl pkg-config))
2378 (inputs
2379 (list gnutls xz openssl zlib
2380 `(,zstd "lib")))
2381 (build-system cmake-build-system)
2382 (home-page "https://libzip.org")
2383 (synopsis "C library for reading, creating, and modifying zip archives")
2384 (description "Libzip is a C library for reading, creating, and modifying
2385zip archives. Files can be added from data buffers, files, or compressed data
2386copied directly from other zip archives. Changes made without closing the
2387archive can be reverted.")
2388 (license license:bsd-3)))
2389
2390(define-public atool
2391 (package
2392 (name "atool")
2393 (version "0.39.0")
2394 (source
2395 (origin
2396 (method url-fetch)
2397 (uri (string-append "mirror://savannah/atool/atool-"
2398 version ".tar.gz"))
2399 (sha256
2400 (base32
2401 "0fvhzip2v08jgnlfpyj6rapan39xlsl1ksgq4lp8gfsai2ah1xma"))))
2402 (build-system gnu-build-system)
2403 (arguments
2404 `(#:phases
2405 (modify-phases %standard-phases
2406 (add-after 'unpack 'embed-absolute-file-name
2407 (lambda* (#:key inputs #:allow-other-keys)
2408 (substitute* "atool"
2409 (("(^\\$::cfg_path_file.*= )'file'" _ pre)
2410 (string-append pre "'" (assoc-ref inputs "file")
2411 "/bin/file'")))
2412 #t)))))
2413 (inputs
2414 (list perl file))
2415 (home-page "https://www.nongnu.org/atool/")
2416 (synopsis "Universal tool to manage file archives of various types")
2417 (description "The main command is @command{aunpack} which extracts files
2418from an archive. The other commands provided are @command{apack} (to create
2419archives), @command{als} (to list files in archives), and @command{acat} (to
2420extract files to standard out). As @command{atool} invokes external programs
2421to handle the archives, not all commands may be supported for a certain type
2422of archives.")
2423 (license license:gpl2+)))
2424
2425(define-public lunzip
2426 (package
2427 (name "lunzip")
2428 (version "1.13")
2429 (source
2430 (origin
2431 (method url-fetch)
2432 (uri (string-append "mirror://savannah/lzip/lunzip/"
2433 "lunzip-" version ".tar.gz"))
2434 (sha256
2435 (base32 "153qa674rlbw812fb7h8rfzdw4hvr6vgkjl1c0yfplj7p4h86z9w"))))
2436 (build-system gnu-build-system)
2437 (arguments
2438 `(#:configure-flags
2439 (list ,(string-append "CC=" (cc-for-target)))))
2440 (home-page "https://www.nongnu.org/lzip/lunzip.html")
2441 (synopsis "Small, stand-alone lzip decompressor")
2442 (description
2443 "Lunzip is a decompressor for files in the lzip compression format (.lz),
2444written as a single small C tool with no dependencies. This makes it
2445well-suited to embedded and other systems without a C++ compiler, or for use in
2446applications such as software installers that need only to decompress files,
2447not compress them.
2448Lunzip is intended to be fully compatible with the regular lzip package.")
2449 (license (list license:bsd-2 ; carg_parser.[ch]
2450 license:gpl2+)))) ; everything else
2451
2452(define-public clzip
2453 (package
2454 (name "clzip")
2455 (version "1.14")
2456 (source
2457 (origin
2458 (method url-fetch)
2459 (uri (string-append "mirror://savannah/lzip/clzip/"
2460 "clzip-" version ".tar.gz"))
2461 (sha256
2462 (base32 "0wrd2s5lqxd3mjqby9isc6mpk4vyd2wbksbryrzy0bw3bcjf2gzn"))))
2463 (build-system gnu-build-system)
2464 (arguments
2465 (list #:configure-flags
2466 #~(list (string-append "CC=" #$(cc-for-target)))))
2467 (home-page "https://www.nongnu.org/lzip/clzip.html")
2468 (synopsis "Small, stand-alone lzip compressor and decompressor")
2469 (description
2470 "Clzip is a compressor and decompressor for files in the lzip compression
2471format (.lz), written as a single small C tool with no dependencies. This makes
2472it well-suited to embedded and other systems without a C++ compiler, or for use
2473in other applications like package managers.
2474Clzip is intended to be fully compatible with the regular lzip package.")
2475 (license (list license:bsd-2 ; carg_parser.[ch], lzd in clzip.texi
2476 license:gpl2+))))
2477
2478(define-public lzlib
2479 (package
2480 (name "lzlib")
2481 (version "1.13")
2482 (source
2483 (origin
2484 (method url-fetch)
2485 (uri (string-append "mirror://savannah/lzip/lzlib/"
2486 "lzlib-" version ".tar.gz"))
2487 (sha256
2488 (base32 "107vkzfgvb21cqq4gmxyfn97l4s2c0b3i14k9rkv594b2krmiax1"))))
2489 (build-system gnu-build-system)
2490 (arguments
2491 `(#:configure-flags
2492 (list (string-append "CC=" ,(cc-for-target))
2493 "--disable-static"
2494 "--enable-shared"))) ; only static (.a) is built by default
2495 (home-page "https://www.nongnu.org/lzip/lzlib.html")
2496 (synopsis "Lzip data compression C library")
2497 (description
2498 "Lzlib is a C library for in-memory LZMA compression and decompression in
2499the lzip format. It supports integrity checking of the decompressed data, and
2500all functions are thread-safe. The library should never crash, even in case of
2501corrupted input.")
2502 (license (list license:bsd-2 ; the library itself
2503 license:gpl2+)))) ; main.c (i.e. minilzip used by tests)
2504
2505(define-public plzip
2506 (package
2507 (name "plzip")
2508 (version "1.12")
2509 (source
2510 (origin
2511 (method url-fetch)
2512 (uri (string-append "mirror://savannah/lzip/plzip/"
2513 "plzip-" version ".tar.gz"))
2514 (sha256
2515 (base32 "0c5fmp7hkb41ybc5gmrj96xz7g74mmpfhya2ha6asm51dynimmsh"))))
2516 (build-system gnu-build-system)
2517 (arguments
2518 (list #:configure-flags
2519 #~(list (string-append "CXX=" #$(cxx-for-target)))))
2520 (inputs
2521 (list lzlib))
2522 (home-page "https://www.nongnu.org/lzip/plzip.html")
2523 (synopsis "Parallel lossless data compressor for the lzip format")
2524 (description
2525 "Plzip is a massively parallel (multi-threaded) lossless data compressor
2526and decompressor that uses the lzip file format (.lz). Files produced by plzip
2527are fully compatible with lzip and can be rescued with lziprecover.
2528On multiprocessor machines, plzip can compress and decompress large files much
2529faster than lzip, at the cost of a slightly reduced compression ratio (0.4% to
25302%). The number of usable threads is limited by file size: on files of only a
2531few MiB, plzip is no faster than lzip.
2532Files that were compressed with regular lzip will also not be decompressed
2533faster by plzip, unless the @code{-b} option was used: lzip usually produces
2534single-member files which can't be decompressed in parallel.")
2535 (license (list license:bsd-2 ; arg_parser.{cc,h}
2536 license:gpl2+)))) ; everything else
2537
2538(define-public innoextract
2539 (package
2540 (name "innoextract")
2541 (version "1.9")
2542 (source
2543 (origin
2544 (method url-fetch)
2545 (uri (string-append "https://constexpr.org/innoextract/files/"
2546 "innoextract-" version "/"
2547 "/innoextract-" version ".tar.gz"))
2548 (sha256
2549 (base32 "09l1z1nbl6ijqqwszdwch9mqr54qb7df0wp2sd77v17dq6gsci33"))))
2550 (build-system cmake-build-system)
2551 (arguments
2552 `(#:tests? #f))
2553 (inputs (list boost-1.83 xz))
2554 (native-inputs (list pkg-config))
2555 (home-page "https://constexpr.org/innoextract/")
2556 (synopsis "Tool for extracting Inno Setup installers")
2557 (description "innoextract allows extracting Inno Setup installers under
2558non-Windows systems without running the actual installer using wine.")
2559 (license license:zlib)))
2560
2561(define-public isa-l
2562 (package
2563 (name "isa-l")
2564 (version "2.31.1")
2565 (source
2566 (origin
2567 (method git-fetch)
2568 (uri (git-reference
2569 (url "https://github.com/intel/isa-l")
2570 (commit (string-append "v" version))))
2571 (file-name (git-file-name name version))
2572 (sha256
2573 (base32 "17k679glx05v23n8kxbg9vmbf89i2252g5xj6w3dkz19asmh1zd6"))))
2574 (build-system gnu-build-system)
2575 (native-inputs
2576 (cons* autoconf automake libtool
2577 (maybe-nasm)))
2578 (home-page "https://github.com/intel/isa-l")
2579 (synopsis "Intelligent storage acceleration library")
2580 (description "ISA-L is a collection of optimized low-level functions
2581targeting storage applications. ISA-L includes:
2582
2583@itemize
2584@item Erasure codes: fast block Reed-Solomon type erasure codes for any
2585 encode/decode matrix;
2586@item CRC: fast implementations of cyclic redundancy check. Six different
2587 polynomials supported: iscsi32, ieee32, t10dif, ecma64, iso64, jones64;
2588@item Raid: calculate and operate on XOR and P+Q parity found in common RAID
2589 implementations;
2590@item Compression: fast deflate-compatible data compression;
2591@item De-compression: fast inflate-compatible data compression;
2592@item igzip: command line application like gzip, accelerated with ISA-L.
2593@end itemize
2594")
2595 (license license:bsd-3)))
2596
2597(define-public brotli
2598 (package
2599 (name "brotli")
2600 (version "1.2.0")
2601 (source
2602 (origin
2603 (method git-fetch)
2604 (uri (git-reference
2605 (url "https://github.com/google/brotli")
2606 (commit (string-append "v" version))))
2607 (file-name (git-file-name name version))
2608 (sha256
2609 (base32 "0vv7r7m7m6hqhbwb017s4rvc378mjxxvigg37r76imsqlyafbxvq"))))
2610 (build-system cmake-build-system)
2611 (home-page "https://github.com/google/brotli")
2612 (synopsis "General-purpose lossless compression")
2613 (description "This package provides the reference implementation of Brotli,
2614a generic-purpose lossless compression algorithm that compresses data using a
2615combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd
2616order context modeling, with a compression ratio comparable to the best
2617currently available general-purpose compression methods. It is similar in speed
2618with @code{deflate} but offers more dense compression.
2619
2620The specification of the Brotli Compressed Data Format is defined in RFC 7932.")
2621 (license license:expat)))
2622
2623(define-public java-brotli
2624 (package
2625 (inherit brotli)
2626 (name "java-brotli")
2627 (build-system ant-build-system)
2628 (arguments
2629 `(#:jar-name "java-brotli.jar"
2630 #:source-dir "java"
2631 ;; Tests are mixed in with java sources, the ant build system
2632 ;; doesn't allow that
2633 #:tests? #f
2634 #:phases (modify-phases %standard-phases
2635 (add-after 'unpack 'drop-android-wrapper
2636 (lambda _
2637 (delete-file-recursively
2638 "java/org/brotli/wrapper/android"))))))
2639 (native-inputs (list java-junit))))
2640
2641(define-public ucl
2642 (package
2643 (name "ucl")
2644 (version "1.03")
2645 (source (origin
2646 (method url-fetch)
2647 (uri (string-append "https://www.oberhumer.com/opensource/"
2648 name "/download/" name "-" version ".tar.gz"))
2649 (sha256
2650 (base32
2651 "0j036lkwsxvm15gr29n8wn07cqq79dswjs9k54939ms5zngjjrdq"))))
2652 (build-system gnu-build-system)
2653 (arguments
2654 `(;; UCL 1.03 fails to build with newer C standards.
2655 #:configure-flags '("CFLAGS=-std=gnu90"
2656 "--enable-shared" "--disable-static")))
2657 (home-page "https://www.oberhumer.com/opensource/ucl/")
2658 (synopsis "Portable lossless data compression library")
2659 (description "UCL implements a number of compression algorithms that
2660achieve an excellent compression ratio while allowing fast decompression.
2661Decompression requires no additional memory.
2662
2663Compared to LZO, the UCL algorithms achieve a better compression ratio but
2664decompression is a little bit slower.")
2665 (license license:gpl2+)))
2666
2667(define-public upx
2668 (package
2669 (name "upx")
2670 (version "5.2.0")
2671 (source
2672 (origin
2673 (method url-fetch)
2674 (uri (string-append "https://github.com/upx/upx/releases/download/v"
2675 version "/upx-" version "-src.tar.xz"))
2676 (sha256
2677 (base32 "076fq4yq97nc7rizi5ajfb5hd92cbr6i18df292fk7bmslkfb6dg"))))
2678 (build-system cmake-build-system)
2679 (arguments
2680 (list #:build-type "Release"))
2681 (home-page "https://upx.github.io/")
2682 (synopsis "Compression tool for executables")
2683 (description
2684 "The Ultimate Packer for eXecutables (UPX) is an executable file
2685compressor. UPX typically reduces the file size of programs and shared
2686libraries by around 50%--70%, thus reducing disk space, network load times,
2687download times, and other distribution and storage costs.")
2688 ;; These CVEs have been fixed since 4.0.2 but are still linted.
2689 (properties `((lint-hidden-cve . ("CVE-2023-23456" "CVE-2023-23457"))))
2690 (license license:gpl2+)))
2691
2692(define-public qatzip
2693 (package
2694 (name "qatzip")
2695 (version "1.3.1")
2696 (source (origin
2697 (method git-fetch)
2698 (uri (git-reference
2699 (url "https://github.com/intel/QATzip")
2700 (commit (string-append "v" version))))
2701 (file-name (git-file-name name version))
2702 (sha256
2703 (base32
2704 "0c7kph69cf48gr97j3gzh1zwd58wxmp64vfv34z4r9ixj3lh6ziz"))))
2705 (build-system gnu-build-system)
2706 (arguments
2707 (list #:phases
2708 #~(modify-phases %standard-phases
2709 (replace 'bootstrap
2710 (lambda _
2711 ;; The script has a broken shebang (see:
2712 ;; <https://github.com/intel/QATzip/issues/143>).
2713 (invoke "sh" "autogen.sh"))))))
2714 (native-inputs (list autoconf automake libtool))
2715 (inputs (list numactl qatlib))
2716 (propagated-inputs (list lz4 zlib)) ;in Requires of qatzip.pc
2717 (home-page "https://github.com/intel/QATzip")
2718 (synopsis "Compression Library accelerated by Intel QuickAssist Technology")
2719 (description "QATzip is a library which builds on top of the
2720 Intel QuickAssist Technology user space library, to provide extended
2721accelerated compression and decompression services by offloading the actual
2722compression and decompression request(s) to the Intel Chipset Series. QATzip
2723produces data using the standard gzip format (RFC1952) with extended headers
2724or lz4 blocks with lz4 frame format. The data can be decompressed with a
2725compliant gzip or lz4 implementation. QATzip is designed to take full
2726advantage of the performance provided by Intel QuickAssist Technology.")
2727 (license license:bsd-3)
2728 ;; This package only supports hardware that exists on the x86_64 platform,
2729 ;; and is not portable.
2730 (supported-systems (list "x86_64-linux"))))
2731
2732(define-public quazip
2733 (package
2734 (name "quazip")
2735 ;; When updating, change also the version in quazip-qt5,
2736 ;; which shares the same source.
2737 (version "1.5")
2738 (source
2739 (origin
2740 (method git-fetch)
2741 (uri (git-reference
2742 (url "https://github.com/stachenov/quazip")
2743 (commit (string-append "v" version))))
2744 (file-name (git-file-name name version))
2745 (sha256
2746 (base32 "0ni1656g2xf0cspwjp645hhd2p4iaqki4z26xhkxz04l5nzsdrh0"))))
2747 (build-system cmake-build-system)
2748 (arguments
2749 `(#:tests? #f)) ;no test
2750 (native-inputs
2751 (list doxygen))
2752 (inputs
2753 (list qtbase qt5compat zlib))
2754 (home-page "https://stachenov.github.io/quazip/index.html")
2755 (synopsis "Qt/C++ wrapper for Minizip")
2756 (description "QuaZIP is a simple C++ wrapper over Gilles Vollant's
2757ZIP/UNZIP package that can be used to access ZIP archives. It uses
2758Trolltech's Qt toolkit.
2759
2760QuaZIP allows you to access files inside ZIP archives using QIODevice
2761API, and that means that you can also use QTextStream, QDataStream or
2762whatever you would like to use on your zipped files.
2763
2764QuaZIP provides complete abstraction of the ZIP/UNZIP API, for both
2765reading from and writing to ZIP archives.")
2766 ;; Project is distributed under LGPL, but "quazip/z*" "quazip/unzip.*" are
2767 ;; distributed under zlib terms.
2768 (license (list license:lgpl2.1+ license:zlib))))
2769
2770(define-public quazip-5
2771 (package
2772 (inherit quazip)
2773 (name "quazip-qt5")
2774 (version "1.5")
2775 (inputs (list qtbase-5 zlib))))
2776
2777(define-public zchunk
2778 (package
2779 (name "zchunk")
2780 (version "1.5.1")
2781 (source (origin
2782 (method git-fetch)
2783 (uri (git-reference
2784 (url "https://github.com/zchunk/zchunk")
2785 (commit version)))
2786 (file-name (git-file-name name version))
2787 (sha256
2788 (base32
2789 "08ngp6d54fllk19qhdz6r1s9832781g322gn7524akbr3v1v5jjz"))))
2790 (build-system meson-build-system)
2791 (arguments
2792 (list
2793 #:phases
2794 #~(modify-phases %standard-phases
2795 (add-after 'unpack 'patch-file-name
2796 (lambda* (#:key inputs #:allow-other-keys)
2797 (substitute* "src/zck_gen_zdict.c"
2798 (("/usr/(bin/zstd)" _ file)
2799 (string-append (search-input-file inputs file)))))))))
2800 (native-inputs
2801 (list pkg-config))
2802 (inputs
2803 (list curl zstd))
2804 (propagated-inputs
2805 (list `(,zstd "lib"))) ; in Requires.private of zck.pc
2806 (home-page "https://github.com/zchunk/zchunk")
2807 (synopsis "Compressed file format for efficient deltas")
2808 (description "The zchunk compressed file format allows splitting a file
2809into independent chunks. This makes it possible to retrieve only changed
2810chunks when downloading a new version of the file, and also makes zchunk files
2811efficient over rsync. Along with the library, this package provides the
2812following utilities:
2813@table @command
2814@item unzck
2815To decompress a zchunk file.
2816@item zck
2817To compress a new zchunk file, or re-compress an existing one.
2818@item zck_delta_size
2819To calculate the difference between two zchunk files.
2820@item zck_gen_zdict
2821To create a dictionary for a zchunk file.
2822@item zck_read_header
2823To read a zchunk header.
2824@item zckdl
2825To download a zchunk file.
2826@end table")
2827 (license license:bsd-2)))
2828
2829(define-public zutils
2830 (package
2831 (name "zutils")
2832 (version "1.12")
2833 (source
2834 (origin
2835 (method url-fetch)
2836 (uri (string-append "mirror://savannah/zutils/zutils-" version ".tar.lz"))
2837 (sha256
2838 (base32 "1vl8mhvsl0zlh34hwhc05vj33a2xfr0w7i978hcwaw8wn1w59bkq"))))
2839 (build-system gnu-build-system)
2840 (arguments
2841 (list
2842 #:configure-flags
2843 #~(list "--sysconfdir=/etc")
2844 #:phases
2845 #~(modify-phases %standard-phases
2846 (replace 'install
2847 (lambda* (#:key make-flags #:allow-other-keys)
2848 (apply invoke "make" "install"
2849 (string-append "sysconfdir=" #$output "/etc")
2850 make-flags))))))
2851 (native-inputs
2852 ;; Needed to extract the source tarball and run the test suite.
2853 (list lzip))
2854 (home-page "https://www.nongnu.org/zutils/zutils.html")
2855 (synopsis "Utilities that transparently operate on compressed files")
2856 (description
2857 "Zutils is a collection of utilities able to process any combination of
2858compressed and uncompressed files transparently. If any given file, including
2859standard input, is compressed, its decompressed content is used instead.
2860
2861@command{zcat}, @command{zcmp}, @command{zdiff}, and @command{zgrep} are
2862improved replacements for the shell scripts provided by GNU gzip.
2863@command{ztest} tests the integrity of supported compressed files.
2864@command{zupdate} recompresses files with lzip, similar to gzip's
2865@command{znew}.
2866
2867Supported compression formats are bzip2, gzip, lzip, and xz. Zutils uses
2868external compressors: the compressor to be used for each format is configurable
2869at run time, and must be installed separately.")
2870 (license (list license:bsd-2 ; arg_parser.{cc,h}
2871 license:gpl2+)))) ; the rest
2872
2873(define-public makeself-safeextract
2874 (let ((commit "1a95e121fa8e3c02d307ae37b9b7834e616c3683"))
2875 (package
2876 (name "makeself-safeextract")
2877 (version (git-version "0.0.0" "1" commit))
2878 (home-page "https://github.com/ssokolow/makeself_safeextract")
2879 (source
2880 (origin
2881 (method git-fetch)
2882 (uri (git-reference
2883 (url home-page)
2884 (commit commit)))
2885 (file-name (git-file-name name version))
2886 (sha256
2887 (base32
2888 "1anlinaj9lvfi8bn00wp11vzqq0f9sig4fm9yrspisx31v0z4a2c"))))
2889 (build-system trivial-build-system)
2890 (inputs
2891 `(("python" ,python-2)
2892 ("p7zip" ,p7zip)
2893 ("unzip" ,unzip)))
2894 (arguments
2895 `(#:modules ((guix build utils))
2896 #:builder
2897 (begin
2898 (use-modules (guix build utils))
2899 (let* ((name "makeself_safeextract")
2900 (source (string-append (assoc-ref %build-inputs "source")
2901 "/" name ".py"))
2902 (bin (string-append (assoc-ref %outputs "out") "/bin"))
2903 (target (string-append bin "/" name))
2904 (python (string-append (assoc-ref %build-inputs "python") "/bin"))
2905 (7z (search-input-file %build-inputs "/bin/7z"))
2906 (unzip (search-input-file %build-inputs "/bin/unzip")))
2907 (setenv "PATH" (string-append (getenv "PATH") ":" python))
2908 (mkdir-p bin)
2909 (copy-file source target)
2910 (substitute* target
2911 (("'7z'") (format #f "'~a'" 7z))
2912 (("'unzip'") (format #f "'~a'" unzip)))
2913 (patch-shebang target)))))
2914 (synopsis "Extract makeself and mojo archives without running untrusted code")
2915 (description "This package provides a script to unpack self-extracting
2916archives generated by @command{makeself} or @command{mojo} without running the
2917possibly untrusted extraction shell script.")
2918 (license license:gpl3+))))
2919
2920(define-public ncompress
2921 (package
2922 (name "ncompress")
2923 (version "5.0")
2924 (source (origin
2925 (method git-fetch)
2926 (uri (git-reference
2927 (url "https://github.com/vapier/ncompress")
2928 (commit (string-append "v" version))))
2929 (patches (search-patches "ncompress-fix-softlinks.patch"))
2930 (file-name (string-append name "-" version ".tar.gz"))
2931 (sha256
2932 (base32
2933 "090kksxrlqnsdc76fzz2j2ajc98mhmfwyn163ca2ia9niqmlpcm0"))))
2934 (arguments
2935 `(#:make-flags (list (string-append "CC=" ,(cc-for-target))
2936 (string-append "BINDIR=" %output "/bin")
2937 (string-append "MANDIR=" %output "/share/man/man1"))
2938 #:phases (modify-phases %standard-phases
2939 (delete 'configure)))) ; no configure script
2940 (build-system gnu-build-system)
2941 (home-page "https://github.com/vapier/ncompress/")
2942 (synopsis "Original Lempel-Ziv compress/uncompress programs")
2943 (description "(N)compress provides the original compress and uncompress
2944programs that used to be the de facto UNIX standard for compressing and
2945uncompressing files. These programs implement a fast, simple Lempel-Ziv (LZW)
2946file compression algorithm.")
2947 (license license:gpl2+)))
2948
2949(define-public xarchiver
2950 (package
2951 (name "xarchiver")
2952 (version "0.5.4.23")
2953 (source
2954 (origin
2955 (method git-fetch)
2956 (uri (git-reference
2957 (url "https://github.com/ib/xarchiver")
2958 (commit version)))
2959 (file-name (git-file-name name version))
2960 (sha256
2961 (base32 "0ccxp106c3r759l1bjaszz3fwlw10qzzlsd9mnmpksnlwfwjkmb8"))))
2962 (build-system glib-or-gtk-build-system)
2963 (native-inputs
2964 (list gettext-minimal intltool libxslt pkg-config))
2965 (inputs
2966 (list adwaita-icon-theme ; hard-coded theme
2967 gtk+))
2968 (home-page "https://github.com/ib/xarchiver")
2969 (synopsis "Graphical front-end for archive operations")
2970 (description "Xarchiver is a front-end to various command line archiving
2971tools. It uses GTK+ tool-kit and is designed to be desktop-environment
2972independent. Supported formats are 7z, ARJ, bzip2, gzip, LHA, lzma, lzop,
2973RAR, RPM, DEB, tar, and ZIP. It cannot perform functions for archives, whose
2974archiver is not installed.")
2975 (license license:gpl2+)))
2976
2977;; XXX: This software is abandoned since 2018. It may be removed as soon as
2978;; the build breaks; see also the discussion at #1734.
2979(define-public tarsplitter
2980 (package
2981 (name "tarsplitter")
2982 (version "2.2.0")
2983 (source (origin
2984 (method git-fetch)
2985 (uri (git-reference
2986 (url "https://github.com/AQUAOSOTech/tarsplitter")
2987 (commit (string-append "v" version))))
2988 (file-name (git-file-name name version))
2989 (sha256
2990 (base32
2991 "17qkg95r97kcrs17b0mcqswx99280ni47j5yx8xa7nl3bdhm6325"))))
2992 (build-system go-build-system)
2993 (arguments
2994 `(#:import-path "github.com/AQUAOSOTech/tarsplitter"
2995 #:install-source? #f
2996 #:phases
2997 (modify-phases %standard-phases
2998 (add-after 'install 'install-documentation
2999 (lambda* (#:key import-path outputs #:allow-other-keys)
3000 (let* ((source (string-append "src/" import-path))
3001 (out (assoc-ref outputs "out"))
3002 (doc (string-append out "/share/doc/" ,name "-" ,version)))
3003 (with-directory-excursion source
3004 (install-file "README.md" doc))
3005 #t))))))
3006 (home-page "https://github.com/AQUAOSOTech/tarsplitter")
3007 (synopsis "Multithreaded tar utility")
3008 (description
3009 "Archive huge numbers of files, or split massive tar archives into smaller
3010chunks.")
3011 (license license:expat)))
3012
3013(define-public c-blosc
3014 (package
3015 (name "c-blosc")
3016 (version "1.21.1")
3017 (source
3018 (origin
3019 (method git-fetch)
3020 (uri (git-reference
3021 (url "https://github.com/Blosc/c-blosc")
3022 (commit (string-append "v" version))))
3023 (file-name (git-file-name name version))
3024 (sha256
3025 (base32 "0gy9a7wp7x71x5l3rprx8wpb3c5cn7wqc77gdiffq35hr34q88p9"))
3026 (modules '((guix build utils)))
3027 (snippet
3028 ;; In a rare victory, we may delete all bundled libs to no ill effect.
3029 '(delete-file-recursively "internal-complibs"))))
3030 (build-system cmake-build-system)
3031 (arguments
3032 `(#:configure-flags
3033 '("-DBUILD_STATIC=OFF"
3034 "-DDEACTIVATE_AVX2=ON"
3035 "-DPREFER_EXTERNAL_LZ4=ON"
3036 "-DPREFER_EXTERNAL_ZLIB=ON"
3037 "-DPREFER_EXTERNAL_ZSTD=ON")))
3038 (inputs
3039 (list lz4 snappy zlib `(,zstd "lib")))
3040 (home-page "https://www.blosc.org/")
3041 (synopsis "Blocking, shuffling and lossless compression library")
3042 (description
3043 "Blosc is a high performance compressor optimized for binary data. It
3044has been designed to transmit data to the processor cache faster than the
3045traditional, non-compressed, direct memory fetch approach via a
3046@code{memcpy()} system call. Blosc is meant not only to reduce the size of
3047large datasets on-disk or in-memory, but also to accelerate memory-bound
3048computations.")
3049 ;; Blosc itself is released under BSD-3 but it incorporates code under
3050 ;; other non-copyleft licenses.
3051 (license license:bsd-3)))
3052
3053(define-public c-blosc2
3054 (package
3055 (name "c-blosc2")
3056 (version "2.22.0")
3057 (source (origin
3058 (method git-fetch)
3059 (uri (git-reference
3060 (url "https://github.com/Blosc/c-blosc2")
3061 (commit (string-append "v" version))))
3062 (file-name (git-file-name name version))
3063 (sha256
3064 (base32
3065 "147gkmdrqbw3knqmsj8pc2x0jqcrai81wxjj5f3jna556krpxq6i"))))
3066 (build-system cmake-build-system)
3067 (arguments
3068 (list #:parallel-tests? #f
3069 #:configure-flags #~(list "-DBUILD_STATIC=OFF"
3070 "-DDEACTIVATE_AVX2=ON"
3071 "-DDEACTIVATE_AVX512=ON"
3072 "-DPREFER_EXTERNAL_LZ4=ON"
3073 "-DPREFER_EXTERNAL_ZLIB=ON"
3074 "-DPREFER_EXTERNAL_ZSTD=ON")))
3075 (inputs (list lz4 zlib `(,zstd "lib")))
3076 (home-page "https://blosc.org")
3077 (synopsis "Blocking, shuffling and lossless compression library")
3078 (description
3079 "Blosc is a high performance compressor optimized for binary
3080data (i.e. floating point numbers, integers and booleans, although it can
3081handle string data too). It has been designed to transmit data to the
3082processor cache faster than the traditional, non-compressed, direct memory
3083fetch approach via a @code{memcpy()} system call. Blosc main goal is not just
3084to reduce the size of large datasets on-disk or in-memory, but also to
3085accelerate memory-bound computations.
3086
3087C-Blosc2 is the new major version of C-Blosc, and is backward compatible with
3088both the C-Blosc1 API and its in-memory format. However, the reverse thing is
3089generally not true for the format; buffers generated with C-Blosc2 are not
3090format-compatible with C-Blosc1 (i.e. forward compatibility is not
3091supported).")
3092 (license license:bsd-3)))
3093
3094(define-public ecm
3095 (package
3096 (name "ecm")
3097 (version "1.0.3")
3098 (source (origin
3099 (method git-fetch)
3100 (uri (git-reference
3101 (url "https://github.com/alucryd/ecm-tools")
3102 (commit (string-append "v" version))))
3103 (file-name (git-file-name name version))
3104 (sha256
3105 (base32
3106 "1rvyx5gcy8lfklgj80szlz3312x45wzx0d9jsgwyvy8f6m4nnb0c"))))
3107 (build-system gnu-build-system)
3108 (arguments
3109 `(#:tests? #f ; no check target
3110 #:make-flags
3111 (list (string-append "CC=" ,(cc-for-target))
3112 (string-append "DESTDIR=" (assoc-ref %outputs "out")))
3113 #:phases
3114 (modify-phases %standard-phases
3115 (replace 'configure
3116 (lambda _
3117 (substitute* "Makefile"
3118 (("\\$\\(DESTDIR\\)/usr") "$(DESTDIR)"))
3119 #t)))))
3120 (home-page "https://github.com/alucryd/ecm-tools")
3121 (synopsis "Error code modeler")
3122 (description "ECM is a utility that converts ECM files, i.e., CD data files
3123with their error correction data losslessly rearranged for better compression,
3124to their original, binary CD format.")
3125 (license license:gpl3+)))
3126
3127(define-public libdeflate
3128 (package
3129 (name "libdeflate")
3130 (version "1.19")
3131 (source (origin
3132 (method git-fetch)
3133 (uri (git-reference
3134 (url "https://github.com/ebiggers/libdeflate")
3135 (commit (string-append "v" version))))
3136 (file-name (git-file-name name version))
3137 (sha256
3138 (base32
3139 "033d8jcaissiy3mk07wx6dap17c1xl768xy75righ22ggmm7c1hy"))))
3140 (build-system cmake-build-system)
3141 (arguments
3142 (list #:configure-flags
3143 #~(list "-DLIBDEFLATE_BUILD_STATIC_LIB=NO"
3144 "-DLIBDEFLATE_BUILD_TESTS=YES")))
3145 (inputs
3146 (list zlib))
3147 (home-page "https://github.com/ebiggers/libdeflate")
3148 (synopsis "Library for DEFLATE/zlib/gzip compression and decompression")
3149 (description "Libdeflate is a library for fast, whole-buffer DEFLATE-based
3150compression and decompression. The supported formats are:
3151
3152@enumerate
3153@item DEFLATE (raw)
3154@item zlib (a.k.a. DEFLATE with a zlib wrapper)
3155@item gzip (a.k.a. DEFLATE with a gzip wrapper)
3156@end enumerate
3157")
3158 (license license:expat)))
3159
3160(define-public tarlz
3161 (package
3162 (name "tarlz")
3163 (version "0.21")
3164 (source
3165 (origin
3166 (method url-fetch)
3167 (uri (string-append "mirror://savannah/lzip/tarlz/"
3168 "tarlz-" version ".tar.lz"))
3169 (sha256
3170 (base32 "1x5dw03lcwfigcv97cg70gkbkfycjmv1012s9lwnl4izvl9235qg"))))
3171 (build-system gnu-build-system)
3172 (native-inputs
3173 (list lzip))
3174 (inputs
3175 (list lzlib))
3176 (home-page "https://www.nongnu.org/lzip/tarlz.html")
3177 (synopsis "Combination of the tar archiver and the lzip compressor")
3178 (description
3179 "Tarlz is a massively parallel (multi-threaded) combined implementation of
3180the tar archiver and the lzip compressor. Tarlz creates, lists, and extracts
3181archives in a simplified and safer variant of the POSIX pax format compressed
3182with lzip, keeping the alignment between tar members and lzip members. The
3183resulting multimember tar.lz archive is fully backward compatible with standard
3184tar tools like GNU tar, which treat it like any other tar.lz archive. Tarlz
3185can append files to the end of such compressed archives.")
3186 (license license:gpl2+)))
3187
3188(define-public libcbor
3189 (package
3190 (name "libcbor")
3191 (version "0.11.0")
3192 (source
3193 (origin
3194 (method git-fetch)
3195 (uri (git-reference
3196 (url "https://github.com/PJK/libcbor")
3197 (commit (string-append "v" version))))
3198 (file-name (git-file-name name version))
3199 (sha256
3200 (base32
3201 "00ibddiy62kbs9wl52c35j0hbqanx6pi7lvzkpzmbsizkj8mhp1p"))))
3202 (build-system cmake-build-system)
3203 (arguments
3204 (list
3205 #:configure-flags
3206 #~'("-DWITH_TESTS=ON"
3207 "-DBUILD_SHARED_LIBS=ON")))
3208 (synopsis "The C library for parsing and generating CBOR")
3209 (native-inputs
3210 (list cmocka))
3211 (description
3212 "@acronym{CBOR, The Concise Binary Object Representation} is a data format
3213whose design goals include the possibility of extremely small code size, fairly
3214small message size, and extensibility without the need for version
3215negotiation. These design goals make it different from earlier binary
3216serializations such as ASN.1 and MessagePack.")
3217 (license license:expat)
3218 (home-page "https://github.com/PJK/libcbor")))
3219
3220(define-public lzfse
3221 (package
3222 (name "lzfse")
3223 (version "1.0")
3224 (source
3225 (origin
3226 (method git-fetch)
3227 (uri (git-reference
3228 (url "https://github.com/lzfse/lzfse")
3229 (commit (string-append "lzfse-" version))))
3230 (file-name (git-file-name name version))
3231 (sha256
3232 (base32 "1mfh6y6vpvxsdwmqmfbkqkwvxc0pz2dqqc72c6fk9sbsrxxaghd5"))))
3233 (build-system cmake-build-system)
3234 (home-page "https://github.com/lzfse/lzfse")
3235 (synopsis "LZFSE compression library and command line tool")
3236 (description "LZFSE is a Lempel-Ziv style data compression algorithm using
3237Finite State Entropy coding. It targets similar compression rates at higher
3238compression and decompression speed compared to Deflate using Zlib.")
3239 (license license:bsd-3)))
3240
3241(define-public fcrackzip
3242 (package
3243 (name "fcrackzip")
3244 (version "1.0")
3245 (source (origin
3246 (method url-fetch)
3247 (uri (string-append "https://oldhome.schmorp.de/marc/data/"
3248 "fcrackzip-" version ".tar.gz"))
3249 (sha256
3250 (base32
3251 "0l1qsk949vnz18k4vjf3ppq8p497966x4c7f2yx18x8pk35whn2a"))))
3252 (build-system gnu-build-system)
3253 (arguments
3254 (list
3255 #:make-flags
3256 #~(list "CFLAGS=-Wno-error=implicit-int")
3257 #:phases
3258 #~(modify-phases %standard-phases
3259 (add-after 'unpack 'fix-reference-to-unzip
3260 (lambda* (#:key inputs #:allow-other-keys)
3261 (substitute* "main.c"
3262 (("\"unzip")
3263 (string-append "\""
3264 (search-input-file inputs "/bin/unzip")))))))))
3265 (inputs
3266 (list perl unzip))
3267 (home-page "https://oldhome.schmorp.de/marc/fcrackzip.html")
3268 (synopsis "Zip password cracker")
3269 (description "Fcrackzip is a Zip file password cracker.")
3270 (license license:gpl2+)))
3271
3272(define-public unrar-free
3273 (package
3274 (name "unrar-free")
3275 (version "0.3.2")
3276 (source
3277 (origin
3278 (method git-fetch)
3279 (uri (git-reference
3280 (url "https://gitlab.com/bgermann/unrar-free")
3281 (commit version)))
3282 (file-name (git-file-name name version))
3283 (sha256
3284 (base32 "13qkflwcdfnyrajs3hf2hgrzq4l0kqzngxwa5vyqhw4zz0r9djpm"))))
3285 (build-system gnu-build-system)
3286 (native-inputs
3287 (list autoconf
3288 automake
3289 pkg-config))
3290 (inputs
3291 (list libarchive))
3292 (home-page "https://gitlab.com/bgermann/unrar-free")
3293 (synopsis "Extract files from RAR archives")
3294 (description
3295 "@code{unrar-free} is a free software version of the non-free @code{unrar}
3296utility. This program is a simple command-line front-end to libarchive, and can
3297list and extract not only RAR archives but also other formats supported by
3298libarchive. It does not rival the non-free @code{unrar} in terms of features,
3299but special care has been taken to ensure it meets most user's needs.")
3300 (license license:gpl2+)))
3301
3302(define-public miniz
3303 (package
3304 (name "miniz")
3305 (version "3.0.2")
3306 (source (origin
3307 (method git-fetch)
3308 (uri (git-reference
3309 (url "https://github.com/richgel999/miniz")
3310 (commit version)))
3311 (file-name (git-file-name name version))
3312 (sha256
3313 (base32
3314 "0672q35vjrpakmsr1gwj9k5fwv5ihzhahm19bq4y74wqpn91p7fw"))))
3315 (build-system cmake-build-system)
3316 (arguments
3317 (list
3318 #:configure-flags
3319 ''("-DBUILD_SHARED_LIBS=ON")
3320 ;; No tests
3321 #:tests? #f))
3322 (home-page "https://github.com/richgel999/miniz")
3323 (synopsis "Independent implementation of zlib and Deflate compression")
3324 (description "Miniz is a lossless data compression library that implements
3325the zlib (RFC 1950) and Deflate (RFC 1951) compressed data format
3326specification standards. It supports the most commonly used functions
3327exported by the zlib library.")
3328 (license license:expat)))
3329
3330(define-public miniz-for-pytorch
3331 (package
3332 (inherit miniz)
3333 (version "pytorch-2.7.0")
3334 (source (origin
3335 (method git-fetch)
3336 (uri (git-reference
3337 (url "https://github.com/richgel999/miniz")
3338 (commit "3.0.2")))
3339 (file-name (git-file-name (package-name miniz) version))
3340 (sha256
3341 (base32
3342 "0672q35vjrpakmsr1gwj9k5fwv5ihzhahm19bq4y74wqpn91p7fw"))
3343 (patches (search-patches "miniz-for-pytorch.patch"))))
3344 (arguments
3345 (substitute-keyword-arguments arguments
3346 ((#:configure-flags flags '())
3347 ;; The changes break the examples.
3348 `(cons "-DBUILD_EXAMPLES=OFF" ,flags))))
3349 (properties '((hidden? . #t)))))
3350
3351(define-public cmix
3352 (package
3353 (name "cmix")
3354 (version "21")
3355 (source
3356 (origin
3357 (method git-fetch)
3358 (uri (git-reference
3359 (url "https://github.com/byronknoll/cmix")
3360 (commit (string-append "v" version))))
3361 (file-name (git-file-name name version))
3362 (sha256
3363 (base32 "1alivia1hnhxa7z8vkqammacyhj8zfqwk7hjahj5nkfq28v2ddb4"))))
3364 (build-system gnu-build-system)
3365 (arguments
3366 (list
3367 #:phases
3368 #~(modify-phases %standard-phases
3369 (delete 'configure)
3370 (delete 'check) ;No tests
3371 (replace 'install
3372 (lambda _
3373 (install-file "cmix"
3374 (string-append #$output "/bin")))))
3375 #:make-flags
3376 #~(list (string-append "CXX=" #$(cxx-for-target))
3377 ;; Linker fails when you use CC=cc-for-target
3378 (string-append "CC=" #$(cxx-for-target)))))
3379 (native-inputs (list clang-13))
3380 (synopsis "Lossless data-compression program optimized for file size")
3381 (description
3382 "Cmix is a lossless data compression program aimed at optimizing compression
3383ratio at the cost of high CPU/memory usage.")
3384 (home-page "https://github.com/byronknoll/cmix")
3385 (license license:gpl3)))
3386
3387(define-public zlib-ng
3388 (package
3389 (name "zlib-ng")
3390 (version "2.3.3")
3391 (source (origin
3392 (method git-fetch)
3393 (uri (git-reference
3394 (url "https://github.com/zlib-ng/zlib-ng")
3395 (commit version)))
3396 (file-name (git-file-name name version))
3397 (sha256
3398 (base32
3399 "0g4pxy7gc1slw9n6j583hzps32mml30f08gmmg1adsq4y3dl2cny"))))
3400 (build-system cmake-build-system)
3401 (native-inputs (list googletest))
3402 (home-page "https://github.com/zlib-ng/zlib-ng")
3403 (synopsis "Fork of the zlib data compression library")
3404 (description
3405 "zlib-ng is a @code{zlib} replacement with optimizations for next
3406generation systems.")
3407 (license license:zlib)))
3408
3409(define-public zlib-ng-compat
3410 (package/inherit zlib-ng
3411 (name "zlib-ng-compat")
3412 (arguments
3413 (substitute-keyword-arguments arguments
3414 ((#:configure-flags flags #~(list))
3415 #~(cons "-DZLIB_COMPAT=ON" #$flags))))))