disk.scm 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824
  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, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
  6. ;;; Copyright © 2016 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 Pierre Neidhardt <mail@ambrevar.xyz>
  16. ;;;
  17. ;;; This file is part of GNU Guix.
  18. ;;;
  19. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  20. ;;; under the terms of the GNU General Public License as published by
  21. ;;; the Free Software Foundation; either version 3 of the License, or (at
  22. ;;; your option) any later version.
  23. ;;;
  24. ;;; GNU Guix is distributed in the hope that it will be useful, but
  25. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  26. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  27. ;;; GNU General Public License for more details.
  28. ;;;
  29. ;;; You should have received a copy of the GNU General Public License
  30. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  31. (define-module (gnu packages disk)
  32. #:use-module (gnu packages)
  33. #:use-module (gnu packages autotools)
  34. #:use-module (gnu packages base)
  35. #:use-module (gnu packages bash)
  36. #:use-module (gnu packages c)
  37. #:use-module (gnu packages check)
  38. #:use-module (gnu packages compression)
  39. #:use-module (gnu packages crypto)
  40. #:use-module (gnu packages cryptsetup)
  41. #:use-module (gnu packages docbook)
  42. #:use-module (gnu packages documentation)
  43. #:use-module (gnu packages elf)
  44. #:use-module (gnu packages gettext)
  45. #:use-module (gnu packages glib)
  46. #:use-module (gnu packages gnome)
  47. #:use-module (gnu packages gnupg)
  48. #:use-module (gnu packages gnuzilla)
  49. #:use-module (gnu packages gtk)
  50. #:use-module (gnu packages guile)
  51. #:use-module (gnu packages linux)
  52. #:use-module (gnu packages ncurses)
  53. #:use-module (gnu packages perl)
  54. #:use-module (gnu packages pkg-config)
  55. #:use-module (gnu packages popt)
  56. #:use-module (gnu packages python)
  57. #:use-module (gnu packages python-xyz)
  58. #:use-module (gnu packages readline)
  59. #:use-module (gnu packages sqlite)
  60. #:use-module (gnu packages swig)
  61. #:use-module (gnu packages vim)
  62. #:use-module (gnu packages w3m)
  63. #:use-module (gnu packages web)
  64. #:use-module (gnu packages xml)
  65. #:use-module (guix build-system gnu)
  66. #:use-module (guix build-system python)
  67. #:use-module (guix build-system trivial)
  68. #:use-module (guix build-system scons)
  69. #:use-module (guix download)
  70. #:use-module (guix git-download)
  71. #:use-module ((guix licenses) #:prefix license:)
  72. #:use-module (guix packages))
  73. (define-public parted
  74. (package
  75. (name "parted")
  76. (version "3.2")
  77. (source (origin
  78. (method url-fetch)
  79. (uri (string-append "mirror://gnu/parted/parted-"
  80. version ".tar.xz"))
  81. (patches (search-patches "parted-glibc-compat.patch"))
  82. (sha256
  83. (base32
  84. "1r3qpg3bhz37mgvp9chsaa3k0csby3vayfvz8ggsqz194af5i2w5"))))
  85. (build-system gnu-build-system)
  86. (arguments
  87. `(#:phases
  88. (modify-phases %standard-phases
  89. (add-after
  90. 'unpack 'fix-locales-and-python
  91. (lambda* (#:key inputs #:allow-other-keys)
  92. (substitute* "tests/t0251-gpt-unicode.sh"
  93. (("C.UTF-8") "en_US.utf8")) ;not in Glibc locales
  94. (substitute* "tests/msdos-overlap"
  95. (("/usr/bin/python") (which "python"))))))))
  96. (inputs
  97. `(("lvm2" ,lvm2)
  98. ("readline" ,readline)
  99. ("util-linux" ,util-linux)))
  100. (native-inputs
  101. `(("gettext" ,gettext-minimal)
  102. ;; For the tests.
  103. ("perl" ,perl)
  104. ("python" ,python-2)))
  105. (home-page "https://www.gnu.org/software/parted/")
  106. (synopsis "Disk partition editor")
  107. (description
  108. "GNU Parted is a package for creating and manipulating disk partition
  109. tables. It includes a library and command-line utility.")
  110. (license license:gpl3+)))
  111. (define-public fdisk
  112. (package
  113. (name "fdisk")
  114. (version "2.0.0a1")
  115. (source
  116. (origin
  117. (method url-fetch)
  118. (uri (string-append "mirror://gnu/fdisk/gnufdisk-"
  119. version ".tar.gz"))
  120. (sha256
  121. (base32
  122. "1d8za79kw8ihnp2br084rgyjv9whkwp7957rzw815i0izx6xhqy9"))))
  123. (build-system gnu-build-system)
  124. (inputs
  125. `(("gettext" ,gettext-minimal)
  126. ("guile" ,guile-1.8)
  127. ("util-linux" ,util-linux)
  128. ("parted" ,parted)))
  129. ;; The build neglects to look for its own headers in its own tree. A next
  130. ;; release should fix this, but may never come: GNU fdisk looks abandoned.
  131. (arguments
  132. `(#:phases
  133. (modify-phases %standard-phases
  134. (add-after 'unpack 'skip-broken-header-probes
  135. (lambda _
  136. (substitute* "backend/configure"
  137. (("gnufdisk-common.h .*") "\n"))
  138. #t)))
  139. #:make-flags (list (string-append "CPPFLAGS="
  140. " -I../common/include "
  141. " -I../debug/include "
  142. " -I../exception/include"))))
  143. (home-page "https://www.gnu.org/software/fdisk/")
  144. (synopsis "Low-level disk partitioning and formatting")
  145. (description
  146. "GNU fdisk provides a GNU version of the common disk partitioning tool
  147. fdisk. fdisk is used for the creation and manipulation of disk partition
  148. tables, and it understands a variety of different formats.")
  149. (license license:gpl3+)))
  150. (define-public gptfdisk
  151. (package
  152. (name "gptfdisk")
  153. (version "1.0.4")
  154. (source
  155. (origin
  156. (method url-fetch)
  157. (uri (string-append "mirror://sourceforge/gptfdisk/gptfdisk/"
  158. version "/" name "-" version ".tar.gz"))
  159. (sha256
  160. (base32
  161. "13d7gff4prl1nsdknjigmb7bbqhn79165n01v4y9mwbnd0d3jqxn"))))
  162. (build-system gnu-build-system)
  163. (inputs
  164. `(("gettext" ,gettext-minimal)
  165. ("ncurses" ,ncurses)
  166. ("popt" ,popt)
  167. ("util-linux" ,util-linux))) ; libuuid
  168. (arguments
  169. `(#:test-target "test"
  170. #:phases
  171. (modify-phases %standard-phases
  172. ;; no configure script
  173. (delete 'configure)
  174. ;; no install target
  175. (replace 'install
  176. (lambda* (#:key outputs #:allow-other-keys)
  177. (let* ((out (assoc-ref outputs "out"))
  178. (bin (string-append out "/bin"))
  179. (man (string-append out "/share/man/man8")))
  180. (install-file "gdisk" bin)
  181. (install-file "sgdisk" bin)
  182. (install-file "cgdisk" bin)
  183. (install-file "fixparts" bin)
  184. (install-file "cgdisk.8" man)
  185. (install-file "fixparts.8" man)
  186. (install-file "gdisk.8" man)
  187. (install-file "sgdisk.8" man)))))))
  188. (home-page "http://www.rodsbooks.com/gdisk/")
  189. (synopsis "Low-level GPT disk partitioning and formatting")
  190. (description "GPT fdisk (aka gdisk) is a text-mode partitioning tool that
  191. works on Globally Unique Identifier (@dfn{GUID}) Partition Table (@dfn{GPT})
  192. disks, rather than on the older Master Boot Record (@dfn{MBR}) partition
  193. scheme.")
  194. (license license:gpl2)))
  195. (define-public ddrescue
  196. (package
  197. (name "ddrescue")
  198. (version "1.23")
  199. (source
  200. (origin
  201. (method url-fetch)
  202. (uri (string-append "mirror://gnu/ddrescue/ddrescue-"
  203. version ".tar.lz"))
  204. (sha256
  205. (base32
  206. "13cd6c0x91zq10vdlyl6r5rib47bmsn5sshmkin3igwj8pa2vbm9"))))
  207. (build-system gnu-build-system)
  208. (home-page "https://www.gnu.org/software/ddrescue/ddrescue.html")
  209. (synopsis "Data recovery utility")
  210. (native-inputs `(("lzip" ,lzip)))
  211. (description
  212. "GNU ddrescue is a fully automated data recovery tool. It copies data
  213. from one file to another, working to rescue data in case of read errors. The
  214. program also includes a tool for manipulating its log files, which are used
  215. to recover data more efficiently by only reading the necessary blocks.")
  216. (license license:gpl3+)))
  217. (define-public dosfstools
  218. (package
  219. (name "dosfstools")
  220. (version "4.1")
  221. (source
  222. (origin
  223. (method url-fetch)
  224. (uri (string-append "https://github.com/" name "/" name
  225. "/releases/download/v" version "/"
  226. name "-" version ".tar.xz"))
  227. (sha256
  228. (base32
  229. "0wy13i3i4x2bw1hf5m4fd0myh61f9bcrs035fdlf6gyc1jksrcp6"))))
  230. (build-system gnu-build-system)
  231. (arguments
  232. `(#:make-flags (list (string-append "PREFIX=" %output)
  233. "CC=gcc")))
  234. (native-inputs
  235. `(("xxd" ,xxd))) ; for tests
  236. (home-page "https://github.com/dosfstools/dosfstools")
  237. (synopsis "Utilities for making and checking MS-DOS FAT file systems")
  238. (description
  239. "The dosfstools package includes the mkfs.fat and fsck.fat utilities,
  240. which respectively make and check MS-DOS FAT file systems.")
  241. (license license:gpl3+)))
  242. (define dosfstools/static
  243. (static-package
  244. (package (inherit dosfstools))))
  245. (define-public fatfsck/static
  246. (package
  247. (name "fatfsck-static")
  248. (version (package-version dosfstools))
  249. (build-system trivial-build-system)
  250. (source #f)
  251. (arguments
  252. `(#:modules ((guix build utils))
  253. #:builder
  254. (begin
  255. (use-modules (guix build utils))
  256. (let ((src (string-append (assoc-ref %build-inputs "dosfstools")
  257. "/sbin"))
  258. (exe "fsck.fat")
  259. (bin (string-append (assoc-ref %outputs "out") "/sbin")))
  260. (mkdir-p bin)
  261. (with-directory-excursion bin
  262. (copy-file (string-append src "/" exe) exe)
  263. (remove-store-references exe)
  264. (chmod exe #o555)
  265. ;; Add fsck.vfat symlink to match the Linux driver name.
  266. (symlink exe "fsck.vfat")
  267. #t)))))
  268. (inputs `(("dosfstools" ,dosfstools/static)))
  269. (home-page (package-home-page dosfstools))
  270. (synopsis "Statically linked fsck.fat from dosfstools")
  271. (description "This package provides a statically-linked @command{fsck.fat}
  272. and a @command{fsck.vfat} compatibility symlink for use in an initrd.")
  273. (license (package-license dosfstools))))
  274. (define-public sdparm
  275. (package
  276. (name "sdparm")
  277. (version "1.10")
  278. (source
  279. (origin
  280. (method url-fetch)
  281. (uri (string-append "http://sg.danny.cz/sg/p/"
  282. name "-" version ".tar.xz"))
  283. (sha256
  284. (base32
  285. "1jjq3lzgfy4r76rc26q02lv4wm5cb4dx5nh913h489zjrr4f3jbx"))))
  286. (build-system gnu-build-system)
  287. (home-page "http://sg.danny.cz/sg/sdparm.html")
  288. (synopsis "Provide access to SCSI device parameters")
  289. (description
  290. "Sdparm reads and modifies SCSI device parameters. These devices can be
  291. SCSI disks, in which case the role of @command{sdparm} is similar to its
  292. namesake: the @command{hdparm} utility originally designed for ATA disks.
  293. However, @command{sdparm} can be used to access parameters on any device that
  294. uses a SCSI command set. Such devices include CD/DVD drives (irrespective of
  295. transport), SCSI and ATAPI tape drives, and SCSI enclosures. This utility can
  296. also send commands associated with starting and stopping the media, loading
  297. and unloading removable media and some other housekeeping functions.")
  298. (license license:bsd-3)))
  299. (define-public idle3-tools
  300. (package
  301. (name "idle3-tools")
  302. (version "0.9.1")
  303. (source
  304. (origin
  305. (method url-fetch)
  306. (uri (string-append "mirror://sourceforge/idle3-tools/idle3-tools-"
  307. version ".tgz"))
  308. (sha256
  309. (base32
  310. "00ia7xq9yldxyl9gz0mr4xa568nav14p0fnv82f2rbbkg060cy4p"))))
  311. (build-system gnu-build-system)
  312. (arguments
  313. `(#:tests? #f ;no test suite
  314. #:phases
  315. (modify-phases %standard-phases
  316. (delete 'configure))
  317. #:make-flags (list "CC=gcc"
  318. (string-append "manprefix=")
  319. (string-append "DESTDIR="
  320. (assoc-ref %outputs "out")))))
  321. (home-page "http://idle3-tools.sourceforge.net")
  322. (synopsis "Change or disable Western Digital hard drives' Idle3 timer")
  323. (description
  324. "Idle3-tools provides a utility to get, set, or disable the Idle3 timer
  325. present in many Western Digital hard drives. This timer is part of the
  326. \"IntelliPark\" feature that stops the disk when not in use. Unfortunately,
  327. the default timer setting is not well suited to Linux or other *nix systems,
  328. and can dramatically shorten the lifespan of the drive if left unchecked.")
  329. (license license:gpl3+)))
  330. (define-public gparted
  331. (package
  332. (name "gparted")
  333. (version "0.33.0")
  334. (source
  335. (origin
  336. (method url-fetch)
  337. (uri (string-append "mirror://sourceforge/gparted/gparted/gparted-"
  338. version "/gparted-" version ".tar.gz"))
  339. (sha256
  340. (base32 "1ml1ky3s75lbxr91p608q3prsdh9x899mw7nbgk252pqhg4vh8sh"))))
  341. (build-system gnu-build-system)
  342. (arguments
  343. `(#:tests? #f ; tests require a network connection
  344. #:configure-flags '("--disable-scrollkeeper")))
  345. (inputs
  346. `(("util-linux" ,util-linux)
  347. ("parted" ,parted)
  348. ("glib" ,glib)
  349. ("gtkmm" ,gtkmm-2)
  350. ("libxml2" ,libxml2)
  351. ("libxslt" ,libxslt)
  352. ("gnome-doc-utils" ,gnome-doc-utils)
  353. ("docbook-xml" ,docbook-xml-4.2)
  354. ("python" ,python-2)
  355. ("python-libxml2" ,python2-libxml2)
  356. ("which" ,which)))
  357. (native-inputs
  358. `(("intltool" ,intltool)
  359. ("pkg-config" ,pkg-config)))
  360. (home-page "https://gparted.org/")
  361. (synopsis "Partition editor to graphically manage disk partitions")
  362. (description "GParted is a GNOME partition editor for creating,
  363. reorganizing, and deleting disk partitions. It uses libparted from the parted
  364. project to detect and manipulate partition tables. Optional file system tools
  365. permit managing file systems not included in libparted.")
  366. ;; The home page says GPLv2, but the source code says GPLv2+.
  367. (license license:gpl2+)))
  368. (define-public pydf
  369. (package
  370. (name "pydf")
  371. (version "12")
  372. (source
  373. (origin
  374. (method url-fetch)
  375. (uri (pypi-uri "pydf" version))
  376. (sha256
  377. (base32
  378. "0f8ly8xyp93i2hm9c0qjqd4y86nz73axw2f09z01mszwmg1sfivz"))))
  379. (build-system python-build-system)
  380. (home-page "http://kassiopeia.juls.savba.sk/~garabik/software/pydf/")
  381. (synopsis "Colourised @command{df} clone")
  382. (description "All-singing, all-dancing, fully colourised @command{df} clone
  383. written in Python. It displays the amount of disk space available on the
  384. mounted file systems, using different colours for different types of file
  385. systems. Output format is completely customizable.")
  386. (license license:public-domain)))
  387. (define-public f3
  388. (package
  389. (name "f3")
  390. (version "7.1")
  391. (source
  392. (origin
  393. (method git-fetch)
  394. (uri (git-reference
  395. (url "https://github.com/AltraMayor/f3.git")
  396. (commit (string-append "v" version))))
  397. (file-name (git-file-name name version))
  398. (sha256
  399. (base32
  400. "0zglsmz683jg7f9wc6vmgljyg9w87pbnjw5x4w6x02w8233zvjqf"))))
  401. (build-system gnu-build-system)
  402. (arguments
  403. '(#:tests? #f ; no check target
  404. #:make-flags (list "CC=gcc"
  405. (string-append "PREFIX=" %output))
  406. #:phases
  407. (modify-phases %standard-phases
  408. (delete 'configure) ; no configure script
  409. (add-after 'build 'build-extra
  410. (lambda* (#:key make-flags #:allow-other-keys)
  411. (apply invoke "make" "extra" make-flags)))
  412. (add-after 'build 'install-extra
  413. (lambda* (#:key make-flags #:allow-other-keys)
  414. (apply invoke "make" "install-extra" make-flags))))))
  415. (inputs
  416. `(("eudev" ,eudev)
  417. ("parted" ,parted)))
  418. (home-page "http://oss.digirati.com.br/f3/")
  419. (synopsis "Test real capacity of flash memory cards and such.")
  420. (description "F3 (Fight Flash Fraud or Fight Fake Flash) tests the full
  421. capacity of a flash card (flash drive, flash disk, pendrive). F3 writes to
  422. the card and then checks if can read it. It will assure you haven't been sold
  423. a card with a smaller capacity than stated.")
  424. (license license:gpl3+)))
  425. (define-public python-parted
  426. (package
  427. (name "python-parted")
  428. (version "3.11.1")
  429. (source
  430. (origin
  431. (method url-fetch)
  432. (uri (string-append "https://github.com/dcantrell/pyparted/archive/v"
  433. version ".tar.gz"))
  434. (sha256
  435. (base32
  436. "0r1nyjj40nacnfnv17x2mnsj6ga1qplyxyza82v2809dfhim2fwq"))))
  437. (build-system python-build-system)
  438. (arguments
  439. `(#:phases
  440. (modify-phases %standard-phases
  441. (delete 'check)
  442. (add-after 'install 'check
  443. (lambda* (#:key outputs inputs #:allow-other-keys)
  444. (add-installed-pythonpath inputs outputs)
  445. ;; See <https://github.com/dcantrell/pyparted/issues/47>.
  446. (substitute* "tests/test__ped_ped.py"
  447. (("\"/tmp/temp-device-\"") "self.path"))
  448. (invoke "python" "-m" "unittest" "discover" "-v")
  449. #t)))))
  450. (native-inputs
  451. `(("e2fsprogs" ,e2fsprogs)
  452. ("pkg-config" ,pkg-config)))
  453. (propagated-inputs
  454. `(("python-six" ,python-six)))
  455. (inputs
  456. `(("parted" ,parted)))
  457. (home-page "https://github.com/dcantrell/pyparted")
  458. (synopsis "Parted bindings for Python")
  459. (description "This package provides @code{parted} bindings for Python.")
  460. (license license:gpl2+)))
  461. (define-public python2-parted
  462. (package-with-python2 python-parted))
  463. (define-public duperemove
  464. (package
  465. (name "duperemove")
  466. (version "0.11.1")
  467. (source
  468. (origin
  469. (method git-fetch)
  470. (uri (git-reference
  471. (url "https://github.com/markfasheh/duperemove.git")
  472. (commit (string-append "v" version))))
  473. (sha256
  474. (base32 "1scz76pvpljvrpfn176125xwaqwyy4pirlm11sc9spb2hyzknw2z"))
  475. (file-name (git-file-name name version))))
  476. (build-system gnu-build-system)
  477. (native-inputs
  478. `(("pkg-config" ,pkg-config)))
  479. (inputs
  480. `(("glib" ,glib)
  481. ("sqlite" ,sqlite)))
  482. (arguments
  483. `(#:tests? #f ; no test suite
  484. #:phases
  485. (modify-phases %standard-phases
  486. (delete 'configure)) ; no configure script
  487. #:make-flags (list (string-append "PREFIX=" %output)
  488. "CC=gcc")))
  489. (home-page "https://github.com/markfasheh/duperemove")
  490. (synopsis "Tools for de-duplicating file system data")
  491. (description "Duperemove is a simple tool for finding duplicated extents
  492. and submitting them for deduplication. When given a list of files it will
  493. hash their contents on a block by block basis and compare those hashes to each
  494. other, finding and categorizing blocks that match each other. When given the
  495. @option{-d} option, duperemove will submit those extents for deduplication
  496. using the Linux kernel extent-same @code{ioctl}.
  497. Duperemove can store the hashes it computes in a @dfn{hash file}. If given an
  498. existing hash file, duperemove will only compute hashes for those files which
  499. have changed since the last run. Thus you can run duperemove repeatedly on
  500. your data as it changes, without having to re-checksum unchanged data.
  501. Duperemove can also take input from the @command{fdupes} program.")
  502. (license license:gpl2)))
  503. (define-public ranger
  504. (package
  505. (name "ranger")
  506. (version "1.9.2")
  507. (source (origin
  508. (method url-fetch)
  509. (uri (string-append "https://ranger.github.io/"
  510. "ranger-" version ".tar.gz"))
  511. (sha256
  512. (base32
  513. "12kbsqakbxs09y0x8hy66mmaf72rk0p850x7ryk2ghkq7wfin78f"))))
  514. (build-system python-build-system)
  515. (inputs
  516. `(("w3m" ,w3m)))
  517. (native-inputs
  518. `(("which" ,which)
  519. ;; For tests.
  520. ("python-pytest" ,python-pytest)))
  521. (arguments
  522. '( ;; The 'test' target runs developer tools like pylint, which fail.
  523. #:test-target "test_pytest"
  524. #:phases
  525. (modify-phases %standard-phases
  526. (add-after 'configure 'wrap-program
  527. ;; Tell 'ranger' where 'w3mimgdisplay' is.
  528. (lambda* (#:key inputs outputs #:allow-other-keys)
  529. (let* ((out (assoc-ref outputs "out"))
  530. (ranger (string-append out "/bin/ranger"))
  531. (w3m (assoc-ref inputs "w3m"))
  532. (w3mimgdisplay (string-append w3m
  533. "/libexec/w3m/w3mimgdisplay")))
  534. (wrap-program ranger
  535. `("W3MIMGDISPLAY_PATH" ":" prefix (,w3mimgdisplay)))
  536. #t)))
  537. (replace 'check
  538. ;; The default check phase simply prints 'Ran 0 tests in 0.000s'.
  539. (lambda* (#:key test-target #:allow-other-keys)
  540. (invoke "make" test-target))))))
  541. (home-page "https://ranger.github.io/")
  542. (synopsis "Console file manager")
  543. (description "ranger is a console file manager with Vi key bindings. It
  544. provides a minimalistic and nice curses interface with a view on the directory
  545. hierarchy. It ships with @code{rifle}, a file launcher that is good at
  546. automatically finding out which program to use for what file type.")
  547. (license license:gpl3)))
  548. (define-public volume-key
  549. (package
  550. (name "volume-key")
  551. (version "0.3.12")
  552. (source (origin
  553. (method url-fetch)
  554. (uri (string-append "https://releases.pagure.org/volume_key/volume_key-"
  555. version ".tar.xz"))
  556. (sha256
  557. (base32
  558. "16rhfz6sjwxlmss1plb2wv2i3jq6wza02rmz1d2jrlnsq67p98vc"))))
  559. (build-system gnu-build-system)
  560. (native-inputs
  561. `(("pkg-config" ,pkg-config)
  562. ("util-linux" ,util-linux)
  563. ("swig" ,swig)
  564. ("python" ,python-3))) ; used to generate the Python bindings
  565. (inputs
  566. `(("cryptsetup" ,cryptsetup)
  567. ("nss" ,nss)
  568. ("lvm2" ,lvm2) ; for "-ldevmapper"
  569. ("glib" ,glib)
  570. ("gpgme" ,gpgme)))
  571. (arguments
  572. `(#:tests? #f ; not sure how tests are supposed to pass, even when run manually
  573. #:phases
  574. (modify-phases %standard-phases
  575. (add-before 'configure 'patch-python.h-path
  576. (lambda* (#:key inputs #:allow-other-keys)
  577. (let ((python (assoc-ref inputs "python")))
  578. (substitute* "Makefile.in"
  579. (("/usr/include/python") (string-append python "/include/python")))
  580. #t))))))
  581. (home-page "https://pagure.io/volume_key")
  582. (synopsis "Manipulate storage volume encryption keys")
  583. (description
  584. "This package provides a library for manipulating storage volume
  585. encryption keys and storing them separately from volumes to handle forgotten
  586. passphrases.")
  587. (license license:gpl2)))
  588. (define-public ndctl
  589. (package
  590. (name "ndctl")
  591. (version "64.1")
  592. (source (origin
  593. (method git-fetch)
  594. (uri (git-reference
  595. (url "https://github.com/pmem/ndctl.git")
  596. (commit (string-append "v" version))))
  597. (file-name (git-file-name name version))
  598. (sha256
  599. (base32
  600. "1la82fqbdwjkw6il498nkdfgqc4aszv481xf2p9p07jfvankx24v"))))
  601. (build-system gnu-build-system)
  602. (native-inputs
  603. `(("asciidoc" ,asciidoc)
  604. ("automake" ,automake)
  605. ("autoconf" ,autoconf)
  606. ("bash-completion" ,bash-completion)
  607. ("docbook-xsl" ,docbook-xsl)
  608. ("libtool" ,libtool)
  609. ("libxml2" ,libxml2)
  610. ("pkg-config" ,pkg-config)
  611. ("xmlto" ,xmlto)
  612. ;; Required for offline docbook generation.
  613. ("which" ,which)))
  614. (inputs
  615. `(("eudev" ,eudev)
  616. ("json-c" ,json-c)
  617. ("keyutils" ,keyutils)
  618. ("kmod" ,kmod)
  619. ("util-linux" ,util-linux)))
  620. (arguments
  621. `(#:configure-flags
  622. (list "--disable-asciidoctor" ; use docbook-xsl instead
  623. "--without-systemd")
  624. #:phases
  625. (modify-phases %standard-phases
  626. (add-after 'unpack 'patch-FHS-file-names
  627. (lambda _
  628. (substitute* "git-version-gen"
  629. (("/bin/sh") (which "sh")))
  630. (substitute* "git-version"
  631. (("/bin/bash") (which "bash")))
  632. #t)))
  633. #:make-flags
  634. (let ((out (assoc-ref %outputs "out")))
  635. (list (string-append "BASH_COMPLETION_DIR=" out
  636. "/share/bash-completion/completions")))))
  637. (home-page "https://github.com/pmem/ndctl")
  638. (synopsis "Manage the non-volatile memory device sub-system in the Linux kernel")
  639. (description
  640. "This package provides a utility library for managing the
  641. libnvdimm (non-volatile memory device) sub-system in the Linux kernel.")
  642. ;; COPYING says LGPL2.1, but many source files are GPL2 so that's
  643. ;; the effective license. Note that some files under ccan/ are
  644. ;; covered by BSD-3 or public domain, see the individual folders.
  645. (license license:gpl2)))
  646. (define-public dmraid
  647. (package
  648. (name "dmraid")
  649. (version "1.0.0.rc16-3")
  650. (source (origin
  651. (method url-fetch)
  652. (uri (string-append "https://people.redhat.com/~heinzm/sw/dmraid/src/dmraid-"
  653. version ".tar.bz2"))
  654. (sha256
  655. (base32
  656. "1n7vsqvh7y6yvil682q129d21yhb0cmvd5fvsbkza7ypd78inhlk"))))
  657. (build-system gnu-build-system)
  658. (inputs `(("lvm2" ,lvm2)))
  659. (native-inputs `(("which" ,which)))
  660. (arguments
  661. `(#:tests? #f ; No tests.
  662. ;; Prevent a race condition where some target would attempt to link
  663. ;; libdmraid.so before it had been built as reported in
  664. ;; <https://bugs.gnu.org/31999#187>.
  665. #:parallel-build? #f
  666. #:phases (modify-phases %standard-phases
  667. (add-before 'configure 'change-directory
  668. (lambda _
  669. (chdir (string-append ,version "/dmraid"))
  670. (substitute* "make.tmpl.in"
  671. (("/bin/sh") (which "sh")))
  672. #t)))
  673. #:configure-flags (list ;; Make sure programs such as 'dmevent_tool' can
  674. ;; find libdmraid.so.
  675. (string-append "LDFLAGS=-Wl,-rpath="
  676. (assoc-ref %outputs "out")
  677. "/lib"))))
  678. (home-page "https://people.redhat.com/~heinzm/sw/dmraid/")
  679. (synopsis "Device mapper RAID interface")
  680. (description
  681. "This software supports RAID device discovery, RAID set activation, creation,
  682. removal, rebuild and display of properties for ATARAID/DDF1 metadata.
  683. @command{dmraid} uses @file{libdevmapper} and the device-mapper kernel runtime
  684. to create devices with respective mappings for the ATARAID sets discovered.")
  685. (license license:gpl2+)))
  686. (define-public libblockdev
  687. (package
  688. (name "libblockdev")
  689. (version "2.20")
  690. (source (origin
  691. (method url-fetch)
  692. (uri (string-append "https://github.com/storaged-project/"
  693. "libblockdev/releases/download/"
  694. version "-1/libblockdev-" version ".tar.gz"))
  695. (sha256
  696. (base32
  697. "092snk5jyv48na4d46v1ckiy859zwpb3r0ivnxv3km5vzsp76y7q"))))
  698. (build-system gnu-build-system)
  699. (native-inputs
  700. `(("pkg-config" ,pkg-config)
  701. ("python" ,python-wrapper)
  702. ("util-linux" ,util-linux)))
  703. (inputs
  704. `(("btrfs-progs" ,btrfs-progs)
  705. ("cryptsetup" ,cryptsetup)
  706. ("dosfstools" ,dosfstools)
  707. ("dmraid" ,dmraid)
  708. ("eudev" ,eudev)
  709. ("glib" ,glib)
  710. ("gobject-introspection" ,gobject-introspection)
  711. ("kmod" ,kmod)
  712. ("libbytesize" ,libbytesize)
  713. ("libyaml" ,libyaml)
  714. ("lvm2" ,lvm2)
  715. ("mdadm" ,mdadm)
  716. ("ndctl" ,ndctl)
  717. ("nss" ,nss)
  718. ("parted" ,parted)
  719. ("volume-key" ,volume-key)
  720. ;; ("xfsprogs" ,xfsprogs) ; TODO: Package?
  721. ))
  722. (home-page "https://github.com/storaged-project/libblockdev")
  723. (synopsis "Library for manipulating block devices")
  724. (description
  725. "libblockdev is a C library supporting GObject introspection for
  726. manipulation of block devices. It has a plugin-based architecture where each
  727. technology (like LVM, Btrfs, MD RAID, Swap...) is implemented in a separate
  728. plugin, possibly with multiple implementations (e.g. using LVM CLI or the new
  729. LVM D-Bus API).")
  730. (license license:lgpl2.1+)))
  731. (define-public rmlint
  732. (package
  733. (name "rmlint")
  734. (version "2.8.0")
  735. (source (origin
  736. (method git-fetch)
  737. (uri (git-reference
  738. (url "https://github.com/sahib/rmlint")
  739. (commit (string-append "v" version))))
  740. (file-name (git-file-name name version))
  741. (sha256
  742. (base32
  743. "1gc7gbnh0qg1kl151cv1ld87vhpm1v3pnkn7prhscdcc21jrg8nz"))))
  744. (build-system scons-build-system)
  745. (arguments
  746. `(#:scons ,scons-python2
  747. #:scons-flags (list (string-append "--prefix=" %output)
  748. (string-append "--actual-prefix=" %output))
  749. #:tests? #f ; No tests?
  750. #:phases
  751. (modify-phases %standard-phases
  752. (add-after 'unpack 'scons-propagate-environment
  753. (lambda* (#:key inputs #:allow-other-keys)
  754. ;; TODO: `rmlint --gui` fails with
  755. ;; "Failed to load shredder: No module named 'shredder'".
  756. ;; The GUI might also need extra dependencies, such as
  757. ;; python-gobject, python-cairo, dconf, librsvg, gtksourceview3.
  758. (substitute* "lib/cmdline.c"
  759. (("const char \\*commands\\[\\] = \\{\"python3\", \"python\", NULL\\};")
  760. (string-append
  761. "const char *commands[] = {\""
  762. (assoc-ref inputs "python") "/bin/python"
  763. "\", \"python\", NULL};")))
  764. ;; By design, SCons does not, by default, propagate
  765. ;; environment variables to subprocesses. See:
  766. ;; <http://comments.gmane.org/gmane.linux.distributions.nixos/4969>
  767. ;; Here, we modify the SConstruct file to arrange for
  768. ;; environment variables to be propagated.
  769. (substitute* "SConstruct"
  770. (("^env = Environment\\(.*\\)" all)
  771. (string-append
  772. all
  773. "\nenv['ENV']=os.environ"))))))))
  774. (native-inputs
  775. `(("pkg-config" ,pkg-config)
  776. ("glib:bin" ,glib "bin")
  777. ("python-sphinx" ,python-sphinx)))
  778. (inputs
  779. `(("python" ,python-wrapper)
  780. ("glib" ,glib)
  781. ("libelf" ,libelf)
  782. ("elfutils" ,elfutils)
  783. ("json-glib" ,json-glib)
  784. ("libblkid" ,util-linux)))
  785. (home-page "https://rmlint.rtfd.org")
  786. (synopsis "Remove duplicates and other lint from the filesystem")
  787. (description "@command{rmlint} finds space waste and other broken things
  788. on your filesystem and offers to remove it. @command{rmlint} can find:
  789. @itemize
  790. @item duplicate files and duplicate directories,
  791. @item non-stripped binaries (i.e. binaries with debug symbols),
  792. @item broken symbolic links,
  793. @item empty files and directories,
  794. @item files with broken user and/or group ID.
  795. @end itemize\n")
  796. (license license:gpl3+)))