gnu: go: Update to 1.14.4.
[jackhill/guix/guix.git] / gnu / packages / compression.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
c11ac62d 2;;; Copyright © 2012, 2013, 2014, 2015, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
b357faac 3;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
144cc3c4 4;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
27f76fe6 5;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
69d9792a 6;;; Copyright © 2015, 2016 Eric Bavier <bavier@member.fsf.org>
9a2fcb63 7;;; Copyright © 2015, 2016, 2017, 2018, 2020 Ricardo Wurmus <rekado@elephly.net>
77737e03 8;;; Copyright © 2015, 2017, 2018 Leo Famulari <leo@famulari.name>
820dc3f5 9;;; Copyright © 2015 Jeff Mickey <j@codemac.net>
d84ddbb9 10;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
23f3cbb8 11;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
3fd4b90d 12;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
f38eabe9 13;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
e4c2136d 14;;; Copyright © 2016 David Craven <david@craven.ch>
3480ceb1 15;;; Copyright © 2016, 2019, 2020 Kei Kebreau <kkebreau@posteo.net>
8e98f750 16;;; Copyright © 2016, 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
3c986a7d 17;;; Copyright © 2017 Nikita <nikita@n0.is>
9e6ada8f 18;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
d109b1e8 19;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
ef5c40aa 20;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
b44ecca6 21;;; Copyright © 2017 Petter <petter@mykolab.ch>
9869bb12 22;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
e294c05e 23;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
2ed0ef2f 24;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
8ff5c735 25;;; Copyright © 2018, 2019 Pierre Neidhardt <mail@ambrevar.xyz>
09debcf5 26;;; Copyright © 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
9720104c 27;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
1ac624cd 28;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
d2b237d0 29;;; Copyright © 2020 Arun Isaac <arunisaac@systemreboot.net>
910bf1f7 30;;; Copyright © 2020 Lars-Dominik Braun <lars@6xq.net>
a268f085 31;;;
233e7676 32;;; This file is part of GNU Guix.
a268f085 33;;;
233e7676 34;;; GNU Guix is free software; you can redistribute it and/or modify it
a268f085
LC
35;;; under the terms of the GNU General Public License as published by
36;;; the Free Software Foundation; either version 3 of the License, or (at
37;;; your option) any later version.
38;;;
233e7676 39;;; GNU Guix is distributed in the hope that it will be useful, but
a268f085
LC
40;;; WITHOUT ANY WARRANTY; without even the implied warranty of
41;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42;;; GNU General Public License for more details.
43;;;
44;;; You should have received a copy of the GNU General Public License
233e7676 45;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
a268f085 46
1ffa7090 47(define-module (gnu packages compression)
b5b73a82 48 #:use-module ((guix licenses) #:prefix license:)
21b2ec4d 49 #:use-module (guix utils)
a268f085 50 #:use-module (guix packages)
87f5d366 51 #:use-module (guix download)
646898b3 52 #:use-module (guix git-download)
9e6ada8f 53 #:use-module (guix build-system cmake)
0745e28d 54 #:use-module (guix build-system glib-or-gtk)
b357faac 55 #:use-module (guix build-system gnu)
910bf1f7 56 #:use-module (guix build-system go)
d2b237d0 57 #:use-module (guix build-system python)
8ff5c735 58 #:use-module (guix build-system trivial)
e99dd67a 59 #:use-module (gnu packages)
389eb3fa 60 #:use-module (gnu packages assembly)
69d9792a 61 #:use-module (gnu packages autotools)
23f3cbb8 62 #:use-module (gnu packages backup)
73f542c3 63 #:use-module (gnu packages base)
e294c05e 64 #:use-module (gnu packages boost)
0f03c531 65 #:use-module (gnu packages check)
9e6ada8f 66 #:use-module (gnu packages curl)
09debcf5 67 #:use-module (gnu packages documentation)
ef5c40aa 68 #:use-module (gnu packages file)
0745e28d
RG
69 #:use-module (gnu packages gettext)
70 #:use-module (gnu packages glib)
71 #:use-module (gnu packages gnome)
72 #:use-module (gnu packages gtk)
9869bb12 73 #:use-module (gnu packages maths)
646898b3 74 #:use-module (gnu packages perl)
23f3cbb8 75 #:use-module (gnu packages pkg-config)
1ae60db8 76 #:use-module (gnu packages python)
09debcf5 77 #:use-module (gnu packages qt)
9e6ada8f 78 #:use-module (gnu packages tls)
82aa2a28 79 #:use-module (gnu packages valgrind)
0745e28d 80 #:use-module (gnu packages xml)
36df995c 81 #:use-module (ice-9 match)
646898b3 82 #:use-module ((srfi srfi-1) #:select (last)))
a268f085 83
6a92093d
LC
84(define-public zlib
85 (package
86 (name "zlib")
2b8bea03 87 (version "1.2.11")
6a92093d
LC
88 (source
89 (origin
87f5d366 90 (method url-fetch)
a67f97fe
CR
91 (uri (list (string-append "http://zlib.net/zlib-"
92 version ".tar.gz")
b2859a4f
LC
93 (string-append "mirror://sourceforge/libpng/zlib/"
94 version "/zlib-" version ".tar.gz")))
6a92093d
LC
95 (sha256
96 (base32
2b8bea03 97 "18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3"))))
6a92093d 98 (build-system gnu-build-system)
b90289da 99 (outputs '("out" "static"))
6a92093d 100 (arguments
6cd00453
EF
101 `(#:phases
102 (modify-phases %standard-phases
103 (replace 'configure
104 (lambda* (#:key outputs #:allow-other-keys)
105 ;; Zlib's home-made `configure' fails when passed
106 ;; extra flags like `--enable-fast-install', so we need to
107 ;; invoke it with just what it understand.
108 (let ((out (assoc-ref outputs "out")))
109 ;; 'configure' doesn't understand '--host'.
110 ,@(if (%current-target-system)
111 `((setenv "CHOST" ,(%current-target-system)))
112 '())
144cc3c4 113 (invoke "./configure"
b90289da
MB
114 (string-append "--prefix=" out)))))
115 (add-after 'install 'move-static-library
116 (lambda* (#:key outputs #:allow-other-keys)
117 (let ((out (assoc-ref outputs "out"))
118 (static (assoc-ref outputs "static")))
119 (with-directory-excursion (string-append out "/lib")
120 (install-file "libz.a" (string-append static "/lib"))
121 (delete-file "libz.a")
122 #t)))))))
7f1773ea 123 (home-page "https://zlib.net/")
35b9e423 124 (synopsis "Compression library")
6a92093d
LC
125 (description
126 "zlib is designed to be a free, general-purpose, legally unencumbered --
127that is, not covered by any patents -- lossless data-compression library for
128use on virtually any computer hardware and operating system. The zlib data
35b9e423 129format is itself portable across platforms. Unlike the LZW compression method
6a92093d
LC
130used in Unix compress(1) and in the GIF image format, the compression method
131currently used in zlib essentially never expands the data. (LZW can double or
132triple the file size in extreme cases.) zlib's memory footprint is also
133independent of the input data and can be reduced, if necessary, at some cost
134in compression.")
4a44e743 135 (license license:zlib)))
6a92093d 136
8298df96
MB
137(define-public minizip
138 (package
139 (name "minizip")
140 (version (package-version zlib))
141 (source (package-source zlib))
142 (build-system gnu-build-system)
143 (arguments
144 `(#:phases
145 (modify-phases %standard-phases
146 (add-after 'unpack 'enter-source
c11ac62d
LC
147 (lambda _ (chdir "contrib/minizip") #t))
148 (add-after 'install 'remove-crypt-h
149 (lambda* (#:key outputs #:allow-other-keys)
150 ;; Remove <minizip/crypt.h> because it interferes with libc's
151 ;; <crypt.h> given that 'minizip.pc' says "-I…/include/minizip".
152 ;; Fedora does the same:
153 ;; <https://src.fedoraproject.org/rpms/zlib/c/4d2785ec3116947872f6f32dc4104e6d36d8a7a4?branch=master>.
154 (let ((out (assoc-ref outputs "out")))
155 (delete-file (string-append out "/include/minizip/crypt.h"))
156 #t))))))
8298df96
MB
157 (native-inputs
158 `(("autoconf" ,autoconf)
159 ("automake" ,automake)
160 ("libtool" ,libtool)))
161 (propagated-inputs `(("zlib" ,zlib)))
162 (home-page (package-home-page zlib))
163 (synopsis "Zip Compression library")
164 (description
165 "Minizip is a minimalistic library that supports compressing,
166extracting and viewing ZIP archives. This version is extracted from
167the @code{zlib} source.")
168 (license (package-license zlib))))
169
ee97be9f
RW
170(define-public fastjar
171 (package
172 (name "fastjar")
173 (version "0.98")
174 (source (origin
175 (method url-fetch)
176 (uri (string-append "mirror://savannah/fastjar/fastjar-"
177 version ".tar.gz"))
178 (sha256
179 (base32
180 "0iginbz2m15hcsa3x4y7v3mhk54gr1r7m3ghx0pg4n46vv2snmpi"))))
181 (build-system gnu-build-system)
182 (inputs `(("zlib" ,zlib)))
340978d7 183 (home-page "https://savannah.nongnu.org/projects/fastjar")
ee97be9f
RW
184 (synopsis "Replacement for Sun's 'jar' utility")
185 (description
36a4366d
EF
186 "FastJar is an attempt to create a much faster replacement for Sun's
187@code{jar} utility. Instead of being written in Java, FastJar is written in C.")
ee97be9f
RW
188 (license license:gpl2+)))
189
58593975
RW
190(define-public libtar
191 (package
192 (name "libtar")
89d80159 193 (version "1.2.20")
58593975
RW
194 (source (origin
195 (method url-fetch)
89d80159
EF
196 (uri (list
197 (string-append
198 "ftp://ftp.feep.net/pub/software/libtar/libtar-"
199 version ".tar.gz")
200 (string-append
201 "mirror://debian/pool/main/libt/libtar/libtar_"
202 version ".orig.tar.gz")))
58593975
RW
203 (sha256
204 (base32
e99dd67a
EF
205 "02cihzl77ia0dcz7z2cga2412vyhhs5pa2355q4wpwbyga2lrwjh"))
206 (patches (search-patches "libtar-CVE-2013-4420.patch"))))
58593975 207 (build-system gnu-build-system)
112fcafb 208 (arguments `(#:tests? #f)) ; no "check" target
89d80159
EF
209 (native-inputs
210 `(("autoconf" ,autoconf)
211 ("automake" ,automake)
212 ("libtool" ,libtool)))
213 (inputs
214 `(("zlib" ,zlib)))
58593975
RW
215 (synopsis "C library for manipulating POSIX tar files")
216 (description
217 "libtar is a C library for manipulating POSIX tar files. It handles
218adding and extracting files to/from a tar archive.")
89d80159 219 (home-page "https://repo.or.cz/libtar.git")
58593975
RW
220 (license license:bsd-3)))
221
a268f085
LC
222(define-public gzip
223 (package
224 (name "gzip")
07c95566 225 (version "1.10")
a268f085 226 (source (origin
87f5d366 227 (method url-fetch)
0db342a5 228 (uri (string-append "mirror://gnu/gzip/gzip-"
28181faf 229 version ".tar.xz"))
a268f085
LC
230 (sha256
231 (base32
07c95566 232 "1h6p374d3j8d4cdfydzls021xa2yby8myc0h8d6m8bc7k6ncq9c4"))))
a268f085 233 (build-system gnu-build-system)
f50d2669 234 (synopsis "General file (de)compression (using lzw)")
a268f085
LC
235 (arguments
236 ;; FIXME: The test suite wants `less', and optionally Perl.
48623f5b
RW
237 '(#:tests? #f
238 #:phases
239 (modify-phases %standard-phases
c7b87eed
MB
240 (add-after 'unpack 'patch-for-glibc-2.28
241 (lambda _
242 ;; Adjust the bundled gnulib to work with glibc 2.28. See e.g.
243 ;; "m4-gnulib-libio.patch". This is a phase rather than patch
244 ;; or snippet to work around <https://bugs.gnu.org/32347>.
245 (substitute* (find-files "lib" "\\.c$")
246 (("#if defined _IO_ftrylockfile")
247 "#if defined _IO_EOF_SEEN"))
248 (substitute* "lib/stdio-impl.h"
249 (("^/\\* BSD stdio derived implementations")
250 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
251 "# define _IO_IN_BACKUP 0x100\n"
252 "#endif\n\n"
253 "/* BSD stdio derived implementations")))
254 #t))
48623f5b
RW
255 (add-after 'unpack 'use-absolute-name-of-gzip
256 (lambda* (#:key outputs #:allow-other-keys)
257 (substitute* "gunzip.in"
258 (("exec gzip")
259 (string-append "exec " (assoc-ref outputs "out")
260 "/bin/gzip")))
261 #t)))))
a268f085 262 (description
79c311b8
LC
263 "GNU Gzip provides data compression and decompression utilities; the
264typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
265file; as a result, it is often used in conjunction with \"tar\", resulting in
266\".tar.gz\" or \".tgz\", etc.")
4a44e743 267 (license license:gpl3+)
6fd52309 268 (home-page "https://www.gnu.org/software/gzip/")))
a268f085
LC
269
270(define-public bzip2
03bc86b8
CB
271 (package
272 (name "bzip2")
b9a3654e 273 (version "1.0.8")
03bc86b8
CB
274 (source (origin
275 (method url-fetch)
b9a3654e
MB
276 (uri (string-append "https://sourceware.org/pub/bzip2/bzip2-"
277 version ".tar.gz"))
03bc86b8
CB
278 (sha256
279 (base32
b9a3654e 280 "0s92986cv0p692icqlw1j42y9nld8zd83qwhzbqd61p1dqbh6nmb"))))
03bc86b8
CB
281 (build-system gnu-build-system)
282 (arguments
283 `(#:modules ((guix build gnu-build-system)
284 (guix build utils)
5212c52c 285 (ice-9 ftw)
03bc86b8
CB
286 (srfi srfi-1))
287 #:phases
288 (modify-phases %standard-phases
8e98f750
MB
289 (add-after 'set-paths 'hide-input-bzip2
290 (lambda* (#:key inputs #:allow-other-keys)
291 (let ((bzip2 (assoc-ref inputs "bzip2")))
292 (if bzip2
293 ;; Prevent the build system from retaining a reference to
294 ;; BZIP2 from INPUTS.
295 (begin
296 (setenv "LIBRARY_PATH"
297 (string-join (delete (string-append bzip2 "/lib")
298 (string-split (getenv "LIBRARY_PATH")
299 #\:))
300 ":"))
301 (format #t "environment variable `LIBRARY_PATH' set to `~a'~%"
302 (getenv "LIBRARY_PATH")))
303 (format #t "no bzip2 found, nothing done~%"))
304 #t)))
03bc86b8
CB
305 (replace 'configure
306 (lambda* (#:key target #:allow-other-keys)
3158bc04
MW
307 (when ,(%current-target-system)
308 ;; Cross-compilation: use the cross tools.
309 (substitute* (find-files "." "Makefile")
310 (("CC=.*$")
311 (string-append "CC = " target "-gcc\n"))
312 (("AR=.*$")
313 (string-append "AR = " target "-ar\n"))
314 (("RANLIB=.*$")
315 (string-append "RANLIB = " target "-ranlib\n"))
316 (("^all:(.*)test" _ prerequisites)
317 ;; Remove 'all' -> 'test' dependency.
318 (string-append "all:" prerequisites "\n"))))
319 #t))
03bc86b8
CB
320 (add-before 'build 'build-shared-lib
321 (lambda* (#:key inputs #:allow-other-keys)
322 (patch-makefile-SHELL "Makefile-libbz2_so")
3158bc04 323 (invoke "make" "-f" "Makefile-libbz2_so")))
03bc86b8
CB
324 (add-after 'install 'install-shared-lib
325 (lambda* (#:key outputs #:allow-other-keys)
2b786f67
MB
326 ;; The Makefile above does not have an 'install' target, nor does
327 ;; it create all the (un)versioned symlinks, so we handle it here.
03bc86b8 328 (let* ((out (assoc-ref outputs "out"))
2b786f67 329 (libdir (string-append out "/lib"))
5212c52c
MB
330 (soname "libbz2.so")
331 ;; Locate the built library (e.g. "libbz2.so.1.0.6").
332 (lib (car (scandir "."
333 (lambda (file)
334 (and (string-prefix? soname file)
335 (eq? 'regular
336 (stat:type (lstat file))))))))
337 (soversion (string-drop lib (+ 1 (string-length soname)))))
2b786f67
MB
338 (install-file lib libdir)
339 (with-directory-excursion libdir
340 ;; Create symlinks libbz2.so.1 -> libbz2.so.1.0, etc.
5212c52c 341 (let loop ((base soname)
2b786f67
MB
342 (numbers (string-split soversion #\.)))
343 (unless (null? numbers)
344 (let ((so-file (string-append base "." (car numbers))))
345 (symlink so-file base)
346 (loop so-file (cdr numbers))))))
347 #t)))
45719c1d
MB
348 (add-after 'install-shared-lib 'move-static-lib
349 (lambda* (#:key outputs #:allow-other-keys)
350 (let ((out (assoc-ref outputs "out"))
351 (static (assoc-ref outputs "static")))
352 (with-directory-excursion (string-append out "/lib")
353 (install-file "libbz2.a" (string-append static "/lib"))
354 (delete-file "libbz2.a")
355 #t))))
e7ee50f2
CB
356 (add-after 'install-shared-lib 'patch-scripts
357 (lambda* (#:key outputs inputs #:allow-other-keys)
358 (let* ((out (assoc-ref outputs "out")))
359 (substitute* (string-append out "/bin/bzdiff")
360 (("/bin/rm") "rm")))
03bc86b8 361 #t)))
ab4fab19 362
03bc86b8
CB
363 #:make-flags (list (string-append "PREFIX="
364 (assoc-ref %outputs "out")))
ab4fab19 365
03bc86b8
CB
366 ;; Don't attempt to run the tests when cross-compiling.
367 ,@(if (%current-target-system)
368 '(#:tests? #f)
369 '())))
45719c1d 370 (outputs '("out" "static"))
03bc86b8
CB
371 (synopsis "High-quality data compression program")
372 (description
373 "bzip2 is a freely available, patent free (see below), high-quality data
a268f085
LC
374compressor. It typically compresses files to within 10% to 15% of the best
375available techniques (the PPM family of statistical compressors), whilst
376being around twice as fast at compression and six times faster at
377decompression.")
03bc86b8
CB
378 (license (license:non-copyleft "file://LICENSE"
379 "See LICENSE in the distribution."))
7598b678 380 (home-page "https://web.archive.org/web/20180801004107/http://www.bzip.org/")))
a268f085 381
669b7b83
RW
382(define-public lbzip2
383 (package
384 (name "lbzip2")
385 (version "2.5")
386 (source (origin
387 (method url-fetch)
388 (uri (string-append "http://archive.lbzip2.org/lbzip2-"
389 version ".tar.gz"))
390 (sha256
391 (base32
f268b744
EF
392 "1sahaqc5bw4i0iyri05syfza4ncf5cml89an033fspn97klmxis6"))
393 (modules '((guix build utils)))
394 (snippet
395 '(begin
f268b744
EF
396 (substitute* (find-files "lib" "\\.c$")
397 (("#if defined _IO_ftrylockfile")
398 "#if defined _IO_EOF_SEEN"))
399 (substitute* "lib/stdio-impl.h"
400 (("^/\\* BSD stdio derived implementations")
401 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
402 "# define _IO_IN_BACKUP 0x100\n"
403 "#endif\n\n"
404 "/* BSD stdio derived implementations")))
405 #t))))
669b7b83
RW
406 (build-system gnu-build-system)
407 (synopsis "Parallel bzip2 compression utility")
408 (description
409 "lbzip2 is a multi-threaded compression utility with support for the
410bzip2 compressed file format. lbzip2 can process standard bz2 files in
411parallel. It uses POSIX threading model (pthreads), which allows it to take
412full advantage of symmetric multiprocessing (SMP) systems. It has been proven
413to scale linearly, even to over one hundred processor cores. lbzip2 is fully
414compatible with bzip2 – both at file format and command line level.")
415 (home-page "http://www.lbzip2.org/")
416 (license license:gpl3+)))
417
5d47eab0
EF
418(define-public pbzip2
419 (package
420 (name "pbzip2")
bf867709 421 (version "1.1.13")
5d47eab0
EF
422 (source (origin
423 (method url-fetch)
21b2ec4d
EF
424 (uri (string-append "https://launchpad.net/pbzip2/"
425 (version-major+minor version) "/" version
426 "/+download/" name "-" version ".tar.gz"))
5d47eab0
EF
427 (sha256
428 (base32
bf867709 429 "1rnvgcdixjzbrmcr1nv9b6ccrjfrhryaj7jwz28yxxv6lam3xlcg"))))
5d47eab0
EF
430 (build-system gnu-build-system)
431 (inputs
b3546174 432 `(("bzip2" ,bzip2)))
5d47eab0 433 (arguments
bf867709 434 `(#:tests? #f ; no tests
5d47eab0 435 #:phases (modify-phases %standard-phases
bf867709 436 (delete 'configure)) ; no configure script
21b2ec4d 437 #:make-flags (list (string-append "PREFIX=" %output))))
1ac624cd
BH
438 (home-page (string-append "https://web.archive.org/web/20180412020219/"
439 "http://compression.ca/pbzip2/"))
5d47eab0
EF
440 (synopsis "Parallel bzip2 implementation")
441 (description
442 "Pbzip2 is a parallel implementation of the bzip2 block-sorting file
443compressor that uses pthreads and achieves near-linear speedup on SMP machines.
21b2ec4d 444The output of this version is fully compatible with bzip2 v1.0.2 (i.e. anything
5d47eab0
EF
445compressed with pbzip2 can be decompressed with bzip2).")
446 (license (license:non-copyleft "file://COPYING"
21b2ec4d 447 "See COPYING in the distribution."))))
5d47eab0 448
a268f085
LC
449(define-public xz
450 (package
451 (name "xz")
957aac76 452 (version "5.2.4")
a268f085 453 (source (origin
87f5d366 454 (method url-fetch)
52d76b64
LC
455 (uri (list (string-append "http://tukaani.org/xz/xz-" version
456 ".tar.gz")
457 (string-append "http://multiprecision.org/guix/xz-"
458 version ".tar.gz")))
a268f085
LC
459 (sha256
460 (base32
957aac76 461 "0ibi2zsfaz6l756spjwc5rayf4ckgc9hwmy8qinppcyk4svz64mm"))))
a268f085 462 (build-system gnu-build-system)
5b2da2a6
MB
463 (arguments
464 `(#:phases
465 (modify-phases %standard-phases
466 (add-after 'install 'move-static-lib
467 (lambda* (#:key outputs #:allow-other-keys)
468 (let ((out (assoc-ref outputs "out"))
469 (static (assoc-ref outputs "static")))
470 (mkdir-p (string-append static "/lib"))
471 (rename-file (string-append out "/lib/liblzma.a")
472 (string-append static "/lib/liblzma.a"))
473 ;; Remove reference to the static library from the .la file
474 ;; so Libtool does the right thing when both the shared and
475 ;; static library is available.
476 (substitute* (string-append out "/lib/liblzma.la")
477 (("^old_library='liblzma.a'") "old_library=''"))
478 #t))))))
479 (outputs '("out" "static"))
35b9e423 480 (synopsis "General-purpose data compression")
a268f085
LC
481 (description
482 "XZ Utils is free general-purpose data compression software with high
483compression ratio. XZ Utils were written for POSIX-like systems, but also
484work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
485
486The core of the XZ Utils compression code is based on LZMA SDK, but it has
487been modified quite a lot to be suitable for XZ Utils. The primary
488compression algorithm is currently LZMA2, which is used inside the .xz
489container format. With typical files, XZ Utils create 30 % smaller output
490than gzip and 15 % smaller output than bzip2.")
38bbd61d 491 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
58891850 492 (home-page "https://tukaani.org/xz/")))
c6eac761 493
0dcea35d
KK
494(define-public lhasa
495 (package
496 (name "lhasa")
497 (version "0.3.1")
498 (source (origin
499 (method url-fetch)
500 (uri (string-append
501 "https://github.com/fragglet/lhasa/releases/download/v"
502 version "/lhasa-" version ".tar.gz"))
503 (sha256
504 (base32
505 "092zi9av18ma20c6h9448k0bapvx2plnp292741dvfd9hmgqxc1z"))))
506 (build-system gnu-build-system)
507 (arguments
508 '(#:phases
509 (modify-phases %standard-phases
510 (add-before 'check 'set-up-test-environment
511 (lambda* (#:key inputs #:allow-other-keys)
512 (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata")
513 "/share/zoneinfo"))
514 #t)))))
515 (native-inputs
5a8ef3c1 516 `(("tzdata" ,tzdata-for-tests)))
0dcea35d
KK
517 (home-page "https://fragglet.github.com/lhasa/")
518 (synopsis "LHA archive decompressor")
519 (description "Lhasa is a replacement for the Unix LHA tool, for
520decompressing .lzh (LHA / LHarc) and .lzs (LArc) archives. The backend for the
521tool is a library, so that it can be reused for other purposes. Lhasa aims to
522be compatible with as many types of lzh/lzs archives as possible. It also aims
523to generate the same output as the (non-free) Unix LHA tool, so that it will
524act as a free drop-in replacement.")
525 (license license:isc)))
526
c6eac761
LC
527(define-public lzo
528 (package
529 (name "lzo")
7276eca4 530 (version "2.10")
c6eac761
LC
531 (source
532 (origin
533 (method url-fetch)
534 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
535 version ".tar.gz"))
536 (sha256
537 (base32
7276eca4 538 "0wm04519pd3g8hqpjqhfr72q8qmbiwqaxcs3cndny9h86aa95y60"))))
c6eac761 539 (build-system gnu-build-system)
165fd9d5 540 (arguments '(#:configure-flags '("--enable-shared")))
c6eac761
LC
541 (home-page "http://www.oberhumer.com/opensource/lzo")
542 (synopsis
e881752c 543 "Data compression library suitable for real-time data de-/compression")
c6eac761
LC
544 (description
545 "LZO is a data compression library which is suitable for data
546de-/compression in real-time. This means it favours speed over
547compression ratio.
548
549LZO is written in ANSI C. Both the source code and the compressed data
550format are designed to be portable across platforms.")
4a44e743 551 (license license:gpl2+)))
0f323dad 552
a9f48ff0
EB
553(define-public lzop
554 (package
555 (name "lzop")
89d159fe 556 (version "1.04")
a9f48ff0
EB
557 (source
558 (origin
559 (method url-fetch)
560 (uri (string-append "http://www.lzop.org/download/lzop-"
561 version ".tar.gz"))
562 (sha256
563 (base32
89d159fe 564 "0h9gb8q7y54m9mvy3jvsmxf21yx8fc3ylzh418hgbbv0i8mbcwky"))))
a9f48ff0
EB
565 (build-system gnu-build-system)
566 (inputs `(("lzo" ,lzo)))
6f465a51 567 (home-page "https://www.lzop.org/")
a9f48ff0
EB
568 (synopsis "Compress or expand files")
569 (description
570 "Lzop is a file compressor which is very similar to gzip. Lzop uses the
571LZO data compression library for compression services, and its main advantages
572over gzip are much higher compression and decompression speed (at the cost of
573some compression ratio).")
574 (license license:gpl2+)))
575
0f323dad
LC
576(define-public lzip
577 (package
578 (name "lzip")
43d9ed77 579 (version "1.21")
0f323dad
LC
580 (source (origin
581 (method url-fetch)
582 (uri (string-append "mirror://savannah/lzip/lzip-"
583 version ".tar.gz"))
584 (sha256
585 (base32
43d9ed77 586 "12qdcw5k1cx77brv9yxi1h4dzwibhfmdpigrj43nfk8nscwm12z4"))))
0f323dad 587 (build-system gnu-build-system)
340978d7 588 (home-page "https://www.nongnu.org/lzip/lzip.html")
0f323dad
LC
589 (synopsis "Lossless data compressor based on the LZMA algorithm")
590 (description
591 "Lzip is a lossless data compressor with a user interface similar to the
592one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
0963e3e4 593more than bzip2, which makes it well-suited for software distribution and data
0f323dad
LC
594archiving. Lzip is a clean implementation of the LZMA algorithm.")
595 (license license:gpl3+)))
b357faac 596
9d9fc399
TGR
597(define-public lziprecover
598 (package
599 (name "lziprecover")
b099b4a7 600 (version "1.21")
9d9fc399
TGR
601 (source (origin
602 (method url-fetch)
f6145bb6
TGR
603 (uri (string-append "mirror://savannah/lzip/lziprecover/"
604 "lziprecover-" version ".tar.gz"))
9d9fc399
TGR
605 (sha256
606 (base32
b099b4a7 607 "094w2z8fz41yaq0gkyr61cl7pb1d7kchpl5dka7rvm3qvbb7ncd2"))))
9d9fc399 608 (build-system gnu-build-system)
340978d7 609 (home-page "https://www.nongnu.org/lzip/lziprecover.html")
9d9fc399
TGR
610 (synopsis "Recover and decompress data from damaged lzip files")
611 (description
612 "Lziprecover is a data recovery tool and decompressor for files in the lzip
613compressed data format (.lz). It can test the integrity of lzip files, extract
614data from damaged ones, and repair most files with small errors (up to one
615single-byte error per member) entirely.
616
617Lziprecover is not a replacement for regular backups, but a last line of defence
618when even the backups are corrupt. It can recover files by merging the good
619parts of two or more damaged copies, such as can be easily produced by running
620@command{ddrescue} on a failing device.
621
622This package also includes @command{unzcrash}, a tool to test the robustness of
623decompressors when faced with corrupted input.")
624 (license (list license:bsd-2 ; arg_parser.{cc,h}
625 license:gpl2+)))) ; everything else
626
b357faac
AE
627(define-public sharutils
628 (package
629 (name "sharutils")
9a59ce24 630 (version "4.15.2")
b357faac
AE
631 (source
632 (origin
633 (method url-fetch)
634 (uri (string-append "mirror://gnu/sharutils/sharutils-"
635 version ".tar.xz"))
d0ee11b2 636 (patches (search-patches "sharutils-CVE-2018-1000097.patch"))
b357faac
AE
637 (sha256
638 (base32
b50d58b3 639 "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))
211db9ca
EF
640 (modules '((guix build utils)))
641 (snippet
642 '(begin
643 (substitute* (find-files "lib" "\\.c$")
644 (("#if defined _IO_ftrylockfile")
645 "#if defined _IO_EOF_SEEN"))
646 (substitute* "lib/stdio-impl.h"
647 (("^/\\* BSD stdio derived implementations")
648 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
649 "# define _IO_IN_BACKUP 0x100\n"
650 "#endif\n\n"
651 "/* BSD stdio derived implementations")))
652 #t))))
b357faac
AE
653 (build-system gnu-build-system)
654 (inputs
655 `(("which" ,which)))
656 (arguments
657 `(#:phases
dc1d3cde
KK
658 (modify-phases %standard-phases
659 (add-after 'patch-source-shebangs 'unpatch-source-shebang
660 ;; revert the patch-shebang phase on a script which is
661 ;; in fact test data
662 (lambda _
663 (substitute* "tests/shar-1.ok"
664 (((which "sh")) "/bin/sh"))
665 #t)))))
6fd52309 666 (home-page "https://www.gnu.org/software/sharutils/")
b357faac
AE
667 (synopsis "Archives in shell scripts, uuencode/uudecode")
668 (description
79c311b8
LC
669 "GNU sharutils is a package for creating and manipulating shell
670archives that can be readily emailed. A shell archive is a file that can be
e881752c 671processed by a Bourne-type shell to unpack the original collection of files.
79c311b8 672This package is mostly for compatibility and historical interest.")
b357faac 673 (license license:gpl3+)))
28469ab0 674
646898b3
RW
675(define-public sfarklib
676 (package
677 (name "sfarklib")
979f9e8a 678 (version "2.24")
646898b3 679 (source (origin
d40362f4
EF
680 (method git-fetch)
681 (uri (git-reference
682 (url "https://github.com/raboof/sfArkLib.git")
683 (commit version)))
684 (file-name (git-file-name name version))
646898b3
RW
685 (sha256
686 (base32
d40362f4 687 "0jrxy24gak7q5ml06p5jjgzk9i5r2mkfjk4ycirkp4kg7k5a237w"))))
646898b3
RW
688 (build-system gnu-build-system)
689 (arguments
690 `(#:tests? #f ;no "check" target
691 #:phases
692 (modify-phases %standard-phases
693 (replace 'configure
694 (lambda* (#:key outputs #:allow-other-keys)
695 (substitute* "Makefile"
696 (("/usr/local") (assoc-ref outputs "out")))
697 #t)))))
698 (inputs
699 `(("zlib" ,zlib)))
700 (home-page "https://github.com/raboof/sfArkLib")
701 (synopsis "Library for SoundFont decompression")
702 (description
703 "SfArkLib is a C++ library for decompressing SoundFont files compressed
704with the sfArk algorithm.")
705 (license license:gpl3+)))
706
b5ad1659 707(define-public sfarkxtc
3fa31317
RW
708 (let ((commit "13cd6f93725a90d91ec5ea75babf1dbd694ac463")
709 (revision "1"))
710 (package
711 (name "sfarkxtc")
712 (version (git-version "0" revision commit))
713 (source (origin
714 ;; There are no release tarballs, so we just fetch the latest
715 ;; commit at this time.
716 (method git-fetch)
717 (uri (git-reference
718 (url "https://github.com/raboof/sfarkxtc.git")
719 (commit commit)))
720 (file-name (git-file-name name version))
721 (sha256
722 (base32
723 "1mb1jyk1m11l1gppd9hmql9cyp55sdf7jk5rbc7acky1z4k4mv19"))))
724 (build-system gnu-build-system)
725 (arguments
726 `(#:tests? #f ;no "check" target
727 #:phases
728 (modify-phases %standard-phases
729 (replace 'configure
730 (lambda* (#:key outputs #:allow-other-keys)
731 (substitute* "Makefile"
732 (("/usr/local") (assoc-ref outputs "out")))
733 #t)))))
734 (inputs
735 `(("zlib" ,zlib)
736 ("sfarklib" ,sfarklib)))
737 (home-page "https://github.com/raboof/sfarkxtc")
738 (synopsis "Basic sfArk decompressor")
739 (description "SfArk extractor converts SoundFonts in the compressed legacy
b5ad1659 740sfArk file format to the uncompressed sf2 format.")
3fa31317 741 (license license:gpl3+))))
b5ad1659 742
27f76fe6
TUBK
743(define-public libmspack
744 (package
745 (name "libmspack")
27b2f34c 746 (home-page "https://cabextract.org.uk/libmspack/")
511930c2 747 (version "0.10.1")
27f76fe6
TUBK
748 (source
749 (origin
750 (method url-fetch)
27b2f34c 751 (uri (string-append home-page name "-" version "alpha.tar.gz"))
27f76fe6 752 (sha256
511930c2 753 (base32 "13janaqsvm7aqc4agjgd4819pbgqv50j88bh5kci1z70wvg65j5s"))))
27f76fe6 754 (build-system gnu-build-system)
03c16bb5
MB
755 (arguments
756 `(#:configure-flags '("--disable-static")))
27f76fe6
TUBK
757 (synopsis "Compression tools for some formats used by Microsoft")
758 (description
759 "The purpose of libmspack is to provide both compression and
760decompression of some loosely related file formats used by Microsoft.")
761 (license license:lgpl2.1+)))
73f542c3 762
82aa2a28
LF
763(define-public lz4
764 (package
765 (name "lz4")
9205f451 766 (version "1.9.2")
82aa2a28
LF
767 (source
768 (origin
b38cfa1d
MB
769 (method git-fetch)
770 (uri (git-reference (url "https://github.com/lz4/lz4")
771 (commit (string-append "v" version))))
82aa2a28 772 (sha256
b496bfea 773 (base32
9205f451 774 "0lpaypmk70ag2ks3kf2dl4ac3ba40n5kc1ainkp9wfjawz76mh61"))
b38cfa1d 775 (file-name (git-file-name name version))))
82aa2a28 776 (build-system gnu-build-system)
9205f451
MB
777 (native-inputs
778 `(;; For tests.
779 ("python" ,python)
780 ("valgrind" ,valgrind)))
82aa2a28
LF
781 (arguments
782 `(#:test-target "test"
82aa2a28 783 #:make-flags (list "CC=gcc"
0dd6d21a 784 (string-append "prefix=" (assoc-ref %outputs "out")))
82aa2a28 785 #:phases (modify-phases %standard-phases
97e537c3
MB
786 (delete 'configure) ;no configure script
787 (add-before 'check 'disable-broken-test
788 (lambda _
789 ;; XXX: test_install.sh fails when prefix is a subdirectory.
790 (substitute* "tests/Makefile"
791 (("^test: (.*) test-install" _ targets)
792 (string-append "test: " targets)))
986dce4f
MB
793 #t))
794 (add-after 'install 'delete-static-library
795 (lambda* (#:key outputs #:allow-other-keys)
796 (let ((out (assoc-ref outputs "out")))
797 (delete-file (string-append out "/lib/liblz4.a"))
798 #t))))))
fd174342 799 (home-page "https://www.lz4.org")
82aa2a28
LF
800 (synopsis "Compression algorithm focused on speed")
801 (description "LZ4 is a lossless compression algorithm, providing
802compression speed at 400 MB/s per core (0.16 Bytes/cycle). It also features an
803extremely fast decoder, with speed in multiple GB/s per core (0.71 Bytes/cycle).
804A high compression derivative, called LZ4_HC, is also provided. It trades CPU
805time for compression ratio.")
b7585ca3 806 ;; The libraries (lz4, lz4hc, and xxhash) are BSD licenced. The command
82aa2a28
LF
807 ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
808 (license (list license:bsd-2 license:gpl2+))))
dd8d6d65
SB
809
810(define-public squashfs-tools
811 (package
812 (name "squashfs-tools")
957fe1c2 813 (version "4.4")
dd8d6d65
SB
814 (source (origin
815 (method url-fetch)
de67e922
LF
816 (uri (string-append "mirror://sourceforge/squashfs/squashfs/"
817 "squashfs" version "/"
dd8d6d65
SB
818 "squashfs" version ".tar.gz"))
819 (sha256
820 (base32
957fe1c2 821 "0zmhvczscqz0mzh4b9m8m42asq14db0a6lc8clp5ljq5ybrv70d9"))))
dd8d6d65
SB
822 (build-system gnu-build-system)
823 (arguments
957fe1c2 824 '(#:tests? #f ; no check target
dd8d6d65
SB
825 #:make-flags
826 (list "CC=gcc"
827 "XZ_SUPPORT=1"
828 "LZO_SUPPORT=1"
829 "LZ4_SUPPORT=1"
830 (string-append "INSTALL_DIR=" %output "/bin"))
831 #:phases
832 (modify-phases %standard-phases
833 (replace 'configure
f793b4ef
EF
834 (lambda _
835 (chdir "squashfs-tools")
f793b4ef 836 #t)))))
dd8d6d65
SB
837 (inputs
838 `(("lz4" ,lz4)
839 ("lzo" ,lzo)
840 ("xz" ,xz)
841 ("zlib" ,zlib)))
c5bb55a8 842 (home-page "https://github.com/plougher/squashfs-tools")
8f65585b 843 (synopsis "Tools to create and extract squashfs file systems")
dd8d6d65 844 (description
8f65585b 845 "Squashfs is a highly compressed read-only file system for Linux. It uses
dd8d6d65
SB
846zlib to compress files, inodes, and directories. All blocks are packed to
847minimize the data overhead, and block sizes of between 4K and 1M are supported.
848It is intended to be used for archival use, for live CDs, and for embedded
849systems where low overhead is needed. This package allows you to create and
8f65585b 850extract such file systems.")
dd8d6d65 851 (license license:gpl2+)))
820dc3f5
JM
852
853(define-public pigz
854 (package
855 (name "pigz")
9dae73c3 856 (version "2.4")
820dc3f5
JM
857 (source (origin
858 (method url-fetch)
859 (uri (string-append "http://zlib.net/pigz/"
860 name "-" version ".tar.gz"))
861 (sha256
862 (base32
9dae73c3 863 "0wsgw5vwl23jrnpsvd8v3xcp5k4waw5mk0164fynjhkv58i1dy54"))))
820dc3f5
JM
864 (build-system gnu-build-system)
865 (arguments
866 `(#:phases
867 (modify-phases %standard-phases
868 (delete 'configure)
869 (replace 'install
870 (lambda* (#:key outputs #:allow-other-keys)
871 (let* ((out (assoc-ref outputs "out"))
872 (bin (string-append out "/bin"))
873 (man (string-append out "/share/man/man1")))
874 (install-file "pigz" bin)
875 (symlink "pigz" (string-append bin "/unpigz"))
876 (install-file "pigz.1" man)
877 #t))))
9b9bc1b0
TGR
878 #:make-flags
879 (list ,(string-append "CC=" (cc-for-target)))
820dc3f5
JM
880 #:test-target "tests"))
881 (inputs `(("zlib" ,zlib)))
7f1773ea 882 (home-page "https://zlib.net/pigz/")
820dc3f5
JM
883 (synopsis "Parallel implementation of gzip")
884 (description
885 "This package provides a parallel implementation of gzip that exploits
886multiple processors and multiple cores when compressing data.")
887
888 ;; Things under zopfli/ are under ASL2.0, but 4 files at the top-level,
889 ;; written by Mark Adler, are under another non-copyleft license.
890 (license license:asl2.0)))
23f3cbb8
BW
891
892(define-public pixz
893 (package
894 (name "pixz")
895 (version "1.0.6")
896 (source (origin
897 (method url-fetch)
898 (uri (string-append
899 "https://github.com/vasi/pixz/releases/download/v" version
900 "/pixz-" version ".tar.xz"))
901 (sha256
902 (base32
903 "1s3j7zw6j5zi3fhdxg287ndr3wf6swac7z21mqd1pyiln530gi82"))))
904 (build-system gnu-build-system)
905 (native-inputs
906 `(("pkg-config" ,pkg-config)
907 ("libarchive" ,libarchive)))
908 (home-page "https://github.com/vasi/pixz")
909 (synopsis "Parallel indexing implementation of LZMA")
910 (description
911 "The existing XZ Utils provide great compression in the .xz file format,
912but they produce just one big block of compressed data. Pixz instead produces
913a collection of smaller blocks which makes random access to the original data
914possible and can compress in parallel. This is especially useful for large
915tarballs.")
916 (license license:bsd-2)))
69d9792a 917
ac83cf22
MB
918(define-public bsdiff
919 (package
920 (name "bsdiff")
921 (version "4.3")
922 (home-page "https://www.daemonology.net/bsdiff/")
923 (source (origin
924 (method url-fetch)
925 (uri (string-append home-page name "-" version ".tar.gz"))
926 (sha256
927 (base32
928 "0j2zm3z271x5aw63mwhr3vymzn45p2vvrlrpm9cz2nywna41b0hq"))))
929 (build-system gnu-build-system)
930 (arguments
931 `(#:make-flags (list "INSTALL=install" "CC=gcc"
932 (string-append "PREFIX=" (assoc-ref %outputs "out")))
933 #:phases (modify-phases %standard-phases
934 (delete 'configure)
935 (add-before 'build 'fix-Makefile
936 (lambda _
937 (substitute* "Makefile"
938 ;; Adjust syntax to make it compatible with GNU Make.
939 (("^\\.") "")
940 ;; Help install(1) create the target directory.
941 (("\\$\\{PREFIX\\}") "-D -t ${PREFIX}"))
942 #t)))
943 #:tests? #f)) ;no tests
944 (inputs
945 `(("bzip2" ,bzip2)))
946 (synopsis "Patch binary files")
947 (description
948 "@command{bsdiff} and @command{bspatch} are tools for building and
949applying patches to binary files. By using suffix sorting (specifically
950Larsson and Sadakane's @code{qsufsort}) and taking advantage of how
951executable files change, bsdiff routinely produces binary patches 50-80%
952smaller than those produced by @code{Xdelta}.")
953 (license license:bsd-2)))
3fd4b90d
DM
954
955(define-public cabextract
956 (package
957 (name "cabextract")
27b2f34c 958 (home-page "https://cabextract.org.uk/")
bde093c2 959 (version "1.9.1")
3fd4b90d
DM
960 (source (origin
961 (method url-fetch)
393b55d5 962 (uri (string-append home-page "cabextract-" version ".tar.gz"))
3fd4b90d
DM
963 (sha256
964 (base32
bde093c2 965 "19qwhl2r8ip95q4vxzxg2kp4p125hjmc9762sns1dwwf7ikm7hmg"))
92526ade
MB
966 (modules '((guix build utils)))
967 (snippet
968 '(begin
969 ;; Delete bundled libmspack.
970 (delete-file-recursively "mspack")
971 #t))))
3fd4b90d 972 (build-system gnu-build-system)
b3175c70
KK
973 (arguments
974 '(#:configure-flags '("--with-external-libmspack")
975 #:phases
976 (modify-phases %standard-phases
977 ;; cabextract needs some of libmspack's header files.
978 ;; These are located in the "mspack" directory of libmspack.
979 (add-before 'build 'unpack-libmspack
980 (lambda* (#:key inputs #:allow-other-keys)
981 (let ((dir-name "libmspack-src"))
982 (mkdir dir-name)
983 (invoke "tar" "-xvf" (assoc-ref inputs "libmspack-source")
984 "-C" dir-name "--strip-components" "1")
985 (rename-file (string-append dir-name "/mspack")
986 "mspack")
987 (delete-file-recursively dir-name)
988 #t))))))
3fd4b90d
DM
989 (native-inputs
990 `(("pkg-config" ,pkg-config)))
991 (inputs
b3175c70
KK
992 `(("libmspack" ,libmspack)
993 ("libmspack-source" ,(package-source libmspack))))
3fd4b90d
DM
994 (synopsis "Tool to unpack Cabinet archives")
995 (description "Extracts files out of Microsoft Cabinet (.cab) archives")
996 ;; Some source files specify gpl2+, lgpl2+, however COPYING is gpl3.
997 (license license:gpl3+)))
0b073506
TGR
998
999(define-public xdelta
1000 (package
1001 (name "xdelta")
1002 (version "3.1.0")
1003 (source
1004 (origin
0633c77b
RW
1005 (method git-fetch)
1006 (uri (git-reference
1007 (url "https://github.com/jmacd/xdelta.git")
1008 (commit (string-append "v" version))))
1009 (file-name (git-file-name name version))
0b073506
TGR
1010 (sha256
1011 (base32
0633c77b 1012 "09mmsalc7dwlvgrda56s2k927rpl3a5dzfa88aslkqcjnr790wjy"))
0b073506
TGR
1013 (snippet
1014 ;; This file isn't freely distributable and has no effect on building.
6cbee49d
MW
1015 '(begin
1016 (delete-file "xdelta3/draft-korn-vcdiff.txt")
1017 #t))))
0b073506
TGR
1018 (build-system gnu-build-system)
1019 (native-inputs
1020 `(("autoconf" ,autoconf)
1021 ("automake" ,automake)))
1022 (arguments
1023 `(#:phases
1024 (modify-phases %standard-phases
1025 (add-after 'unpack 'enter-build-directory
e5ff963a 1026 (lambda _ (chdir "xdelta3") #t)))))
69b7fa3e 1027 (home-page "http://xdelta.org")
0b073506
TGR
1028 (synopsis "Delta encoder for binary files")
1029 (description "xdelta encodes only the differences between two binary files
1030using the VCDIFF algorithm and patch file format described in RFC 3284. It can
1031also be used to apply such patches. xdelta is similar to @command{diff} and
1032@command{patch}, but is not limited to plain text and does not generate
1033human-readable output.")
1034 (license license:asl2.0)))
389eb3fa
TGR
1035
1036(define-public lrzip
1037 (package
1038 (name "lrzip")
666619d0 1039 (version "0.631")
389eb3fa
TGR
1040 (source
1041 (origin
1042 (method url-fetch)
1043 (uri (string-append
1044 "http://ck.kolivas.org/apps/lrzip/lrzip-" version ".tar.bz2"))
1045 (sha256
1046 (base32
5400fdfd
TGR
1047 "0mb449vmmwpkalq732jdyginvql57nxyd31sszb108yps1lf448d"))
1048 (patches (search-patches "lrzip-CVE-2017-8842.patch"))))
389eb3fa
TGR
1049 (build-system gnu-build-system)
1050 (native-inputs
1051 `(;; nasm is only required when building for 32-bit x86 platforms
1052 ,@(if (string-prefix? "i686" (or (%current-target-system)
1053 (%current-system)))
1054 `(("nasm" ,nasm))
1055 '())
1056 ("perl" ,perl)))
1057 (inputs
1058 `(("bzip2" ,bzip2)
1059 ("lzo" ,lzo)
1060 ("zlib" ,zlib)))
1061 (home-page "http://ck.kolivas.org/apps/lrzip/")
1062 (synopsis "Large file compressor with a very high compression ratio")
1063 (description "lrzip is a compression utility that uses long-range
1064redundancy reduction to improve the subsequent compression ratio of
1065larger files. It can then further compress the result with the ZPAQ or
1066LZMA algorithms for maximum compression, or LZO for maximum speed. This
1067choice between size or speed allows for either better compression than
1068even LZMA can provide, or a higher speed than gzip while compressing as
1069well as bzip2.")
1070 (license (list license:gpl3+
1071 license:public-domain)))) ; most files in lzma/
e4c2136d
DC
1072
1073(define-public snappy
1074 (package
1075 (name "snappy")
a5407c76 1076 (version "1.1.8")
16de7f15
TGR
1077 (source
1078 (origin
898ac8e7
EF
1079 (method git-fetch)
1080 (uri (git-reference
1081 (url "https://github.com/google/snappy.git")
1082 (commit version)))
1083 (file-name (git-file-name name version))
16de7f15 1084 (sha256
a5407c76 1085 (base32 "1j0kslq2dvxgkcxl1gakhvsa731yrcvcaipcp5k8k7ayicvkv9jv"))
16de7f15 1086 (patches (search-patches "snappy-add-O2-flag-in-CmakeLists.txt.patch"))))
5a437357
MB
1087 (build-system cmake-build-system)
1088 (arguments
1089 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
e4c2136d
DC
1090 (home-page "https://github.com/google/snappy")
1091 (synopsis "Fast compressor/decompressor")
5a437357 1092 (description "Snappy is a compression/decompression library. It does not
e4c2136d 1093aim for maximum compression, or compatibility with any other compression library;
5a437357 1094instead, it aims for very high speeds and reasonable compression. For instance,
e4c2136d
DC
1095compared to the fastest mode of zlib, Snappy is an order of magnitude faster
1096for most inputs, but the resulting compressed files are anywhere from 20% to
1097100% bigger.")
1098 (license license:asl2.0)))
adbd7faf
KK
1099
1100(define-public p7zip
1101 (package
1102 (name "p7zip")
1103 (version "16.02")
1104 (source (origin
1105 (method url-fetch)
1106 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1107 version "/" name "_" version
1108 "_src_all.tar.bz2"))
1109 (sha256
1110 (base32
1111 "07rlwbbgszq8i7m8jh3x6j2w2hc9a72dc7fmqawnqkwlwb00mcjy"))
1112 (modules '((guix build utils)))
1113 (snippet
1114 '(begin
1115 ;; Remove non-free source files
1116 (for-each delete-file
1117 (append
1118 (find-files "CPP/7zip/Compress" "Rar.*")
1119 (find-files "CPP/7zip/Crypto" "Rar.*")
1120 (find-files "DOC/unRarLicense.txt")
1121 (find-files "Utils/file_Codecs_Rar_so.py")))
1122 (delete-file-recursively "CPP/7zip/Archive/Rar")
1123 (delete-file-recursively "CPP/7zip/Compress/Rar")
1124 #t))
1ac675a5 1125 (patches (search-patches "p7zip-CVE-2016-9296.patch"
a630c647 1126 "p7zip-CVE-2017-17969.patch"
1ac675a5 1127 "p7zip-remove-unused-code.patch"))))
adbd7faf
KK
1128 (build-system gnu-build-system)
1129 (arguments
1130 `(#:make-flags
1131 (list (string-append "DEST_HOME=" (assoc-ref %outputs "out")) "all3")
1132 #:phases
1133 (modify-phases %standard-phases
1134 (replace 'configure
1135 (lambda* (#:key system outputs #:allow-other-keys)
8fcdd9d5
MW
1136 (invoke "cp"
1137 (let ((system ,(or (%current-target-system)
1138 (%current-system))))
1139 (cond
1140 ((string-prefix? "x86_64" system)
1141 "makefile.linux_amd64_asm")
1142 ((string-prefix? "i686" system)
1143 "makefile.linux_x86_asm_gcc_4.X")
1144 (else
1145 "makefile.linux_any_cpu_gcc_4.X")))
1146 "makefile.machine")))
adbd7faf
KK
1147 (replace 'check
1148 (lambda _
8fcdd9d5
MW
1149 (invoke "make" "test")
1150 (invoke "make" "test_7z")
1151 (invoke "make" "test_7zr"))))))
0f4f5715 1152 (native-inputs
adbd7faf
KK
1153 (let ((system (or (%current-target-system)
1154 (%current-system))))
1155 `(,@(cond ((string-prefix? "x86_64" system)
1156 `(("yasm" ,yasm)))
1157 ((string-prefix? "i686" system)
1158 `(("nasm" ,nasm)))
1159 (else '())))))
1160 (home-page "http://p7zip.sourceforge.net/")
1161 (synopsis "Command-line file archiver with high compression ratio")
1162 (description "p7zip is a command-line port of 7-Zip, a file archiver that
1163handles the 7z format which features very high compression ratios.")
1164 (license (list license:lgpl2.1+
1165 license:gpl2+
1166 license:public-domain))))
618089f9
MB
1167
1168(define-public gzstream
1169 (package
1170 (name "gzstream")
1171 (version "1.5")
1172 (source (origin
1173 (method url-fetch)
1174 (uri
1175 ;; No versioned URL, but last release was in 2003.
1176 "http://www.cs.unc.edu/Research/compgeom/gzstream/gzstream.tgz")
1177 (file-name (string-append name "-" version ".tgz"))
1178 (sha256
1179 (base32
1180 "00y19pqjsdj5zcrx4p9j56pl73vayfwnb7y2hvp423nx0cwv5b4r"))
1181 (modules '((guix build utils)))
1182 (snippet
1183 ;; Remove pre-compiled object.
6cbee49d
MW
1184 '(begin
1185 (delete-file "gzstream.o")
1186 #t))))
618089f9
MB
1187 (build-system gnu-build-system)
1188 (arguments
1189 `(#:test-target "test"
1190 #:phases
1191 (modify-phases %standard-phases
1192 (delete 'configure)
1193 (replace 'install
1194 (lambda* (#:key outputs #:allow-other-keys)
1195 (let* ((out (assoc-ref outputs "out"))
1196 (lib (string-append out "/lib"))
1197 (include (string-append out "/include")))
1198 (install-file "libgzstream.a" lib)
1199 (install-file "gzstream.h" include)
1200 #t))))))
1201 (propagated-inputs `(("zlib" ,zlib)))
1202 (home-page "http://www.cs.unc.edu/Research/compgeom/gzstream/")
1203 (synopsis "Compressed C++ iostream")
1204 (description "gzstream is a small library for providing zlib
1205functionality in a C++ iostream.")
1206 (license license:lgpl2.1+)))
36df995c
TGR
1207
1208(define-public zpaq
1209 (package
1210 (name "zpaq")
1211 (version "7.15")
1212 (source
1213 (origin
1214 (method url-fetch/zipbomb)
1215 (uri (string-append "http://mattmahoney.net/dc/zpaq"
1216 (string-delete #\. version) ".zip"))
1217 (sha256
1218 (base32
1219 "066l94yyladlfzri877nh2dhkvspagjn3m5bmv725fmhkr9c4pp8"))
1220 (modules '((guix build utils)))
1221 (snippet
1222 ;; Delete irrelevant pre-compiled binaries.
6cbee49d
MW
1223 '(begin
1224 (for-each delete-file (find-files "." "\\.exe$"))
1225 #t))))
36df995c
TGR
1226 (build-system gnu-build-system)
1227 (arguments
1228 `(#:phases
1229 (modify-phases %standard-phases
1230 (delete 'configure)) ; no ‘configure’ script
1231 #:make-flags
1232 (list
1233 (string-append "CPPFLAGS=-Dunix"
1234 ,(match (or (%current-target-system)
1235 (%current-system))
1236 ("x86_64-linux" "")
1237 ("i686-linux" "")
1238 (_ " -DNOJIT")))
1239 ;; These should be safe, lowest-common-denominator instruction sets,
1240 ;; allowing for some optimisation while remaining reproducible.
effd7198 1241 (string-append "CXXFLAGS=-O3 -DNDEBUG"
36df995c
TGR
1242 ,(match (or (%current-target-system)
1243 (%current-system))
effd7198
EF
1244 ("x86_64-linux" " -march=nocona -mtune=generic")
1245 ("i686-linux" " -march=i686 -mtune=generic")
1246 ("armhf-linux" " -mtune=generic-armv7-a")
36df995c
TGR
1247 (_ "")))
1248 (string-append "PREFIX="
1249 (assoc-ref %outputs "out")))))
1250 (native-inputs
1251 `(("perl" ,perl))) ; for pod2man
1252 (home-page "http://mattmahoney.net/dc/zpaq.html")
1253 (synopsis "Incremental journaling archiver")
1254 (description "ZPAQ is a command-line archiver for realistic situations with
1255many duplicate and already compressed files. It backs up only those files
1256modified since the last update. All previous versions remain untouched and can
1257be independently recovered. Identical files are only stored once (known as
1258@dfn{de-duplication}). Archives can also be encrypted.
1259
1260ZPAQ is intended to back up user data, not entire operating systems. It ignores
1261owner and group IDs, ACLs, extended attributes, or special file types like
1262devices, sockets, or named pipes. It does not follow or restore symbolic links
1263or junctions, and always follows hard links.")
1264 (license (list license:public-domain
1265 ;; libzpaq.cpp contains a mix of public-domain and
1266 ;; expat-licenced (or ‘MIT’) code.
1267 license:expat))))
0da8313c 1268
9e6ada8f
MR
1269(define-public unshield
1270 (package
1271 (name "unshield")
6cf48e8c 1272 (version "1.4.3")
9e6ada8f 1273 (source
298180cd
EF
1274 (origin (method git-fetch)
1275 (uri (git-reference
1276 (url "http://github.com/twogood/unshield.git")
1277 (commit version)))
1278 (file-name (git-file-name name version))
9e6ada8f
MR
1279 (sha256
1280 (base32
298180cd 1281 "19wn22vszhci8dfcixx5rliz7phx3lv5ablvhjlclvj75k2vsdqd"))))
9e6ada8f
MR
1282 (build-system cmake-build-system)
1283 (inputs
1284 `(("zlib" ,zlib)
1285 ("openssl" ,openssl)
6cf48e8c 1286 ;; Test data that is otherwise downloaded with curl.
9e6ada8f
MR
1287 ("unshield-avigomanager11b22.zip"
1288 ,(origin
1289 (method url-fetch)
6cf48e8c
TGR
1290 (uri (string-append
1291 "https://www.dropbox.com/s/8r4b6752swe3nhu/"
1292 "unshield-avigomanager11b22.zip?dl=1"))
9e6ada8f
MR
1293 (sha256
1294 (base32 "0fwq7lih04if68wpwpsk5wjqyvh32db76a41sq6gbx4dn1lc3ddn"))
1295 (file-name "unshield-avigomanager11b22.zip")))
6cf48e8c
TGR
1296 ("unshield-baldurs_gate_patch_v1_1_4315_international.zip"
1297 ,(origin
1298 (method url-fetch)
1299 (uri (string-append
1300 "https://www.dropbox.com/s/9ruil8oi6amjbbk/"
1301 "unshield-baldurs_gate_patch_v1_1_4315_international.zip?dl=1"))
1302 (sha256
1303 (base32 "0spaxf6dardlhqxz3ys09fzamj007q3nfyw4xng6gh3qp9780maj"))
1304 (file-name "unshield-baldurs_gate_patch_v1_1_4315_international.zip")))
9e6ada8f
MR
1305 ("unshield-the-feeble-files-spanish.zip"
1306 ,(origin
1307 (method url-fetch)
6cf48e8c
TGR
1308 (uri (string-append
1309 "https://www.dropbox.com/s/1ng0z9kfxc7eb1e/"
1310 "unshield-the-feeble-files-spanish.zip?dl=1"))
9e6ada8f
MR
1311 (sha256
1312 (base32 "1k5cw6vnpja8yjlnhx5124xrw9i8s1l539hfdqqrqz3l5gn0bnyd"))
1313 (file-name "unshield-the-feeble-files-spanish.zip")))))
1314 (native-inputs
1315 `(("unzip" ,unzip)))
1316 (arguments
1317 `(#:out-of-source? #f
1318 #:phases
1319 (modify-phases %standard-phases
1320 (add-before 'check 'pre-check
1321 (lambda* (#:key inputs #:allow-other-keys)
1322 (for-each (lambda (i)
1323 (copy-file (assoc-ref inputs i)
1324 (string-append "test/v0/" i)))
1325 '("unshield-avigomanager11b22.zip"
6cf48e8c 1326 "unshield-baldurs_gate_patch_v1_1_4315_international.zip"
9e6ada8f
MR
1327 "unshield-the-feeble-files-spanish.zip"))
1328 (substitute* (find-files "test/" "/*\\.sh")
1329 ;; Tests expect the unshield binary in a specific
1330 ;; location.
1331 (("/var/tmp/unshield/bin/unshield")
1332 (string-append (getcwd) "/src/unshield"))
1333 ;; We no longer need to download the data.
1334 ((".?URL=.*$") "")
1335 (("curl -(|f)sSL -o test.zip .*") ""))
1336 (substitute* "test/v0/avigomanager.sh"
1337 (("test.zip")
1338 (string-append (getcwd)
6cf48e8c
TGR
1339 "/test/v0/unshield-avigomanager11b22.zip")))
1340 (substitute* "test/v0/baldurs_gate_patch_v1_1_4315_international.sh"
1341 (("test.zip")
1342 (string-append
1343 (getcwd)
1344 "/test/v0/unshield-baldurs_gate_patch_v1_1_4315_international.zip")))
9e6ada8f
MR
1345 (substitute* "test/v0/the-feeble-files-spanish.sh"
1346 (("test.zip")
1347 (string-append (getcwd)
1348 "/test/v0/unshield-the-feeble-files-spanish.zip")))
1349 #t))
1350 (replace 'check
1351 (lambda _
df04bd25 1352 (invoke "./run-tests.sh"))))))
9e6ada8f
MR
1353 (home-page "https://github.com/twogood/unshield")
1354 (synopsis "Extract CAB files from InstallShield installers")
1355 (description
1356 "@command{unshield} is a tool and library for extracting @file{.cab}
1357 archives from InstallShield installers.")
1358 (license license:expat)))
1359
f6ac3101
TGR
1360(define-public zstd
1361 (package
1362 (name "zstd")
ca0576d6 1363 (version "1.4.4")
3880537c
TGR
1364 (source
1365 (origin
1366 (method url-fetch)
1367 (uri (string-append "https://github.com/facebook/zstd/releases/download/"
1368 "v" version "/zstd-" version ".tar.gz"))
1369 (sha256
ca0576d6 1370 (base32 "05ckxap00qvc0j51d3ci38150cxsw82w7s9zgd5fgzspnzmp1vsr"))))
f6ac3101 1371 (build-system gnu-build-system)
ca0576d6
MB
1372 (outputs '("out" ;1.2MiB executables and documentation
1373 "lib" ;1.2MiB shared library and headers
1374 "static")) ;1.2MiB static library
f6ac3101
TGR
1375 (arguments
1376 `(#:phases
1377 (modify-phases %standard-phases
ec0de9d8
MB
1378 (delete 'configure) ;no configure script
1379 (add-after 'install 'adjust-library-locations
1380 (lambda* (#:key outputs #:allow-other-keys)
1381 (let* ((out (assoc-ref outputs "out"))
1382 (lib (assoc-ref outputs "lib"))
1383 (static (assoc-ref outputs "static"))
1384 (shared-libs (string-append lib "/lib"))
1385 (static-libs (string-append static "/lib")))
1386 ;; Move the static library to its own output to save ~1MiB.
1387 (mkdir-p static-libs)
1388 (for-each (lambda (ar)
1389 (link ar (string-append static-libs "/"
1390 (basename ar)))
1391 (delete-file ar))
1392 (find-files shared-libs "\\.a$"))
1393
ca0576d6 1394 ;; Make sure the pkg-config file refers to the right output.
ec0de9d8 1395 (substitute* (string-append shared-libs "/pkgconfig/libzstd.pc")
ca0576d6
MB
1396 (("^prefix=.*")
1397 (string-append "prefix=" lib "\n")))
ec0de9d8
MB
1398
1399 #t))))
f6ac3101
TGR
1400 #:make-flags
1401 (list "CC=gcc"
f45e314e 1402 (string-append "PREFIX=" (assoc-ref %outputs "out"))
ec0de9d8
MB
1403 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib")
1404 (string-append "INCLUDEDIR=" (assoc-ref %outputs "lib") "/include")
f45e314e
TGR
1405 ;; Skip auto-detection of, and creating a dependency on, the build
1406 ;; environment's ‘xz’ for what amounts to a dubious feature anyway.
1407 "HAVE_LZMA=0"
1408 ;; Not currently detected, but be explicit & avoid surprises later.
1409 "HAVE_LZ4=0"
e8073063 1410 "HAVE_ZLIB=0")))
2f325b63 1411 (home-page "https://facebook.github.io/zstd/")
f6ac3101
TGR
1412 (synopsis "Zstandard real-time compression algorithm")
1413 (description "Zstandard (@command{zstd}) is a lossless compression algorithm
1414that combines very fast operation with a compression ratio comparable to that of
1415zlib. In most scenarios, both compression and decompression can be performed in
1416‘real time’. The compressor can be configured to provide the most suitable
1417trade-off between compression ratio and speed, without affecting decompression
1418speed.")
1419 (license (list license:bsd-3 ; the main top-level LICENSE file
16123d1d 1420 license:bsd-2 ; many files explicitly state 2-Clause
5a719dee 1421 license:gpl2 ; the main top-level COPYING file
16123d1d
TGR
1422 license:gpl3+ ; tests/gzip/*.sh
1423 license:expat ; lib/dictBuilder/divsufsort.[ch]
f6ac3101
TGR
1424 license:public-domain ; zlibWrapper/examples/fitblk*
1425 license:zlib)))) ; zlibWrapper/{gz*.c,gzguts.h}
0f03c531
TGR
1426
1427(define-public pzstd
1428 (package
1429 (name "pzstd")
1430 (version (package-version zstd))
1431 (source (package-source zstd))
1432 (build-system gnu-build-system)
1433 (native-inputs
c695fb76 1434 `(("googletest" ,googletest)))
0f03c531
TGR
1435 (arguments
1436 `(#:phases
1437 (modify-phases %standard-phases
1438 (add-after 'unpack 'enter-subdirectory
9f6f726c 1439 (lambda _ (chdir "contrib/pzstd") #t))
0f03c531
TGR
1440 (delete 'configure) ; no configure script
1441 (add-before 'check 'compile-tests
1442 (lambda* (#:key make-flags #:allow-other-keys)
745e83ca 1443 (apply invoke "make" "tests" make-flags)))
0f03c531
TGR
1444 (add-after 'install 'install-documentation
1445 (lambda* (#:key outputs #:allow-other-keys)
1446 (let* ((out (assoc-ref outputs "out"))
1447 (doc (string-append out "/share/doc/" ,name)))
1448 (mkdir-p doc)
1449 (install-file "README.md" doc)
1450 #t))))
1451 #:make-flags
1452 (list "CC=gcc"
1453 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1454 (home-page (package-home-page zstd))
1455 (synopsis "Threaded implementation of the Zstandard compression algorithm")
1456 (description "Parallel Zstandard (PZstandard or @command{pzstd}) is a
1457multi-threaded implementation of the @uref{http://zstd.net/, Zstandard
1458compression algorithm}. It is fully compatible with the original Zstandard file
1459format and command-line interface, and can be used as a drop-in replacement.
1460
1461Compression is distributed over multiple processor cores to improve performance,
1462as is the decompression of data compressed in this manner. Data compressed by
1463other implementations will only be decompressed by two threads: one performing
1464the actual decompression, the other input and output.")
1465 (license (package-license zstd))))
148585c2
AI
1466
1467(define-public zip
1468 (package
1469 (name "zip")
1470 (version "3.0")
1471 (source
1472 (origin
1473 (method url-fetch)
1474 (uri (string-append "mirror://sourceforge/infozip"
1475 "/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz"))
1476 (sha256
1477 (base32
1478 "0sb3h3067pzf3a7mlxn1hikpcjrsvycjcnj9hl9b1c3ykcgvps7h"))))
1479 (build-system gnu-build-system)
1480 (inputs `(("bzip2" ,bzip2)))
1481 (arguments
1482 `(#:tests? #f ; no test target
1483 #:make-flags (let ((out (assoc-ref %outputs "out")))
1484 (list "-f" "unix/Makefile"
1485 (string-append "prefix=" out)
1486 (string-append "MANDIR=" out "/share/man/man1")))
148585c2
AI
1487 #:phases
1488 (modify-phases %standard-phases
1489 (replace 'build
1490 (lambda* (#:key (make-flags '()) #:allow-other-keys)
b0559d24 1491 (apply invoke "make" "generic_gcc" make-flags)))
148585c2
AI
1492 (delete 'configure))))
1493 (home-page "http://www.info-zip.org/Zip.html")
1494 (synopsis "Compression and file packing utility")
1495 (description
1496 "Zip is a compression and file packaging/archive utility. Zip is useful
1497for packaging a set of files for distribution, for archiving files, and for
1498saving disk space by temporarily compressing unused files or directories.
1499Zip puts one or more compressed files into a single ZIP archive, along with
1500information about the files (name, path, date, time of last modification,
1501protection, and check information to verify file integrity). An entire
1502directory structure can be packed into a ZIP archive with a single command.
1503
1504Zip has one compression method (deflation) and can also store files without
1505compression. Zip automatically chooses the better of the two for each file.
1506Compression ratios of 2:1 to 3:1 are common for text files.")
1507 (license (license:non-copyleft "file://LICENSE"
1508 "See LICENSE in the distribution."))))
1509
1510(define-public unzip
1511 (package (inherit zip)
1512 (name "unzip")
1513 (version "6.0")
1514 (source
1515 (origin
1516 (method url-fetch)
1517 (uri (string-append "mirror://sourceforge/infozip"
1518 "/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz"))
1519 (sha256
1520 (base32
1521 "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83"))
1522 (patches (search-patches "unzip-CVE-2014-8139.patch"
1523 "unzip-CVE-2014-8140.patch"
1524 "unzip-CVE-2014-8141.patch"
1525 "unzip-CVE-2014-9636.patch"
1526 "unzip-CVE-2015-7696.patch"
1527 "unzip-CVE-2015-7697.patch"
1528 "unzip-allow-greater-hostver-values.patch"
1529 "unzip-initialize-symlink-flag.patch"
1530 "unzip-remove-build-date.patch"
1531 "unzip-attribs-overflow.patch"
1532 "unzip-overflow-on-invalid-input.patch"
1533 "unzip-format-secure.patch"
1534 "unzip-overflow-long-fsize.patch"))))
1535 (build-system gnu-build-system)
1536 ;; no inputs; bzip2 is not supported, since not compiled with BZ_NO_STDIO
1537 (arguments
1538 `(#:phases (modify-phases %standard-phases
1539 (delete 'configure)
190376a1
MW
1540 (add-after 'unpack 'fortify
1541 (lambda _
1542 ;; Mitigate CVE-2018-1000035, an exploitable buffer overflow.
1543 ;; This environment variable is recommended in 'unix/Makefile'
1544 ;; for passing flags to the C compiler.
1545 (setenv "LOCAL_UNZIP" "-D_FORTIFY_SOURCE=1")
1546 #t))
148585c2
AI
1547 (replace 'build
1548 (lambda* (#:key make-flags #:allow-other-keys)
fa76696b
MW
1549 (apply invoke "make"
1550 `("-j" ,(number->string
1551 (parallel-job-count))
1552 ,@make-flags
1553 "generic_gcc")))))
148585c2
AI
1554 #:make-flags (list "-f" "unix/Makefile"
1555 (string-append "prefix=" %output)
1556 (string-append "MANDIR=" %output "/share/man/man1"))))
1557 (home-page "http://www.info-zip.org/UnZip.html")
1558 (synopsis "Decompression and file extraction utility")
1559 (description
1560 "UnZip is an extraction utility for archives compressed in .zip format,
1561also called \"zipfiles\".
1562
1563UnZip lists, tests, or extracts files from a .zip archive. The default
1564behaviour (with no options) is to extract into the current directory, and
1565subdirectories below it, all files from the specified zipfile. UnZip
1566recreates the stored directory structure by default.")
1567 (license (license:non-copyleft "file://LICENSE"
1568 "See LICENSE in the distribution."))))
1569
1570(define-public zziplib
1571 (package
1572 (name "zziplib")
3f986ff6
MB
1573 (version "0.13.69")
1574 (home-page "https://github.com/gdraheim/zziplib")
d0a52e65
MB
1575 (source (origin
1576 (method git-fetch)
1577 (uri (git-reference (url home-page)
1578 (commit (string-append "v" version))))
1579 (file-name (git-file-name name version))
e6bd8b5e 1580 (patches (search-patches "zziplib-CVE-2018-16548.patch"))
d0a52e65
MB
1581 (sha256
1582 (base32
1583 "0fbk9k7ryas2wh2ykwkvm1pbi40i88rfvc3dydh9xyd7w2jcki92"))))
148585c2 1584 (build-system gnu-build-system)
d0a52e65
MB
1585 (arguments
1586 `(#:phases (modify-phases %standard-phases
1587 (add-before 'check 'make-files-writable
1588 (lambda _
1589 (for-each make-file-writable
1590 (find-files "test" #:directories? #t))
b0dc2454
MB
1591 #t)))
1592
1593 ;; XXX: The default test target attempts to download external resources and
1594 ;; fails without error: <https://github.com/gdraheim/zziplib/issues/53>.
1595 ;; To prevent confusing log messages, just run a simple zip test that works.
1596 #:test-target "check-readme"))
148585c2
AI
1597 (inputs
1598 `(("zlib" ,zlib)))
1599 (native-inputs `(("perl" ,perl) ; for the documentation
1600 ("pkg-config" ,pkg-config)
1601 ;; for the documentation; Python 3 not supported,
1602 ;; http://forums.gentoo.org/viewtopic-t-863161-start-0.html
1603 ("python" ,python-2)
1604 ("zip" ,zip))) ; to create test files
148585c2
AI
1605 (synopsis "Library for accessing zip files")
1606 (description
1607 "ZZipLib is a library based on zlib for accessing zip files.")
0d729c5b
MB
1608 ;; zziplib is dual licensed under LGPL2.0+ and MPL1.1. Some example source
1609 ;; files carry the Zlib license; see "docs/copying.html" for details.
1610 (license (list license:lgpl2.0+ license:mpl1.1))))
148585c2 1611
06de4aaf
TF
1612(define-public libzip
1613 (package
1614 (name "libzip")
dcc3f215 1615 (version "1.6.1")
06de4aaf
TF
1616 (source (origin
1617 (method url-fetch)
1618 (uri (string-append
66fea0c4 1619 "https://libzip.org/download/libzip-" version ".tar.xz"))
06de4aaf
TF
1620 (sha256
1621 (base32
dcc3f215 1622 "0h9nsgkw0dk4srsvmz6xy6f9l4h815xn07j8h40l8gqvcxxaqpbh"))))
06de4aaf
TF
1623 (native-inputs
1624 `(("perl" ,perl)))
1625 (inputs
a9b15d4c 1626 `(("gnutls" ,gnutls)
dcc3f215 1627 ("liblzma" ,xz)
a9b15d4c
BH
1628 ("openssl" ,openssl)
1629 ("zlib" ,zlib)))
80486319 1630 (build-system cmake-build-system)
8d6c7456 1631 (home-page "https://libzip.org")
06de4aaf
TF
1632 (synopsis "C library for reading, creating, and modifying zip archives")
1633 (description "Libzip is a C library for reading, creating, and modifying
1634zip archives. Files can be added from data buffers, files, or compressed data
1635copied directly from other zip archives. Changes made without closing the
1636archive can be reverted.")
1637 (license license:bsd-3)))
ef5c40aa
SR
1638
1639(define-public atool
1640 (package
1641 (name "atool")
1642 (version "0.39.0")
1643 (source
1644 (origin
1645 (method url-fetch)
1646 (uri (string-append "http://savannah.nongnu.org/download/atool/atool-"
1647 version ".tar.gz"))
1648 (sha256
1649 (base32
1650 "0fvhzip2v08jgnlfpyj6rapan39xlsl1ksgq4lp8gfsai2ah1xma"))))
1651 (build-system gnu-build-system)
1652 (arguments
1653 `(#:phases
1654 (modify-phases %standard-phases
1655 (add-after 'unpack 'embed-absolute-file-name
1656 (lambda* (#:key inputs #:allow-other-keys)
1657 (substitute* "atool"
1658 (("(^\\$::cfg_path_file.*= )'file'" _ pre)
1659 (string-append pre "'" (assoc-ref inputs "file")
1660 "/bin/file'")))
1661 #t)))))
1662 (inputs
1663 `(("perl" ,perl)
1664 ("file" ,file)))
340978d7 1665 (home-page "https://www.nongnu.org/atool/")
ef5c40aa
SR
1666 (synopsis "Universal tool to manage file archives of various types")
1667 (description "The main command is @command{aunpack} which extracts files
1668from an archive. The other commands provided are @command{apack} (to create
1669archives), @command{als} (to list files in archives), and @command{acat} (to
1670extract files to standard out). As @command{atool} invokes external programs
1671to handle the archives, not all commands may be supported for a certain type
1672of archives.")
1673 (license license:gpl2+)))
b44ecca6 1674
34e8cf22
TGR
1675(define-public lunzip
1676 (package
1677 (name "lunzip")
9f4f085f 1678 (version "1.11")
34e8cf22
TGR
1679 (source
1680 (origin
1681 (method url-fetch)
a28cd477
TGR
1682 (uri (string-append "mirror://savannah/lzip/lunzip/"
1683 "lunzip-" version ".tar.gz"))
34e8cf22 1684 (sha256
9f4f085f 1685 (base32 "19zq3gmlbia2krq4k4zs1j0xjdv7nsdzqvfb0pyca5n53h2mzb91"))))
34e8cf22
TGR
1686 (build-system gnu-build-system)
1687 (arguments
1688 `(#:configure-flags
cb3ca320 1689 (list ,(string-append "CC=" (cc-for-target)))))
340978d7 1690 (home-page "https://www.nongnu.org/lzip/lunzip.html")
34e8cf22
TGR
1691 (synopsis "Small, stand-alone lzip decompressor")
1692 (description
1693 "Lunzip is a decompressor for files in the lzip compression format (.lz),
1694written as a single small C tool with no dependencies. This makes it
1695well-suited to embedded and other systems without a C++ compiler, or for use in
1696applications such as software installers that need only to decompress files,
1697not compress them.
1698Lunzip is intended to be fully compatible with the regular lzip package.")
1699 (license (list license:bsd-2 ; carg_parser.[ch]
1700 license:gpl2+)))) ; everything else
5dca4c76
TGR
1701
1702(define-public clzip
1703 (package
1704 (name "clzip")
11b1c71d 1705 (version "1.11")
5dca4c76
TGR
1706 (source
1707 (origin
1708 (method url-fetch)
39e5d3b6
TGR
1709 (uri (string-append "mirror://savannah/lzip/clzip/"
1710 "clzip-" version ".tar.gz"))
5dca4c76 1711 (sha256
11b1c71d 1712 (base32 "1h14dmc9fi10gcdpdpbgq1bwvcxvivppilj64pf720x8mw915mfr"))))
5dca4c76
TGR
1713 (build-system gnu-build-system)
1714 (arguments
1715 `(#:configure-flags
cb056c40 1716 (list ,(string-append "CC=" (cc-for-target)))))
340978d7 1717 (home-page "https://www.nongnu.org/lzip/clzip.html")
5dca4c76
TGR
1718 (synopsis "Small, stand-alone lzip compressor and decompressor")
1719 (description
1720 "Clzip is a compressor and decompressor for files in the lzip compression
1721format (.lz), written as a single small C tool with no dependencies. This makes
1722it well-suited to embedded and other systems without a C++ compiler, or for use
1723in other applications like package managers.
1724Clzip is intended to be fully compatible with the regular lzip package.")
1725 (license (list license:bsd-2 ; carg_parser.[ch], lzd in clzip.texi
1726 license:gpl2+))))
2e3b1a92
TGR
1727
1728(define-public lzlib
1729 (package
1730 (name "lzlib")
29904223 1731 (version "1.11")
2e3b1a92
TGR
1732 (source
1733 (origin
1734 (method url-fetch)
76b2f084
TGR
1735 (uri (string-append "mirror://savannah/lzip/lzlib/"
1736 "lzlib-" version ".tar.gz"))
2e3b1a92 1737 (sha256
29904223 1738 (base32 "0djdj4sg33rzi4k84cygvnp09bfsv6i8wy2k7i67rayib63myp3c"))))
2e3b1a92 1739 (build-system gnu-build-system)
2e3b1a92
TGR
1740 (arguments
1741 `(#:configure-flags
1742 (list "CC=gcc"
1743 "--enable-shared"))) ; only static (.a) is built by default
340978d7 1744 (home-page "https://www.nongnu.org/lzip/lzlib.html")
2e3b1a92
TGR
1745 (synopsis "Lzip data compression C library")
1746 (description
1747 "Lzlib is a C library for in-memory LZMA compression and decompression in
1748the lzip format. It supports integrity checking of the decompressed data, and
1749all functions are thread-safe. The library should never crash, even in case of
1750corrupted input.")
1751 (license (list license:bsd-2 ; the library itself
1752 license:gpl2+)))) ; main.c (i.e. minilzip used by tests)
8c4ca853
TGR
1753
1754(define-public plzip
1755 (package
1756 (name "plzip")
ff0e1eed 1757 (version "1.8")
8c4ca853
TGR
1758 (source
1759 (origin
1760 (method url-fetch)
894669a7
TGR
1761 (uri (string-append "mirror://savannah/lzip/plzip/"
1762 "plzip-" version ".tar.gz"))
8c4ca853 1763 (sha256
ff0e1eed 1764 (base32 "04indil809qgfmz776imb3dnhkysh7zk28jcv3mw0ahl2lyaxbzd"))))
8c4ca853
TGR
1765 (build-system gnu-build-system)
1766 (inputs
1767 `(("lzlib" ,lzlib)))
340978d7 1768 (home-page "https://www.nongnu.org/lzip/plzip.html")
8c4ca853
TGR
1769 (synopsis "Parallel lossless data compressor for the lzip format")
1770 (description
1771 "Plzip is a massively parallel (multi-threaded) lossless data compressor
1772and decompressor that uses the lzip file format (.lz). Files produced by plzip
1773are fully compatible with lzip and can be rescued with lziprecover.
1774On multiprocessor machines, plzip can compress and decompress large files much
1775faster than lzip, at the cost of a slightly reduced compression ratio (0.4% to
17762%). The number of usable threads is limited by file size: on files of only a
1777few MiB, plzip is no faster than lzip.
1778Files that were compressed with regular lzip will also not be decompressed
1779faster by plzip, unless the @code{-b} option was used: lzip usually produces
1780single-member files which can't be decompressed in parallel.")
1781 (license (list license:bsd-2 ; arg_parser.{cc,h}
1782 license:gpl2+)))) ; everything else
e294c05e
RH
1783
1784(define-public innoextract
1785 (package
1786 (name "innoextract")
46b0136e 1787 (version "1.8")
e294c05e
RH
1788 (source
1789 (origin
1790 (method url-fetch)
ff983864
EF
1791 (uri (string-append "https://github.com/dscharrer/innoextract/releases"
1792 "/download/" version
1793 "/innoextract-" version ".tar.gz"))
e294c05e
RH
1794 (sha256
1795 (base32
46b0136e 1796 "0saj50n8ds85shygy4mq1h6s99510r9wgjjdll4dmvhra4lzcy2y"))))
e294c05e
RH
1797 (build-system cmake-build-system)
1798 (arguments
4788c1ae 1799 `(#:tests? #f
75ca2cda 1800 #:configure-flags '("-DBoost_NO_BOOST_CMAKE=ON")))
4cb9b726 1801 (inputs `(("boost" ,boost)
e294c05e
RH
1802 ("libiconv" ,libiconv)
1803 ("xz" ,xz)))
1804 (native-inputs `(("pkg-config" ,pkg-config)))
1805 (home-page "https://constexpr.org/innoextract/")
1806 (synopsis "Tool for extracting Inno Setup installers")
1807 (description "innoextract allows extracting Inno Setup installers under
1808non-Windows systems without running the actual installer using wine.")
1809 (license license:zlib)))
2ed0ef2f
LF
1810
1811(define-public google-brotli
1812 (package
1813 (name "google-brotli")
598c2bbc 1814 (version "1.0.7")
fc82c175
TGR
1815 (source
1816 (origin
1817 (method git-fetch)
1818 (uri (git-reference
1819 (url "https://github.com/google/brotli.git")
1820 (commit (string-append "v" version))))
1821 (file-name (git-file-name name version))
1822 (sha256
598c2bbc 1823 (base32 "1811b55wdfg4kbsjcgh1kc938g118jpvif97ilgrmbls25dfpvvw"))))
2ed0ef2f
LF
1824 (build-system cmake-build-system)
1825 (arguments
1826 `(#:phases
1827 (modify-phases %standard-phases
1828 (add-after 'install 'rename-static-libraries
1829 ;; The build tools put a 'static' suffix on the static libraries, but
1830 ;; other applications don't know how to find these.
1831 (lambda* (#:key outputs #:allow-other-keys)
1832 (let ((lib (string-append (assoc-ref %outputs "out") "/lib/")))
1833 (rename-file (string-append lib "libbrotlicommon-static.a")
1834 (string-append lib "libbrotlicommon.a"))
1835 (rename-file (string-append lib "libbrotlidec-static.a")
1836 (string-append lib "libbrotlidec.a"))
1837 (rename-file (string-append lib "libbrotlienc-static.a")
1838 (string-append lib "libbrotlienc.a"))
1839 #t))))
1840 #:configure-flags
1841 (list ;; Defaults to "lib64" on 64-bit archs.
1842 (string-append "-DCMAKE_INSTALL_LIBDIR="
1843 (assoc-ref %outputs "out") "/lib"))))
1844 (home-page "https://github.com/google/brotli")
1845 (synopsis "General-purpose lossless compression")
1846 (description "This package provides the reference implementation of Brotli,
1847a generic-purpose lossless compression algorithm that compresses data using a
1848combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd
1849order context modeling, with a compression ratio comparable to the best
1850currently available general-purpose compression methods. It is similar in speed
1851with @code{deflate} but offers more dense compression.
1852
1853The specification of the Brotli Compressed Data Format is defined in RFC 7932.")
1854 (license license:expat)))
71987177 1855
83ac7cb4
LDB
1856(define-public brotli
1857 ;; We used to provide an older version under the name "brotli".
1858 (deprecated-package "brotli" google-brotli))
1859
d2b237d0
AI
1860(define-public python-google-brotli
1861 (package
1862 (inherit google-brotli)
1863 (name "python-google-brotli")
1864 (build-system python-build-system)
1865 (arguments '())
1866 (synopsis "Python interface to google-brotli")
1867 (description "@code{python-google-brotli} provides a Python interface to
1868@code{google-brotli}, an implementation of the Brotli lossless compression
1869algorithm.")))
1870
71987177
PN
1871(define-public ucl
1872 (package
1873 (name "ucl")
1874 (version "1.03")
1875 (source (origin
1876 (method url-fetch)
01c8b90b 1877 (uri (string-append "https://www.oberhumer.com/opensource/"
71987177
PN
1878 name "/download/" name "-" version ".tar.gz"))
1879 (sha256
1880 (base32
1881 "0j036lkwsxvm15gr29n8wn07cqq79dswjs9k54939ms5zngjjrdq"))))
1882 (build-system gnu-build-system)
7349f926
MB
1883 (arguments
1884 `(;; UCL 1.03 fails to build with newer C standards.
41c27444
MB
1885 #:configure-flags '("CFLAGS=-std=gnu90"
1886 "--enable-shared" "--disable-static")))
01c8b90b 1887 (home-page "https://www.oberhumer.com/opensource/ucl/")
71987177
PN
1888 (synopsis "Portable lossless data compression library")
1889 (description "UCL implements a number of compression algorithms that
1890achieve an excellent compression ratio while allowing fast decompression.
1891Decompression requires no additional memory.
1892
1893Compared to LZO, the UCL algorithms achieve a better compression ratio but
1894decompression is a little bit slower.")
1895 (license license:gpl2+)))
5735256d
PN
1896
1897(define-public upx
1898 (package
1899 (name "upx")
f5255ed3 1900 (version "3.96")
5735256d
PN
1901 (source (origin
1902 (method url-fetch)
1903 (uri (string-append "https://github.com/upx/upx/releases/download/v"
de5bc83c 1904 version "/upx-" version "-src.tar.xz"))
5735256d
PN
1905 (sha256
1906 (base32
f5255ed3 1907 "051pk5jk8fcfg5mpgzj43z5p4cn7jy5jbyshyn78dwjqr7slsxs7"))))
5735256d 1908 (build-system gnu-build-system)
d8963031
MB
1909 (native-inputs
1910 `(("perl" ,perl)))
1911 (inputs
1912 `(("ucl" ,ucl)
1913 ("zlib" ,zlib)))
5735256d
PN
1914 (arguments
1915 `(#:make-flags
f5255ed3 1916 (list "all")
5735256d
PN
1917 #:phases
1918 (modify-phases %standard-phases
7046106e
TGR
1919 (delete 'configure) ; no configure script
1920 (delete 'check) ; no test suite
5735256d
PN
1921 (add-before 'build 'patch-exec-bin-sh
1922 (lambda _
7046106e
TGR
1923 (substitute* (list "Makefile"
1924 "src/Makefile")
5735256d
PN
1925 (("/bin/sh") (which "sh")))
1926 #t))
7046106e 1927 (replace 'install
5735256d
PN
1928 (lambda* (#:key outputs #:allow-other-keys)
1929 (let* ((out (assoc-ref outputs "out"))
7046106e 1930 (bin (string-append out "/bin")))
5735256d
PN
1931 (mkdir-p bin)
1932 (copy-file "src/upx.out" (string-append bin "/upx")))
7046106e 1933 #t)))))
5735256d
PN
1934 (home-page "https://upx.github.io/")
1935 (synopsis "Compression tool for executables")
1936 (description
1937 "The Ultimate Packer for eXecutables (UPX) is an executable file
1938compressor. UPX typically reduces the file size of programs and shared
1939libraries by around 50%--70%, thus reducing disk space, network load times,
1940download times, and other distribution and storage costs.")
1941 (license license:gpl2+)))
09debcf5
NG
1942
1943(define-public quazip
1944 (package
1945 (name "quazip")
d84ddbb9 1946 (version "0.9.1")
09debcf5
NG
1947 (source (origin
1948 (method git-fetch)
1949 (uri (git-reference
1950 (url "https://github.com/stachenov/quazip.git")
1951 (commit (string-append "v" version))))
1952 (file-name (git-file-name name version))
1953 (sha256
1954 (base32
d84ddbb9 1955 "11icgwv2xyxhd1hm1add51xv54zwkcqkg85d1xqlgiigvbm196iq"))))
09debcf5
NG
1956 (build-system cmake-build-system)
1957 (arguments
1958 `(#:tests? #f)) ;no test
1959 (native-inputs
1960 `(("doxygen" ,doxygen)))
1961 (inputs
1962 `(("qtbase" ,qtbase)
1963 ("zlib" ,zlib)))
1964 (home-page "https://stachenov.github.io/quazip/index.html")
1965 (synopsis "Qt/C++ wrapper for Minizip")
1966 (description "QuaZIP is a simple C++ wrapper over Gilles Vollant's
1967ZIP/UNZIP package that can be used to access ZIP archives. It uses
1968Trolltech's Qt toolkit.
1969
1970QuaZIP allows you to access files inside ZIP archives using QIODevice
1971API, and that means that you can also use QTextStream, QDataStream or
1972whatever you would like to use on your zipped files.
1973
1974QuaZIP provides complete abstraction of the ZIP/UNZIP API, for both
1975reading from and writing to ZIP archives. ")
1976 ;; Project is distributed under LGPL, but "quazip/z*" "quazip/unzip.*" are
1977 ;; distributed under zlib terms.
1978 (license (list license:lgpl2.1+ license:zlib))))
f5111b4d
TGR
1979
1980(define-public zutils
1981 (package
1982 (name "zutils")
1983 ;; Check and remove the lint-hidden-cve property when updating.
1984 (version "1.8")
1985 (source
1986 (origin
1987 (method url-fetch)
1988 (uri (string-append "mirror://savannah/zutils/zutils-" version ".tar.lz"))
1989 (sha256
1990 (base32 "0dx35mv78fgqgz6sszs05ng8ipz2xy09ry9vpmka2rmy08b7x907"))))
1991 (build-system gnu-build-system)
1992 (arguments
1993 `(#:configure-flags
1994 (list "--sysconfdir=/etc")
1995 #:phases
1996 (modify-phases %standard-phases
1997 (replace 'install
1998 (lambda* (#:key make-flags outputs #:allow-other-keys)
1999 (apply invoke "make" "install"
2000 (string-append "sysconfdir=" (assoc-ref outputs "out")
2001 "/etc")
2002 make-flags))))))
2003 (native-inputs
2004 ;; Needed to extract the source tarball and run the test suite.
2005 `(("lzip" ,lzip)))
2006 (properties `((lint-hidden-cve . ("CVE-2018-1000637"))))
2007 (home-page "https://www.nongnu.org/zutils/zutils.html")
2008 (synopsis "Utilities that transparently operate on compressed files")
2009 (description
2010 "Zutils is a collection of utilities able to process any combination of
2011compressed and uncompressed files transparently. If any given file, including
2012standard input, is compressed, its decompressed content is used instead.
2013
2014@command{zcat}, @command{zcmp}, @command{zdiff}, and @command{zgrep} are
2015improved replacements for the shell scripts provided by GNU gzip.
2016@command{ztest} tests the integrity of supported compressed files.
2017@command{zupdate} recompresses files with lzip, similar to gzip's
2018@command{znew}.
2019
2020Supported compression formats are bzip2, gzip, lzip, and xz. Zutils uses
2021external compressors: the compressor to be used for each format is configurable
2022at run time, and must be installed separately.")
2023 (license (list license:bsd-2 ; arg_parser.{cc,h}
2024 license:gpl2+)))) ; the rest
8ff5c735
PN
2025
2026(define-public makeself-safeextract
2027 (let ((commit "1a95e121fa8e3c02d307ae37b9b7834e616c3683"))
2028 (package
2029 (name "makeself-safeextract")
2030 (version (git-version "0.0.0" "1" commit))
2031 (home-page "https://github.com/ssokolow/makeself_safeextract")
2032 (source
2033 (origin
2034 (method git-fetch)
2035 (uri (git-reference
2036 (url home-page)
2037 (commit commit)))
2038 (file-name (git-file-name name version))
2039 (sha256
2040 (base32
2041 "1anlinaj9lvfi8bn00wp11vzqq0f9sig4fm9yrspisx31v0z4a2c"))))
2042 (build-system trivial-build-system)
2043 (inputs
2044 `(("python" ,python-2)
2045 ("p7zip" ,p7zip)
2046 ("unzip" ,unzip)))
2047 (arguments
2048 `(#:modules ((guix build utils))
2049 #:builder
2050 (begin
2051 (use-modules (guix build utils))
2052 (let* ((name "makeself_safeextract")
2053 (source (string-append (assoc-ref %build-inputs "source")
2054 "/" name ".py"))
2055 (bin (string-append (assoc-ref %outputs "out") "/bin"))
2056 (target (string-append bin "/" name))
2057 (python (string-append (assoc-ref %build-inputs "python") "/bin"))
2058 (7z (string-append (assoc-ref %build-inputs "p7zip") "/bin/7z"))
2059 (unzip (string-append (assoc-ref %build-inputs "unzip") "/bin/unzip")))
2060 (setenv "PATH" (string-append (getenv "PATH") ":" python))
2061 (mkdir-p bin)
2062 (copy-file source target)
2063 (substitute* target
2064 (("'7z'") (format #f "'~a'" 7z))
2065 (("'unzip'") (format #f "'~a'" unzip)))
2066 (patch-shebang target)))))
2067 (synopsis "Extract makeself and mojo archives without running untrusted code")
2068 (description "This package provides a script to unpack self-extracting
2069archives generated by @command{makeself} or @command{mojo} without running the
2070possibly untrusted extraction shell script.")
2071 (license license:gpl3+))))
9720104c
JN
2072
2073(define-public ncompress
2074 (package
2075 (name "ncompress")
f38eabe9 2076 (version "4.2.4.6")
9720104c
JN
2077 (source (origin
2078 (method git-fetch)
2079 (uri (git-reference
2080 (url "https://github.com/vapier/ncompress")
2081 (commit (string-append "v" version))))
2082 (patches (search-patches "ncompress-fix-softlinks.patch"))
2083 (file-name (string-append name "-" version ".tar.gz"))
2084 (sha256
2085 (base32
f38eabe9 2086 "1a4yir1ilafz0nzxdwigj204j4yy2zljbc501nsaqqm3dxdap8zn"))))
9720104c
JN
2087 (arguments
2088 '(#:make-flags (list "CC=gcc"
2089 (string-append "BINDIR=" %output "/bin")
2090 (string-append "MANDIR=" %output "/share/man/man1"))
2091 #:phases (modify-phases %standard-phases
2092 (delete 'configure))))
2093 (build-system gnu-build-system)
2094 (home-page "https://github.com/vapier/ncompress/")
2095 (synopsis "Original Lempel-Ziv compress/uncompress programs")
2096 (description "(N)compress provides the original compress and uncompress
2097programs that used to be the de facto UNIX standard for compressing and
2098uncompressing files. These programs implement a fast, simple Lempel-Ziv (LZW)
2099file compression algorithm.")
2100 (license license:gpl2+)))
0745e28d
RG
2101
2102(define-public xarchiver
2103 (package
2104 (name "xarchiver")
ddde8a07 2105 (version "0.5.4.15")
0745e28d
RG
2106 (source
2107 (origin
2108 (method git-fetch)
2109 (uri (git-reference
2110 (url "https://github.com/ib/xarchiver.git")
2111 (commit version)))
2112 (file-name (git-file-name name version))
2113 (sha256
ddde8a07 2114 (base32 "0a3y54r5zp2c0cqm77r07qrl1vh200wvqmbhm35diy22fvkq5mwc"))))
0745e28d
RG
2115 (build-system glib-or-gtk-build-system)
2116 (native-inputs
2117 `(("gettext" ,gettext-minimal)
2118 ("intltool" ,intltool)
2119 ("libxslt" ,libxslt)
2120 ("pkg-config" ,pkg-config)))
2121 (inputs
ddde8a07 2122 `(("adwaita-icon-theme" ,adwaita-icon-theme) ; hard-coded theme
0745e28d
RG
2123 ("gtk+" ,gtk+)))
2124 (home-page "https://github.com/ib/xarchiver")
2125 (synopsis "Graphical front-end for archive operations")
2126 (description "Xarchiver is a front-end to various command line archiving
2127tools. It uses GTK+ tool-kit and is designed to be desktop-environment
2128independent. Supported formats are 7z, ARJ, bzip2, gzip, LHA, lzma, lzop,
2129RAR, RPM, DEB, tar, and ZIP. It cannot perform functions for archives, whose
2130archiver is not installed.")
2131 (license license:gpl2+)))
910bf1f7
LDB
2132
2133(define-public tarsplitter
2134 (package
2135 (name "tarsplitter")
2136 (version "2.2.0")
2137 (source (origin
2138 (method git-fetch)
2139 (uri (git-reference
2140 (url "https://github.com/AQUAOSOTech/tarsplitter.git")
2141 (commit (string-append "v" version))))
2142 (file-name (git-file-name name version))
2143 (sha256
2144 (base32
2145 "17qkg95r97kcrs17b0mcqswx99280ni47j5yx8xa7nl3bdhm6325"))))
2146 (build-system go-build-system)
2147 (arguments
2148 `(#:import-path "github.com/AQUAOSOTech/tarsplitter"
2149 #:install-source? #f
2150 #:phases
2151 (modify-phases %standard-phases
2152 (add-after 'install 'install-documentation
2153 (lambda* (#:key import-path outputs #:allow-other-keys)
2154 (let* ((source (string-append "src/" import-path))
2155 (out (assoc-ref outputs "out"))
2156 (doc (string-append out "/share/doc/" ,name "-" ,version)))
2157 (with-directory-excursion source
2158 (install-file "README.md" doc))
2159 #t))))))
2160 (home-page "https://github.com/AQUAOSOTech/tarsplitter")
2161 (synopsis "Multithreaded tar utility")
2162 (description
bb6d9e26 2163 "Archive huge numbers of files, or split massive tar archives into smaller
910bf1f7
LDB
2164chunks.")
2165 (license license:expat)))
9a2fcb63
RW
2166
2167(define-public c-blosc
2168 (package
2169 (name "c-blosc")
2170 (version "1.18.1")
2171 (source (origin
2172 (method git-fetch)
2173 (uri (git-reference
2174 (url "https://github.com/Blosc/c-blosc.git")
2175 (commit (string-append "v" version))))
2176 (file-name (git-file-name name version))
2177 (sha256
2178 (base32
2179 "1ywq8j70149859vvs19wgjq89d6xsvvmvm2n1dmkzpchxgrvnw70"))))
2180 (build-system cmake-build-system)
2181 (home-page "https://blosc.org")
2182 (synopsis "Blocking, shuffling and lossless compression library")
2183 (description
2184 "Blosc is a high performance compressor optimized for binary data. It has
2185been designed to transmit data to the processor cache faster than the
2186traditional, non-compressed, direct memory fetch approach via a
2187@code{memcpy()} system call. Blosc is meant not only to reduce the size of
2188large datasets on-disk or in-memory, but also to accelerate memory-bound
2189computations.")
2190 ;; Blosc itself is released under BSD-3 but it incorporates code under
2191 ;; other non-copyleft licenses.
2192 (license license:bsd-3)))
3480ceb1
KK
2193
2194(define-public ecm
2195 (package
2196 (name "ecm")
2197 (version "1.0.3")
2198 (source (origin
2199 (method git-fetch)
2200 (uri (git-reference
2201 (url "https://github.com/alucryd/ecm-tools")
2202 (commit (string-append "v" version))))
2203 (file-name (git-file-name name version))
2204 (sha256
2205 (base32
2206 "1rvyx5gcy8lfklgj80szlz3312x45wzx0d9jsgwyvy8f6m4nnb0c"))))
2207 (build-system gnu-build-system)
2208 (arguments
2209 `(#:tests? #f ; no check target
2210 #:make-flags
1ca44ae3
MB
2211 (list (string-append "CC=" ,(cc-for-target))
2212 (string-append "DESTDIR=" (assoc-ref %outputs "out")))
3480ceb1
KK
2213 #:phases
2214 (modify-phases %standard-phases
2215 (replace 'configure
2216 (lambda _
2217 (substitute* "Makefile"
2218 (("\\$\\(DESTDIR\\)/usr") "$(DESTDIR)"))
2219 #t)))))
2220 (home-page "https://github.com/alucryd/ecm-tools")
2221 (synopsis "Error code modeler")
2222 (description "ECM is a utility that converts ECM files, i.e., CD data files
2223with their error correction data losslessly rearranged for better compression,
2224to their original, binary CD format.")
2225 (license license:gpl3+)))