compression.scm 110 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663
  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.3")
  886. (source
  887. (origin
  888. (method git-fetch)
  889. (uri (git-reference
  890. (url "https://github.com/AgentD/squashfs-tools-ng")
  891. (commit (string-append "v" version))))
  892. (file-name (git-file-name name version))
  893. (sha256
  894. (base32 "12ipqmjp10574sz64ls8qbgzkxz5dcbzk0l2fxyh2yrrhnjp34mi"))
  895. (modules '((guix build utils)))
  896. (snippet
  897. '(begin
  898. ;; Delete bundled third-party libraries.
  899. (for-each (lambda (directory)
  900. (substitute* "Makefile.am"
  901. (((format #f "^include ~a.*" directory)) ""))
  902. (delete-file-recursively directory))
  903. (list "lib/lz4"
  904. "lib/zlib"))))))
  905. (build-system gnu-build-system)
  906. (arguments
  907. `(#:configure-flags
  908. (list "--disable-static")))
  909. (native-inputs
  910. `(("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 brotli
  2035. (package
  2036. (name "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 google-brotli
  2086. (deprecated-package "google-brotli" brotli))
  2087. (define-public python-brotli
  2088. (package
  2089. (inherit brotli)
  2090. (name "python-brotli")
  2091. (build-system python-build-system)
  2092. (arguments '())
  2093. (synopsis "Python interface to Brotli")
  2094. (description "This package provides a Python interface to the @code{brotli}
  2095. package, an implementation of the Brotli lossless compression algorithm.")))
  2096. (define-public python-google-brotli
  2097. (deprecated-package "python-google-brotli" python-brotli))
  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-0
  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 quazip
  2203. (package
  2204. (inherit quazip-0)
  2205. (name "quazip")
  2206. (version "1.1")
  2207. (source
  2208. (origin
  2209. (method git-fetch)
  2210. (uri (git-reference
  2211. (url "https://github.com/stachenov/quazip")
  2212. (commit (string-append "v" version))))
  2213. (file-name (git-file-name name version))
  2214. (sha256
  2215. (base32 "06srglrj6jvy5ngmidlgx03i0d5w91yhi7sf846wql00v8rvhc5h"))))))
  2216. (define-public zchunk
  2217. (package
  2218. (name "zchunk")
  2219. (version "1.1.16")
  2220. (source (origin
  2221. (method git-fetch)
  2222. (uri (git-reference
  2223. (url "https://github.com/zchunk/zchunk")
  2224. (commit version)))
  2225. (file-name (git-file-name name version))
  2226. (sha256
  2227. (base32
  2228. "0nlzwnv6wh2yjyyv27f81jnvmk7psgpbnw7dsdp7frfkya569hgv"))))
  2229. (build-system meson-build-system)
  2230. (arguments
  2231. `(#:phases (modify-phases %standard-phases
  2232. (add-after 'unpack 'patch-paths
  2233. (lambda* (#:key inputs #:allow-other-keys)
  2234. (substitute* "src/zck_gen_zdict.c"
  2235. (("/usr/bin/zstd")
  2236. (string-append (assoc-ref inputs "zstd")
  2237. "/bin/zstd"))))))))
  2238. (native-inputs
  2239. `(("pkg-config" ,pkg-config)))
  2240. (inputs
  2241. `(("curl" ,curl)
  2242. ("zstd" ,zstd)))
  2243. (propagated-inputs
  2244. `(("zstd:lib" ,zstd "lib"))) ;in Requires.private of zck.pc
  2245. (home-page "https://github.com/zchunk/zchunk")
  2246. (synopsis "Compressed file format for efficient deltas")
  2247. (description "The zchunk compressed file format allows splitting a file
  2248. into independent chunks. This makes it possible to retrieve only changed
  2249. chunks when downloading a new version of the file, and also makes zchunk files
  2250. efficient over rsync. Along with the library, this package provides the
  2251. following utilities:
  2252. @table @command
  2253. @item unzck
  2254. To decompress a zchunk file.
  2255. @item zck
  2256. To compress a new zchunk file, or re-compress an existing one.
  2257. @item zck_delta_size
  2258. To calculate the difference between two zchunk files.
  2259. @item zck_gen_zdict
  2260. To create a dictionary for a zchunk file.
  2261. @item zck_read_header
  2262. To read a zchunk header.
  2263. @item zckdl
  2264. To download a zchunk file.
  2265. @end table")
  2266. (license license:bsd-2)))
  2267. (define-public zutils
  2268. (package
  2269. (name "zutils")
  2270. (version "1.10")
  2271. (source
  2272. (origin
  2273. (method url-fetch)
  2274. (uri (string-append "mirror://savannah/zutils/zutils-" version ".tar.lz"))
  2275. (sha256
  2276. (base32 "15dimqp8zlqaaa2l46r22srp1py38mlmn69ph1j5fmrd54w43m0d"))))
  2277. (build-system gnu-build-system)
  2278. (arguments
  2279. `(#:configure-flags
  2280. (list "--sysconfdir=/etc")
  2281. #:phases
  2282. (modify-phases %standard-phases
  2283. (add-before 'check 'disable-failing-tests
  2284. ;; XXX https://lists.nongnu.org/archive/html/zutils-bug/2020-07/msg00005.html
  2285. (lambda _
  2286. (substitute* "testsuite/check.sh"
  2287. (("\"\\$\\{ZGREP\\}\" -N -L \"GNU\"") "true")
  2288. (("\"\\$\\{ZGREP\\}\" -N -L \"nx_pattern\"") "false"))
  2289. #t))
  2290. (replace 'install
  2291. (lambda* (#:key make-flags outputs #:allow-other-keys)
  2292. (apply invoke "make" "install"
  2293. (string-append "sysconfdir=" (assoc-ref outputs "out")
  2294. "/etc")
  2295. make-flags))))))
  2296. (native-inputs
  2297. ;; Needed to extract the source tarball and run the test suite.
  2298. `(("lzip" ,lzip)))
  2299. (home-page "https://www.nongnu.org/zutils/zutils.html")
  2300. (synopsis "Utilities that transparently operate on compressed files")
  2301. (description
  2302. "Zutils is a collection of utilities able to process any combination of
  2303. compressed and uncompressed files transparently. If any given file, including
  2304. standard input, is compressed, its decompressed content is used instead.
  2305. @command{zcat}, @command{zcmp}, @command{zdiff}, and @command{zgrep} are
  2306. improved replacements for the shell scripts provided by GNU gzip.
  2307. @command{ztest} tests the integrity of supported compressed files.
  2308. @command{zupdate} recompresses files with lzip, similar to gzip's
  2309. @command{znew}.
  2310. Supported compression formats are bzip2, gzip, lzip, and xz. Zutils uses
  2311. external compressors: the compressor to be used for each format is configurable
  2312. at run time, and must be installed separately.")
  2313. (license (list license:bsd-2 ; arg_parser.{cc,h}
  2314. license:gpl2+)))) ; the rest
  2315. (define-public makeself-safeextract
  2316. (let ((commit "1a95e121fa8e3c02d307ae37b9b7834e616c3683"))
  2317. (package
  2318. (name "makeself-safeextract")
  2319. (version (git-version "0.0.0" "1" commit))
  2320. (home-page "https://github.com/ssokolow/makeself_safeextract")
  2321. (source
  2322. (origin
  2323. (method git-fetch)
  2324. (uri (git-reference
  2325. (url home-page)
  2326. (commit commit)))
  2327. (file-name (git-file-name name version))
  2328. (sha256
  2329. (base32
  2330. "1anlinaj9lvfi8bn00wp11vzqq0f9sig4fm9yrspisx31v0z4a2c"))))
  2331. (build-system trivial-build-system)
  2332. (inputs
  2333. `(("python" ,python-2)
  2334. ("p7zip" ,p7zip)
  2335. ("unzip" ,unzip)))
  2336. (arguments
  2337. `(#:modules ((guix build utils))
  2338. #:builder
  2339. (begin
  2340. (use-modules (guix build utils))
  2341. (let* ((name "makeself_safeextract")
  2342. (source (string-append (assoc-ref %build-inputs "source")
  2343. "/" name ".py"))
  2344. (bin (string-append (assoc-ref %outputs "out") "/bin"))
  2345. (target (string-append bin "/" name))
  2346. (python (string-append (assoc-ref %build-inputs "python") "/bin"))
  2347. (7z (search-input-file %build-inputs "/bin/7z"))
  2348. (unzip (search-input-file %build-inputs "/bin/unzip")))
  2349. (setenv "PATH" (string-append (getenv "PATH") ":" python))
  2350. (mkdir-p bin)
  2351. (copy-file source target)
  2352. (substitute* target
  2353. (("'7z'") (format #f "'~a'" 7z))
  2354. (("'unzip'") (format #f "'~a'" unzip)))
  2355. (patch-shebang target)))))
  2356. (synopsis "Extract makeself and mojo archives without running untrusted code")
  2357. (description "This package provides a script to unpack self-extracting
  2358. archives generated by @command{makeself} or @command{mojo} without running the
  2359. possibly untrusted extraction shell script.")
  2360. (license license:gpl3+))))
  2361. (define-public ncompress
  2362. (package
  2363. (name "ncompress")
  2364. (version "5.0")
  2365. (source (origin
  2366. (method git-fetch)
  2367. (uri (git-reference
  2368. (url "https://github.com/vapier/ncompress")
  2369. (commit (string-append "v" version))))
  2370. (patches (search-patches "ncompress-fix-softlinks.patch"))
  2371. (file-name (string-append name "-" version ".tar.gz"))
  2372. (sha256
  2373. (base32
  2374. "090kksxrlqnsdc76fzz2j2ajc98mhmfwyn163ca2ia9niqmlpcm0"))))
  2375. (arguments
  2376. `(#:make-flags (list (string-append "CC=" ,(cc-for-target))
  2377. (string-append "BINDIR=" %output "/bin")
  2378. (string-append "MANDIR=" %output "/share/man/man1"))
  2379. #:phases (modify-phases %standard-phases
  2380. (delete 'configure)))) ; no configure script
  2381. (build-system gnu-build-system)
  2382. (home-page "https://github.com/vapier/ncompress/")
  2383. (synopsis "Original Lempel-Ziv compress/uncompress programs")
  2384. (description "(N)compress provides the original compress and uncompress
  2385. programs that used to be the de facto UNIX standard for compressing and
  2386. uncompressing files. These programs implement a fast, simple Lempel-Ziv (LZW)
  2387. file compression algorithm.")
  2388. (license license:gpl2+)))
  2389. (define-public xarchiver
  2390. (package
  2391. (name "xarchiver")
  2392. (version "0.5.4.17")
  2393. (source
  2394. (origin
  2395. (method git-fetch)
  2396. (uri (git-reference
  2397. (url "https://github.com/ib/xarchiver")
  2398. (commit version)))
  2399. (file-name (git-file-name name version))
  2400. (sha256
  2401. (base32 "00adrjpxqlaccrwjf65w3vhxfswdj0as8aj263c6f9b85llypc5v"))))
  2402. (build-system glib-or-gtk-build-system)
  2403. (native-inputs
  2404. `(("gettext" ,gettext-minimal)
  2405. ("intltool" ,intltool)
  2406. ("libxslt" ,libxslt)
  2407. ("pkg-config" ,pkg-config)))
  2408. (inputs
  2409. `(("adwaita-icon-theme" ,adwaita-icon-theme) ; hard-coded theme
  2410. ("gtk+" ,gtk+)))
  2411. (home-page "https://github.com/ib/xarchiver")
  2412. (synopsis "Graphical front-end for archive operations")
  2413. (description "Xarchiver is a front-end to various command line archiving
  2414. tools. It uses GTK+ tool-kit and is designed to be desktop-environment
  2415. independent. Supported formats are 7z, ARJ, bzip2, gzip, LHA, lzma, lzop,
  2416. RAR, RPM, DEB, tar, and ZIP. It cannot perform functions for archives, whose
  2417. archiver is not installed.")
  2418. (license license:gpl2+)))
  2419. (define-public tarsplitter
  2420. (package
  2421. (name "tarsplitter")
  2422. (version "2.2.0")
  2423. (source (origin
  2424. (method git-fetch)
  2425. (uri (git-reference
  2426. (url "https://github.com/AQUAOSOTech/tarsplitter")
  2427. (commit (string-append "v" version))))
  2428. (file-name (git-file-name name version))
  2429. (sha256
  2430. (base32
  2431. "17qkg95r97kcrs17b0mcqswx99280ni47j5yx8xa7nl3bdhm6325"))))
  2432. (build-system go-build-system)
  2433. (arguments
  2434. `(#:import-path "github.com/AQUAOSOTech/tarsplitter"
  2435. #:install-source? #f
  2436. #:phases
  2437. (modify-phases %standard-phases
  2438. (add-after 'install 'install-documentation
  2439. (lambda* (#:key import-path outputs #:allow-other-keys)
  2440. (let* ((source (string-append "src/" import-path))
  2441. (out (assoc-ref outputs "out"))
  2442. (doc (string-append out "/share/doc/" ,name "-" ,version)))
  2443. (with-directory-excursion source
  2444. (install-file "README.md" doc))
  2445. #t))))))
  2446. (home-page "https://github.com/AQUAOSOTech/tarsplitter")
  2447. (synopsis "Multithreaded tar utility")
  2448. (description
  2449. "Archive huge numbers of files, or split massive tar archives into smaller
  2450. chunks.")
  2451. (license license:expat)))
  2452. (define-public c-blosc
  2453. (package
  2454. (name "c-blosc")
  2455. (version "1.18.1")
  2456. (source (origin
  2457. (method git-fetch)
  2458. (uri (git-reference
  2459. (url "https://github.com/Blosc/c-blosc")
  2460. (commit (string-append "v" version))))
  2461. (file-name (git-file-name name version))
  2462. (sha256
  2463. (base32
  2464. "1ywq8j70149859vvs19wgjq89d6xsvvmvm2n1dmkzpchxgrvnw70"))))
  2465. (build-system cmake-build-system)
  2466. (home-page "https://blosc.org")
  2467. (synopsis "Blocking, shuffling and lossless compression library")
  2468. (description
  2469. "Blosc is a high performance compressor optimized for binary data. It has
  2470. been designed to transmit data to the processor cache faster than the
  2471. traditional, non-compressed, direct memory fetch approach via a
  2472. @code{memcpy()} system call. Blosc is meant not only to reduce the size of
  2473. large datasets on-disk or in-memory, but also to accelerate memory-bound
  2474. computations.")
  2475. ;; Blosc itself is released under BSD-3 but it incorporates code under
  2476. ;; other non-copyleft licenses.
  2477. (license license:bsd-3)))
  2478. (define-public ecm
  2479. (package
  2480. (name "ecm")
  2481. (version "1.0.3")
  2482. (source (origin
  2483. (method git-fetch)
  2484. (uri (git-reference
  2485. (url "https://github.com/alucryd/ecm-tools")
  2486. (commit (string-append "v" version))))
  2487. (file-name (git-file-name name version))
  2488. (sha256
  2489. (base32
  2490. "1rvyx5gcy8lfklgj80szlz3312x45wzx0d9jsgwyvy8f6m4nnb0c"))))
  2491. (build-system gnu-build-system)
  2492. (arguments
  2493. `(#:tests? #f ; no check target
  2494. #:make-flags
  2495. (list (string-append "CC=" ,(cc-for-target))
  2496. (string-append "DESTDIR=" (assoc-ref %outputs "out")))
  2497. #:phases
  2498. (modify-phases %standard-phases
  2499. (replace 'configure
  2500. (lambda _
  2501. (substitute* "Makefile"
  2502. (("\\$\\(DESTDIR\\)/usr") "$(DESTDIR)"))
  2503. #t)))))
  2504. (home-page "https://github.com/alucryd/ecm-tools")
  2505. (synopsis "Error code modeler")
  2506. (description "ECM is a utility that converts ECM files, i.e., CD data files
  2507. with their error correction data losslessly rearranged for better compression,
  2508. to their original, binary CD format.")
  2509. (license license:gpl3+)))
  2510. (define-public libdeflate
  2511. (package
  2512. (name "libdeflate")
  2513. (version "1.8")
  2514. (source (origin
  2515. (method git-fetch)
  2516. (uri (git-reference
  2517. (url "https://github.com/ebiggers/libdeflate")
  2518. (commit (string-append "v" version))))
  2519. (file-name (git-file-name name version))
  2520. (sha256
  2521. (base32
  2522. "0nw1zhr2s6ffcc3s0n5wsshvjb6pmybwapagli135zzn2fx1pdiz"))))
  2523. (build-system gnu-build-system)
  2524. (arguments
  2525. `(#:make-flags
  2526. (list (string-append "CC=" ,(cc-for-target))
  2527. (string-append "PREFIX=" (assoc-ref %outputs "out")))
  2528. #:phases
  2529. (modify-phases %standard-phases
  2530. (delete 'configure))))
  2531. (inputs
  2532. `(("zlib" ,zlib)))
  2533. (home-page "https://github.com/ebiggers/libdeflate")
  2534. (synopsis "Library for DEFLATE/zlib/gzip compression and decompression")
  2535. (description "Libdeflate is a library for fast, whole-buffer DEFLATE-based
  2536. compression and decompression. The supported formats are:
  2537. @enumerate
  2538. @item DEFLATE (raw)
  2539. @item zlib (a.k.a. DEFLATE with a zlib wrapper)
  2540. @item gzip (a.k.a. DEFLATE with a gzip wrapper)
  2541. @end enumerate
  2542. ")
  2543. (license license:expat)))
  2544. (define-public tarlz
  2545. (package
  2546. (name "tarlz")
  2547. (version "0.21")
  2548. (source
  2549. (origin
  2550. (method url-fetch)
  2551. (uri (string-append "mirror://savannah/lzip/tarlz/"
  2552. "tarlz-" version ".tar.lz"))
  2553. (sha256
  2554. (base32 "1x5dw03lcwfigcv97cg70gkbkfycjmv1012s9lwnl4izvl9235qg"))))
  2555. (build-system gnu-build-system)
  2556. (native-inputs
  2557. `(("lzip" ,lzip)))
  2558. (inputs
  2559. `(("lzlib" ,lzlib)))
  2560. (home-page "https://www.nongnu.org/lzip/tarlz.html")
  2561. (synopsis "Combination of the tar archiver and the lzip compressor")
  2562. (description
  2563. "Tarlz is a massively parallel (multi-threaded) combined implementation of
  2564. the tar archiver and the lzip compressor. Tarlz creates, lists, and extracts
  2565. archives in a simplified and safer variant of the POSIX pax format compressed
  2566. with lzip, keeping the alignment between tar members and lzip members. The
  2567. resulting multimember tar.lz archive is fully backward compatible with standard
  2568. tar tools like GNU tar, which treat it like any other tar.lz archive. Tarlz
  2569. can append files to the end of such compressed archives.")
  2570. (license license:gpl2+)))