disk.scm 54 KB

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