compression.scm 78 KB

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