compression.scm 109 KB

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