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