compression.scm 114 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013, 2014, 2015, 2017, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
  4. ;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
  5. ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
  6. ;;; Copyright © 2015, 2016 Eric Bavier <bavier@member.fsf.org>
  7. ;;; Copyright © 2015, 2016, 2017, 2018, 2020, 2021, 2022 Ricardo Wurmus <rekado@elephly.net>
  8. ;;; Copyright © 2015, 2017, 2018 Leo Famulari <leo@famulari.name>
  9. ;;; Copyright © 2015 Jeff Mickey <j@codemac.net>
  10. ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Efraim Flashner <efraim@flashner.co.il>
  11. ;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
  12. ;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
  13. ;;; Copyright © 2016–2021 Tobias Geerinckx-Rice <me@tobias.gr>
  14. ;;; Copyright © 2016 David Craven <david@craven.ch>
  15. ;;; Copyright © 2016, 2019, 2020 Kei Kebreau <kkebreau@posteo.net>
  16. ;;; Copyright © 2016, 2018, 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
  17. ;;; Copyright © 2017 Nikita <nikita@n0.is>
  18. ;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
  19. ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
  20. ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
  21. ;;; Copyright © 2017 Petter <petter@mykolab.ch>
  22. ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
  23. ;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
  24. ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
  25. ;;; Copyright © 2018, 2019 Pierre Neidhardt <mail@ambrevar.xyz>
  26. ;;; Copyright © 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
  27. ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  28. ;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
  29. ;;; Copyright © 2020 Arun Isaac <arunisaac@systemreboot.net>
  30. ;;; Copyright © 2020, 2021 Lars-Dominik Braun <lars@6xq.net>
  31. ;;; Copyright © 2020 Guillaume Le Vaillant <glv@posteo.net>
  32. ;;; Copyright © 2020 Léo Le Bouter <lle-bout@zaclys.net>
  33. ;;; Copyright © 2021 Antoine Côté <antoine.cote@posteo.net>
  34. ;;; Copyright © 2021 Vincent Legoll <vincent.legoll@gmail.com>
  35. ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
  36. ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
  37. ;;; Copyright © 2021 Ahmad Jarara <git@ajarara.io>
  38. ;;;
  39. ;;; This file is part of GNU Guix.
  40. ;;;
  41. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  42. ;;; under the terms of the GNU General Public License as published by
  43. ;;; the Free Software Foundation; either version 3 of the License, or (at
  44. ;;; your option) any later version.
  45. ;;;
  46. ;;; GNU Guix is distributed in the hope that it will be useful, but
  47. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  48. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  49. ;;; GNU General Public License for more details.
  50. ;;;
  51. ;;; You should have received a copy of the GNU General Public License
  52. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  53. (define-module (gnu packages compression)
  54. #:use-module ((guix licenses) #:prefix license:)
  55. #:use-module (guix utils)
  56. #:use-module (guix packages)
  57. #:use-module (guix download)
  58. #:use-module (guix git-download)
  59. #:use-module (guix build-system cmake)
  60. #:use-module (guix build-system glib-or-gtk)
  61. #:use-module (guix build-system gnu)
  62. #:use-module (guix build-system go)
  63. #:use-module (guix build-system meson)
  64. #:use-module (guix build-system python)
  65. #:use-module (guix build-system trivial)
  66. #:use-module (gnu packages)
  67. #:use-module (gnu packages assembly)
  68. #:use-module (gnu packages autotools)
  69. #:use-module (gnu packages backup)
  70. #:use-module (gnu packages base)
  71. #:use-module (gnu packages benchmark)
  72. #:use-module (gnu packages boost)
  73. #:use-module (gnu packages check)
  74. #:use-module (gnu packages curl)
  75. #:use-module (gnu packages documentation)
  76. #:use-module (gnu packages file)
  77. #:use-module (gnu packages gettext)
  78. #:use-module (gnu packages glib)
  79. #:use-module (gnu packages gnome)
  80. #:use-module (gnu packages gnupg)
  81. #:use-module (gnu packages gtk)
  82. #:use-module (gnu packages llvm)
  83. #:use-module (gnu packages man)
  84. #:use-module (gnu packages maths)
  85. #:use-module (gnu packages perl)
  86. #:use-module (gnu packages pkg-config)
  87. #:use-module (gnu packages python)
  88. #:use-module (gnu packages qt)
  89. #:use-module (gnu packages selinux)
  90. #:use-module (gnu packages tls)
  91. #:use-module (gnu packages valgrind)
  92. #:use-module (gnu packages version-control)
  93. #:use-module (gnu packages xml)
  94. #:use-module (ice-9 match)
  95. #:use-module (srfi srfi-1))
  96. (define-public zlib
  97. (package
  98. (name "zlib")
  99. (version "1.2.11")
  100. (source
  101. (origin
  102. (method url-fetch)
  103. (uri (list (string-append "http://zlib.net/zlib-"
  104. version ".tar.gz")
  105. (string-append "mirror://sourceforge/libpng/zlib/"
  106. version "/zlib-" version ".tar.gz")))
  107. (sha256
  108. (base32
  109. "18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3"))))
  110. (build-system gnu-build-system)
  111. (outputs '("out" "static"))
  112. (arguments
  113. `(#:phases
  114. (modify-phases %standard-phases
  115. (replace 'configure
  116. (lambda* (#:key outputs #:allow-other-keys)
  117. ;; Zlib's home-made `configure' fails when passed
  118. ;; extra flags like `--enable-fast-install', so we need to
  119. ;; invoke it with just what it understand.
  120. (let ((out (assoc-ref outputs "out")))
  121. ;; 'configure' doesn't understand '--host'.
  122. ,@(if (%current-target-system)
  123. `((setenv "CHOST" ,(%current-target-system)))
  124. '())
  125. (invoke "./configure"
  126. (string-append "--prefix=" out)))))
  127. (add-after 'install 'move-static-library
  128. (lambda* (#:key outputs #:allow-other-keys)
  129. (let ((out (assoc-ref outputs "out"))
  130. (static (assoc-ref outputs "static")))
  131. (with-directory-excursion (string-append out "/lib")
  132. (install-file "libz.a" (string-append static "/lib"))
  133. (delete-file "libz.a")
  134. #t)))))))
  135. (home-page "https://zlib.net/")
  136. (synopsis "Compression library")
  137. (description
  138. "zlib is designed to be a free, general-purpose, legally unencumbered --
  139. that is, not covered by any patents -- lossless data-compression library for
  140. use on virtually any computer hardware and operating system. The zlib data
  141. format is itself portable across platforms. Unlike the LZW compression method
  142. used in Unix compress(1) and in the GIF image format, the compression method
  143. currently used in zlib essentially never expands the data. (LZW can double or
  144. triple the file size in extreme cases.) zlib's memory footprint is also
  145. independent of the input data and can be reduced, if necessary, at some cost
  146. in compression.")
  147. (license license:zlib)))
  148. (define-public minizip
  149. (package
  150. (name "minizip")
  151. (version (package-version zlib))
  152. (source (package-source zlib))
  153. (build-system gnu-build-system)
  154. (arguments
  155. `(#:phases
  156. (modify-phases %standard-phases
  157. (add-after 'unpack 'enter-source
  158. (lambda _ (chdir "contrib/minizip") #t))
  159. (add-after 'install 'remove-crypt-h
  160. (lambda* (#:key outputs #:allow-other-keys)
  161. ;; Remove <minizip/crypt.h> because it interferes with libc's
  162. ;; <crypt.h> given that 'minizip.pc' says "-I…/include/minizip".
  163. ;; Fedora does the same:
  164. ;; <https://src.fedoraproject.org/rpms/zlib/c/4d2785ec3116947872f6f32dc4104e6d36d8a7a4?branch=master>.
  165. (let ((out (assoc-ref outputs "out")))
  166. (delete-file (string-append out "/include/minizip/crypt.h"))
  167. #t))))))
  168. (native-inputs
  169. (list autoconf automake libtool))
  170. (propagated-inputs (list zlib))
  171. (home-page (package-home-page zlib))
  172. (synopsis "Zip Compression library")
  173. (description
  174. "Minizip is a minimalistic library that supports compressing,
  175. extracting and viewing ZIP archives. This version is extracted from
  176. the @code{zlib} source.")
  177. (license (package-license zlib))))
  178. (define-public fastjar
  179. (package
  180. (name "fastjar")
  181. (version "0.98")
  182. (source (origin
  183. (method url-fetch)
  184. (uri (string-append "mirror://savannah/fastjar/fastjar-"
  185. version ".tar.gz"))
  186. (sha256
  187. (base32
  188. "0iginbz2m15hcsa3x4y7v3mhk54gr1r7m3ghx0pg4n46vv2snmpi"))))
  189. (build-system gnu-build-system)
  190. (inputs (list zlib))
  191. (home-page "https://savannah.nongnu.org/projects/fastjar")
  192. (synopsis "Replacement for Sun's 'jar' utility")
  193. (description
  194. "FastJar is an attempt to create a much faster replacement for Sun's
  195. @code{jar} utility. Instead of being written in Java, FastJar is written in C.")
  196. (license license:gpl2+)))
  197. (define-public libtar
  198. (package
  199. (name "libtar")
  200. (version "1.2.20")
  201. (source (origin
  202. (method url-fetch)
  203. (uri (list
  204. (string-append
  205. "ftp://ftp.feep.net/pub/software/libtar/libtar-"
  206. version ".tar.gz")
  207. (string-append
  208. "mirror://debian/pool/main/libt/libtar/libtar_"
  209. version ".orig.tar.gz")))
  210. (sha256
  211. (base32
  212. "02cihzl77ia0dcz7z2cga2412vyhhs5pa2355q4wpwbyga2lrwjh"))
  213. (patches (search-patches "libtar-CVE-2013-4420.patch"))))
  214. (build-system gnu-build-system)
  215. (arguments `(#:tests? #f)) ; no "check" target
  216. (native-inputs
  217. (list autoconf automake libtool))
  218. (inputs
  219. (list zlib))
  220. (synopsis "C library for manipulating POSIX tar files")
  221. (description
  222. "libtar is a C library for manipulating POSIX tar files. It handles
  223. adding and extracting files to/from a tar archive.")
  224. (home-page "https://repo.or.cz/libtar.git")
  225. (license license:bsd-3)))
  226. (define-public gzip
  227. (package
  228. (name "gzip")
  229. (version "1.10")
  230. (source (origin
  231. (method url-fetch)
  232. (uri (string-append "mirror://gnu/gzip/gzip-"
  233. version ".tar.xz"))
  234. (sha256
  235. (base32
  236. "1h6p374d3j8d4cdfydzls021xa2yby8myc0h8d6m8bc7k6ncq9c4"))))
  237. (build-system gnu-build-system)
  238. (synopsis "General file (de)compression (using lzw)")
  239. (arguments
  240. ;; FIXME: The test suite wants `less', and optionally Perl.
  241. '(#:tests? #f
  242. #:phases
  243. (modify-phases %standard-phases
  244. (add-after 'unpack 'patch-for-glibc-2.28
  245. (lambda _
  246. ;; Adjust the bundled gnulib to work with glibc 2.28. See e.g.
  247. ;; "m4-gnulib-libio.patch". This is a phase rather than patch
  248. ;; or snippet to work around <https://bugs.gnu.org/32347>.
  249. (substitute* (find-files "lib" "\\.c$")
  250. (("#if defined _IO_ftrylockfile")
  251. "#if defined _IO_EOF_SEEN"))
  252. (substitute* "lib/stdio-impl.h"
  253. (("^/\\* BSD stdio derived implementations")
  254. (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
  255. "# define _IO_IN_BACKUP 0x100\n"
  256. "#endif\n\n"
  257. "/* BSD stdio derived implementations")))
  258. #t))
  259. (add-after 'unpack 'use-absolute-name-of-gzip
  260. (lambda* (#:key outputs #:allow-other-keys)
  261. (substitute* "gunzip.in"
  262. (("exec gzip")
  263. (string-append "exec " (assoc-ref outputs "out")
  264. "/bin/gzip")))
  265. #t)))))
  266. (description
  267. "GNU Gzip provides data compression and decompression utilities; the
  268. typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
  269. file; as a result, it is often used in conjunction with \"tar\", resulting in
  270. \".tar.gz\" or \".tgz\", etc.")
  271. (license license:gpl3+)
  272. (home-page "https://www.gnu.org/software/gzip/")))
  273. (define-public bzip2
  274. (package
  275. (name "bzip2")
  276. (version "1.0.8")
  277. (source (origin
  278. (method url-fetch)
  279. (uri (string-append "https://sourceware.org/pub/bzip2/bzip2-"
  280. version ".tar.gz"))
  281. (sha256
  282. (base32
  283. "0s92986cv0p692icqlw1j42y9nld8zd83qwhzbqd61p1dqbh6nmb"))))
  284. (build-system gnu-build-system)
  285. (arguments
  286. `(#:modules ((guix build gnu-build-system)
  287. (guix build utils)
  288. (ice-9 ftw)
  289. (srfi srfi-1))
  290. #:phases
  291. (modify-phases %standard-phases
  292. (add-after 'set-paths 'hide-input-bzip2
  293. (lambda* (#:key inputs #:allow-other-keys)
  294. (let ((bzip2 (assoc-ref inputs "bzip2")))
  295. (if bzip2
  296. ;; Prevent the build system from retaining a reference to
  297. ;; BZIP2 from INPUTS.
  298. (begin
  299. (setenv "LIBRARY_PATH"
  300. (string-join (delete (string-append bzip2 "/lib")
  301. (string-split (getenv "LIBRARY_PATH")
  302. #\:))
  303. ":"))
  304. (format #t "environment variable `LIBRARY_PATH' set to `~a'~%"
  305. (getenv "LIBRARY_PATH")))
  306. (format #t "no bzip2 found, nothing done~%"))
  307. #t)))
  308. (replace 'configure
  309. (lambda* (#:key target #:allow-other-keys)
  310. (when ,(%current-target-system)
  311. ;; Cross-compilation: use the cross tools.
  312. (substitute* (find-files "." "Makefile")
  313. (("CC=.*$")
  314. (string-append "CC = " target "-gcc\n"))
  315. (("AR=.*$")
  316. (string-append "AR = " target "-ar\n"))
  317. (("RANLIB=.*$")
  318. (string-append "RANLIB = " target "-ranlib\n"))
  319. (("^all:(.*)test" _ prerequisites)
  320. ;; Remove 'all' -> 'test' dependency.
  321. (string-append "all:" prerequisites "\n"))))
  322. #t))
  323. (add-before 'build 'build-shared-lib
  324. (lambda* (#:key inputs #:allow-other-keys)
  325. (patch-makefile-SHELL "Makefile-libbz2_so")
  326. (invoke "make" "-f" "Makefile-libbz2_so")))
  327. (add-after 'install 'install-shared-lib
  328. (lambda* (#:key outputs #:allow-other-keys)
  329. ;; The Makefile above does not have an 'install' target, nor does
  330. ;; it create all the (un)versioned symlinks, so we handle it here.
  331. (let* ((out (assoc-ref outputs "out"))
  332. (libdir (string-append out "/lib"))
  333. (soname "libbz2.so")
  334. ;; Locate the built library (e.g. "libbz2.so.1.0.6").
  335. (lib (car (scandir "."
  336. (lambda (file)
  337. (and (string-prefix? soname file)
  338. (eq? 'regular
  339. (stat:type (lstat file))))))))
  340. (soversion (string-drop lib (+ 1 (string-length soname)))))
  341. (install-file lib libdir)
  342. (with-directory-excursion libdir
  343. ;; Create symlinks libbz2.so.1 -> libbz2.so.1.0, etc.
  344. (let loop ((base soname)
  345. (numbers (string-split soversion #\.)))
  346. (unless (null? numbers)
  347. (let ((so-file (string-append base "." (car numbers))))
  348. (symlink so-file base)
  349. (loop so-file (cdr numbers))))))
  350. #t)))
  351. (add-after 'install-shared-lib 'move-static-lib
  352. (lambda* (#:key outputs #:allow-other-keys)
  353. (let ((out (assoc-ref outputs "out"))
  354. (static (assoc-ref outputs "static")))
  355. (with-directory-excursion (string-append out "/lib")
  356. (install-file "libbz2.a" (string-append static "/lib"))
  357. (delete-file "libbz2.a")
  358. #t))))
  359. (add-after 'install-shared-lib 'patch-scripts
  360. (lambda* (#:key outputs inputs #:allow-other-keys)
  361. (let* ((out (assoc-ref outputs "out")))
  362. (substitute* (string-append out "/bin/bzdiff")
  363. (("/bin/rm") "rm")))
  364. #t)))
  365. #:make-flags (list (string-append "PREFIX="
  366. (assoc-ref %outputs "out")))
  367. ;; Don't attempt to run the tests when cross-compiling.
  368. ,@(if (%current-target-system)
  369. '(#:tests? #f)
  370. '())))
  371. (outputs '("out" "static"))
  372. (synopsis "High-quality data compression program")
  373. (description
  374. "bzip2 is a freely available, patent free (see below), high-quality data
  375. compressor. It typically compresses files to within 10% to 15% of the best
  376. available techniques (the PPM family of statistical compressors), whilst
  377. being around twice as fast at compression and six times faster at
  378. decompression.")
  379. (license (license:non-copyleft "file://LICENSE"
  380. "See LICENSE in the distribution."))
  381. (home-page "https://web.archive.org/web/20180801004107/http://www.bzip.org/")))
  382. (define-public lbzip2
  383. ;; The last 2.5 release is 4 years behind the newest commit (from 2018) and
  384. ;; may create files that can't even be decompressed by newer bzip2 versions.
  385. (let ((commit "b6dc48a7b9bfe6b340ed1f6d72133608ad57144b")
  386. (revision "0"))
  387. (package
  388. (name "lbzip2")
  389. (version (git-version "2.5" revision commit))
  390. (source
  391. (origin
  392. (method git-fetch)
  393. (uri (git-reference
  394. (url "https://github.com/kjn/lbzip2")
  395. (commit commit)))
  396. (sha256
  397. (base32 "140xp00dmjsr6c3dwb4dwf0pzlgf159igri321inbinsjiclkngy"))
  398. (file-name (git-file-name name version))))
  399. (build-system gnu-build-system)
  400. (arguments
  401. `(#:phases
  402. (modify-phases %standard-phases
  403. (add-after 'unpack 'unpack-gnulib
  404. (lambda* (#:key inputs native-inputs #:allow-other-keys)
  405. (let ((gnulib
  406. (dirname (search-input-file (or native-inputs inputs)
  407. "gnulib-tool.py"))))
  408. (copy-recursively gnulib "lib")
  409. (setenv "PATH" (string-append "lib:" (getenv "PATH")))
  410. #t)))
  411. (delete 'bootstrap) ; gnulib still has unpatched shebangs
  412. (add-after 'patch-source-shebangs 'bootstrap
  413. (lambda _
  414. (invoke "sh" "build-aux/autogen.sh")
  415. #t)))))
  416. (native-inputs
  417. `(("autoconf" ,autoconf)
  418. ("automake" ,automake)
  419. ("gnulib"
  420. ,(let ((commit "2d431ac35c4943a3655c07ba91870d2323321b43"))
  421. (origin
  422. (method git-fetch)
  423. (uri (git-reference
  424. (url "git://git.savannah.gnu.org/gnulib.git")
  425. (commit commit)))
  426. (sha256
  427. (base32 "1f0xr4w89bqvhzsfcflcagdixidrk41k00k7kpr91w9lazfis4kf"))
  428. (file-name (git-file-name "gnulib" commit)))))
  429. ("perl" ,perl)))
  430. (synopsis "Parallel bzip2 compression utility")
  431. (description
  432. "lbzip2 is a multi-threaded compression utility with support for the
  433. bzip2 compressed file format. lbzip2 can process standard bz2 files in
  434. parallel. It uses POSIX threading model (pthreads), which allows it to take
  435. full advantage of symmetric multiprocessing (SMP) systems. It has been proven
  436. to scale linearly, even to over one hundred processor cores. lbzip2 is fully
  437. compatible with bzip2 – both at file format and command line level.")
  438. ;; lbzip2.org now looks fishy. There is no source code to be found.
  439. ;; Reported upstream: <https://github.com/kjn/lbzip2/issues/26>.
  440. (home-page "https://github.com/kjn/lbzip2")
  441. (license license:gpl3+))))
  442. (define-public pbzip2
  443. (package
  444. (name "pbzip2")
  445. (version "1.1.13")
  446. (source (origin
  447. (method url-fetch)
  448. (uri (string-append "https://launchpad.net/pbzip2/"
  449. (version-major+minor version) "/" version
  450. "/+download/" name "-" version ".tar.gz"))
  451. (sha256
  452. (base32
  453. "1rnvgcdixjzbrmcr1nv9b6ccrjfrhryaj7jwz28yxxv6lam3xlcg"))))
  454. (build-system gnu-build-system)
  455. (inputs
  456. (list bzip2))
  457. (arguments
  458. `(#:tests? #f ; no tests
  459. #:phases (modify-phases %standard-phases
  460. (delete 'configure)) ; no configure script
  461. #:make-flags (list (string-append "PREFIX=" %output))))
  462. (home-page (string-append "https://web.archive.org/web/20180412020219/"
  463. "http://compression.ca/pbzip2/"))
  464. (synopsis "Parallel bzip2 implementation")
  465. (description
  466. "Pbzip2 is a parallel implementation of the bzip2 block-sorting file
  467. compressor that uses pthreads and achieves near-linear speedup on SMP machines.
  468. The output of this version is fully compatible with bzip2 v1.0.2 (i.e. anything
  469. compressed with pbzip2 can be decompressed with bzip2).")
  470. (license (license:non-copyleft "file://COPYING"
  471. "See COPYING in the distribution."))))
  472. (define-public xz
  473. (package
  474. (name "xz")
  475. (version "5.2.5")
  476. (source (origin
  477. (method url-fetch)
  478. (uri (list (string-append "http://tukaani.org/xz/xz-" version
  479. ".tar.gz")
  480. (string-append "http://multiprecision.org/guix/xz-"
  481. version ".tar.gz")))
  482. (sha256
  483. (base32
  484. "045s9agl3bpv3swlwydhgsqh7791957vmgw2plw8f1rks07r3x7n"))))
  485. (build-system gnu-build-system)
  486. (arguments
  487. `(#:phases
  488. (modify-phases %standard-phases
  489. (add-after 'install 'move-static-lib
  490. (lambda* (#:key outputs #:allow-other-keys)
  491. (let ((out (assoc-ref outputs "out"))
  492. (static (assoc-ref outputs "static")))
  493. (mkdir-p (string-append static "/lib"))
  494. (rename-file (string-append out "/lib/liblzma.a")
  495. (string-append static "/lib/liblzma.a"))
  496. ;; Remove reference to the static library from the .la file
  497. ;; so Libtool does the right thing when both the shared and
  498. ;; static library is available.
  499. (substitute* (string-append out "/lib/liblzma.la")
  500. (("^old_library='liblzma.a'") "old_library=''"))
  501. #t))))))
  502. (outputs '("out" "static"))
  503. (synopsis "General-purpose data compression")
  504. (description
  505. "XZ Utils is free general-purpose data compression software with high
  506. compression ratio. XZ Utils were written for POSIX-like systems, but also
  507. work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
  508. The core of the XZ Utils compression code is based on LZMA SDK, but it has
  509. been modified quite a lot to be suitable for XZ Utils. The primary
  510. compression algorithm is currently LZMA2, which is used inside the .xz
  511. container format. With typical files, XZ Utils create 30 % smaller output
  512. than gzip and 15 % smaller output than bzip2.")
  513. (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
  514. (home-page "https://tukaani.org/xz/")))
  515. (define-public lhasa
  516. (package
  517. (name "lhasa")
  518. (version "0.3.1")
  519. (source (origin
  520. (method url-fetch)
  521. (uri (string-append
  522. "https://github.com/fragglet/lhasa/releases/download/v"
  523. version "/lhasa-" version ".tar.gz"))
  524. (sha256
  525. (base32
  526. "092zi9av18ma20c6h9448k0bapvx2plnp292741dvfd9hmgqxc1z"))))
  527. (build-system gnu-build-system)
  528. (arguments
  529. '(#:phases
  530. (modify-phases %standard-phases
  531. (add-before 'check 'set-up-test-environment
  532. (lambda* (#:key inputs #:allow-other-keys)
  533. (setenv "TZDIR"
  534. (search-input-directory inputs
  535. "share/zoneinfo")))))))
  536. (native-inputs
  537. (list tzdata-for-tests))
  538. (home-page "https://fragglet.github.com/lhasa/")
  539. (synopsis "LHA archive decompressor")
  540. (description "Lhasa is a replacement for the Unix LHA tool, for
  541. decompressing .lzh (LHA / LHarc) and .lzs (LArc) archives. The backend for the
  542. tool is a library, so that it can be reused for other purposes. Lhasa aims to
  543. be compatible with as many types of lzh/lzs archives as possible. It also aims
  544. to generate the same output as the (non-free) Unix LHA tool, so that it will
  545. act as a free drop-in replacement.")
  546. (license license:isc)))
  547. (define-public lzo
  548. (package
  549. (name "lzo")
  550. (version "2.10")
  551. (source
  552. (origin
  553. (method url-fetch)
  554. (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
  555. version ".tar.gz"))
  556. (sha256
  557. (base32
  558. "0wm04519pd3g8hqpjqhfr72q8qmbiwqaxcs3cndny9h86aa95y60"))))
  559. (build-system gnu-build-system)
  560. (arguments '(#:configure-flags '("--enable-shared")))
  561. (home-page "http://www.oberhumer.com/opensource/lzo")
  562. (synopsis
  563. "Data compression library suitable for real-time data de-/compression")
  564. (description
  565. "LZO is a data compression library which is suitable for data
  566. de-/compression in real-time. This means it favours speed over
  567. compression ratio.
  568. LZO is written in ANSI C. Both the source code and the compressed data
  569. format are designed to be portable across platforms.")
  570. (license license:gpl2+)))
  571. (define-public lzop
  572. (package
  573. (name "lzop")
  574. (version "1.04")
  575. (source
  576. (origin
  577. (method url-fetch)
  578. (uri (string-append "http://www.lzop.org/download/lzop-"
  579. version ".tar.gz"))
  580. (sha256
  581. (base32
  582. "0h9gb8q7y54m9mvy3jvsmxf21yx8fc3ylzh418hgbbv0i8mbcwky"))))
  583. (build-system gnu-build-system)
  584. (inputs (list lzo))
  585. (home-page "https://www.lzop.org/")
  586. (synopsis "Compress or expand files")
  587. (description
  588. "Lzop is a file compressor which is very similar to gzip. Lzop uses the
  589. LZO data compression library for compression services, and its main advantages
  590. over gzip are much higher compression and decompression speed (at the cost of
  591. some compression ratio).")
  592. (license license:gpl2+)))
  593. (define-public lzip
  594. (package
  595. (name "lzip")
  596. (version "1.22")
  597. (source (origin
  598. (method url-fetch)
  599. (uri (string-append "mirror://savannah/lzip/lzip-"
  600. version ".tar.gz"))
  601. (sha256
  602. (base32
  603. "0j59hx72258334rmkwn57ahr6s69nlrx0a5ip1jw2fbiwr12sd63"))))
  604. (build-system gnu-build-system)
  605. (home-page "https://www.nongnu.org/lzip/lzip.html")
  606. (synopsis "Lossless data compressor based on the LZMA algorithm")
  607. (description
  608. "Lzip is a lossless data compressor with a user interface similar to the
  609. one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
  610. more than bzip2, which makes it well-suited for software distribution and data
  611. archiving. Lzip is a clean implementation of the LZMA algorithm.")
  612. (license license:gpl3+)))
  613. (define-public lziprecover
  614. (package
  615. (name "lziprecover")
  616. (version "1.22")
  617. (source (origin
  618. (method url-fetch)
  619. (uri (string-append "mirror://savannah/lzip/lziprecover/"
  620. "lziprecover-" version ".tar.gz"))
  621. (sha256
  622. (base32
  623. "0qh8dnhr5rly2k9dnx43qqynqwqzi5kfb15pyd29qwppfl4qm5gx"))))
  624. (build-system gnu-build-system)
  625. (home-page "https://www.nongnu.org/lzip/lziprecover.html")
  626. (synopsis "Recover and decompress data from damaged lzip files")
  627. (description
  628. "Lziprecover is a data recovery tool and decompressor for files in the lzip
  629. compressed data format (.lz). It can test the integrity of lzip files, extract
  630. data from damaged ones, and repair most files with small errors (up to one
  631. single-byte error per member) entirely.
  632. Lziprecover is not a replacement for regular backups, but a last line of defence
  633. when even the backups are corrupt. It can recover files by merging the good
  634. parts of two or more damaged copies, such as can be easily produced by running
  635. @command{ddrescue} on a failing device.
  636. This package also includes @command{unzcrash}, a tool to test the robustness of
  637. decompressors when faced with corrupted input.")
  638. (license (list license:bsd-2 ; arg_parser.{cc,h}
  639. license:gpl2+)))) ; everything else
  640. (define-public sharutils
  641. (package
  642. (name "sharutils")
  643. (version "4.15.2")
  644. (source
  645. (origin
  646. (method url-fetch)
  647. (uri (string-append "mirror://gnu/sharutils/sharutils-"
  648. version ".tar.xz"))
  649. (patches (search-patches "sharutils-CVE-2018-1000097.patch"))
  650. (sha256
  651. (base32
  652. "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))
  653. (modules '((guix build utils)))
  654. (snippet
  655. '(begin
  656. ;; Adjust for newer libc versions.
  657. (substitute* (find-files "lib" "\\.c$")
  658. (("#if defined _IO_ftrylockfile")
  659. "#if defined _IO_EOF_SEEN"))
  660. (substitute* "lib/stdio-impl.h"
  661. (("^/\\* BSD stdio derived implementations")
  662. (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
  663. "# define _IO_IN_BACKUP 0x100\n"
  664. "#endif\n\n"
  665. "/* BSD stdio derived implementations")))
  666. ;; ... and for newer GCC with -fno-common.
  667. (substitute* '("src/shar-opts.h"
  668. "src/unshar-opts.h"
  669. "src/uudecode-opts.h"
  670. "src/uuencode-opts.h")
  671. (("char const \\* const program_name" all)
  672. (string-append "extern " all)))))))
  673. (build-system gnu-build-system)
  674. (native-inputs
  675. (list which))
  676. (arguments
  677. `(#:phases
  678. (modify-phases %standard-phases
  679. (add-after 'patch-source-shebangs 'unpatch-source-shebang
  680. ;; revert the patch-shebang phase on a script which is
  681. ;; in fact test data
  682. (lambda _
  683. (substitute* "tests/shar-1.ok"
  684. (((which "sh")) "/bin/sh")))))))
  685. (home-page "https://www.gnu.org/software/sharutils/")
  686. (synopsis "Archives in shell scripts, uuencode/uudecode")
  687. (description
  688. "GNU sharutils is a package for creating and manipulating shell
  689. archives that can be readily emailed. A shell archive is a file that can be
  690. processed by a Bourne-type shell to unpack the original collection of files.
  691. This package is mostly for compatibility and historical interest.")
  692. (license license:gpl3+)))
  693. (define-public sfarklib
  694. (package
  695. (name "sfarklib")
  696. (version "2.24")
  697. (source (origin
  698. (method git-fetch)
  699. (uri (git-reference
  700. (url "https://github.com/raboof/sfArkLib")
  701. (commit version)))
  702. (file-name (git-file-name name version))
  703. (sha256
  704. (base32
  705. "0jrxy24gak7q5ml06p5jjgzk9i5r2mkfjk4ycirkp4kg7k5a237w"))))
  706. (build-system gnu-build-system)
  707. (arguments
  708. `(#:tests? #f ;no "check" target
  709. #:phases
  710. (modify-phases %standard-phases
  711. (replace 'configure
  712. (lambda* (#:key outputs #:allow-other-keys)
  713. (substitute* "Makefile"
  714. (("/usr/local") (assoc-ref outputs "out")))
  715. #t)))))
  716. (inputs
  717. (list zlib))
  718. (home-page "https://github.com/raboof/sfArkLib")
  719. (synopsis "Library for SoundFont decompression")
  720. (description
  721. "SfArkLib is a C++ library for decompressing SoundFont files compressed
  722. with the sfArk algorithm.")
  723. (license license:gpl3+)))
  724. (define-public sfarkxtc
  725. (let ((commit "13cd6f93725a90d91ec5ea75babf1dbd694ac463")
  726. (revision "1"))
  727. (package
  728. (name "sfarkxtc")
  729. (version (git-version "0" revision commit))
  730. (source (origin
  731. ;; There are no release tarballs, so we just fetch the latest
  732. ;; commit at this time.
  733. (method git-fetch)
  734. (uri (git-reference
  735. (url "https://github.com/raboof/sfarkxtc")
  736. (commit commit)))
  737. (file-name (git-file-name name version))
  738. (sha256
  739. (base32
  740. "1mb1jyk1m11l1gppd9hmql9cyp55sdf7jk5rbc7acky1z4k4mv19"))))
  741. (build-system gnu-build-system)
  742. (arguments
  743. `(#:tests? #f ;no "check" target
  744. #:phases
  745. (modify-phases %standard-phases
  746. (replace 'configure
  747. (lambda* (#:key outputs #:allow-other-keys)
  748. (substitute* "Makefile"
  749. (("/usr/local") (assoc-ref outputs "out")))
  750. #t)))))
  751. (inputs
  752. (list zlib sfarklib))
  753. (home-page "https://github.com/raboof/sfarkxtc")
  754. (synopsis "Basic sfArk decompressor")
  755. (description "SfArk extractor converts SoundFonts in the compressed legacy
  756. sfArk file format to the uncompressed sf2 format.")
  757. (license license:gpl3+))))
  758. (define-public libmspack
  759. (package
  760. (name "libmspack")
  761. (home-page "https://cabextract.org.uk/libmspack/")
  762. (version "0.10.1")
  763. (source
  764. (origin
  765. (method url-fetch)
  766. (uri (string-append home-page name "-" version "alpha.tar.gz"))
  767. (sha256
  768. (base32 "13janaqsvm7aqc4agjgd4819pbgqv50j88bh5kci1z70wvg65j5s"))))
  769. (build-system gnu-build-system)
  770. (arguments
  771. `(#:configure-flags '("--disable-static")))
  772. (synopsis "Compression tools for some formats used by Microsoft")
  773. (description
  774. "The purpose of libmspack is to provide both compression and
  775. decompression of some loosely related file formats used by Microsoft.")
  776. (license license:lgpl2.1+)))
  777. (define-public lz4
  778. (package
  779. (name "lz4")
  780. (version "1.9.3")
  781. (source
  782. (origin
  783. (method git-fetch)
  784. (uri (git-reference (url "https://github.com/lz4/lz4")
  785. (commit (string-append "v" version))))
  786. (sha256
  787. (base32 "1w02kazh1fps3sji2sn89fz862j1199c5ajrqcgl1bnlxj09kcbz"))
  788. (file-name (git-file-name name version))))
  789. (build-system gnu-build-system)
  790. (outputs (list "out" "static"))
  791. (native-inputs
  792. (append
  793. (list python) ;; For tests.
  794. (if (member (%current-system) (package-supported-systems valgrind))
  795. (list valgrind)
  796. '())))
  797. (arguments
  798. `(;; Not designed for parallel testing.
  799. ;; See https://github.com/lz4/lz4/issues/957#issuecomment-737419821
  800. #:parallel-tests? #f
  801. #:test-target "test"
  802. #:make-flags (list (string-append "CC=" ,(cc-for-target))
  803. (string-append "prefix=" (assoc-ref %outputs "out")))
  804. #:phases
  805. (modify-phases %standard-phases
  806. (delete 'configure) ; no configure script
  807. (add-before 'check 'disable-broken-test
  808. (lambda _
  809. (substitute* "tests/Makefile"
  810. ;; This fails when $prefix is not a single top-level directory.
  811. (("^test: (.*) test-install" _ targets)
  812. (string-append "test: " targets)))
  813. #t))
  814. (add-after 'install 'move-static-library
  815. (lambda* (#:key outputs #:allow-other-keys)
  816. (let ((out (assoc-ref outputs "out"))
  817. (static (assoc-ref outputs "static")))
  818. (mkdir-p (string-append static "/lib"))
  819. (rename-file (string-append out "/lib/liblz4.a")
  820. (string-append static "/lib/liblz4.a"))
  821. #t))))))
  822. (home-page "https://www.lz4.org")
  823. (synopsis "Compression algorithm focused on speed")
  824. (description "LZ4 is a lossless compression algorithm, providing
  825. compression speed at 400 MB/s per core (0.16 Bytes/cycle). It also features an
  826. extremely fast decoder, with speed in multiple GB/s per core (0.71 Bytes/cycle).
  827. A high compression derivative, called LZ4_HC, is also provided. It trades CPU
  828. time for compression ratio.")
  829. ;; The libraries (lz4, lz4hc, and xxhash) are BSD licenced. The command
  830. ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
  831. (license (list license:bsd-2 license:gpl2+))))
  832. (define-public squashfs-tools
  833. (package
  834. (name "squashfs-tools")
  835. (version "4.5")
  836. (source
  837. (origin
  838. (method git-fetch)
  839. (uri (git-reference
  840. (url "https://github.com/plougher/squashfs-tools")
  841. (commit version)))
  842. (file-name (git-file-name name version))
  843. (sha256
  844. (base32 "18d4nwa22vgb8j2badngjngw63f0lj501cvlh3920wqy2mqxwav6"))))
  845. (build-system gnu-build-system)
  846. (arguments
  847. `(#:tests? #f ; no check target
  848. #:make-flags
  849. (list (string-append "CC=" ,(cc-for-target))
  850. "XZ_SUPPORT=1"
  851. "LZO_SUPPORT=1"
  852. "LZ4_SUPPORT=1"
  853. "ZSTD_SUPPORT=1"
  854. (string-append "INSTALL_DIR=" (assoc-ref %outputs "out") "/bin"))
  855. #:phases
  856. (modify-phases %standard-phases
  857. (replace 'configure
  858. (lambda _
  859. (chdir "squashfs-tools")))
  860. (add-after 'install 'install-documentation
  861. ;; Install what very little usage documentation is provided.
  862. (lambda* (#:key outputs #:allow-other-keys)
  863. (let* ((out (assoc-ref outputs "out"))
  864. (doc (string-append out "/share/doc/" ,name)))
  865. (install-file "../USAGE" doc)))))))
  866. (inputs
  867. `(("lz4" ,lz4)
  868. ("lzo" ,lzo)
  869. ("xz" ,xz)
  870. ("zlib" ,zlib)
  871. ("zstd:lib" ,zstd "lib")))
  872. (home-page "https://github.com/plougher/squashfs-tools")
  873. (synopsis "Tools to create and extract squashfs file systems")
  874. (description
  875. "Squashfs is a highly compressed read-only file system for Linux. It
  876. compresses files, inodes, and directories with one of several compressors.
  877. All blocks are packed to minimize the data overhead, and block sizes of
  878. between 4K and 1M are supported. It is intended to be used for archival use,
  879. for live media, and for embedded systems where low overhead is needed.
  880. This package allows you to create and extract such file systems.")
  881. (license license:gpl2+)))
  882. (define-public squashfs-tools-ng
  883. (package
  884. (name "squashfs-tools-ng")
  885. (version "1.1.3")
  886. (source
  887. (origin
  888. (method git-fetch)
  889. (uri (git-reference
  890. (url "https://github.com/AgentD/squashfs-tools-ng")
  891. (commit (string-append "v" version))))
  892. (file-name (git-file-name name version))
  893. (sha256
  894. (base32 "12ipqmjp10574sz64ls8qbgzkxz5dcbzk0l2fxyh2yrrhnjp34mi"))
  895. (modules '((guix build utils)))
  896. (snippet
  897. '(begin
  898. ;; Delete bundled third-party libraries.
  899. (for-each (lambda (directory)
  900. (substitute* "Makefile.am"
  901. (((format #f "^include ~a.*" directory)) ""))
  902. (delete-file-recursively directory))
  903. (list "lib/lz4"
  904. "lib/zlib"))))))
  905. (build-system gnu-build-system)
  906. (arguments
  907. `(#:configure-flags
  908. (list "--disable-static")))
  909. (native-inputs
  910. (list autoconf automake libtool pkg-config))
  911. (inputs
  912. `(("libselinux" ,libselinux)
  913. ;; Compression algorithms.
  914. ("bzip2" ,bzip2)
  915. ("lz4" ,lz4)
  916. ("lzo" ,lzo)
  917. ("xz" ,xz)
  918. ("zlib" ,zlib)
  919. ("zstd:lib" ,zstd "lib")))
  920. (home-page "https://github.com/AgentD/squashfs-tools-ng")
  921. (synopsis "Tools to create and extract squashfs file systems")
  922. (description
  923. "Squashfs is a highly compressed read-only file system for Linux. It
  924. compresses files, inodes, and directories with one of several compressors.
  925. All blocks are packed to minimize the data overhead, and block sizes of
  926. between 4K and 1M are supported. It is intended to be used for archival use,
  927. for live media, and for embedded systems where low overhead is needed.
  928. The squashfs-tools-ng package offers alternative tooling to create and extract
  929. such file systems. It is not based on the older squashfs-tools package and
  930. its tools have different names:
  931. @enumerate
  932. @item @command{gensquashfs} produces SquashFS images from a directory or
  933. @command{gen_init_cpio}-like file listings and can generate SELinux labels.
  934. @item @command{rdsquashfs} inspects and unpacks SquashFS images.
  935. @item @command{sqfs2tar} and @command{tar2sqfs} convert between SquashFS and
  936. tarballs.
  937. @item @command{sqfsdiff} compares the contents of two SquashFS images.
  938. @end enumerate
  939. These commands are largely command-line wrappers around the included
  940. @code{libsquashfs} library that intends to make SquashFS available to other
  941. applications as an embeddable, extensible archive format.
  942. Both the library and tools operate deterministically: same input will produce
  943. byte-for-byte identical output.")
  944. ;; Upstream goes to some lengths to ensure that libsquashfs is LGPL3+.
  945. (license license:gpl3+)))
  946. (define-public pigz
  947. (package
  948. (name "pigz")
  949. (version "2.6")
  950. (source (origin
  951. (method url-fetch)
  952. (uri (string-append "http://zlib.net/pigz/"
  953. name "-" version ".tar.gz"))
  954. (sha256
  955. (base32
  956. "0z9avc4mifwcpj3qdsf9m2rjw9jx03b2r9pj0c4xgla9fh6ppv9f"))))
  957. (build-system gnu-build-system)
  958. (arguments
  959. `(#:phases
  960. (modify-phases %standard-phases
  961. (delete 'configure)
  962. (replace 'install
  963. (lambda* (#:key outputs #:allow-other-keys)
  964. (let* ((out (assoc-ref outputs "out"))
  965. (bin (string-append out "/bin"))
  966. (man (string-append out "/share/man/man1")))
  967. (install-file "pigz" bin)
  968. (symlink "pigz" (string-append bin "/unpigz"))
  969. (install-file "pigz.1" man)
  970. #t))))
  971. #:make-flags
  972. (list ,(string-append "CC=" (cc-for-target)))
  973. #:test-target "tests"))
  974. (inputs (list zlib))
  975. (home-page "https://zlib.net/pigz/")
  976. (synopsis "Parallel implementation of gzip")
  977. (description
  978. "This package provides a parallel implementation of gzip that exploits
  979. multiple processors and multiple cores when compressing data.")
  980. ;; Things under zopfli/ are under ASL2.0, but 4 files at the top-level,
  981. ;; written by Mark Adler, are under another non-copyleft license.
  982. (license license:asl2.0)))
  983. (define-public pixz
  984. (package
  985. (name "pixz")
  986. (version "1.0.7")
  987. (source (origin
  988. (method url-fetch)
  989. (uri (string-append
  990. "https://github.com/vasi/pixz/releases/download/v" version
  991. "/pixz-" version ".tar.xz"))
  992. (sha256
  993. (base32
  994. "1ifxr18f2h75gkcrkx8033kwmwmrcgxshpaawyc2n4dzn1p2rqz5"))))
  995. (build-system gnu-build-system)
  996. (native-inputs
  997. (list pkg-config libarchive))
  998. (home-page "https://github.com/vasi/pixz")
  999. (synopsis "Parallel indexing implementation of LZMA")
  1000. (description
  1001. "The existing XZ Utils provide great compression in the .xz file format,
  1002. but they produce just one big block of compressed data. Pixz instead produces
  1003. a collection of smaller blocks which makes random access to the original data
  1004. possible and can compress in parallel. This is especially useful for large
  1005. tarballs.")
  1006. (license license:bsd-2)))
  1007. (define-public cabextract
  1008. (package
  1009. (name "cabextract")
  1010. (home-page "https://cabextract.org.uk/")
  1011. (version "1.9.1")
  1012. (source (origin
  1013. (method url-fetch)
  1014. (uri (string-append home-page "cabextract-" version ".tar.gz"))
  1015. (sha256
  1016. (base32
  1017. "19qwhl2r8ip95q4vxzxg2kp4p125hjmc9762sns1dwwf7ikm7hmg"))
  1018. (modules '((guix build utils)))
  1019. (snippet
  1020. '(begin
  1021. ;; Delete bundled libmspack.
  1022. (delete-file-recursively "mspack")
  1023. #t))))
  1024. (build-system gnu-build-system)
  1025. (arguments
  1026. '(#:configure-flags '("--with-external-libmspack")
  1027. #:phases
  1028. (modify-phases %standard-phases
  1029. ;; cabextract needs some of libmspack's header files.
  1030. ;; These are located in the "mspack" directory of libmspack.
  1031. (add-before 'build 'unpack-libmspack
  1032. (lambda* (#:key inputs #:allow-other-keys)
  1033. (let ((dir-name "libmspack-src"))
  1034. (mkdir dir-name)
  1035. (invoke "tar" "-xvf" (assoc-ref inputs "libmspack-source")
  1036. "-C" dir-name "--strip-components" "1")
  1037. (rename-file (string-append dir-name "/mspack")
  1038. "mspack")
  1039. (delete-file-recursively dir-name)
  1040. #t))))))
  1041. (native-inputs
  1042. (list pkg-config))
  1043. (inputs
  1044. `(("libmspack" ,libmspack)
  1045. ("libmspack-source" ,(package-source libmspack))))
  1046. (synopsis "Tool to unpack Cabinet archives")
  1047. (description "Extracts files out of Microsoft Cabinet (.cab) archives")
  1048. ;; Some source files specify gpl2+, lgpl2+, however COPYING is gpl3.
  1049. (license license:gpl3+)))
  1050. (define-public libjcat
  1051. (package
  1052. (name "libjcat")
  1053. (version "0.1.9")
  1054. (source
  1055. (origin
  1056. (method git-fetch)
  1057. (uri
  1058. (git-reference
  1059. (url "https://github.com/hughsie/libjcat")
  1060. (commit version)))
  1061. (file-name (git-file-name name version))
  1062. (sha256
  1063. (base32 "02cgznk6qdylqpcyks6qykmvhpz1pplvnxp72bjzji1y6yj3zpkj"))))
  1064. (build-system meson-build-system)
  1065. (native-inputs
  1066. (list gobject-introspection help2man pkg-config))
  1067. (inputs
  1068. (list git
  1069. glib
  1070. gnupg
  1071. gnutls
  1072. gpgme
  1073. json-glib
  1074. vala))
  1075. (home-page "https://github.com/hughsie/libjcat")
  1076. (synopsis "Library for reading and writing Jcat files")
  1077. (description
  1078. "This library allows reading and writing gzip-compressed JSON catalog
  1079. files, which can be used to store GPG, PKCS-7 and SHA-256 checksums for each
  1080. file.")
  1081. (license license:lgpl2.1+)))
  1082. (define-public xdelta
  1083. (package
  1084. (name "xdelta")
  1085. (version "3.1.0")
  1086. (source
  1087. (origin
  1088. (method git-fetch)
  1089. (uri (git-reference
  1090. (url "https://github.com/jmacd/xdelta")
  1091. (commit (string-append "v" version))))
  1092. (file-name (git-file-name name version))
  1093. (sha256
  1094. (base32
  1095. "09mmsalc7dwlvgrda56s2k927rpl3a5dzfa88aslkqcjnr790wjy"))
  1096. (snippet
  1097. ;; This file isn't freely distributable and has no effect on building.
  1098. '(begin
  1099. (delete-file "xdelta3/draft-korn-vcdiff.txt")
  1100. #t))))
  1101. (build-system gnu-build-system)
  1102. (native-inputs
  1103. (list autoconf automake))
  1104. (arguments
  1105. `(#:phases
  1106. (modify-phases %standard-phases
  1107. (add-after 'unpack 'enter-build-directory
  1108. (lambda _ (chdir "xdelta3") #t)))))
  1109. (home-page "http://xdelta.org")
  1110. (synopsis "Delta encoder for binary files")
  1111. (description "xdelta encodes only the differences between two binary files
  1112. using the VCDIFF algorithm and patch file format described in RFC 3284. It can
  1113. also be used to apply such patches. xdelta is similar to @command{diff} and
  1114. @command{patch}, but is not limited to plain text and does not generate
  1115. human-readable output.")
  1116. (license license:asl2.0)))
  1117. (define-public lrzip
  1118. (package
  1119. (name "lrzip")
  1120. (version "0.641")
  1121. (source
  1122. (origin
  1123. (method url-fetch)
  1124. (uri (string-append
  1125. "http://ck.kolivas.org/apps/lrzip/lrzip-" version ".tar.xz"))
  1126. (sha256
  1127. (base32 "0ziyanspd96dc3lp2qdcylc7aq8dhb511jhqrhxvlp502fjqjqrc"))))
  1128. (build-system gnu-build-system)
  1129. (native-inputs
  1130. `(;; nasm is only required when building for 32-bit x86 platforms
  1131. ,@(if (string-prefix? "i686" (or (%current-target-system)
  1132. (%current-system)))
  1133. `(("nasm" ,nasm))
  1134. '())
  1135. ("perl" ,perl)))
  1136. (inputs
  1137. (list bzip2 lz4 lzo zlib))
  1138. (home-page "http://ck.kolivas.org/apps/lrzip/")
  1139. (synopsis "Large file compressor with a very high compression ratio")
  1140. (description "lrzip is a compression utility that uses long-range
  1141. redundancy reduction to improve the subsequent compression ratio of
  1142. larger files. It can then further compress the result with the ZPAQ or
  1143. LZMA algorithms for maximum compression, or LZO for maximum speed. This
  1144. choice between size or speed allows for either better compression than
  1145. even LZMA can provide, or a higher speed than gzip while compressing as
  1146. well as bzip2.")
  1147. (license (list license:gpl3+
  1148. license:public-domain)))) ; most files in lzma/
  1149. (define-public snappy
  1150. (package
  1151. (name "snappy")
  1152. (version "1.1.9")
  1153. (source
  1154. (origin
  1155. (method git-fetch)
  1156. (uri (git-reference
  1157. (url "https://github.com/google/snappy")
  1158. (commit version)))
  1159. (file-name (git-file-name name version))
  1160. (sha256
  1161. (base32 "03zz56h79z0sgvi5sangjqn9dahhzvf645v26n1y0gwmfbmsax95"))
  1162. (patches
  1163. (search-patches "snappy-add-O2-flag-in-CmakeLists.txt.patch"
  1164. "snappy-add-inline-for-GCC.patch"))))
  1165. (build-system cmake-build-system)
  1166. (arguments
  1167. `(#:configure-flags
  1168. (list "-DBUILD_SHARED_LIBS=ON"
  1169. ;; These would be installed alongside Snappy otherwise.
  1170. "-DBENCHMARK_ENABLE_INSTALL=OFF"
  1171. "-DINSTALL_GTEST=OFF")
  1172. #:phases
  1173. (modify-phases %standard-phases
  1174. (add-after 'unpack 'unpack-third_party-subprojects
  1175. (lambda* (#:key native-inputs inputs #:allow-other-keys)
  1176. (with-directory-excursion "third_party"
  1177. (for-each (lambda (subproject)
  1178. (let* ((input (string-append subproject "-source"))
  1179. (source (assoc-ref (or native-inputs inputs)
  1180. input)))
  1181. (with-directory-excursion subproject
  1182. ;; Take advantage of the coincidence that both
  1183. ;; use GIT-FETCH, which creates a directory.
  1184. (copy-recursively source "."))))
  1185. (list "benchmark"
  1186. "googletest"))
  1187. #;punt))))))
  1188. (native-inputs
  1189. `(("benchmark-source" ,(package-source benchmark))
  1190. ("googletest-source" ,(package-source googletest))))
  1191. (home-page "https://github.com/google/snappy")
  1192. (synopsis "Fast compressor/decompressor")
  1193. (description "Snappy is a compression/decompression library. It does not
  1194. aim for maximum compression, or compatibility with any other compression library;
  1195. instead, it aims for very high speeds and reasonable compression. For instance,
  1196. compared to the fastest mode of zlib, Snappy is an order of magnitude faster
  1197. for most inputs, but the resulting compressed files are anywhere from 20% to
  1198. 100% bigger.")
  1199. (license license:asl2.0)))
  1200. ;; We need this for irods.
  1201. (define-public snappy-with-clang6
  1202. (package
  1203. (inherit snappy)
  1204. (name "snappy-with-clang")
  1205. ;; XXX 1.1.9 fails to build with clang with
  1206. ;; error: invalid output constraint '=@ccz' in asm
  1207. (version "1.1.8")
  1208. (source
  1209. (origin
  1210. (method git-fetch)
  1211. (uri (git-reference
  1212. (url "https://github.com/google/snappy")
  1213. (commit version)))
  1214. (file-name (git-file-name name version))
  1215. (sha256
  1216. (base32 "1j0kslq2dvxgkcxl1gakhvsa731yrcvcaipcp5k8k7ayicvkv9jv"))))
  1217. (arguments
  1218. `(#:configure-flags
  1219. '("-DBUILD_SHARED_LIBS=ON"
  1220. "-DCMAKE_CXX_COMPILER=clang++"
  1221. "-DCMAKE_CXX_FLAGS=-stdlib=libc++"
  1222. "-DCMAKE_EXE_LINKER_FLAGS=-lc++abi")
  1223. #:phases
  1224. (modify-phases %standard-phases
  1225. (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
  1226. (lambda* (#:key native-inputs inputs #:allow-other-keys)
  1227. (let ((gcc (assoc-ref (or native-inputs inputs) "gcc")))
  1228. (setenv "CPLUS_INCLUDE_PATH"
  1229. (string-join
  1230. (cons* (search-input-directory inputs
  1231. "/include/c++/v1")
  1232. ;; Hide GCC's C++ headers so that they do not interfere with
  1233. ;; the Clang headers.
  1234. (delete (string-append gcc "/include/c++")
  1235. (string-split (getenv "CPLUS_INCLUDE_PATH")
  1236. #\:)))
  1237. ":"))
  1238. (format #true
  1239. "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
  1240. (getenv "CPLUS_INCLUDE_PATH"))))))))
  1241. (properties `((hidden? . #true)))
  1242. (native-inputs
  1243. `(("clang" ,clang-toolchain-6)))
  1244. (inputs
  1245. (list libcxx+libcxxabi-6 libcxxabi-6))))
  1246. (define-public p7zip
  1247. (package
  1248. (name "p7zip")
  1249. (version "16.02")
  1250. (source (origin
  1251. (method url-fetch)
  1252. (uri (string-append "mirror://sourceforge/" name "/" name "/"
  1253. version "/" name "_" version
  1254. "_src_all.tar.bz2"))
  1255. (sha256
  1256. (base32
  1257. "07rlwbbgszq8i7m8jh3x6j2w2hc9a72dc7fmqawnqkwlwb00mcjy"))
  1258. (modules '((guix build utils)))
  1259. (snippet
  1260. '(begin
  1261. ;; Remove non-free source files
  1262. (for-each delete-file
  1263. (append
  1264. (find-files "CPP/7zip/Compress" "Rar.*")
  1265. (find-files "CPP/7zip/Crypto" "Rar.*")
  1266. (find-files "DOC/unRarLicense.txt")
  1267. (find-files "Utils/file_Codecs_Rar_so.py")))
  1268. (delete-file-recursively "CPP/7zip/Archive/Rar")
  1269. (delete-file-recursively "CPP/7zip/Compress/Rar")
  1270. ;; Fix FTBFS with gcc-10.
  1271. (substitute* "CPP/Windows/ErrorMsg.cpp"
  1272. (("switch\\(errorCode\\) \\{")
  1273. "switch(static_cast<HRESULT>(errorCode)) {"))))
  1274. (patches (search-patches "p7zip-CVE-2016-9296.patch"
  1275. "p7zip-CVE-2017-17969.patch"
  1276. "p7zip-remove-unused-code.patch"))))
  1277. (build-system gnu-build-system)
  1278. (arguments
  1279. `(#:make-flags
  1280. (list (string-append "DEST_HOME=" (assoc-ref %outputs "out")) "all3")
  1281. #:phases
  1282. (modify-phases %standard-phases
  1283. (replace 'configure
  1284. (lambda _
  1285. (copy-file
  1286. ,(cond ((target-x86-64?)
  1287. "makefile.linux_amd64_asm")
  1288. ((target-x86-32?)
  1289. "makefile.linux_x86_asm_gcc_4.X")
  1290. (else
  1291. "makefile.linux_any_cpu_gcc_4.X"))
  1292. "makefile.machine")))
  1293. (replace 'check
  1294. (lambda* (#:key tests? #:allow-other-keys)
  1295. (when tests?
  1296. (invoke "make" "test")
  1297. (invoke "make" "test_7z")
  1298. (invoke "make" "test_7zr")))))))
  1299. (native-inputs
  1300. (cond ((target-x86-64?)
  1301. (list yasm))
  1302. ((target-x86-32?)
  1303. (list nasm))
  1304. (else '())))
  1305. (home-page "http://p7zip.sourceforge.net/")
  1306. (synopsis "Command-line file archiver with high compression ratio")
  1307. (description "p7zip is a command-line port of 7-Zip, a file archiver that
  1308. handles the 7z format which features very high compression ratios.")
  1309. (license (list license:lgpl2.1+
  1310. license:gpl2+
  1311. license:public-domain))))
  1312. (define-public gzstream
  1313. (package
  1314. (name "gzstream")
  1315. (version "1.5")
  1316. (source (origin
  1317. (method url-fetch)
  1318. (uri
  1319. ;; No versioned URL, but last release was in 2003.
  1320. "http://www.cs.unc.edu/Research/compgeom/gzstream/gzstream.tgz")
  1321. (file-name (string-append name "-" version ".tgz"))
  1322. (sha256
  1323. (base32
  1324. "00y19pqjsdj5zcrx4p9j56pl73vayfwnb7y2hvp423nx0cwv5b4r"))
  1325. (modules '((guix build utils)))
  1326. (snippet
  1327. ;; Remove pre-compiled object.
  1328. '(begin
  1329. (delete-file "gzstream.o")
  1330. #t))))
  1331. (build-system gnu-build-system)
  1332. (arguments
  1333. `(#:test-target "test"
  1334. #:phases
  1335. (modify-phases %standard-phases
  1336. ;; Enable PIC, so it can be used in shared libraries.
  1337. (add-after 'unpack 'use-pic
  1338. (lambda _
  1339. (substitute* "Makefile"
  1340. (("CPPFLAGS = " all) (string-append all "-fPIC ")))
  1341. #t))
  1342. (delete 'configure)
  1343. (replace 'install
  1344. (lambda* (#:key outputs #:allow-other-keys)
  1345. (let* ((out (assoc-ref outputs "out"))
  1346. (lib (string-append out "/lib"))
  1347. (include (string-append out "/include")))
  1348. (install-file "libgzstream.a" lib)
  1349. (install-file "gzstream.h" include)
  1350. #t))))))
  1351. (propagated-inputs (list zlib))
  1352. (home-page "http://www.cs.unc.edu/Research/compgeom/gzstream/")
  1353. (synopsis "Compressed C++ iostream")
  1354. (description "gzstream is a small library for providing zlib
  1355. functionality in a C++ iostream.")
  1356. (license license:lgpl2.1+)))
  1357. (define-public zopfli
  1358. (package
  1359. (name "zopfli")
  1360. (version "1.0.3")
  1361. (source (origin
  1362. (method git-fetch)
  1363. (uri (git-reference
  1364. (url "https://github.com/google/zopfli")
  1365. (commit (string-append name "-" version))))
  1366. (file-name (git-file-name name version))
  1367. (sha256
  1368. (base32
  1369. "0dr8n4j5nj2h9n208jns56wglw59gg4qm3s7c6y3hs75d0nnkhm4"))))
  1370. (build-system cmake-build-system)
  1371. (arguments
  1372. `(#:tests? #f ;no test suite
  1373. #:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
  1374. (home-page "https://github.com/google/zopfli")
  1375. (synopsis "Very good, but slow, deflate or zlib compression")
  1376. (description "Zopfli Compression Algorithm is a compression library
  1377. programmed in C to perform very good, but slow, deflate or zlib compression.
  1378. ZopfliCompress supports the deflate, gzip and zlib output formats. This
  1379. library can only compress, not decompress; existing zlib or deflate libraries
  1380. can decompress the data.")
  1381. (license license:asl2.0)))
  1382. (define-public zpaq
  1383. (package
  1384. (name "zpaq")
  1385. (version "7.15")
  1386. (source
  1387. (origin
  1388. (method url-fetch/zipbomb)
  1389. (uri (string-append "http://mattmahoney.net/dc/zpaq"
  1390. (string-delete #\. version) ".zip"))
  1391. (sha256
  1392. (base32
  1393. "066l94yyladlfzri877nh2dhkvspagjn3m5bmv725fmhkr9c4pp8"))
  1394. (modules '((guix build utils)))
  1395. (snippet
  1396. ;; Delete irrelevant pre-compiled binaries.
  1397. '(begin
  1398. (for-each delete-file (find-files "." "\\.exe$"))
  1399. #t))))
  1400. (build-system gnu-build-system)
  1401. (arguments
  1402. `(#:phases
  1403. (modify-phases %standard-phases
  1404. (delete 'configure)) ; no ‘configure’ script
  1405. #:make-flags
  1406. (list
  1407. (string-append "CPPFLAGS=-Dunix"
  1408. ,(match (or (%current-target-system)
  1409. (%current-system))
  1410. ("x86_64-linux" "")
  1411. ("i686-linux" "")
  1412. (_ " -DNOJIT")))
  1413. ;; These should be safe, lowest-common-denominator instruction sets,
  1414. ;; allowing for some optimisation while remaining reproducible.
  1415. (string-append "CXXFLAGS=-O3 -DNDEBUG"
  1416. ,(match (or (%current-target-system)
  1417. (%current-system))
  1418. ("x86_64-linux" " -march=nocona -mtune=generic")
  1419. ("i686-linux" " -march=i686 -mtune=generic")
  1420. ("armhf-linux" " -mtune=generic-armv7-a")
  1421. (_ "")))
  1422. (string-append "PREFIX="
  1423. (assoc-ref %outputs "out")))))
  1424. (native-inputs
  1425. (list perl)) ; for pod2man
  1426. (home-page "http://mattmahoney.net/dc/zpaq.html")
  1427. (synopsis "Incremental journaling archiver")
  1428. (description "ZPAQ is a command-line archiver for realistic situations with
  1429. many duplicate and already compressed files. It backs up only those files
  1430. modified since the last update. All previous versions remain untouched and can
  1431. be independently recovered. Identical files are only stored once (known as
  1432. @dfn{de-duplication}). Archives can also be encrypted.
  1433. ZPAQ is intended to back up user data, not entire operating systems. It ignores
  1434. owner and group IDs, ACLs, extended attributes, or special file types like
  1435. devices, sockets, or named pipes. It does not follow or restore symbolic links
  1436. or junctions, and always follows hard links.")
  1437. (license (list license:public-domain
  1438. ;; libzpaq.cpp contains a mix of public-domain and
  1439. ;; expat-licenced (or ‘MIT’) code.
  1440. license:expat))))
  1441. (define-public unshield
  1442. (package
  1443. (name "unshield")
  1444. (version "1.4.3")
  1445. (source
  1446. (origin (method git-fetch)
  1447. (uri (git-reference
  1448. (url "http://github.com/twogood/unshield")
  1449. (commit version)))
  1450. (file-name (git-file-name name version))
  1451. (sha256
  1452. (base32
  1453. "19wn22vszhci8dfcixx5rliz7phx3lv5ablvhjlclvj75k2vsdqd"))))
  1454. (build-system cmake-build-system)
  1455. (inputs
  1456. `(("zlib" ,zlib)
  1457. ("openssl" ,openssl)
  1458. ;; Test data that is otherwise downloaded with curl.
  1459. ("unshield-avigomanager11b22.zip"
  1460. ,(origin
  1461. (method url-fetch)
  1462. (uri (string-append
  1463. "https://www.dropbox.com/s/8r4b6752swe3nhu/"
  1464. "unshield-avigomanager11b22.zip?dl=1"))
  1465. (sha256
  1466. (base32 "0fwq7lih04if68wpwpsk5wjqyvh32db76a41sq6gbx4dn1lc3ddn"))
  1467. (file-name "unshield-avigomanager11b22.zip")))
  1468. ("unshield-baldurs_gate_patch_v1_1_4315_international.zip"
  1469. ,(origin
  1470. (method url-fetch)
  1471. (uri (string-append
  1472. "https://www.dropbox.com/s/9ruil8oi6amjbbk/"
  1473. "unshield-baldurs_gate_patch_v1_1_4315_international.zip?dl=1"))
  1474. (sha256
  1475. (base32 "0spaxf6dardlhqxz3ys09fzamj007q3nfyw4xng6gh3qp9780maj"))
  1476. (file-name "unshield-baldurs_gate_patch_v1_1_4315_international.zip")))
  1477. ("unshield-the-feeble-files-spanish.zip"
  1478. ,(origin
  1479. (method url-fetch)
  1480. (uri (string-append
  1481. "https://www.dropbox.com/s/1ng0z9kfxc7eb1e/"
  1482. "unshield-the-feeble-files-spanish.zip?dl=1"))
  1483. (sha256
  1484. (base32 "1k5cw6vnpja8yjlnhx5124xrw9i8s1l539hfdqqrqz3l5gn0bnyd"))
  1485. (file-name "unshield-the-feeble-files-spanish.zip")))))
  1486. (native-inputs
  1487. (list unzip))
  1488. (arguments
  1489. `(#:out-of-source? #f
  1490. #:phases
  1491. (modify-phases %standard-phases
  1492. (add-before 'check 'pre-check
  1493. (lambda* (#:key inputs #:allow-other-keys)
  1494. (for-each (lambda (i)
  1495. (copy-file (assoc-ref inputs i)
  1496. (string-append "test/v0/" i)))
  1497. '("unshield-avigomanager11b22.zip"
  1498. "unshield-baldurs_gate_patch_v1_1_4315_international.zip"
  1499. "unshield-the-feeble-files-spanish.zip"))
  1500. (substitute* (find-files "test/" "/*\\.sh")
  1501. ;; Tests expect the unshield binary in a specific
  1502. ;; location.
  1503. (("/var/tmp/unshield/bin/unshield")
  1504. (string-append (getcwd) "/src/unshield"))
  1505. ;; We no longer need to download the data.
  1506. ((".?URL=.*$") "")
  1507. (("curl -(|f)sSL -o test.zip .*") ""))
  1508. (substitute* "test/v0/avigomanager.sh"
  1509. (("test.zip")
  1510. (string-append (getcwd)
  1511. "/test/v0/unshield-avigomanager11b22.zip")))
  1512. (substitute* "test/v0/baldurs_gate_patch_v1_1_4315_international.sh"
  1513. (("test.zip")
  1514. (string-append
  1515. (getcwd)
  1516. "/test/v0/unshield-baldurs_gate_patch_v1_1_4315_international.zip")))
  1517. (substitute* "test/v0/the-feeble-files-spanish.sh"
  1518. (("test.zip")
  1519. (string-append (getcwd)
  1520. "/test/v0/unshield-the-feeble-files-spanish.zip")))
  1521. #t))
  1522. (replace 'check
  1523. (lambda _
  1524. (invoke "./run-tests.sh"))))))
  1525. (home-page "https://github.com/twogood/unshield")
  1526. (synopsis "Extract CAB files from InstallShield installers")
  1527. (description
  1528. "@command{unshield} is a tool and library for extracting @file{.cab}
  1529. archives from InstallShield installers.")
  1530. (license license:expat)))
  1531. (define-public zstd
  1532. (package
  1533. (name "zstd")
  1534. (version "1.5.0")
  1535. (source
  1536. (origin
  1537. (method url-fetch)
  1538. (uri (string-append "https://github.com/facebook/zstd/releases/download/"
  1539. "v" version "/zstd-" version ".tar.gz"))
  1540. (sha256
  1541. (base32 "150y541303vnvfhd8wkbih00lfvvm98rd12yijwlbkqzg3xgp52i"))))
  1542. (build-system gnu-build-system)
  1543. (outputs '("out" ;1.2MiB executables and documentation
  1544. "lib" ;1.2MiB shared library and headers
  1545. "static")) ;1.2MiB static library
  1546. (arguments
  1547. `(#:phases
  1548. (modify-phases %standard-phases
  1549. (add-after 'unpack 'remove-bogus-check
  1550. (lambda _
  1551. ;; lib/Makefile falsely claims that no .pc file can be created.
  1552. (substitute* "lib/Makefile"
  1553. (("error configured .*dir ")
  1554. "true "))
  1555. #t))
  1556. (add-after 'unpack 'patch-command-file-names
  1557. ;; Don't require hard requirements to be in $PATH.
  1558. (lambda* (#:key outputs #:allow-other-keys)
  1559. (let* ((out (assoc-ref outputs "out"))
  1560. (our (lambda (name) (string-append out "/bin/" name))))
  1561. (substitute* "programs/zstdgrep"
  1562. (("(:-)(grep)" _ prefix command)
  1563. (string-append prefix (which command)))
  1564. (("(:-)(zstdcat)" _ prefix command)
  1565. (string-append prefix (our command))))
  1566. (substitute* "programs/zstdless"
  1567. (("zstdcat" command)
  1568. (our command))))))
  1569. (delete 'configure) ;no configure script
  1570. (add-after 'install 'adjust-library-locations
  1571. (lambda* (#:key outputs #:allow-other-keys)
  1572. (let* ((out (assoc-ref outputs "out"))
  1573. (lib (assoc-ref outputs "lib"))
  1574. (static (assoc-ref outputs "static"))
  1575. (shared-libs (string-append lib "/lib"))
  1576. (static-libs (string-append static "/lib")))
  1577. ;; Move the static library to its own output to save ~1MiB.
  1578. (mkdir-p static-libs)
  1579. (for-each (lambda (ar)
  1580. (link ar (string-append static-libs "/"
  1581. (basename ar)))
  1582. (delete-file ar))
  1583. (find-files shared-libs "\\.a$"))
  1584. ;; Make sure the pkg-config file refers to the right output.
  1585. (substitute* (string-append shared-libs "/pkgconfig/libzstd.pc")
  1586. (("^prefix=.*")
  1587. ;; Note: The .pc file expects a trailing slash for 'prefix'.
  1588. (string-append "prefix=" lib "/\n")))))))
  1589. #:make-flags
  1590. (list ,(string-append "CC=" (cc-for-target))
  1591. (string-append "prefix=" (assoc-ref %outputs "out"))
  1592. (string-append "libdir=" (assoc-ref %outputs "lib") "/lib")
  1593. (string-append "includedir=" (assoc-ref %outputs "lib") "/include")
  1594. ;; Auto-detection is over-engineered and buggy.
  1595. "PCLIBDIR=lib"
  1596. "PCINCDIR=include"
  1597. ;; Skip auto-detection of, and creating a dependency on, the build
  1598. ;; environment's ‘xz’ for what amounts to a dubious feature anyway.
  1599. "HAVE_LZMA=0"
  1600. ;; Not currently detected, but be explicit & avoid surprises later.
  1601. "HAVE_LZ4=0"
  1602. "HAVE_ZLIB=0")))
  1603. (home-page "https://facebook.github.io/zstd/")
  1604. (synopsis "Zstandard real-time compression algorithm")
  1605. (description "Zstandard (@command{zstd}) is a lossless compression algorithm
  1606. that combines very fast operation with a compression ratio comparable to that of
  1607. zlib. In most scenarios, both compression and decompression can be performed in
  1608. ‘real time’. The compressor can be configured to provide the most suitable
  1609. trade-off between compression ratio and speed, without affecting decompression
  1610. speed.")
  1611. (license (list license:bsd-3 ; the main top-level LICENSE file
  1612. license:bsd-2 ; many files explicitly state 2-Clause
  1613. license:gpl2 ; the main top-level COPYING file
  1614. license:gpl3+ ; tests/gzip/*.sh
  1615. license:expat ; lib/dictBuilder/divsufsort.[ch]
  1616. license:public-domain ; zlibWrapper/examples/fitblk*
  1617. license:zlib)))) ; zlibWrapper/{gz*.c,gzguts.h}
  1618. (define-public pzstd
  1619. (package/inherit zstd
  1620. (name "pzstd")
  1621. (outputs '("out"))
  1622. (inputs
  1623. `(,@(if (%current-target-system)
  1624. `(("googletest" ,googletest))
  1625. '())))
  1626. (native-inputs
  1627. `(,@(if (%current-system)
  1628. `(("googletest" ,googletest))
  1629. '())))
  1630. (arguments
  1631. `(#:phases
  1632. (modify-phases %standard-phases
  1633. (add-after 'unpack 'enter-subdirectory
  1634. (lambda _ (chdir "contrib/pzstd") #t))
  1635. (delete 'configure) ; no configure script
  1636. (add-before 'check 'compile-tests
  1637. (lambda* (#:key make-flags #:allow-other-keys)
  1638. (apply invoke "make" "tests" make-flags)))
  1639. (add-after 'install 'install-documentation
  1640. (lambda* (#:key outputs #:allow-other-keys)
  1641. (let* ((out (assoc-ref outputs "out"))
  1642. (doc (string-append out "/share/doc/" ,name)))
  1643. (mkdir-p doc)
  1644. (install-file "README.md" doc)
  1645. #t))))
  1646. #:make-flags
  1647. (list (string-append "CC=" ,(cc-for-target))
  1648. (string-append "CXX=" ,(cxx-for-target))
  1649. (string-append "PREFIX=" (assoc-ref %outputs "out")))))
  1650. (home-page (package-home-page zstd))
  1651. (synopsis "Threaded implementation of the Zstandard compression algorithm")
  1652. (description "Parallel Zstandard (PZstandard or @command{pzstd}) is a
  1653. multi-threaded implementation of the @uref{http://zstd.net/, Zstandard
  1654. compression algorithm}. It is fully compatible with the original Zstandard file
  1655. format and command-line interface, and can be used as a drop-in replacement.
  1656. Compression is distributed over multiple processor cores to improve performance,
  1657. as is the decompression of data compressed in this manner. Data compressed by
  1658. other implementations will only be decompressed by two threads: one performing
  1659. the actual decompression, the other input and output.")
  1660. (license (package-license zstd))))
  1661. (define-public zip
  1662. (package
  1663. (name "zip")
  1664. (version "3.0")
  1665. (source
  1666. (origin
  1667. (method url-fetch)
  1668. (uri (string-append "mirror://sourceforge/infozip"
  1669. "/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz"))
  1670. (sha256
  1671. (base32
  1672. "0sb3h3067pzf3a7mlxn1hikpcjrsvycjcnj9hl9b1c3ykcgvps7h"))))
  1673. (build-system gnu-build-system)
  1674. (inputs (list bzip2))
  1675. (arguments
  1676. `(#:tests? #f ; no test target
  1677. #:make-flags (let ((out (assoc-ref %outputs "out")))
  1678. (list "-f" "unix/Makefile"
  1679. (string-append "prefix=" out)
  1680. (string-append "MANDIR=" out "/share/man/man1")))
  1681. #:phases
  1682. (modify-phases %standard-phases
  1683. (replace 'build
  1684. (lambda* (#:key (make-flags '()) #:allow-other-keys)
  1685. (apply invoke "make" "generic_gcc" make-flags)))
  1686. (delete 'configure))))
  1687. (home-page "http://www.info-zip.org/Zip.html")
  1688. (synopsis "Compression and file packing utility")
  1689. (description
  1690. "Zip is a compression and file packaging/archive utility. Zip is useful
  1691. for packaging a set of files for distribution, for archiving files, and for
  1692. saving disk space by temporarily compressing unused files or directories.
  1693. Zip puts one or more compressed files into a single ZIP archive, along with
  1694. information about the files (name, path, date, time of last modification,
  1695. protection, and check information to verify file integrity). An entire
  1696. directory structure can be packed into a ZIP archive with a single command.
  1697. Zip has one compression method (deflation) and can also store files without
  1698. compression. Zip automatically chooses the better of the two for each file.
  1699. Compression ratios of 2:1 to 3:1 are common for text files.")
  1700. (license (license:non-copyleft "file://LICENSE"
  1701. "See LICENSE in the distribution."))))
  1702. (define-public unzip
  1703. (package (inherit zip)
  1704. (name "unzip")
  1705. (version "6.0")
  1706. (source
  1707. (origin
  1708. (method url-fetch)
  1709. (uri (string-append "mirror://sourceforge/infozip"
  1710. "/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz"))
  1711. (sha256
  1712. (base32
  1713. "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83"))
  1714. (patches (search-patches "unzip-CVE-2014-8139.patch"
  1715. "unzip-CVE-2014-8140.patch"
  1716. "unzip-CVE-2014-8141.patch"
  1717. "unzip-CVE-2014-9636.patch"
  1718. "unzip-CVE-2015-7696.patch"
  1719. "unzip-CVE-2015-7697.patch"
  1720. "unzip-allow-greater-hostver-values.patch"
  1721. "unzip-initialize-symlink-flag.patch"
  1722. "unzip-remove-build-date.patch"
  1723. "unzip-attribs-overflow.patch"
  1724. "unzip-overflow-on-invalid-input.patch"
  1725. "unzip-format-secure.patch"
  1726. "unzip-overflow-long-fsize.patch"
  1727. ;; From Fedora
  1728. "unzip-alt-iconv-utf8.patch"
  1729. "unzip-alt-iconv-utf8-print.patch"
  1730. "unzip-fix-recmatch.patch"
  1731. "unzip-case-insensitive.patch"
  1732. "unzip-close.patch"
  1733. "unzip-COVSCAN-fix-unterminated-string.patch"
  1734. "unzip-CVE-2016-9844.patch"
  1735. "unzip-CVE-2018-1000035.patch"
  1736. "unzip-CVE-2018-18384.patch"
  1737. "unzip-exec-shield.patch"
  1738. "unzip-manpage-fix.patch"
  1739. "unzip-overflow.patch"
  1740. "unzip-timestamp.patch"
  1741. "unzip-valgrind.patch"
  1742. "unzip-x-option.patch"
  1743. ;; CVE-2019-13232
  1744. "unzip-zipbomb-manpage.patch"
  1745. "unzip-zipbomb-part1.patch"
  1746. "unzip-zipbomb-part2.patch"
  1747. "unzip-zipbomb-part3.patch"
  1748. ;; https://github.com/madler/unzip/issues/2
  1749. "unzip-32bit-zipbomb-fix.patch"))))
  1750. (build-system gnu-build-system)
  1751. ;; no inputs; bzip2 is not supported, since not compiled with BZ_NO_STDIO
  1752. (arguments
  1753. `(#:phases (modify-phases %standard-phases
  1754. (delete 'configure)
  1755. (add-after 'unpack 'fortify
  1756. (lambda _
  1757. ;; Mitigate CVE-2018-1000035, an exploitable buffer overflow.
  1758. ;; This environment variable is recommended in 'unix/Makefile'
  1759. ;; for passing flags to the C compiler.
  1760. (setenv "LOCAL_UNZIP" "-D_FORTIFY_SOURCE=1")
  1761. #t))
  1762. (replace 'build
  1763. (lambda* (#:key make-flags #:allow-other-keys)
  1764. (apply invoke "make"
  1765. `("-j" ,(number->string
  1766. (parallel-job-count))
  1767. ,@make-flags
  1768. "generic_gcc")))))
  1769. #:make-flags (list "-f" "unix/Makefile"
  1770. (string-append "prefix=" %output)
  1771. (string-append "MANDIR=" %output "/share/man/man1"))))
  1772. (home-page "http://www.info-zip.org/UnZip.html")
  1773. (synopsis "Decompression and file extraction utility")
  1774. (description
  1775. "UnZip is an extraction utility for archives compressed in .zip format,
  1776. also called \"zipfiles\".
  1777. UnZip lists, tests, or extracts files from a .zip archive. The default
  1778. behaviour (with no options) is to extract into the current directory, and
  1779. subdirectories below it, all files from the specified zipfile. UnZip
  1780. recreates the stored directory structure by default.")
  1781. (license (license:non-copyleft "file://LICENSE"
  1782. "See LICENSE in the distribution."))))
  1783. (define-public ziptime
  1784. (let ((commit "2a5bc9dfbf7c6a80e5f7cb4dd05b4036741478bc")
  1785. (revision "0"))
  1786. (package
  1787. (name "ziptime")
  1788. (version (git-version "0.0.0" revision commit))
  1789. (source
  1790. (origin
  1791. (method git-fetch)
  1792. (uri (git-reference
  1793. (url "https://android.googlesource.com/platform/build")
  1794. (commit commit)))
  1795. (file-name (git-file-name name version))
  1796. (sha256
  1797. (base32 "0hrn61b3a97dlc4iqc28rwx8k8zf7ycbwzqqp93vj34zy5a541kn"))))
  1798. (build-system gnu-build-system)
  1799. (arguments
  1800. `(#:tests? #f ; no test suite
  1801. #:phases
  1802. (modify-phases %standard-phases
  1803. (add-after 'unpack 'change-directory
  1804. (lambda _
  1805. (chdir "tools/ziptime")))
  1806. (delete 'configure) ; nothing to configure
  1807. (replace 'build
  1808. ;; There is no Makefile, only an ‘Android.bp’ file. Ignore it.
  1809. (lambda _
  1810. (let ((c++ ,(cxx-for-target)))
  1811. (apply invoke c++ "-O2" "-o" "ziptime"
  1812. (find-files "." "\\.cpp$")))))
  1813. (replace 'install
  1814. (lambda* (#:key outputs #:allow-other-keys)
  1815. (let* ((out (assoc-ref outputs "out"))
  1816. (bin (string-append out "/bin"))
  1817. (doc (string-append out "/share/doc/" ,name "-" ,version)))
  1818. (install-file "ziptime" bin)
  1819. (install-file "README.txt" doc)))))))
  1820. ;; There is no separate home page for this tiny bundled build tool.
  1821. (home-page (string-append "https://android.googlesource.com/platform/build/"
  1822. "+/master/tools/ziptime/README.txt"))
  1823. (synopsis "Normalize @file{.zip} archive header timestamps")
  1824. (description
  1825. "Ziptime helps make @file{.zip} archives reproducible by replacing
  1826. timestamps in the file header with a fixed time (1 January 2008).
  1827. ``Extra fields'' are not changed, so you'll need to use the @code{-X} option to
  1828. @command{zip} to prevent it from storing the ``universal time'' field.")
  1829. (license license:asl2.0))))
  1830. (define-public zziplib
  1831. (package
  1832. (name "zziplib")
  1833. (version "0.13.72")
  1834. (home-page "https://github.com/gdraheim/zziplib")
  1835. (source (origin
  1836. (method git-fetch)
  1837. (uri (git-reference (url home-page)
  1838. (commit (string-append "v" version))))
  1839. (file-name (git-file-name name version))
  1840. (sha256
  1841. (base32
  1842. "0i6bpa2b13z19alm6ig80364dnin1w28cvif18k6wkkb0w3dzp8y"))))
  1843. (build-system cmake-build-system)
  1844. (inputs
  1845. (list zlib))
  1846. (native-inputs (list perl ; for the documentation
  1847. pkg-config python zip)) ; to create test files
  1848. (synopsis "Library for accessing zip files")
  1849. (description
  1850. "ZZipLib is a library based on zlib for accessing zip files.")
  1851. ;; zziplib is dual licensed under LGPL2.0+ and MPL1.1. Some example source
  1852. ;; files carry the Zlib license; see "docs/copying.html" for details.
  1853. (license (list license:lgpl2.0+ license:mpl1.1))))
  1854. (define-public libzip
  1855. (package
  1856. (name "libzip")
  1857. (version "1.8.0")
  1858. (source (origin
  1859. (method url-fetch)
  1860. (uri (string-append
  1861. "https://libzip.org/download/libzip-" version ".tar.xz"))
  1862. (sha256
  1863. (base32
  1864. "0zn9vaiwy2izj8cnm8i7c2mbdn38n328grqb8f07x55s4kd3nxph"))))
  1865. (native-inputs
  1866. (list perl pkg-config))
  1867. (inputs
  1868. (list gnutls xz openssl zlib
  1869. `(,zstd "lib")))
  1870. (build-system cmake-build-system)
  1871. (home-page "https://libzip.org")
  1872. (synopsis "C library for reading, creating, and modifying zip archives")
  1873. (description "Libzip is a C library for reading, creating, and modifying
  1874. zip archives. Files can be added from data buffers, files, or compressed data
  1875. copied directly from other zip archives. Changes made without closing the
  1876. archive can be reverted.")
  1877. (license license:bsd-3)))
  1878. (define-public atool
  1879. (package
  1880. (name "atool")
  1881. (version "0.39.0")
  1882. (source
  1883. (origin
  1884. (method url-fetch)
  1885. (uri (string-append "mirror://savannah/atool/atool-"
  1886. version ".tar.gz"))
  1887. (sha256
  1888. (base32
  1889. "0fvhzip2v08jgnlfpyj6rapan39xlsl1ksgq4lp8gfsai2ah1xma"))))
  1890. (build-system gnu-build-system)
  1891. (arguments
  1892. `(#:phases
  1893. (modify-phases %standard-phases
  1894. (add-after 'unpack 'embed-absolute-file-name
  1895. (lambda* (#:key inputs #:allow-other-keys)
  1896. (substitute* "atool"
  1897. (("(^\\$::cfg_path_file.*= )'file'" _ pre)
  1898. (string-append pre "'" (assoc-ref inputs "file")
  1899. "/bin/file'")))
  1900. #t)))))
  1901. (inputs
  1902. (list perl file))
  1903. (home-page "https://www.nongnu.org/atool/")
  1904. (synopsis "Universal tool to manage file archives of various types")
  1905. (description "The main command is @command{aunpack} which extracts files
  1906. from an archive. The other commands provided are @command{apack} (to create
  1907. archives), @command{als} (to list files in archives), and @command{acat} (to
  1908. extract files to standard out). As @command{atool} invokes external programs
  1909. to handle the archives, not all commands may be supported for a certain type
  1910. of archives.")
  1911. (license license:gpl2+)))
  1912. (define-public lunzip
  1913. (package
  1914. (name "lunzip")
  1915. (version "1.12")
  1916. (source
  1917. (origin
  1918. (method url-fetch)
  1919. (uri (string-append "mirror://savannah/lzip/lunzip/"
  1920. "lunzip-" version ".tar.gz"))
  1921. (sha256
  1922. (base32 "1liaynyy3qcs29hfk1pnb7i9r1mnmpw557j5v356qsv6qnm4lnz5"))))
  1923. (build-system gnu-build-system)
  1924. (arguments
  1925. `(#:configure-flags
  1926. (list ,(string-append "CC=" (cc-for-target)))))
  1927. (home-page "https://www.nongnu.org/lzip/lunzip.html")
  1928. (synopsis "Small, stand-alone lzip decompressor")
  1929. (description
  1930. "Lunzip is a decompressor for files in the lzip compression format (.lz),
  1931. written as a single small C tool with no dependencies. This makes it
  1932. well-suited to embedded and other systems without a C++ compiler, or for use in
  1933. applications such as software installers that need only to decompress files,
  1934. not compress them.
  1935. Lunzip is intended to be fully compatible with the regular lzip package.")
  1936. (license (list license:bsd-2 ; carg_parser.[ch]
  1937. license:gpl2+)))) ; everything else
  1938. (define-public clzip
  1939. (package
  1940. (name "clzip")
  1941. (version "1.12")
  1942. (source
  1943. (origin
  1944. (method url-fetch)
  1945. (uri (string-append "mirror://savannah/lzip/clzip/"
  1946. "clzip-" version ".tar.gz"))
  1947. (sha256
  1948. (base32 "1s7yidqvmxi61hh569h5aci816l6qkffjgx0zx57qyyq0qq2pjgw"))))
  1949. (build-system gnu-build-system)
  1950. (arguments
  1951. `(#:configure-flags
  1952. (list ,(string-append "CC=" (cc-for-target)))))
  1953. (home-page "https://www.nongnu.org/lzip/clzip.html")
  1954. (synopsis "Small, stand-alone lzip compressor and decompressor")
  1955. (description
  1956. "Clzip is a compressor and decompressor for files in the lzip compression
  1957. format (.lz), written as a single small C tool with no dependencies. This makes
  1958. it well-suited to embedded and other systems without a C++ compiler, or for use
  1959. in other applications like package managers.
  1960. Clzip is intended to be fully compatible with the regular lzip package.")
  1961. (license (list license:bsd-2 ; carg_parser.[ch], lzd in clzip.texi
  1962. license:gpl2+))))
  1963. (define-public lzlib
  1964. (package
  1965. (name "lzlib")
  1966. (version "1.12")
  1967. (source
  1968. (origin
  1969. (method url-fetch)
  1970. (uri (string-append "mirror://savannah/lzip/lzlib/"
  1971. "lzlib-" version ".tar.gz"))
  1972. (sha256
  1973. (base32 "1c9pwd6by8is4z8bs6j306jyy6pgm2dvsn4fr7fg2b5m5qj88pcf"))))
  1974. (build-system gnu-build-system)
  1975. (arguments
  1976. `(#:configure-flags
  1977. (list (string-append "CC=" ,(cc-for-target))
  1978. "--disable-static"
  1979. "--enable-shared"))) ; only static (.a) is built by default
  1980. (home-page "https://www.nongnu.org/lzip/lzlib.html")
  1981. (synopsis "Lzip data compression C library")
  1982. (description
  1983. "Lzlib is a C library for in-memory LZMA compression and decompression in
  1984. the lzip format. It supports integrity checking of the decompressed data, and
  1985. all functions are thread-safe. The library should never crash, even in case of
  1986. corrupted input.")
  1987. (license (list license:bsd-2 ; the library itself
  1988. license:gpl2+)))) ; main.c (i.e. minilzip used by tests)
  1989. (define-public plzip
  1990. (package
  1991. (name "plzip")
  1992. (version "1.9")
  1993. (source
  1994. (origin
  1995. (method url-fetch)
  1996. (uri (string-append "mirror://savannah/lzip/plzip/"
  1997. "plzip-" version ".tar.gz"))
  1998. (sha256
  1999. (base32 "19zinpx7hssl6r3vilpvq2s7wha3545xan8b0vcvsxnyipdx3n0l"))))
  2000. (build-system gnu-build-system)
  2001. (inputs
  2002. (list lzlib))
  2003. (home-page "https://www.nongnu.org/lzip/plzip.html")
  2004. (synopsis "Parallel lossless data compressor for the lzip format")
  2005. (description
  2006. "Plzip is a massively parallel (multi-threaded) lossless data compressor
  2007. and decompressor that uses the lzip file format (.lz). Files produced by plzip
  2008. are fully compatible with lzip and can be rescued with lziprecover.
  2009. On multiprocessor machines, plzip can compress and decompress large files much
  2010. faster than lzip, at the cost of a slightly reduced compression ratio (0.4% to
  2011. 2%). The number of usable threads is limited by file size: on files of only a
  2012. few MiB, plzip is no faster than lzip.
  2013. Files that were compressed with regular lzip will also not be decompressed
  2014. faster by plzip, unless the @code{-b} option was used: lzip usually produces
  2015. single-member files which can't be decompressed in parallel.")
  2016. (license (list license:bsd-2 ; arg_parser.{cc,h}
  2017. license:gpl2+)))) ; everything else
  2018. (define-public innoextract
  2019. (package
  2020. (name "innoextract")
  2021. (version "1.9")
  2022. (source
  2023. (origin
  2024. (method url-fetch)
  2025. (uri (string-append "https://constexpr.org/innoextract/files/"
  2026. "innoextract-" version "/"
  2027. "/innoextract-" version ".tar.gz"))
  2028. (sha256
  2029. (base32 "09l1z1nbl6ijqqwszdwch9mqr54qb7df0wp2sd77v17dq6gsci33"))))
  2030. (build-system cmake-build-system)
  2031. (arguments
  2032. `(#:tests? #f))
  2033. (inputs (list boost xz))
  2034. (native-inputs (list pkg-config))
  2035. (home-page "https://constexpr.org/innoextract/")
  2036. (synopsis "Tool for extracting Inno Setup installers")
  2037. (description "innoextract allows extracting Inno Setup installers under
  2038. non-Windows systems without running the actual installer using wine.")
  2039. (license license:zlib)))
  2040. (define-public isa-l
  2041. (package
  2042. (name "isa-l")
  2043. (version "2.30.0")
  2044. (source
  2045. (origin
  2046. (method git-fetch)
  2047. (uri (git-reference
  2048. (url "https://github.com/intel/isa-l")
  2049. ;; Corresponds to tag v2.30.0
  2050. (commit "2df39cf5f1b9ccaa2973f6ef273857e4dc46f0cf")))
  2051. (file-name (git-file-name name version))
  2052. (sha256
  2053. (base32 "06ymkrf3hkkd94i59ahm79545rk709y8rd0v2l86w38z6is942q0"))))
  2054. (build-system gnu-build-system)
  2055. (native-inputs (list autoconf automake libtool nasm))
  2056. (home-page "https://github.com/intel/isa-l")
  2057. (synopsis "Intelligent storage acceleration library")
  2058. (description "ISA-L is a collection of optimized low-level functions
  2059. targeting storage applications. ISA-L includes:
  2060. @itemize
  2061. @item Erasure codes: fast block Reed-Solomon type erasure codes for any
  2062. encode/decode matrix;
  2063. @item CRC: fast implementations of cyclic redundancy check. Six different
  2064. polynomials supported: iscsi32, ieee32, t10dif, ecma64, iso64, jones64;
  2065. @item Raid: calculate and operate on XOR and P+Q parity found in common RAID
  2066. implementations;
  2067. @item Compression: fast deflate-compatible data compression;
  2068. @item De-compression: fast inflate-compatible data compression;
  2069. @item igzip: command line application like gzip, accelerated with ISA-L.
  2070. @end itemize
  2071. ")
  2072. (license license:bsd-3)))
  2073. (define-public brotli
  2074. (package
  2075. (name "brotli")
  2076. (version "1.0.9")
  2077. (source
  2078. (origin
  2079. (method git-fetch)
  2080. (uri (git-reference
  2081. (url "https://github.com/google/brotli")
  2082. (commit (string-append "v" version))))
  2083. (file-name (git-file-name name version))
  2084. (sha256
  2085. (base32 "1fikasxf7r2dwlk8mv8w7nmjkn0jw5ic31ky3mvpkdzwgd4xfndl"))
  2086. (modules '((guix build utils)))
  2087. (snippet
  2088. '(begin
  2089. ;; Cherry-picked from upstream since the latest release
  2090. ;; https://github.com/google/brotli/commit/09b0992b6acb7faa6fd3b23f9bc036ea117230fc
  2091. (substitute* (find-files "scripts" "^lib.*pc\\.in")
  2092. (("-R\\$\\{libdir\\} ") ""))
  2093. #t))))
  2094. (build-system cmake-build-system)
  2095. (arguments
  2096. `(#:phases
  2097. (modify-phases %standard-phases
  2098. (add-after 'install 'rename-static-libraries
  2099. ;; The build tools put a 'static' suffix on the static libraries, but
  2100. ;; other applications don't know how to find these.
  2101. (lambda* (#:key outputs #:allow-other-keys)
  2102. (let ((lib (string-append (assoc-ref %outputs "out") "/lib/")))
  2103. (rename-file (string-append lib "libbrotlicommon-static.a")
  2104. (string-append lib "libbrotlicommon.a"))
  2105. (rename-file (string-append lib "libbrotlidec-static.a")
  2106. (string-append lib "libbrotlidec.a"))
  2107. (rename-file (string-append lib "libbrotlienc-static.a")
  2108. (string-append lib "libbrotlienc.a"))
  2109. #t))))
  2110. #:configure-flags
  2111. (list ;; Defaults to "lib64" on 64-bit archs.
  2112. (string-append "-DCMAKE_INSTALL_LIBDIR="
  2113. (assoc-ref %outputs "out") "/lib"))))
  2114. (home-page "https://github.com/google/brotli")
  2115. (synopsis "General-purpose lossless compression")
  2116. (description "This package provides the reference implementation of Brotli,
  2117. a generic-purpose lossless compression algorithm that compresses data using a
  2118. combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd
  2119. order context modeling, with a compression ratio comparable to the best
  2120. currently available general-purpose compression methods. It is similar in speed
  2121. with @code{deflate} but offers more dense compression.
  2122. The specification of the Brotli Compressed Data Format is defined in RFC 7932.")
  2123. (license license:expat)))
  2124. (define-public google-brotli
  2125. (deprecated-package "google-brotli" brotli))
  2126. (define-public python-brotli
  2127. (package
  2128. (inherit brotli)
  2129. (name "python-brotli")
  2130. (build-system python-build-system)
  2131. (arguments '())
  2132. (synopsis "Python interface to Brotli")
  2133. (description "This package provides a Python interface to the @code{brotli}
  2134. package, an implementation of the Brotli lossless compression algorithm.")))
  2135. (define-public python-google-brotli
  2136. (deprecated-package "python-google-brotli" python-brotli))
  2137. (define-public ucl
  2138. (package
  2139. (name "ucl")
  2140. (version "1.03")
  2141. (source (origin
  2142. (method url-fetch)
  2143. (uri (string-append "https://www.oberhumer.com/opensource/"
  2144. name "/download/" name "-" version ".tar.gz"))
  2145. (sha256
  2146. (base32
  2147. "0j036lkwsxvm15gr29n8wn07cqq79dswjs9k54939ms5zngjjrdq"))))
  2148. (build-system gnu-build-system)
  2149. (arguments
  2150. `(;; UCL 1.03 fails to build with newer C standards.
  2151. #:configure-flags '("CFLAGS=-std=gnu90"
  2152. "--enable-shared" "--disable-static")))
  2153. (home-page "https://www.oberhumer.com/opensource/ucl/")
  2154. (synopsis "Portable lossless data compression library")
  2155. (description "UCL implements a number of compression algorithms that
  2156. achieve an excellent compression ratio while allowing fast decompression.
  2157. Decompression requires no additional memory.
  2158. Compared to LZO, the UCL algorithms achieve a better compression ratio but
  2159. decompression is a little bit slower.")
  2160. (license license:gpl2+)))
  2161. (define-public upx
  2162. (package
  2163. (name "upx")
  2164. (version "3.96")
  2165. (source (origin
  2166. (method url-fetch)
  2167. (uri (string-append "https://github.com/upx/upx/releases/download/v"
  2168. version "/upx-" version "-src.tar.xz"))
  2169. (sha256
  2170. (base32
  2171. "051pk5jk8fcfg5mpgzj43z5p4cn7jy5jbyshyn78dwjqr7slsxs7"))
  2172. (patches (search-patches "upx-CVE-2021-20285.patch"))))
  2173. (build-system gnu-build-system)
  2174. (native-inputs
  2175. (list perl))
  2176. (inputs
  2177. (list ucl zlib))
  2178. (arguments
  2179. `(#:make-flags
  2180. (list "all")
  2181. #:phases
  2182. (modify-phases %standard-phases
  2183. (delete 'configure) ; no configure script
  2184. (delete 'check) ; no test suite
  2185. (add-before 'build 'patch-exec-bin-sh
  2186. (lambda _
  2187. (substitute* (list "Makefile"
  2188. "src/Makefile")
  2189. (("/bin/sh") (which "sh")))
  2190. #t))
  2191. (replace 'install
  2192. (lambda* (#:key outputs #:allow-other-keys)
  2193. (let* ((out (assoc-ref outputs "out"))
  2194. (bin (string-append out "/bin")))
  2195. (mkdir-p bin)
  2196. (copy-file "src/upx.out" (string-append bin "/upx")))
  2197. #t)))))
  2198. (home-page "https://upx.github.io/")
  2199. (synopsis "Compression tool for executables")
  2200. (description
  2201. "The Ultimate Packer for eXecutables (UPX) is an executable file
  2202. compressor. UPX typically reduces the file size of programs and shared
  2203. libraries by around 50%--70%, thus reducing disk space, network load times,
  2204. download times, and other distribution and storage costs.")
  2205. (license license:gpl2+)))
  2206. (define-public quazip-0
  2207. (package
  2208. (name "quazip")
  2209. (version "0.9.1")
  2210. (source (origin
  2211. (method git-fetch)
  2212. (uri (git-reference
  2213. (url "https://github.com/stachenov/quazip")
  2214. (commit (string-append "v" version))))
  2215. (file-name (git-file-name name version))
  2216. (sha256
  2217. (base32
  2218. "11icgwv2xyxhd1hm1add51xv54zwkcqkg85d1xqlgiigvbm196iq"))))
  2219. (build-system cmake-build-system)
  2220. (arguments
  2221. `(#:tests? #f)) ;no test
  2222. (native-inputs
  2223. (list doxygen))
  2224. (inputs
  2225. (list qtbase-5 zlib))
  2226. (home-page "https://stachenov.github.io/quazip/index.html")
  2227. (synopsis "Qt/C++ wrapper for Minizip")
  2228. (description "QuaZIP is a simple C++ wrapper over Gilles Vollant's
  2229. ZIP/UNZIP package that can be used to access ZIP archives. It uses
  2230. Trolltech's Qt toolkit.
  2231. QuaZIP allows you to access files inside ZIP archives using QIODevice
  2232. API, and that means that you can also use QTextStream, QDataStream or
  2233. whatever you would like to use on your zipped files.
  2234. QuaZIP provides complete abstraction of the ZIP/UNZIP API, for both
  2235. reading from and writing to ZIP archives.")
  2236. ;; Project is distributed under LGPL, but "quazip/z*" "quazip/unzip.*" are
  2237. ;; distributed under zlib terms.
  2238. (license (list license:lgpl2.1+ license:zlib))))
  2239. (define-public quazip
  2240. (package
  2241. (inherit quazip-0)
  2242. (name "quazip")
  2243. (version "1.2")
  2244. (source
  2245. (origin
  2246. (method git-fetch)
  2247. (uri (git-reference
  2248. (url "https://github.com/stachenov/quazip")
  2249. (commit (string-append "v" version))))
  2250. (file-name (git-file-name name version))
  2251. (sha256
  2252. (base32 "1dwld7jxhjz9l33lrqwvklazdy7ygi6n1m4ry1n1sk5dnschrhby"))))))
  2253. (define-public zchunk
  2254. (package
  2255. (name "zchunk")
  2256. (version "1.1.16")
  2257. (source (origin
  2258. (method git-fetch)
  2259. (uri (git-reference
  2260. (url "https://github.com/zchunk/zchunk")
  2261. (commit version)))
  2262. (file-name (git-file-name name version))
  2263. (sha256
  2264. (base32
  2265. "0nlzwnv6wh2yjyyv27f81jnvmk7psgpbnw7dsdp7frfkya569hgv"))))
  2266. (build-system meson-build-system)
  2267. (arguments
  2268. `(#:phases (modify-phases %standard-phases
  2269. (add-after 'unpack 'patch-paths
  2270. (lambda* (#:key inputs #:allow-other-keys)
  2271. (substitute* "src/zck_gen_zdict.c"
  2272. (("/usr/bin/zstd")
  2273. (string-append (assoc-ref inputs "zstd")
  2274. "/bin/zstd"))))))))
  2275. (native-inputs
  2276. (list pkg-config))
  2277. (inputs
  2278. (list curl zstd))
  2279. (propagated-inputs
  2280. `(("zstd:lib" ,zstd "lib"))) ;in Requires.private of zck.pc
  2281. (home-page "https://github.com/zchunk/zchunk")
  2282. (synopsis "Compressed file format for efficient deltas")
  2283. (description "The zchunk compressed file format allows splitting a file
  2284. into independent chunks. This makes it possible to retrieve only changed
  2285. chunks when downloading a new version of the file, and also makes zchunk files
  2286. efficient over rsync. Along with the library, this package provides the
  2287. following utilities:
  2288. @table @command
  2289. @item unzck
  2290. To decompress a zchunk file.
  2291. @item zck
  2292. To compress a new zchunk file, or re-compress an existing one.
  2293. @item zck_delta_size
  2294. To calculate the difference between two zchunk files.
  2295. @item zck_gen_zdict
  2296. To create a dictionary for a zchunk file.
  2297. @item zck_read_header
  2298. To read a zchunk header.
  2299. @item zckdl
  2300. To download a zchunk file.
  2301. @end table")
  2302. (license license:bsd-2)))
  2303. (define-public zutils
  2304. (package
  2305. (name "zutils")
  2306. (version "1.10")
  2307. (source
  2308. (origin
  2309. (method url-fetch)
  2310. (uri (string-append "mirror://savannah/zutils/zutils-" version ".tar.lz"))
  2311. (sha256
  2312. (base32 "15dimqp8zlqaaa2l46r22srp1py38mlmn69ph1j5fmrd54w43m0d"))))
  2313. (build-system gnu-build-system)
  2314. (arguments
  2315. `(#:configure-flags
  2316. (list "--sysconfdir=/etc")
  2317. #:phases
  2318. (modify-phases %standard-phases
  2319. (add-before 'check 'disable-failing-tests
  2320. ;; XXX https://lists.nongnu.org/archive/html/zutils-bug/2020-07/msg00005.html
  2321. (lambda _
  2322. (substitute* "testsuite/check.sh"
  2323. (("\"\\$\\{ZGREP\\}\" -N -L \"GNU\"") "true")
  2324. (("\"\\$\\{ZGREP\\}\" -N -L \"nx_pattern\"") "false"))
  2325. #t))
  2326. (replace 'install
  2327. (lambda* (#:key make-flags outputs #:allow-other-keys)
  2328. (apply invoke "make" "install"
  2329. (string-append "sysconfdir=" (assoc-ref outputs "out")
  2330. "/etc")
  2331. make-flags))))))
  2332. (native-inputs
  2333. ;; Needed to extract the source tarball and run the test suite.
  2334. (list lzip))
  2335. (home-page "https://www.nongnu.org/zutils/zutils.html")
  2336. (synopsis "Utilities that transparently operate on compressed files")
  2337. (description
  2338. "Zutils is a collection of utilities able to process any combination of
  2339. compressed and uncompressed files transparently. If any given file, including
  2340. standard input, is compressed, its decompressed content is used instead.
  2341. @command{zcat}, @command{zcmp}, @command{zdiff}, and @command{zgrep} are
  2342. improved replacements for the shell scripts provided by GNU gzip.
  2343. @command{ztest} tests the integrity of supported compressed files.
  2344. @command{zupdate} recompresses files with lzip, similar to gzip's
  2345. @command{znew}.
  2346. Supported compression formats are bzip2, gzip, lzip, and xz. Zutils uses
  2347. external compressors: the compressor to be used for each format is configurable
  2348. at run time, and must be installed separately.")
  2349. (license (list license:bsd-2 ; arg_parser.{cc,h}
  2350. license:gpl2+)))) ; the rest
  2351. (define-public makeself-safeextract
  2352. (let ((commit "1a95e121fa8e3c02d307ae37b9b7834e616c3683"))
  2353. (package
  2354. (name "makeself-safeextract")
  2355. (version (git-version "0.0.0" "1" commit))
  2356. (home-page "https://github.com/ssokolow/makeself_safeextract")
  2357. (source
  2358. (origin
  2359. (method git-fetch)
  2360. (uri (git-reference
  2361. (url home-page)
  2362. (commit commit)))
  2363. (file-name (git-file-name name version))
  2364. (sha256
  2365. (base32
  2366. "1anlinaj9lvfi8bn00wp11vzqq0f9sig4fm9yrspisx31v0z4a2c"))))
  2367. (build-system trivial-build-system)
  2368. (inputs
  2369. `(("python" ,python-2)
  2370. ("p7zip" ,p7zip)
  2371. ("unzip" ,unzip)))
  2372. (arguments
  2373. `(#:modules ((guix build utils))
  2374. #:builder
  2375. (begin
  2376. (use-modules (guix build utils))
  2377. (let* ((name "makeself_safeextract")
  2378. (source (string-append (assoc-ref %build-inputs "source")
  2379. "/" name ".py"))
  2380. (bin (string-append (assoc-ref %outputs "out") "/bin"))
  2381. (target (string-append bin "/" name))
  2382. (python (string-append (assoc-ref %build-inputs "python") "/bin"))
  2383. (7z (search-input-file %build-inputs "/bin/7z"))
  2384. (unzip (search-input-file %build-inputs "/bin/unzip")))
  2385. (setenv "PATH" (string-append (getenv "PATH") ":" python))
  2386. (mkdir-p bin)
  2387. (copy-file source target)
  2388. (substitute* target
  2389. (("'7z'") (format #f "'~a'" 7z))
  2390. (("'unzip'") (format #f "'~a'" unzip)))
  2391. (patch-shebang target)))))
  2392. (synopsis "Extract makeself and mojo archives without running untrusted code")
  2393. (description "This package provides a script to unpack self-extracting
  2394. archives generated by @command{makeself} or @command{mojo} without running the
  2395. possibly untrusted extraction shell script.")
  2396. (license license:gpl3+))))
  2397. (define-public ncompress
  2398. (package
  2399. (name "ncompress")
  2400. (version "5.0")
  2401. (source (origin
  2402. (method git-fetch)
  2403. (uri (git-reference
  2404. (url "https://github.com/vapier/ncompress")
  2405. (commit (string-append "v" version))))
  2406. (patches (search-patches "ncompress-fix-softlinks.patch"))
  2407. (file-name (string-append name "-" version ".tar.gz"))
  2408. (sha256
  2409. (base32
  2410. "090kksxrlqnsdc76fzz2j2ajc98mhmfwyn163ca2ia9niqmlpcm0"))))
  2411. (arguments
  2412. `(#:make-flags (list (string-append "CC=" ,(cc-for-target))
  2413. (string-append "BINDIR=" %output "/bin")
  2414. (string-append "MANDIR=" %output "/share/man/man1"))
  2415. #:phases (modify-phases %standard-phases
  2416. (delete 'configure)))) ; no configure script
  2417. (build-system gnu-build-system)
  2418. (home-page "https://github.com/vapier/ncompress/")
  2419. (synopsis "Original Lempel-Ziv compress/uncompress programs")
  2420. (description "(N)compress provides the original compress and uncompress
  2421. programs that used to be the de facto UNIX standard for compressing and
  2422. uncompressing files. These programs implement a fast, simple Lempel-Ziv (LZW)
  2423. file compression algorithm.")
  2424. (license license:gpl2+)))
  2425. (define-public xarchiver
  2426. (package
  2427. (name "xarchiver")
  2428. (version "0.5.4.17")
  2429. (source
  2430. (origin
  2431. (method git-fetch)
  2432. (uri (git-reference
  2433. (url "https://github.com/ib/xarchiver")
  2434. (commit version)))
  2435. (file-name (git-file-name name version))
  2436. (sha256
  2437. (base32 "00adrjpxqlaccrwjf65w3vhxfswdj0as8aj263c6f9b85llypc5v"))))
  2438. (build-system glib-or-gtk-build-system)
  2439. (native-inputs
  2440. (list gettext-minimal intltool libxslt pkg-config))
  2441. (inputs
  2442. (list adwaita-icon-theme ; hard-coded theme
  2443. gtk+))
  2444. (home-page "https://github.com/ib/xarchiver")
  2445. (synopsis "Graphical front-end for archive operations")
  2446. (description "Xarchiver is a front-end to various command line archiving
  2447. tools. It uses GTK+ tool-kit and is designed to be desktop-environment
  2448. independent. Supported formats are 7z, ARJ, bzip2, gzip, LHA, lzma, lzop,
  2449. RAR, RPM, DEB, tar, and ZIP. It cannot perform functions for archives, whose
  2450. archiver is not installed.")
  2451. (license license:gpl2+)))
  2452. (define-public tarsplitter
  2453. (package
  2454. (name "tarsplitter")
  2455. (version "2.2.0")
  2456. (source (origin
  2457. (method git-fetch)
  2458. (uri (git-reference
  2459. (url "https://github.com/AQUAOSOTech/tarsplitter")
  2460. (commit (string-append "v" version))))
  2461. (file-name (git-file-name name version))
  2462. (sha256
  2463. (base32
  2464. "17qkg95r97kcrs17b0mcqswx99280ni47j5yx8xa7nl3bdhm6325"))))
  2465. (build-system go-build-system)
  2466. (arguments
  2467. `(#:import-path "github.com/AQUAOSOTech/tarsplitter"
  2468. #:install-source? #f
  2469. #:phases
  2470. (modify-phases %standard-phases
  2471. (add-after 'install 'install-documentation
  2472. (lambda* (#:key import-path outputs #:allow-other-keys)
  2473. (let* ((source (string-append "src/" import-path))
  2474. (out (assoc-ref outputs "out"))
  2475. (doc (string-append out "/share/doc/" ,name "-" ,version)))
  2476. (with-directory-excursion source
  2477. (install-file "README.md" doc))
  2478. #t))))))
  2479. (home-page "https://github.com/AQUAOSOTech/tarsplitter")
  2480. (synopsis "Multithreaded tar utility")
  2481. (description
  2482. "Archive huge numbers of files, or split massive tar archives into smaller
  2483. chunks.")
  2484. (license license:expat)))
  2485. (define-public c-blosc
  2486. (package
  2487. (name "c-blosc")
  2488. (version "1.18.1")
  2489. (source (origin
  2490. (method git-fetch)
  2491. (uri (git-reference
  2492. (url "https://github.com/Blosc/c-blosc")
  2493. (commit (string-append "v" version))))
  2494. (file-name (git-file-name name version))
  2495. (sha256
  2496. (base32
  2497. "1ywq8j70149859vvs19wgjq89d6xsvvmvm2n1dmkzpchxgrvnw70"))))
  2498. (build-system cmake-build-system)
  2499. (arguments
  2500. `(#:configure-flags
  2501. '("-DDEACTIVATE_AVX2=ON"
  2502. "-DPREFER_EXTERNAL_LZ4=ON"
  2503. "-DPREFER_EXTERNAL_SNAPPY=ON"
  2504. "-DPREFER_EXTERNAL_ZLIB=ON"
  2505. "-DPREFER_EXTERNAL_ZSTD=ON")))
  2506. (inputs
  2507. `(("lz4" ,lz4)
  2508. ("snappy" ,snappy)
  2509. ("zlib" ,zlib)
  2510. ("zstd:lib" ,zstd "lib")))
  2511. (home-page "https://blosc.org")
  2512. (synopsis "Blocking, shuffling and lossless compression library")
  2513. (description
  2514. "Blosc is a high performance compressor optimized for binary data. It has
  2515. been designed to transmit data to the processor cache faster than the
  2516. traditional, non-compressed, direct memory fetch approach via a
  2517. @code{memcpy()} system call. Blosc is meant not only to reduce the size of
  2518. large datasets on-disk or in-memory, but also to accelerate memory-bound
  2519. computations.")
  2520. ;; Blosc itself is released under BSD-3 but it incorporates code under
  2521. ;; other non-copyleft licenses.
  2522. (license license:bsd-3)))
  2523. (define-public ecm
  2524. (package
  2525. (name "ecm")
  2526. (version "1.0.3")
  2527. (source (origin
  2528. (method git-fetch)
  2529. (uri (git-reference
  2530. (url "https://github.com/alucryd/ecm-tools")
  2531. (commit (string-append "v" version))))
  2532. (file-name (git-file-name name version))
  2533. (sha256
  2534. (base32
  2535. "1rvyx5gcy8lfklgj80szlz3312x45wzx0d9jsgwyvy8f6m4nnb0c"))))
  2536. (build-system gnu-build-system)
  2537. (arguments
  2538. `(#:tests? #f ; no check target
  2539. #:make-flags
  2540. (list (string-append "CC=" ,(cc-for-target))
  2541. (string-append "DESTDIR=" (assoc-ref %outputs "out")))
  2542. #:phases
  2543. (modify-phases %standard-phases
  2544. (replace 'configure
  2545. (lambda _
  2546. (substitute* "Makefile"
  2547. (("\\$\\(DESTDIR\\)/usr") "$(DESTDIR)"))
  2548. #t)))))
  2549. (home-page "https://github.com/alucryd/ecm-tools")
  2550. (synopsis "Error code modeler")
  2551. (description "ECM is a utility that converts ECM files, i.e., CD data files
  2552. with their error correction data losslessly rearranged for better compression,
  2553. to their original, binary CD format.")
  2554. (license license:gpl3+)))
  2555. (define-public libdeflate
  2556. (package
  2557. (name "libdeflate")
  2558. (version "1.8")
  2559. (source (origin
  2560. (method git-fetch)
  2561. (uri (git-reference
  2562. (url "https://github.com/ebiggers/libdeflate")
  2563. (commit (string-append "v" version))))
  2564. (file-name (git-file-name name version))
  2565. (sha256
  2566. (base32
  2567. "0nw1zhr2s6ffcc3s0n5wsshvjb6pmybwapagli135zzn2fx1pdiz"))))
  2568. (build-system gnu-build-system)
  2569. (arguments
  2570. `(#:make-flags
  2571. (list (string-append "CC=" ,(cc-for-target))
  2572. (string-append "PREFIX=" (assoc-ref %outputs "out")))
  2573. #:phases
  2574. (modify-phases %standard-phases
  2575. (delete 'configure))))
  2576. (inputs
  2577. (list zlib))
  2578. (home-page "https://github.com/ebiggers/libdeflate")
  2579. (synopsis "Library for DEFLATE/zlib/gzip compression and decompression")
  2580. (description "Libdeflate is a library for fast, whole-buffer DEFLATE-based
  2581. compression and decompression. The supported formats are:
  2582. @enumerate
  2583. @item DEFLATE (raw)
  2584. @item zlib (a.k.a. DEFLATE with a zlib wrapper)
  2585. @item gzip (a.k.a. DEFLATE with a gzip wrapper)
  2586. @end enumerate
  2587. ")
  2588. (license license:expat)))
  2589. (define-public tarlz
  2590. (package
  2591. (name "tarlz")
  2592. (version "0.21")
  2593. (source
  2594. (origin
  2595. (method url-fetch)
  2596. (uri (string-append "mirror://savannah/lzip/tarlz/"
  2597. "tarlz-" version ".tar.lz"))
  2598. (sha256
  2599. (base32 "1x5dw03lcwfigcv97cg70gkbkfycjmv1012s9lwnl4izvl9235qg"))))
  2600. (build-system gnu-build-system)
  2601. (native-inputs
  2602. (list lzip))
  2603. (inputs
  2604. (list lzlib))
  2605. (home-page "https://www.nongnu.org/lzip/tarlz.html")
  2606. (synopsis "Combination of the tar archiver and the lzip compressor")
  2607. (description
  2608. "Tarlz is a massively parallel (multi-threaded) combined implementation of
  2609. the tar archiver and the lzip compressor. Tarlz creates, lists, and extracts
  2610. archives in a simplified and safer variant of the POSIX pax format compressed
  2611. with lzip, keeping the alignment between tar members and lzip members. The
  2612. resulting multimember tar.lz archive is fully backward compatible with standard
  2613. tar tools like GNU tar, which treat it like any other tar.lz archive. Tarlz
  2614. can append files to the end of such compressed archives.")
  2615. (license license:gpl2+)))
  2616. (define-public libcbor
  2617. (package
  2618. (name "libcbor")
  2619. (version "0.8.0")
  2620. (source
  2621. (origin
  2622. (method git-fetch)
  2623. (uri (git-reference
  2624. (url "https://github.com/PJK/libcbor")
  2625. (commit (string-append "v" version))))
  2626. (file-name (git-file-name name version))
  2627. (sha256 (base32 "01dv4vxcmbvpphqy16vqiwh25wx11x630js5wfnx7cryarsh9ld7"))))
  2628. (build-system cmake-build-system)
  2629. (arguments
  2630. '(#:configure-flags
  2631. (let* ((out (assoc-ref %outputs "out"))
  2632. (lib (string-append out "/lib")))
  2633. (list
  2634. "-DCMAKE_BUILD_TYPE=Release"
  2635. "-DBUILD_SHARED_LIBS=ON"
  2636. "-DCBOR_CUSTOM_ALLOC=ON"
  2637. (string-append "-DCMAKE_INSTALL_LIBDIR=" lib)
  2638. (string-append "-DCMAKE_INSTALL_RPATH=" lib)))))
  2639. (synopsis "The C library for parsing and generating CBOR")
  2640. (description
  2641. "The Concise Binary Object Representation (CBOR) is a data format whose
  2642. design goals include the possibility of extremely small code size, fairly
  2643. small message size, and extensibility without the need for version
  2644. negotiation. These design goals make it different from earlier binary
  2645. serializations such as ASN.1 and MessagePack.")
  2646. (license license:expat)
  2647. (home-page "https://github.com/PJK/libcbor")))
  2648. (define-public fcrackzip
  2649. (package
  2650. (name "fcrackzip")
  2651. (version "1.0")
  2652. (source (origin
  2653. (method url-fetch)
  2654. (uri (string-append "http://oldhome.schmorp.de/marc/data/"
  2655. "fcrackzip-" version ".tar.gz"))
  2656. (sha256
  2657. (base32
  2658. "0l1qsk949vnz18k4vjf3ppq8p497966x4c7f2yx18x8pk35whn2a"))))
  2659. (build-system gnu-build-system)
  2660. (arguments
  2661. (list
  2662. #:phases
  2663. '(modify-phases %standard-phases
  2664. (add-after 'unpack 'fix-reference-to-unzip
  2665. (lambda _
  2666. (substitute* "main.c"
  2667. (("\"unzip")
  2668. (string-append "\"" (which "unzip")))))))))
  2669. (inputs
  2670. (list perl unzip))
  2671. (home-page "http://oldhome.schmorp.de/marc/fcrackzip.html")
  2672. (synopsis "Zip password cracker")
  2673. (description "Fcrackzip is a Zip file password cracker.")
  2674. (license license:gpl2+)))