disk.scm 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013 Nikita Karetnikov <nikita@karetnikov.org>
  3. ;;; Copyright © 2015 Mathieu Lirzin <mthl@gnu.org>
  4. ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
  5. ;;; Copyright © 2016, 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
  6. ;;; Copyright © 2016, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
  7. ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
  8. ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
  9. ;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
  10. ;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
  11. ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
  12. ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
  13. ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
  14. ;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
  15. ;;; Copyright © 2018, 2019, 2020 Pierre Neidhardt <mail@ambrevar.xyz>
  16. ;;; Copyright © 2019, 2021 Leo Famulari <leo@famulari.name>
  17. ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
  18. ;;; Copyright © 2020 Pkill -9 <pkill9@runbox.com>
  19. ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
  20. ;;; Copyright © 2020 Raghav Gururajan <raghavgururajan@disroot.org>
  21. ;;; Copyright © 2021 Michael Rohleder <mike@rohleder.de>
  22. ;;; Copyright © 2021 Mathieu Othacehe <othacehe@gnu.org>
  23. ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
  24. ;;; Copyright © 2021 Justin Veilleux <terramorpha@cock.li>
  25. ;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
  26. ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
  27. ;;;
  28. ;;; This file is part of GNU Guix.
  29. ;;;
  30. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  31. ;;; under the terms of the GNU General Public License as published by
  32. ;;; the Free Software Foundation; either version 3 of the License, or (at
  33. ;;; your option) any later version.
  34. ;;;
  35. ;;; GNU Guix is distributed in the hope that it will be useful, but
  36. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  37. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  38. ;;; GNU General Public License for more details.
  39. ;;;
  40. ;;; You should have received a copy of the GNU General Public License
  41. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  42. (define-module (gnu packages disk)
  43. #:use-module (gnu packages)
  44. #:use-module (gnu packages autotools)
  45. #:use-module (gnu packages base)
  46. #:use-module (gnu packages bash)
  47. #:use-module (gnu packages c)
  48. #:use-module (gnu packages check)
  49. #:use-module (gnu packages compression)
  50. #:use-module (gnu packages crypto)
  51. #:use-module (gnu packages cryptsetup)
  52. #:use-module (gnu packages databases)
  53. #:use-module (gnu packages docbook)
  54. #:use-module (gnu packages documentation)
  55. #:use-module (gnu packages elf)
  56. #:use-module (gnu packages file-systems)
  57. #:use-module (gnu packages file)
  58. #:use-module (gnu packages fontutils)
  59. #:use-module (gnu packages gettext)
  60. #:use-module (gnu packages glib)
  61. #:use-module (gnu packages gnome)
  62. #:use-module (gnu packages gnupg)
  63. #:use-module (gnu packages golang)
  64. #:use-module (gnu packages graphics)
  65. #:use-module (gnu packages gtk)
  66. #:use-module (gnu packages guile)
  67. #:use-module (gnu packages image)
  68. #:use-module (gnu packages linux)
  69. #:use-module (gnu packages ncurses)
  70. #:use-module (gnu packages nss)
  71. #:use-module (gnu packages perl)
  72. #:use-module (gnu packages perl-web)
  73. #:use-module (gnu packages pkg-config)
  74. #:use-module (gnu packages popt)
  75. #:use-module (gnu packages python)
  76. #:use-module (gnu packages python-xyz)
  77. #:use-module (gnu packages qt)
  78. #:use-module (gnu packages readline)
  79. #:use-module (gnu packages samba)
  80. #:use-module (gnu packages serialization)
  81. #:use-module (gnu packages sphinx)
  82. #:use-module (gnu packages sqlite)
  83. #:use-module (gnu packages swig)
  84. #:use-module (gnu packages terminals)
  85. #:use-module (gnu packages textutils)
  86. #:use-module (gnu packages tls)
  87. #:use-module (gnu packages vim)
  88. #:use-module (gnu packages w3m)
  89. #:use-module (gnu packages web)
  90. #:use-module (gnu packages xml)
  91. #:use-module (gnu packages xorg)
  92. #:use-module (guix build-system gnu)
  93. #:use-module (guix build-system glib-or-gtk)
  94. #:use-module (guix build-system go)
  95. #:use-module (guix build-system python)
  96. #:use-module (guix build-system trivial)
  97. #:use-module (guix build-system scons)
  98. #:use-module (guix download)
  99. #:use-module (guix gexp)
  100. #:use-module (guix git-download)
  101. #:use-module ((guix licenses) #:prefix license:)
  102. #:use-module (guix packages)
  103. #:use-module (guix utils))
  104. (define-public bcache-tools
  105. ;; The 1.1 release is a year old and missing new features & documentation.
  106. (let ((commit "096d205a9f1be8540cbc5a468c0da8203023de70")
  107. (revision "0"))
  108. (package
  109. (name "bcache-tools")
  110. (version (git-version "1.1" revision commit))
  111. (source
  112. (origin
  113. (method git-fetch)
  114. (uri (git-reference
  115. (url (string-append "https://git.kernel.org/pub/scm/"
  116. "linux/kernel/git/colyli/bcache-tools.git"))
  117. (commit commit)))
  118. (file-name (git-file-name name version))
  119. (sha256
  120. (base32 "0r0vwg4vacz5zgsafk360xn7gi2scy01c79mkmjrdyxjfij5z3iy"))))
  121. (build-system gnu-build-system)
  122. (arguments
  123. `(#:tests? #f ; no test suite
  124. #:make-flags
  125. (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
  126. (string-append "UDEVLIBDIR=" (assoc-ref %outputs "out")
  127. "/lib/udev")
  128. (string-append "DRACUTLIBDIR=" (assoc-ref %outputs "out")
  129. "/lib/dracut")
  130. (string-append "CC=" ,(cc-for-target)))
  131. #:phases
  132. (modify-phases %standard-phases
  133. (delete 'configure) ; no configure script
  134. (add-before 'install 'fix-hard-coded-file-names
  135. (lambda _
  136. ;; Some rules still hard-code /usr.
  137. (substitute* "Makefile"
  138. (("/usr") "${PREFIX}"))
  139. #t))
  140. (add-before 'install 'create-target-directories
  141. (lambda* (#:key outputs #:allow-other-keys)
  142. (let* ((out (assoc-ref outputs "out")))
  143. (for-each (lambda (dir)
  144. (mkdir-p (string-append out dir)))
  145. (list "/lib/udev/rules.d"
  146. "/sbin"
  147. "/share/man/man8"))
  148. #t))))))
  149. (native-inputs
  150. (list pkg-config))
  151. (inputs
  152. `(("util-linux:lib" ,util-linux "lib"))) ; libblkid
  153. (home-page "https://bcache.evilpiepirate.org")
  154. (synopsis "Tools for the Linux kernel block layer cache")
  155. (description
  156. "This package contains user-space utilities to create and inspect bcache
  157. partitions. It's rather minimal as bcache is designed to work well without
  158. configuration on any system.
  159. Linux's @acronym{bcache, block layer cache} lets one or more fast block devices,
  160. such as flash-based @acronym{SSDs, solid state drives}, to act as a cache for
  161. one or more slower (and inexpensive) devices, such as hard disk drives or
  162. redundant storage arrays. In fact, bcache intends to be a superior alternative
  163. to battery-backed RAID controllers.
  164. Bcache is designed around the performance characteristics of SSDs and tries to
  165. minimize write inflation. It's file-system agnostic and does both write-through
  166. and write-back caching.")
  167. (license license:gpl2))))
  168. (define-public udevil
  169. (package
  170. (name "udevil")
  171. (version "0.4.4")
  172. (source
  173. (origin
  174. (method git-fetch)
  175. (uri
  176. (git-reference
  177. (url "https://github.com/IgnorantGuru/udevil")
  178. (commit version)))
  179. (file-name (git-file-name name version))
  180. (sha256
  181. (base32 "0x9mjr9abvbxzfa9mrip5264iz1qxvsl01k3ybz95q4a7xl4jcb3"))))
  182. (build-system gnu-build-system)
  183. (arguments
  184. `(#:configure-flags
  185. (list
  186. "--disable-systemd"
  187. (string-append "--sysconfdir="
  188. (assoc-ref %outputs "out")
  189. "/etc")
  190. ;; udevil expects these programs to be run with uid set as root.
  191. ;; user has to manually add these programs to setuid-programs.
  192. ;; mount and umount are default setuid-programs in guix system.
  193. "--with-mount-prog=/run/setuid-programs/mount"
  194. "--with-umount-prog=/run/setuid-programs/umount"
  195. "--with-losetup-prog=/run/setuid-programs/losetup"
  196. "--with-setfacl-prog=/run/setuid-programs/setfacl")
  197. #:phases
  198. (modify-phases %standard-phases
  199. (add-after 'unpack 'remove-root-reference
  200. (lambda _
  201. (substitute* "src/Makefile.in"
  202. (("-o root -g root") ""))
  203. #t))
  204. (add-after 'unpack 'patch-udevil-reference
  205. ;; udevil expects itself to be run with uid set as root.
  206. ;; devmon also expects udevil to be run with uid set as root.
  207. ;; user has to manually add udevil to setuid-programs.
  208. (lambda _
  209. (substitute* "src/udevil.c"
  210. (("/usr/bin/udevil") "/run/setuid-programs/udevil"))
  211. (substitute* "src/devmon"
  212. (("`which udevil 2>/dev/null`") "/run/setuid-programs/udevil"))
  213. #t)))))
  214. (native-inputs
  215. (list intltool pkg-config))
  216. (inputs
  217. (list cifs-utils
  218. curlftpfs
  219. eudev
  220. fakeroot
  221. glib
  222. sshfs))
  223. (synopsis "Device and file system manager")
  224. (description "udevil is a command line program that mounts and unmounts
  225. removable devices without a password, shows device info, and monitors device
  226. changes. It can also mount ISO files, NFS, SMB, FTP, SSH and WebDAV URLs, and
  227. tmpfs/ramfs filesystems.")
  228. (home-page "https://ignorantguru.github.io/udevil/")
  229. (license license:gpl3+)))
  230. (define-public parted
  231. (package
  232. (name "parted")
  233. (version "3.4")
  234. (source (origin
  235. (method url-fetch)
  236. (uri (string-append "mirror://gnu/parted/parted-"
  237. version ".tar.xz"))
  238. (sha256
  239. (base32
  240. "0hjkv84x1bs2qqyx1fnzjqyyqrhv7kpdbq9bgydmi99d8wi80ag1"))))
  241. (build-system gnu-build-system)
  242. (arguments
  243. `(#:phases
  244. (modify-phases %standard-phases
  245. (add-after 'unpack 'fix-locales-and-python
  246. (lambda* (#:key inputs #:allow-other-keys)
  247. (substitute* "tests/t0251-gpt-unicode.sh"
  248. (("C.UTF-8") "en_US.utf8")) ;not in Glibc locales
  249. (substitute* "tests/msdos-overlap"
  250. (("/usr/bin/python") (which "python")))
  251. #t)))))
  252. (inputs
  253. (list lvm2 readline
  254. `(,util-linux "lib")))
  255. (native-inputs
  256. `(("gettext" ,gettext-minimal)
  257. ;; For the tests.
  258. ("e2fsprogs" ,e2fsprogs)
  259. ("perl" ,perl)
  260. ("python-wrapper" ,python-wrapper)
  261. ("util-linux" ,util-linux)))
  262. (home-page "https://www.gnu.org/software/parted/")
  263. (synopsis "Disk partition editor")
  264. (description
  265. "GNU Parted is a package for creating and manipulating disk partition
  266. tables. It includes a library and command-line utility.")
  267. (license license:gpl3+)))
  268. (define-public fdisk
  269. (package
  270. (name "fdisk")
  271. (version "2.0.0a1")
  272. (source
  273. (origin
  274. (method url-fetch)
  275. (uri (string-append "mirror://gnu/fdisk/gnufdisk-"
  276. version ".tar.gz"))
  277. (sha256
  278. (base32
  279. "1d8za79kw8ihnp2br084rgyjv9whkwp7957rzw815i0izx6xhqy9"))))
  280. (build-system gnu-build-system)
  281. (inputs
  282. `(("gettext" ,gettext-minimal)
  283. ("guile" ,guile-1.8)
  284. ("util-linux" ,util-linux "lib")
  285. ("parted" ,parted)))
  286. ;; The build neglects to look for its own headers in its own tree. A next
  287. ;; release should fix this, but may never come: GNU fdisk looks abandoned.
  288. (arguments
  289. `(#:phases
  290. (modify-phases %standard-phases
  291. (add-after 'unpack 'skip-broken-header-probes
  292. (lambda _
  293. (substitute* "backend/configure"
  294. (("gnufdisk-common.h .*") "\n"))
  295. #t)))
  296. #:make-flags (list (string-append "CPPFLAGS="
  297. " -I../common/include "
  298. " -I../debug/include "
  299. " -I../exception/include"))))
  300. (home-page "https://www.gnu.org/software/fdisk/")
  301. (synopsis "Low-level disk partitioning and formatting")
  302. (description
  303. "GNU fdisk provides a GNU version of the common disk partitioning tool
  304. fdisk. fdisk is used for the creation and manipulation of disk partition
  305. tables, and it understands a variety of different formats.")
  306. (license license:gpl3+)))
  307. (define-public gpart
  308. ;; The latest (0.3) release is from 2015 and is missing a crash fix.
  309. (let ((commit "ec03350a01ad69708b5a3e2d47b8e002b0eba6c9")
  310. (revision "0"))
  311. (package
  312. (name "gpart")
  313. (version (git-version "0.3" revision commit))
  314. (source
  315. (origin
  316. (method git-fetch)
  317. (uri (git-reference
  318. (url "https://github.com/baruch/gpart")
  319. (commit commit)))
  320. (file-name (git-file-name name version))
  321. (sha256
  322. (base32 "1dassswliaiwhhmx7yz540yyxgk53fvg672dbvgc5q0v6cqrh5jx"))))
  323. (build-system gnu-build-system)
  324. (arguments
  325. `(#:configure-flags
  326. (list (string-append "--docdir=" (assoc-ref %outputs "out") "/share/doc/"
  327. ,name "-" ,version))
  328. #:phases
  329. (modify-phases %standard-phases
  330. (add-after 'unpack 'skip-premature-configuration
  331. (lambda _
  332. (substitute* "autogen.sh"
  333. (("\\./configure") "")))))))
  334. (native-inputs
  335. (list autoconf automake))
  336. (home-page "https://github.com/baruch/gpart")
  337. (synopsis "Guess and recover PC-style partition tables")
  338. (description
  339. "Gpart tries to guess the partitions on a PC-style, MBR-partitioned disk
  340. after they have been inadvertently deleted or the primary partition table at
  341. sector 0 damaged. In both cases, the contents of these partitions still exist
  342. on the disk but the operating system cannot access them.
  343. Gpart ignores the partition table and scans each sector of the device or image
  344. file for several known file system and partition types. Only partitions which
  345. have been formatted in some way can be recognized. Several file system guessing
  346. modules are built in; more can be written and loaded at run time.
  347. The guessed table can be restored manually, for example with @command{fdisk},
  348. written to a file, or---if you firmly believe it's entirely correct---directly
  349. to disk.
  350. It should be stressed that gpart does a very heuristic job. It can easily be
  351. right in its guesswork but it can also be terribly wrong. Never believe its
  352. output without any plausibility checks.")
  353. (license license:gpl2+))))
  354. (define-public gptfdisk
  355. (package
  356. (name "gptfdisk")
  357. (version "1.0.8")
  358. (source
  359. (origin
  360. (method url-fetch)
  361. (uri (string-append "mirror://sourceforge/gptfdisk/gptfdisk/"
  362. version "/gptfdisk-" version ".tar.gz"))
  363. (sha256
  364. (base32 "1py6klp1b7rni1qjj110snyyxafhx092carlii5vrnh4y1b9ilcm"))))
  365. (build-system gnu-build-system)
  366. (inputs
  367. `(("gettext" ,gettext-minimal)
  368. ("ncurses" ,ncurses)
  369. ("popt" ,popt)
  370. ("util-linux" ,util-linux "lib"))) ;libuuid
  371. (arguments
  372. `(#:test-target "test"
  373. #:phases
  374. (modify-phases %standard-phases
  375. (add-after 'unpack 'fix-include-directory
  376. (lambda _
  377. (substitute* "gptcurses.cc"
  378. (("ncursesw/ncurses.h") "ncurses.h"))
  379. #t))
  380. (delete 'configure) ; no configure script
  381. (replace 'install
  382. ;; There's no ‘make install’ target.
  383. (lambda* (#:key outputs #:allow-other-keys)
  384. (let* ((out (assoc-ref outputs "out"))
  385. (bin (string-append out "/bin"))
  386. (man (string-append out "/share/man/man8")))
  387. (install-file "gdisk" bin)
  388. (install-file "sgdisk" bin)
  389. (install-file "cgdisk" bin)
  390. (install-file "fixparts" bin)
  391. (install-file "cgdisk.8" man)
  392. (install-file "fixparts.8" man)
  393. (install-file "gdisk.8" man)
  394. (install-file "sgdisk.8" man)))))))
  395. (home-page "https://www.rodsbooks.com/gdisk/")
  396. (synopsis "Low-level GPT disk partitioning and formatting")
  397. (description "GPT fdisk (aka gdisk) is a text-mode partitioning tool that
  398. works on Globally Unique Identifier (@dfn{GUID}) Partition Table (@dfn{GPT})
  399. disks, rather than on the older Master Boot Record (@dfn{MBR}) partition
  400. scheme.")
  401. (license license:gpl2)))
  402. (define-public ddrescue
  403. (package
  404. (name "ddrescue")
  405. (version "1.25")
  406. (source
  407. (origin
  408. (method url-fetch)
  409. (uri (string-append "mirror://gnu/ddrescue/ddrescue-"
  410. version ".tar.lz"))
  411. (sha256
  412. (base32 "0qqh38izl5ppap9a5izf3hijh94k65s3zbfkczd4b7x04syqwlyf"))))
  413. (build-system gnu-build-system)
  414. (arguments
  415. `(#:configure-flags (list (string-append "CXX=" ,(cxx-for-target)))))
  416. (home-page "https://www.gnu.org/software/ddrescue/ddrescue.html")
  417. (synopsis "Data recovery utility")
  418. (native-inputs (list lzip))
  419. (description
  420. "GNU ddrescue is a fully automated data recovery tool. It copies data
  421. from one file to another, working to rescue data in case of read errors. The
  422. program also includes a tool for manipulating its log files, which are used
  423. to recover data more efficiently by only reading the necessary blocks.")
  424. (license license:gpl3+)))
  425. (define-public dosfstools
  426. (package
  427. (name "dosfstools")
  428. (version "4.2")
  429. (source
  430. (origin
  431. (method git-fetch)
  432. (uri (git-reference
  433. (url "https://github.com/dosfstools/dosfstools")
  434. (commit (string-append "v" version))))
  435. (file-name (git-file-name name version))
  436. (sha256
  437. (base32 "1xygsixmmc9l7drxylggnzkqqiks8zmlsbhg3z723ii2ak94236s"))))
  438. (build-system gnu-build-system)
  439. (arguments
  440. `(#:configure-flags (list "--enable-compat-symlinks")
  441. #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
  442. (string-append "CC=" ,(cc-for-target)))))
  443. (native-inputs
  444. (list autoconf automake
  445. ;; For tests.
  446. xxd))
  447. (home-page "https://github.com/dosfstools/dosfstools")
  448. (synopsis "Utilities for making and checking MS-DOS FAT file systems")
  449. (description
  450. "The dosfstools package includes the mkfs.fat and fsck.fat utilities,
  451. which respectively make and check MS-DOS FAT file systems.")
  452. (license license:gpl3+)))
  453. (define dosfstools/static
  454. (static-package
  455. (package (inherit dosfstools))))
  456. (define-public fatfsck/static
  457. (package
  458. (name "fatfsck-static")
  459. (version (package-version dosfstools))
  460. (build-system trivial-build-system)
  461. (source #f)
  462. (arguments
  463. `(#:modules ((guix build utils))
  464. #:builder
  465. (begin
  466. (use-modules (guix build utils))
  467. (let ((src (string-append (assoc-ref %build-inputs "dosfstools")
  468. "/sbin"))
  469. (exe "fsck.fat")
  470. (bin (string-append (assoc-ref %outputs "out") "/sbin")))
  471. (mkdir-p bin)
  472. (with-directory-excursion bin
  473. (copy-file (string-append src "/" exe) exe)
  474. (remove-store-references exe)
  475. (chmod exe #o555)
  476. ;; Add fsck.vfat symlink to match the Linux driver name.
  477. (symlink exe "fsck.vfat")
  478. #t)))))
  479. (inputs (list dosfstools/static))
  480. (home-page (package-home-page dosfstools))
  481. (synopsis "Statically linked fsck.fat from dosfstools")
  482. (description "This package provides a statically-linked @command{fsck.fat}
  483. and a @command{fsck.vfat} compatibility symlink for use in an initrd.")
  484. (license (package-license dosfstools))))
  485. (define-public sdparm
  486. (package
  487. (name "sdparm")
  488. (version "1.12")
  489. (source
  490. (origin
  491. (method url-fetch)
  492. (uri (string-append "http://sg.danny.cz/sg/p/"
  493. "sdparm-" version ".tar.xz"))
  494. (sha256
  495. (base32 "1gmdxr36allrgap2j4dv238d8awkj327ww0jjwpjwrpbvfpyzjf4"))))
  496. (build-system gnu-build-system)
  497. (home-page "http://sg.danny.cz/sg/sdparm.html")
  498. (synopsis "Provide access to SCSI device parameters")
  499. (description
  500. "Sdparm reads and modifies SCSI device parameters. These devices can be
  501. SCSI disks, in which case the role of @command{sdparm} is similar to its
  502. namesake: the @command{hdparm} utility originally designed for ATA disks.
  503. However, @command{sdparm} can be used to access parameters on any device that
  504. uses a SCSI command set. Such devices include CD/DVD drives (irrespective of
  505. transport), SCSI and ATAPI tape drives, and SCSI enclosures. This utility can
  506. also send commands associated with starting and stopping the media, loading
  507. and unloading removable media and some other housekeeping functions.")
  508. (license license:bsd-3)))
  509. (define-public idle3-tools
  510. (package
  511. (name "idle3-tools")
  512. (version "0.9.1")
  513. (source
  514. (origin
  515. (method url-fetch)
  516. (uri (string-append "mirror://sourceforge/idle3-tools/idle3-tools-"
  517. version ".tgz"))
  518. (sha256
  519. (base32
  520. "00ia7xq9yldxyl9gz0mr4xa568nav14p0fnv82f2rbbkg060cy4p"))))
  521. (build-system gnu-build-system)
  522. (arguments
  523. `(#:tests? #f ;no test suite
  524. #:phases
  525. (modify-phases %standard-phases
  526. (delete 'configure))
  527. #:make-flags (list "CC=gcc"
  528. (string-append "manprefix=")
  529. (string-append "DESTDIR="
  530. (assoc-ref %outputs "out")))))
  531. (home-page "http://idle3-tools.sourceforge.net")
  532. (synopsis "Change or disable Western Digital hard drives' Idle3 timer")
  533. (description
  534. "Idle3-tools provides a utility to get, set, or disable the Idle3 timer
  535. present in many Western Digital hard drives. This timer is part of the
  536. \"IntelliPark\" feature that stops the disk when not in use. Unfortunately,
  537. the default timer setting is not well suited to Linux or other *nix systems,
  538. and can dramatically shorten the lifespan of the drive if left unchecked.")
  539. (license license:gpl3+)))
  540. (define-public gparted
  541. (package
  542. (name "gparted")
  543. (version "1.3.1")
  544. (source
  545. (origin
  546. (method url-fetch)
  547. (uri (string-append "mirror://sourceforge/gparted/gparted/gparted-"
  548. version "/gparted-" version ".tar.gz"))
  549. (sha256
  550. (base32 "02g1s6hrhnias7kj241l0f72kllfhq6338mk2dmzjpmifinjxvjy"))))
  551. (build-system glib-or-gtk-build-system)
  552. (arguments
  553. ;; Tests require access to paths outside the build container, such
  554. ;; as '/dev/disk/by-id'
  555. `(#:tests? #f))
  556. (inputs
  557. (list `(,util-linux "lib") parted glib gtkmm-3 libxml2))
  558. (native-inputs
  559. (list intltool
  560. itstool
  561. lvm2 ; for tests
  562. yelp-tools
  563. pkg-config))
  564. (home-page "https://gparted.org/")
  565. (synopsis "Partition editor to graphically manage disk partitions")
  566. (description "GParted is a GNOME partition editor for creating,
  567. reorganizing, and deleting disk partitions. It uses libparted from the parted
  568. project to detect and manipulate partition tables. Optional file system tools
  569. permit managing file systems not included in libparted.")
  570. ;; The home page says GPLv2, but the source code says GPLv2+.
  571. (license license:gpl2+)))
  572. (define-public testdisk
  573. (package
  574. (name "testdisk")
  575. (version "7.1")
  576. (source (origin
  577. (method url-fetch)
  578. (uri (string-append "https://www.cgsecurity.org/testdisk-"
  579. version ".tar.bz2"))
  580. (sha256
  581. (base32
  582. "1zlh44w67py416hkvw6nrfmjickc2d43v51vcli5p374d5sw84ql"))))
  583. (build-system gnu-build-system)
  584. (inputs
  585. (list ntfs-3g
  586. `(,util-linux "lib")
  587. openssl
  588. ;; FIXME: add reiserfs.
  589. zlib
  590. e2fsprogs
  591. libjpeg-turbo
  592. ncurses))
  593. (home-page "https://www.cgsecurity.org/wiki/TestDisk")
  594. (synopsis "Data recovery tool")
  595. (description "TestDisk is primarily designed to help recover lost
  596. partitions and/or make non-booting disks bootable again when these symptoms
  597. were caused by faulty software or human error (such as accidentally deleting a
  598. partition table). TestDisk can:
  599. @enumerate
  600. @item Fix partition table, recover deleted partition
  601. @item Recover FAT32 boot sector from its backup
  602. @item Rebuild FAT12/FAT16/FAT32 boot sector
  603. @item Fix FAT tables
  604. @item Rebuild NTFS boot sector
  605. @item Recover NTFS boot sector from its backup
  606. @item Fix MFT using MFT mirror
  607. @item Locate ext2/ext3/ext4 Backup SuperBlock
  608. @item Un-delete files from FAT, exFAT, NTFS and ext2 file systems
  609. @item Copy files from deleted FAT, exFAT, NTFS and ext2/ext3/ext4 partitions.
  610. @end enumerate
  611. This package also includes the @command{photorec} command, described below.
  612. PhotoRec is file data recovery software designed to recover lost files
  613. including video, documents and archives from hard disks, CD-ROMs, and lost
  614. pictures (thus the Photo Recovery name) from digital camera memory. PhotoRec
  615. ignores the file system and goes after the underlying data, so it will still
  616. work even if your media's file system has been severely damaged or
  617. reformatted. It can recover lost files from at least:
  618. @enumerate
  619. @item FAT
  620. @item NTFS
  621. @item exFAT
  622. @item ext2/ext3/ext4 file system
  623. @item HFS+
  624. @end enumerate")
  625. (license license:gpl2+)))
  626. (define-public pydf
  627. (package
  628. (name "pydf")
  629. (version "12")
  630. (source
  631. (origin
  632. (method url-fetch)
  633. (uri (pypi-uri "pydf" version))
  634. (sha256
  635. (base32
  636. "0f8ly8xyp93i2hm9c0qjqd4y86nz73axw2f09z01mszwmg1sfivz"))))
  637. (build-system python-build-system)
  638. (home-page "http://kassiopeia.juls.savba.sk/~garabik/software/pydf/")
  639. (synopsis "Colourised @command{df} clone")
  640. (description "All-singing, all-dancing, fully colourised @command{df} clone
  641. written in Python. It displays the amount of disk space available on the
  642. mounted file systems, using different colours for different types of file
  643. systems. Output format is completely customizable.")
  644. (license license:public-domain)))
  645. (define-public f3
  646. (package
  647. (name "f3")
  648. (version "8.0")
  649. (source
  650. (origin
  651. (method git-fetch)
  652. (uri (git-reference
  653. (url "https://github.com/AltraMayor/f3")
  654. (commit (string-append "v" version))))
  655. (file-name (git-file-name name version))
  656. (sha256
  657. (base32 "17l5vspfcgfbkqg7bakp3gql29yb05gzawm8n3im30ilzdr53678"))))
  658. (build-system gnu-build-system)
  659. (arguments
  660. `(#:tests? #f ; no check target
  661. #:make-flags (list (string-append "CC=" ,(cc-for-target))
  662. (string-append "PREFIX=" %output))
  663. #:phases
  664. (modify-phases %standard-phases
  665. (delete 'configure) ; no configure script
  666. (add-after 'build 'build-extra
  667. (lambda* (#:key make-flags #:allow-other-keys)
  668. (apply invoke "make" "extra" make-flags)))
  669. (add-after 'build 'install-extra
  670. (lambda* (#:key make-flags #:allow-other-keys)
  671. (apply invoke "make" "install-extra" make-flags))))))
  672. (inputs
  673. (list eudev parted))
  674. (home-page "http://oss.digirati.com.br/f3/")
  675. (synopsis "Test real capacity of flash memory cards and such")
  676. (description "F3 (Fight Flash Fraud or Fight Fake Flash) tests the full
  677. capacity of a flash card (flash drive, flash disk, pendrive). F3 writes to
  678. the card and then checks if can read it. It will assure you haven't been sold
  679. a card with a smaller capacity than stated.")
  680. (license license:gpl3+)))
  681. (define-public python-parted
  682. (package
  683. (name "python-parted")
  684. (version "3.11.7")
  685. (source
  686. (origin
  687. (method git-fetch)
  688. (uri (git-reference
  689. (url "https://github.com/dcantrell/pyparted")
  690. (commit (string-append "v" version))))
  691. (file-name (git-file-name name version))
  692. (sha256
  693. (base32 "01193fmkss9icjvqpw85szpk8ld1pnha7p9kqm7mpwk6rc6gi2m3"))))
  694. (build-system python-build-system)
  695. (arguments
  696. `(#:phases
  697. (modify-phases %standard-phases
  698. (delete 'check)
  699. (add-after 'install 'check
  700. (lambda* (#:key outputs inputs #:allow-other-keys)
  701. (add-installed-pythonpath inputs outputs)
  702. ;; See <https://github.com/dcantrell/pyparted/issues/47>.
  703. (substitute* "tests/test__ped_ped.py"
  704. (("\"/tmp/temp-device-\"") "self.path"))
  705. (invoke "python" "-m" "unittest" "discover" "-v")
  706. #t)))))
  707. (native-inputs
  708. (list e2fsprogs pkg-config))
  709. (propagated-inputs
  710. (list python-six))
  711. (inputs
  712. (list parted))
  713. (home-page "https://github.com/dcantrell/pyparted")
  714. (synopsis "Parted bindings for Python")
  715. (description "This package provides @code{parted} bindings for Python.")
  716. (license license:gpl2+)))
  717. (define-public duperemove
  718. (package
  719. (name "duperemove")
  720. (version "0.11.3")
  721. (source
  722. (origin
  723. (method git-fetch)
  724. (uri (git-reference
  725. (url "https://github.com/markfasheh/duperemove")
  726. (commit (string-append "v" version))))
  727. (sha256
  728. (base32 "0jwxmhadv2f1mx7gan4gk0xwrjr5g2xa71z1rp0knc1acbkhqdas"))
  729. (file-name (git-file-name name version))))
  730. (build-system gnu-build-system)
  731. (native-inputs
  732. (list pkg-config))
  733. (inputs
  734. (list glib sqlite))
  735. (arguments
  736. `(#:tests? #f ; no test suite
  737. #:phases
  738. (modify-phases %standard-phases
  739. (delete 'configure)) ; no configure script
  740. #:make-flags (list (string-append "PREFIX=" %output)
  741. (string-append "CC=" ,(cc-for-target))
  742. ;; Set to <next release>dev by default.
  743. (string-append "VER=" ,version))))
  744. (home-page "https://github.com/markfasheh/duperemove")
  745. (synopsis "Tools for de-duplicating file system data")
  746. (description "Duperemove is a simple tool for finding duplicated extents
  747. and submitting them for deduplication. When given a list of files it will
  748. hash their contents on a block by block basis and compare those hashes to each
  749. other, finding and categorizing blocks that match each other. When given the
  750. @option{-d} option, duperemove will submit those extents for deduplication
  751. using the Linux kernel extent-same @code{ioctl}.
  752. Duperemove can store the hashes it computes in a @dfn{hash file}. If given an
  753. existing hash file, duperemove will only compute hashes for those files which
  754. have changed since the last run. Thus you can run duperemove repeatedly on
  755. your data as it changes, without having to re-checksum unchanged data.
  756. Duperemove can also take input from the @command{fdupes} program.")
  757. (license license:gpl2)))
  758. (define-public ranger
  759. (package
  760. (name "ranger")
  761. (version "1.9.3")
  762. (source (origin
  763. (method url-fetch)
  764. (uri (string-append "https://ranger.github.io/"
  765. "ranger-" version ".tar.gz"))
  766. (sha256
  767. (base32
  768. "0lfjrpv3z4h0knd3v94fijrw2zjba51mrp3mjqx2c98wr428l26f"))))
  769. (build-system python-build-system)
  770. (inputs
  771. (list w3m))
  772. (native-inputs
  773. (list which
  774. ;; For tests.
  775. python-pytest))
  776. (arguments
  777. '( ;; The 'test' target runs developer tools like pylint, which fail.
  778. #:test-target "test_pytest"
  779. #:phases
  780. (modify-phases %standard-phases
  781. (add-after 'configure 'wrap-program
  782. ;; Tell 'ranger' where 'w3mimgdisplay' is.
  783. (lambda* (#:key inputs outputs #:allow-other-keys)
  784. (let* ((out (assoc-ref outputs "out"))
  785. (ranger (string-append out "/bin/ranger"))
  786. (w3m (assoc-ref inputs "w3m"))
  787. (w3mimgdisplay (string-append w3m
  788. "/libexec/w3m/w3mimgdisplay")))
  789. (wrap-program ranger
  790. `("W3MIMGDISPLAY_PATH" ":" prefix (,w3mimgdisplay)))
  791. #t)))
  792. (replace 'check
  793. ;; The default check phase simply prints 'Ran 0 tests in 0.000s'.
  794. (lambda* (#:key test-target #:allow-other-keys)
  795. (invoke "make" test-target))))))
  796. (home-page "https://ranger.github.io/")
  797. (synopsis "Console file manager")
  798. (description "ranger is a console file manager with Vi key bindings. It
  799. provides a minimalistic and nice curses interface with a view on the directory
  800. hierarchy. It ships with @code{rifle}, a file launcher that is good at
  801. automatically finding out which program to use for what file type.")
  802. (license license:gpl3)))
  803. (define-public volume-key
  804. (package
  805. (name "volume-key")
  806. (version "0.3.12")
  807. (source (origin
  808. (method url-fetch)
  809. (uri (string-append "https://releases.pagure.org/volume_key/volume_key-"
  810. version ".tar.xz"))
  811. (sha256
  812. (base32
  813. "16rhfz6sjwxlmss1plb2wv2i3jq6wza02rmz1d2jrlnsq67p98vc"))))
  814. (build-system gnu-build-system)
  815. (native-inputs
  816. (list pkg-config swig python-3)) ; used to generate the Python bindings
  817. (inputs
  818. `(("cryptsetup" ,cryptsetup)
  819. ("nss" ,nss)
  820. ("libblkid" ,util-linux "lib")
  821. ("lvm2" ,lvm2) ; for "-ldevmapper"
  822. ("glib" ,glib)
  823. ("gpgme" ,gpgme)))
  824. (arguments
  825. `(#:tests? #f ; not sure how tests are supposed to pass, even when run manually
  826. #:phases
  827. (modify-phases %standard-phases
  828. (add-before 'configure 'patch-python.h-path
  829. (lambda* (#:key inputs #:allow-other-keys)
  830. (let ((python (assoc-ref inputs "python")))
  831. (substitute* "Makefile.in"
  832. (("/usr/include/python") (string-append python "/include/python")))
  833. #t))))))
  834. (home-page "https://pagure.io/volume_key")
  835. (synopsis "Manipulate storage volume encryption keys")
  836. (description
  837. "This package provides a library for manipulating storage volume
  838. encryption keys and storing them separately from volumes to handle forgotten
  839. passphrases.")
  840. (license license:gpl2)))
  841. (define-public ndctl
  842. (package
  843. (name "ndctl")
  844. (version "72.1")
  845. (source (origin
  846. (method git-fetch)
  847. (uri (git-reference
  848. (url "https://github.com/pmem/ndctl")
  849. (commit (string-append "v" version))))
  850. (file-name (git-file-name name version))
  851. (sha256
  852. (base32
  853. "1lvrhlad5n43bal053ihgbwr1k4ka2kscrjwr9rs5xnf2vy7204v"))))
  854. (build-system gnu-build-system)
  855. (arguments
  856. (list #:configure-flags
  857. #~(list "--disable-asciidoctor" ; use docbook-xsl instead
  858. "--without-systemd")
  859. #:phases
  860. #~(modify-phases %standard-phases
  861. (add-after 'unpack 'fix-version
  862. ;; Our VERSION's always better than the build's poor guess.
  863. (lambda _
  864. (with-output-to-file "version"
  865. (lambda _ (display #$version)))))
  866. (add-after 'unpack 'patch-FHS-file-names
  867. (lambda _
  868. (substitute* "git-version-gen"
  869. (("/bin/sh") (which "sh")))
  870. (substitute* "git-version"
  871. (("/bin/bash") (which "bash"))))))
  872. #:make-flags
  873. #~(list (string-append "BASH_COMPLETION_DIR=" #$output
  874. "/share/bash-completion/completions"))))
  875. (native-inputs
  876. (list asciidoc
  877. automake
  878. autoconf
  879. bash-completion
  880. docbook-xsl
  881. libtool
  882. libxml2
  883. pkg-config
  884. xmlto
  885. ;; Required for offline docbook generation.
  886. which))
  887. (inputs
  888. (list eudev
  889. iniparser
  890. json-c
  891. keyutils
  892. kmod
  893. `(,util-linux "lib")))
  894. (home-page "https://github.com/pmem/ndctl")
  895. (synopsis "Manage the non-volatile memory device sub-system in the Linux kernel")
  896. (description
  897. "This package provides a utility library for managing the
  898. libnvdimm (non-volatile memory device) sub-system in the Linux kernel.")
  899. ;; COPYING says LGPL2.1, but many source files are GPL2 so that's
  900. ;; the effective license. Note that some files under ccan/ are
  901. ;; covered by BSD-3 or public domain, see the individual folders.
  902. (license license:gpl2)))
  903. (define-public dmraid
  904. (package
  905. (name "dmraid")
  906. (version "1.0.0.rc16-3")
  907. (source (origin
  908. (method url-fetch)
  909. (uri (string-append "https://people.redhat.com/~heinzm/sw/dmraid/src/dmraid-"
  910. version ".tar.bz2"))
  911. (sha256
  912. (base32
  913. "1n7vsqvh7y6yvil682q129d21yhb0cmvd5fvsbkza7ypd78inhlk"))))
  914. (build-system gnu-build-system)
  915. (inputs (list lvm2))
  916. (native-inputs (list which))
  917. (arguments
  918. `(#:tests? #f ; No tests.
  919. ;; Prevent a race condition where some target would attempt to link
  920. ;; libdmraid.so before it had been built as reported in
  921. ;; <https://bugs.gnu.org/31999#187>.
  922. #:parallel-build? #f
  923. #:phases (modify-phases %standard-phases
  924. (add-before 'configure 'change-directory
  925. (lambda _
  926. (chdir (string-append ,version "/dmraid"))
  927. (substitute* "make.tmpl.in"
  928. (("/bin/sh") (which "sh")))
  929. #t)))
  930. #:configure-flags (list ;; Make sure programs such as 'dmevent_tool' can
  931. ;; find libdmraid.so.
  932. (string-append "LDFLAGS=-Wl,-rpath="
  933. (assoc-ref %outputs "out")
  934. "/lib"))))
  935. (home-page "https://people.redhat.com/~heinzm/sw/dmraid/")
  936. (synopsis "Device mapper RAID interface")
  937. (description
  938. "This software supports RAID device discovery, RAID set activation, creation,
  939. removal, rebuild and display of properties for ATARAID/DDF1 metadata.
  940. @command{dmraid} uses @file{libdevmapper} and the device-mapper kernel runtime
  941. to create devices with respective mappings for the ATARAID sets discovered.")
  942. (license license:gpl2+)))
  943. (define-public libblockdev
  944. (package
  945. (name "libblockdev")
  946. (version "2.26")
  947. (source (origin
  948. (method url-fetch)
  949. (uri (string-append "https://github.com/storaged-project/"
  950. "libblockdev/releases/download/"
  951. version "-1/libblockdev-" version ".tar.gz"))
  952. (sha256
  953. (base32
  954. "0sg068jb87ljhn8yazrqxi6ri10ic2sh1lp6ikd2nqxc6l5y3h64"))))
  955. (build-system gnu-build-system)
  956. (arguments
  957. `(#:phases
  958. (modify-phases %standard-phases
  959. (add-after 'unpack 'patch-configuration-directory
  960. (lambda* (#:key outputs #:allow-other-keys)
  961. (let ((out (assoc-ref outputs "out")))
  962. (substitute* "src/lib/blockdev.c"
  963. (("/etc/libblockdev/conf.d/" path) (string-append out path)))))))))
  964. (native-inputs
  965. `(("gobject-introspection" ,gobject-introspection)
  966. ("pkg-config" ,pkg-config)
  967. ("python" ,python-wrapper)
  968. ("util-linux" ,util-linux)))
  969. (inputs
  970. (list btrfs-progs
  971. cryptsetup
  972. dosfstools
  973. dmraid
  974. eudev
  975. glib
  976. kmod
  977. libbytesize
  978. libyaml
  979. lvm2
  980. mdadm
  981. ndctl
  982. nss
  983. parted
  984. volume-key
  985. xfsprogs))
  986. (home-page "https://github.com/storaged-project/libblockdev")
  987. (synopsis "Library for manipulating block devices")
  988. (description
  989. "libblockdev is a C library supporting GObject introspection for
  990. manipulation of block devices. It has a plugin-based architecture where each
  991. technology (like LVM, Btrfs, MD RAID, Swap...) is implemented in a separate
  992. plugin, possibly with multiple implementations (e.g. using LVM CLI or the new
  993. LVM D-Bus API).")
  994. (license license:lgpl2.1+)))
  995. (define-public rmlint
  996. (package
  997. (name "rmlint")
  998. (version "2.10.1")
  999. (source (origin
  1000. (method git-fetch)
  1001. (uri (git-reference
  1002. (url "https://github.com/sahib/rmlint")
  1003. (commit (string-append "v" version))))
  1004. (file-name (git-file-name name version))
  1005. (sha256
  1006. (base32
  1007. "15xfkcw1bkfyf3z8kl23k3rlv702m0h7ghqxvhniynvlwbgh6j2x"))))
  1008. (build-system scons-build-system)
  1009. (arguments
  1010. `(#:scons ,scons-python2
  1011. #:scons-flags (list (string-append "--prefix=" %output)
  1012. (string-append "--actual-prefix=" %output))
  1013. #:tests? #f ; No tests?
  1014. #:phases
  1015. (modify-phases %standard-phases
  1016. (add-after 'unpack 'scons-propagate-environment
  1017. (lambda* (#:key inputs #:allow-other-keys)
  1018. ;; TODO: `rmlint --gui` fails with
  1019. ;; "Failed to load shredder: No module named 'shredder'".
  1020. ;; The GUI might also need extra dependencies, such as
  1021. ;; python-gobject, python-cairo, dconf, librsvg, gtksourceview3.
  1022. (substitute* "lib/cmdline.c"
  1023. (("const char \\*commands\\[\\] = \\{\"python3\", \"python\", NULL\\};")
  1024. (string-append
  1025. "const char *commands[] = {\""
  1026. (assoc-ref inputs "python") "/bin/python"
  1027. "\", \"python\", NULL};")))
  1028. ;; By design, SCons does not, by default, propagate
  1029. ;; environment variables to subprocesses. See:
  1030. ;; <http://comments.gmane.org/gmane.linux.distributions.nixos/4969>
  1031. ;; Here, we modify the SConstruct file to arrange for
  1032. ;; environment variables to be propagated.
  1033. (substitute* "SConstruct"
  1034. (("^env = Environment\\(.*\\)" all)
  1035. (string-append
  1036. all
  1037. "\nenv['ENV']=os.environ"))))))))
  1038. (native-inputs
  1039. `(("pkg-config" ,pkg-config)
  1040. ("glib:bin" ,glib "bin")
  1041. ("python-sphinx" ,python-sphinx)))
  1042. (inputs
  1043. `(("python" ,python-wrapper)
  1044. ("glib" ,glib)
  1045. ("libelf" ,libelf)
  1046. ("elfutils" ,elfutils)
  1047. ("json-glib" ,json-glib)
  1048. ("libblkid" ,util-linux "lib")))
  1049. (home-page "https://rmlint.rtfd.org")
  1050. (synopsis "Remove duplicates and other lint from the file system")
  1051. (description "@command{rmlint} finds space waste and other broken things
  1052. on your file system and offers to remove it. @command{rmlint} can find:
  1053. @itemize
  1054. @item duplicate files and duplicate directories,
  1055. @item non-stripped binaries (i.e. binaries with debug symbols),
  1056. @item broken symbolic links,
  1057. @item empty files and directories,
  1058. @item files with broken user and/or group ID.
  1059. @end itemize\n")
  1060. (license license:gpl3+)))
  1061. (define-public lf
  1062. (package
  1063. (name "lf")
  1064. (version "25")
  1065. (source (origin
  1066. (method git-fetch)
  1067. (uri (git-reference
  1068. (url "https://github.com/gokcehan/lf")
  1069. (commit (string-append "r" version))))
  1070. (file-name (git-file-name name version))
  1071. (sha256
  1072. (base32
  1073. "014cybng6hc9y3ma74hpc1ac3rkz4ydflx8jbmvx81rdd08rzwz7"))))
  1074. (build-system go-build-system)
  1075. (native-inputs
  1076. `(("go-github.com-mattn-go-runewidth" ,go-github.com-mattn-go-runewidth)
  1077. ("go-github.com-nsf-termbox-go" ,go-github.com-nsf-termbox-go)
  1078. ("go-golang-org-x-term" ,go-golang-org-x-term)
  1079. ("go-gopkg-in-djherbis-times-v1" ,go-gopkg-in-djherbis-times-v1)
  1080. ("go-github-com-gdamore-tcell-v2" ,go-github-com-gdamore-tcell-v2)))
  1081. (arguments
  1082. `(#:import-path "github.com/gokcehan/lf"))
  1083. (home-page "https://github.com/gokcehan/lf")
  1084. (synopsis "Console file browser similar to Ranger")
  1085. (description "lf (as in \"list files\") is a terminal file manager
  1086. written in Go. It is heavily inspired by ranger with some missing and
  1087. extra features. Some of the missing features are deliberately omitted
  1088. since they are better handled by external tools.")
  1089. (license license:expat)))
  1090. (define-public xfe
  1091. (package
  1092. (name "xfe")
  1093. (version "1.44")
  1094. (source
  1095. (origin
  1096. (method url-fetch)
  1097. (uri
  1098. (string-append "mirror://sourceforge/xfe/xfe/" version "/"
  1099. "xfe-" version ".tar.xz"))
  1100. (sha256
  1101. (base32 "1dihq03jqjllb69r78d9ihjjadi39v7sgzdf68qpxz5xhp8i8k2r"))))
  1102. (build-system gnu-build-system)
  1103. (arguments
  1104. `(#:phases
  1105. (modify-phases %standard-phases
  1106. (add-after 'unpack 'patch-potfiles
  1107. (lambda _
  1108. ;; To add missing entry 'intl/plural.c' to potfiles list.
  1109. ;; Refer to https://sourceforge.net/p/xfe/bugs/257/
  1110. (substitute* "po/POTFILES.in"
  1111. (("src/help.h")
  1112. (string-append "src/help.h\n"
  1113. "intl/plural.c")))))
  1114. (add-after 'unpack 'patch-bin-dirs
  1115. (lambda* (#:key inputs #:allow-other-keys)
  1116. (let* ((bash (assoc-ref inputs "bash"))
  1117. (coreutils (assoc-ref inputs "coreutils"))
  1118. (findutils (assoc-ref inputs "findutils"))
  1119. (file-prog (assoc-ref inputs "file")))
  1120. (with-directory-excursion "src"
  1121. (substitute* '("FilePanel.cpp" "help.h" "SearchPanel.cpp"
  1122. "startupnotification.cpp" "xfeutils.cpp"
  1123. "../st/config.h")
  1124. (("/bin/sh" file) (string-append bash file))
  1125. (("/bin/ls" file) (string-append coreutils file))
  1126. (("/usr(/bin/du)" _ file) (string-append coreutils file))
  1127. (("/usr(/bin/sort)" _ file) (string-append coreutils file))
  1128. (("/usr(/bin/cut)" _ file) (string-append coreutils file))
  1129. (("/usr(/bin/xargs)" _ file) (string-append findutils file))
  1130. (("/usr(/bin/file)" _ file) (string-append file-prog file))))
  1131. #t)))
  1132. (add-after 'unpack 'patch-share-dirs
  1133. (lambda* (#:key outputs #:allow-other-keys)
  1134. (let* ((out (assoc-ref outputs "out"))
  1135. (share (string-append out "/share"))
  1136. (xfe (string-append share "/xfe")))
  1137. (with-directory-excursion "src"
  1138. (substitute* '("foxhacks.cpp" "help.h" "xfedefs.h"
  1139. "XFileExplorer.cpp")
  1140. (("/(usr|opt)(/local)?/share") share)
  1141. (("~/.config/xfe") xfe)))
  1142. #t))))))
  1143. (native-inputs
  1144. (list intltool pkg-config))
  1145. (inputs
  1146. `(("bash" ,bash)
  1147. ("coreutils" ,coreutils)
  1148. ("file" ,file)
  1149. ("findutils" ,findutils)
  1150. ("fox" ,fox)
  1151. ("freetype" ,freetype)
  1152. ("x11" ,libx11)
  1153. ("xcb" ,libxcb)
  1154. ("xcb-util" ,xcb-util)
  1155. ("xft" ,libxft)
  1156. ("xrandr" ,libxrandr)))
  1157. (synopsis "File Manager for X-Based Graphical Systems")
  1158. (description "XFE (X File Explorer) is a file manager for X. It is based on
  1159. the popular but discontinued, X Win Commander. It aims to be the file manager
  1160. of choice for all light thinking Unix addicts!")
  1161. (home-page "http://roland65.free.fr/xfe/")
  1162. (license license:gpl2+)))
  1163. (define-public hddtemp
  1164. (package
  1165. (name "hddtemp")
  1166. ;; <https://savannah.nongnu.org/projects/hddtemp/> advertises the project as
  1167. ;; ‘orphaned/unmaintained’. Use a maintained fork/continuation.
  1168. (version "0.4.3")
  1169. (source
  1170. (origin
  1171. (method git-fetch)
  1172. (uri (git-reference
  1173. (url "https://github.com/vitlav/hddtemp")
  1174. (commit (string-append "v" version))))
  1175. (file-name (git-file-name name version))
  1176. (sha256
  1177. (base32 "04kylb2ka0jimi238zpfq1yii2caidpmj3ck51rvxz03y5lpq8fw"))))
  1178. (build-system gnu-build-system)
  1179. (arguments
  1180. `(#:configure-flags (list (string-append
  1181. "--with-db-path="
  1182. (assoc-ref %outputs "out")
  1183. "/share/hddtemp/hddtemp.db"))
  1184. #:phases
  1185. (modify-phases %standard-phases
  1186. (add-before 'bootstrap 'delete-autogen.sh
  1187. (lambda _
  1188. ;; The default 'bootstrap phase works better.
  1189. (delete-file "autogen.sh")))
  1190. (add-after 'install 'install-db
  1191. (lambda* (#:key outputs #:allow-other-keys)
  1192. (let ((out (assoc-ref outputs "out")))
  1193. (install-file "data/hddtemp.db"
  1194. (string-append out "/share/hddtemp"))))))))
  1195. (native-inputs
  1196. `(("autoconf" ,autoconf)
  1197. ("automake" ,automake)
  1198. ("gettext" ,gettext-minimal)))
  1199. (home-page "https://github.com/vitlav/hddtemp")
  1200. (synopsis "Report the temperature of hard drives from S.M.A.R.T. information")
  1201. (description "@command{hddtemp} is a small utility that gives you the
  1202. temperature of your hard drive by reading S.M.A.R.T. information (for drives
  1203. that support this feature).")
  1204. (license license:gpl2+)))
  1205. (define-public memkind
  1206. (package
  1207. (name "memkind")
  1208. (version "1.12.0")
  1209. (source (origin
  1210. (method git-fetch)
  1211. (uri (git-reference
  1212. (url "https://github.com/memkind/memkind")
  1213. (commit (string-append "v" version))))
  1214. (file-name (git-file-name name version))
  1215. (sha256
  1216. (base32 "1s52vl2jlrdc8nxnvf993x9mcag56qxcaniiijhmsv42a26hvjk4"))))
  1217. (build-system gnu-build-system)
  1218. (inputs
  1219. (list ;; memkind patched jemalloc to add je_arenalookupx,
  1220. ;; je_check_reallocatex--i.e. they forked jemalloc.
  1221. ;("jemalloc" ,jemalloc)
  1222. ndctl numactl))
  1223. (native-inputs
  1224. (list autoconf automake libtool))
  1225. (arguments
  1226. `(#:configure-flags
  1227. (list (string-append "--docdir=" (assoc-ref %outputs "out")
  1228. "/share/doc/" ,name "-" ,version))
  1229. #:tests? #f ; Tests require a NUMA-enabled system.
  1230. #:phases
  1231. (modify-phases %standard-phases
  1232. (add-before 'build 'autogen-jemalloc
  1233. (lambda _
  1234. (with-directory-excursion "jemalloc"
  1235. (substitute* "Makefile.in"
  1236. (("/bin/sh") (which "sh")))
  1237. (invoke "autoconf")
  1238. (substitute* "configure"
  1239. (("/bin/sh") (which "sh")))))))))
  1240. (home-page "https://github.com/memkind/memkind")
  1241. (synopsis "Heap manager with memory kinds (for NUMA)")
  1242. (description "This package provides a user-extensible heap manager
  1243. built on top of jemalloc which enables control of memory characteristics
  1244. and a partitioning of the heap between kinds of memory (for NUMA).")
  1245. (license license:bsd-3)))
  1246. (define-public mmc-utils
  1247. (let ((commit "3969aa4804edb8aed7bcb3c958e49d0c7388b067")
  1248. (revision "1"))
  1249. (package
  1250. (name "mmc-utils")
  1251. (version (git-version "0.1" revision commit))
  1252. (source
  1253. (origin
  1254. (method git-fetch)
  1255. (uri (git-reference
  1256. (url "https://git.kernel.org/pub/scm/utils/mmc/mmc-utils.git")
  1257. (commit commit)))
  1258. (file-name (git-file-name name version))
  1259. (sha256
  1260. (base32 "0pvcm685x63afvp8795jd4vn4zs8psh8bs6j2yvk1kgrawpyk10g"))))
  1261. (build-system gnu-build-system)
  1262. (arguments
  1263. `(#:tests? #f ; No test suite
  1264. #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out"))
  1265. (string-append "CC=" ,(cc-for-target)))
  1266. #:phases
  1267. (modify-phases %standard-phases
  1268. ;; No ./configure script
  1269. (delete 'configure)
  1270. ;; The Makefile's "install-man" target is a no-op.
  1271. (add-after 'install 'install-doc
  1272. (lambda* (#:key outputs #:allow-other-keys)
  1273. (let* ((out (assoc-ref outputs "out"))
  1274. (man1 (string-append out "/share/man/man1")))
  1275. (install-file "man/mmc.1" man1)))))))
  1276. (home-page
  1277. "https://www.kernel.org/doc/html/latest/driver-api/mmc/mmc-tools.html")
  1278. (synopsis "Configure MMC storage devices from userspace")
  1279. (description "mmc-utils is a command-line tool for configuring and
  1280. inspecting MMC storage devices from userspace.")
  1281. (license license:gpl2))))
  1282. (define-public bmaptools
  1283. (package
  1284. (name "bmaptools")
  1285. (version "3.6")
  1286. (source (origin
  1287. (method git-fetch)
  1288. (uri (git-reference
  1289. (url "https://github.com/intel/bmap-tools")
  1290. (commit (string-append "v" version))))
  1291. (file-name (git-file-name name version))
  1292. (sha256
  1293. (base32
  1294. "01xzrv5nvd2nvj91lz4x9s91y9825j9pj96z0ap6yvy3w2dgvkkl"))))
  1295. (build-system python-build-system)
  1296. (arguments
  1297. '(#:phases
  1298. (modify-phases %standard-phases
  1299. (replace 'check
  1300. (lambda _
  1301. ;; XXX: Remove failing test.
  1302. (invoke "nosetests" "-v"
  1303. "--exclude" "test_bmap_helpers"))))))
  1304. (native-inputs
  1305. (list python-mock python-nose))
  1306. (propagated-inputs
  1307. (list python-six))
  1308. (home-page "https://github.com/intel/bmap-tools")
  1309. (synopsis "Create block map for a file or copy a file using block map")
  1310. (description "Bmaptool is a tool for creating the block map (bmap) for a
  1311. file and copying files using the block map. The idea is that large files,
  1312. like raw system image files, can be copied or flashed a lot faster and more
  1313. reliably with @code{bmaptool} than with traditional tools, like @code{dd} or
  1314. @code{cp}.")
  1315. (license license:gpl2)))
  1316. (define-public duc
  1317. (package
  1318. (name "duc")
  1319. (version "1.4.4")
  1320. (source (origin
  1321. (method git-fetch)
  1322. (uri (git-reference
  1323. (url "https://github.com/zevv/duc")
  1324. (commit version)))
  1325. (file-name (git-file-name name version))
  1326. (sha256
  1327. (base32
  1328. "1i7ry25xzy027g6ysv6qlf09ax04q4vy0kikl8h0aq5jbxsl9q52"))))
  1329. (build-system gnu-build-system)
  1330. (arguments
  1331. `(#:phases
  1332. (modify-phases %standard-phases
  1333. (add-after 'unpack 'patch
  1334. (lambda* (#:key outputs #:allow-other-keys)
  1335. (let* ((out (assoc-ref outputs "out")))
  1336. (substitute* "src/duc/cmd-ui.c"
  1337. (("ncursesw/ncurses.h") "ncurses.h"))
  1338. (substitute* "examples/index.cgi"
  1339. (("/usr/local/bin/duc")
  1340. (string-append out "/bin/duc"))))))
  1341. (add-after 'install 'install-examples
  1342. (lambda* (#:key outputs #:allow-other-keys)
  1343. (let* ((out (assoc-ref outputs "out"))
  1344. (doc (string-append out "/share/doc/" ,name "-" ,version)))
  1345. (copy-recursively "examples" (string-append doc "/examples"))))))))
  1346. (native-inputs
  1347. (list autoconf automake libtool pkg-config))
  1348. (inputs
  1349. (list cairo pango tokyocabinet ncurses))
  1350. (home-page "http://duc.zevv.nl")
  1351. (synopsis "Library and suite of tools for inspecting disk usage")
  1352. (description "Duc maintains a database of accumulated sizes of
  1353. directories of the file system, and allows you to query this database with
  1354. some tools, or create fancy graphs showing you where your bytes are.
  1355. Duc comes with console utilities, ncurses and X11 user interfaces and a CGI
  1356. wrapper for disk usage querying and visualisation.")
  1357. (license license:lgpl3+)))
  1358. (define-public qdirstat
  1359. (package
  1360. (name "qdirstat")
  1361. (version "1.8")
  1362. (source (origin
  1363. (method git-fetch)
  1364. (uri (git-reference
  1365. (url "https://github.com/shundhammer/qdirstat")
  1366. (commit version)))
  1367. (file-name (git-file-name name version))
  1368. (sha256
  1369. (base32
  1370. "079rmy3j0442y5gjh6la6w1j6jaw83wklamrf19yxi20zsm99xs7"))))
  1371. (arguments
  1372. `(#:phases
  1373. (modify-phases %standard-phases
  1374. (replace 'configure
  1375. (lambda* (#:key outputs #:allow-other-keys)
  1376. (system* "qmake"
  1377. (string-append "INSTALL_PREFIX="
  1378. (assoc-ref outputs "out")))))
  1379. (add-after 'install 'wrap
  1380. (lambda* (#:key inputs outputs #:allow-other-keys)
  1381. (wrap-program (string-append
  1382. (assoc-ref outputs "out")
  1383. "/bin/qdirstat-cache-writer")
  1384. `("PERL5LIB" ":" prefix
  1385. (,(string-append
  1386. (assoc-ref inputs "perl-uri-escape")
  1387. "/lib/perl5/site_perl")))))))))
  1388. (build-system gnu-build-system)
  1389. (inputs
  1390. (list bash-minimal
  1391. perl
  1392. perl-uri-escape
  1393. qtbase-5
  1394. zlib))
  1395. (synopsis "Storage utilisation visualization tool")
  1396. (description
  1397. "QDirStat is a graphical application to show where your disk space has
  1398. gone and to help you to clean it up.")
  1399. (home-page "https://github.com/shundhammer/qdirstat")
  1400. (license license:gpl2)))