c3eacea9c6c56de809c4c587d080c1202d3941a7
[jackhill/guix/guix.git] / gnu / packages / file-systems.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017, 2018, 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
3 ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
4 ;;; Copyright © 2017, 2018, 2021 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2018 Leo Famulari <leo@famulari.name>
6 ;;; Copyright © 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2020 Raghav Gururajan <raghavgururajan@disroot.org>
8 ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
9 ;;; Copyright © 2021 raid5atemyhomework <raid5atemyhomework@protonmail.com>
10 ;;; Copyright © 2021 Stefan Reichör <stefan@xsteve.at>
11 ;;; Copyright © 2021 Noisytoot <noisytoot@disroot.org>
12 ;;;
13 ;;; This file is part of GNU Guix.
14 ;;;
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
19 ;;;
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
24 ;;;
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28 (define-module (gnu packages file-systems)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix build-system cmake)
34 #:use-module (guix build-system copy)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system go)
37 #:use-module (guix build-system linux-module)
38 #:use-module (guix build-system python)
39 #:use-module (guix build-system trivial)
40 #:use-module (guix utils)
41 #:use-module (gnu packages)
42 #:use-module (gnu packages acl)
43 #:use-module (gnu packages admin)
44 #:use-module (gnu packages attr)
45 #:use-module (gnu packages autotools)
46 #:use-module (gnu packages base)
47 #:use-module (gnu packages bison)
48 #:use-module (gnu packages check)
49 #:use-module (gnu packages compression)
50 #:use-module (gnu packages crypto)
51 #:use-module (gnu packages curl)
52 #:use-module (gnu packages cyrus-sasl)
53 #:use-module (gnu packages datastructures)
54 #:use-module (gnu packages documentation)
55 #:use-module (gnu packages docbook)
56 #:use-module (gnu packages flex)
57 #:use-module (gnu packages gawk)
58 #:use-module (gnu packages glib)
59 #:use-module (gnu packages gnupg)
60 #:use-module (gnu packages golang)
61 #:use-module (gnu packages guile)
62 #:use-module (gnu packages kerberos)
63 #:use-module (gnu packages libffi)
64 #:use-module (gnu packages linux)
65 #:use-module (gnu packages nfs)
66 #:use-module (gnu packages onc-rpc)
67 #:use-module (gnu packages openldap)
68 #:use-module (gnu packages pcre)
69 #:use-module (gnu packages perl)
70 #:use-module (gnu packages photo)
71 #:use-module (gnu packages pkg-config)
72 #:use-module (gnu packages python)
73 #:use-module (gnu packages python-crypto)
74 #:use-module (gnu packages python-web)
75 #:use-module (gnu packages python-xyz)
76 #:use-module (gnu packages readline)
77 #:use-module (gnu packages rsync)
78 #:use-module (gnu packages sssd)
79 #:use-module (gnu packages sqlite)
80 #:use-module (gnu packages time)
81 #:use-module (gnu packages tls)
82 #:use-module (gnu packages valgrind)
83 #:use-module (gnu packages version-control)
84 #:use-module (gnu packages xml))
85
86 (define-public autofs
87 (package
88 (name "autofs")
89 (version "5.1.7")
90 (source
91 (origin
92 (method url-fetch)
93 (uri (string-append "mirror://kernel.org/linux/daemons/autofs/"
94 "v" (version-major version) "/"
95 "autofs-" version ".tar.xz"))
96 (sha256
97 (base32 "1myfz6a3wj2c4j9h5g44zj796fdi82jhp1s92w2hg6xp2632csx3"))))
98 (build-system gnu-build-system)
99 (arguments
100 `(#:configure-flags
101 (list "--enable-ignore-busy" ; during shutdown
102 "--enable-sloppy-mount" ; support mount(8) -s
103 "--with-libtirpc"
104 (string-append "--with-openldap="
105 (assoc-ref %build-inputs "openldap"))
106 (string-append "--with-sasl="
107 (assoc-ref %build-inputs "cyrus-sasl"))
108 "HAVE_SSS_AUTOFS=1" ; required to make sssldir click
109 (string-append "sssldir="
110 (assoc-ref %build-inputs "sssd")
111 "/lib/sssd/modules"))
112 #:tests? #f ; no test suite
113 #:phases
114 (modify-phases %standard-phases
115 (add-before 'configure 'fix-hard-coded-search-path
116 (lambda _
117 (substitute* "configure"
118 (("^searchpath=\".*\"")
119 "searchpath=\"$PATH\""))
120 #t))
121 (add-before 'configure 'fix-rpath
122 (lambda* (#:key outputs #:allow-other-keys)
123 (let ((out (assoc-ref outputs "out")))
124 (substitute* "Makefile.rules"
125 (("^AUTOFS_LIB_LINK.*=" match)
126 (string-append match " -Wl,-rpath=" out "/lib"))))))
127 (add-before 'install 'omit-obsolete-lookup_nis.so-link
128 ;; Building lookup_yp.so depends on $(YPCLNT) but this doesn't,
129 ;; leading to a make error. Since it's broken, comment it out.
130 (lambda _
131 (substitute* "modules/Makefile"
132 (("ln -fs lookup_yp.so" match)
133 (string-append "# " match)))
134 #t)))))
135 (native-inputs
136 `(("bison" ,bison)
137 ("flex" ,flex)
138 ("pkg-config" ,pkg-config)
139 ("rpcsvc-proto" ,rpcsvc-proto)))
140 (inputs
141 `(("cyrus-sasl" ,cyrus-sasl)
142 ("e2fsprogs" ,e2fsprogs) ; for e[234]fsck
143 ("libtirpc" ,libtirpc)
144 ("libxml2" ,libxml2) ; needed for LDAP, SASL
145 ("mit-krb5" ,mit-krb5) ; needed for LDAP, SASL
146 ("nfs-utils" ,nfs-utils) ; for mount.nfs
147 ("openldap" ,openldap)
148 ("openssl" ,openssl) ; needed for SASL
149 ("sssd" ,sssd)
150 ("util-linux" ,util-linux))) ; for mount, umount
151 ;; XXX A directory index is the closest thing this has to a home page.
152 (home-page "https://www.kernel.org/pub/linux/daemons/autofs/")
153 (synopsis "Kernel-based automounter for Linux")
154 (description
155 "Autofs is a kernel-based automounter for use with the Linux autofs4
156 module. It automatically mounts selected file systems when they are used and
157 unmounts them after a set period of inactivity. This provides
158 centrally-managed, consistent file names for users and applications, even in a
159 large and/or frequently changing (network) environment.")
160 ;; fedfs/ is GPL-2-only but not built.
161 (license (list license:bsd-3 ; modules/cyrus-sasl.c
162 license:gpl2+)))) ; the rest
163
164 (define-public bindfs
165 (package
166 (name "bindfs")
167 (version "1.15.1")
168 (source (origin
169 (method url-fetch)
170 (uri (string-append "https://bindfs.org/downloads/bindfs-"
171 version ".tar.gz"))
172 (sha256
173 (base32
174 "1av8dj9i1g0105fs5r9srqqsp7yahlhwc0yl8i1szyfdls23bp84"))))
175 (build-system gnu-build-system)
176 (arguments
177 ;; XXX: The tests have no hope of passing until there is a "nogroup"
178 ;; entry (or at least some group to which the guix builder does
179 ;; not belong) in the /etc/group file of the build environment.
180 ;; Currently we do not have such a group. Disable tests for now.
181 '(#:tests? #f))
182 (native-inputs
183 ;; Native inputs to run the tests
184 ;; ("ruby" ,ruby)
185 ;; ("valgrind" ,valgrind)
186 ;; ("which" ,which)
187 `(("pkg-config" ,pkg-config)))
188 (inputs
189 `(("fuse" ,fuse)))
190 (home-page "https://bindfs.org")
191 (synopsis "Bind mount a directory and alter permission bits")
192 (description
193 "@command{bindfs} is a FUSE file system for mounting a directory to
194 another location, similar to @command{mount --bind}. It can be used for:
195 @itemize
196 @item Making a directory read-only.
197 @item Making all executables non-executable.
198 @item Sharing a directory with a list of users (or groups).
199 @item Modifying permission bits using rules with chmod-like syntax.
200 @item Changing the permissions with which files are created.
201 @end itemize ")
202 (license license:gpl2+)))
203
204 (define-public cachefilesd-inotify
205 (package
206 (name "cachefilesd-inotify")
207 (version "0.11.0")
208 (source
209 (origin
210 (method git-fetch)
211 (uri (git-reference
212 (url "https://gitlab.com/tomalok/cachefilesd-inotify")
213 (commit version)))
214 (file-name (git-file-name name version))
215 (sha256
216 (base32 "0qkrpz69ql6fb3fwh0l35hhf9znnqyxhgv5fzd1gl2a2kz13rq5a"))))
217 (build-system gnu-build-system)
218 (arguments
219 `(#:make-flags
220 (list (string-append "CC=" ,(cc-for-target))
221 ;; The Makefile doesn't support prefix= or similar.
222 (string-append "DESTDIR=" (assoc-ref %outputs "out"))
223 "MANDIR=/share/man")
224 #:tests? #f ; no test suite
225 #:phases
226 (modify-phases %standard-phases
227 (delete 'configure)))) ; no configure script
228 (home-page "https://gitlab.com/tomalok/cachefilesd-inotify")
229 (synopsis
230 "CacheFiles file system cache management daemon (using @code{inotify})")
231 (description
232 "This package provides the user space component of CacheFiles, a caching
233 back end that uses a directory on a locally mounted file system (such as ext4)
234 as a cache to speed up (by reducing) access to a slower file system and make it
235 appear more reliable.
236
237 The cached file system is often a network file system such as NFS or CIFS, but
238 can also be a local file system like ISO 9660 on a slow optical drive.
239
240 CacheFiles itself is part of the kernel but relies on this user space
241 @command{cachefilesd} daemon to perform maintenance tasks like culling and
242 reaping stale nodes. Only one such daemon can be running at a time, and
243 communicates with the kernel through the @file{/dev/cachefiles} character
244 device.
245
246 This version modifies David Howells original cachefilesd---which appears
247 unmaintained---to use the @code{inotify} API instead of the deprecated
248 @code{dnotify} to monitor file changes.")
249 (license license:gpl2+)))
250
251 (define-public davfs2
252 (package
253 (name "davfs2")
254 (version "1.6.0")
255 (source
256 (origin
257 (method url-fetch)
258 (uri (string-append "https://download.savannah.nongnu.org/releases/"
259 "davfs2/davfs2-" version ".tar.gz"))
260 (sha256
261 (base32 "0l1vnv5lfigciwg17p10zxwhzj4qw2d9kw30prr7g4dxhmb6fsrf"))))
262 (build-system gnu-build-system)
263 (arguments
264 `(#:configure-flags
265 (list "--sysconfdir=/etc" ; so man pages & binaries contain /etc
266 (string-append "--docdir=" (assoc-ref %outputs "out")
267 "/share/doc/" ,name "-" ,version)
268 (string-append "ssbindir=" (assoc-ref %outputs "out") "/sbin")
269 ;; The default ‘davfs2’ user and group don't exist on most systems.
270 "dav_user=nobody"
271 "dav_group=nogroup")
272 #:phases
273 (modify-phases %standard-phases
274 (add-after 'unpack 'omit-redundancy
275 ;; Don't install redundant copies of /etc examples into /share.
276 (lambda _
277 (substitute* "etc/Makefile.in"
278 (("(dist_pkgdata_DATA =.*) davfs2.conf secrets(.*)"
279 _ prefix suffix)
280 (string-append prefix suffix)))
281 #t))
282 (add-after 'unpack 'patch-file-names
283 (lambda _
284 ;; Don't auto-load the FUSE kernel module. That's up to root.
285 ;; XXX If/when we restore the previous behaviour, make sure not
286 ;; to introduce a security hole when mount.davfs is setuid.
287 (substitute* "src/kernel_interface.c"
288 (("/sbin/modprobe") "/modprobe/disabled"))
289 #t))
290 (replace 'install
291 (lambda* (#:key make-flags outputs #:allow-other-keys)
292 (let ((out (assoc-ref outputs "out")))
293 (apply invoke "make" "install"
294 (string-append "pkgsysconfdir=" out "/etc")
295 make-flags)))))))
296 (inputs
297 `(("neon" ,neon)
298
299 ;; Neon requires but doesn't propagate zlib, nor would we want that.
300 ;; XZ as well, but that's already present in the build environment.
301 ("zlib" ,zlib)))
302 (home-page "https://savannah.nongnu.org/projects/davfs2")
303 (synopsis "Mount remote WebDAV resources in the local file system")
304 (description
305 "The @acronym{WebDAV, Web Distributed Authoring and Versioning} extension
306 to the HTTP protocol defines a standard way to author resources on a remote Web
307 server. Davfs2 exposes such resources as a typical file system which can be
308 used by standard applications with no built-in support for WebDAV, such as the
309 GNU coreutils (@command{cp}, @command{mv}, etc.) or a graphical word processor.
310
311 Davfs2 works with most WebDAV servers with no or little configuration. It
312 supports TLS (HTTPS), HTTP proxies, HTTP basic and digest authentication, and
313 client certificates. It performs extensive caching to avoid unnecessary network
314 traffic, stay responsive even over slow or unreliable connections, and prevent
315 data loss. It aims to make use by unprivileged users as easy and secure as
316 possible.
317
318 However, davfs2 is not a full-featured WebDAV client. The file system interface
319 and the WebDAV protocol are quite different. Translating between the two is not
320 always possible.")
321 (license (list license:bsd-2 ; src/fuse_kernel.h
322 license:gpl3+)))) ; everything else
323
324 (define-public exfat-utils
325 (package
326 (name "exfat-utils")
327 (version "1.3.0")
328 (source
329 (origin
330 (method url-fetch)
331 (uri (string-append
332 "https://github.com/relan/exfat/releases/download/v"
333 version "/exfat-utils-" version ".tar.gz"))
334 (sha256
335 (base32 "0da8f8mm1sbwqp7prh78qk33xm0b8kk2d5is7mh2szlhgdxd1syz"))))
336 (build-system gnu-build-system)
337 (home-page "https://github.com/relan/exfat")
338 (synopsis "Utilities to manipulate exFAT file systems")
339 (description
340 "This package provides an implementation of the exFAT file system,
341 including command-line tools to validate exFAT file systems and to create new
342 ones.")
343 (license license:gpl2+)))
344
345 (define-public fsarchiver
346 (package
347 (name "fsarchiver")
348 (version "0.8.6")
349 (source
350 (origin
351 (method git-fetch)
352 (uri
353 (git-reference
354 (url "https://github.com/fdupoux/fsarchiver")
355 (commit version)))
356 (file-name (git-file-name name version))
357 (sha256
358 (base32 "1ry2sdkfbg4bwcldk42g1i3wa3z4pr9yh9dil6ilhwcvhqiw41zc"))))
359 (build-system gnu-build-system)
360 (native-inputs
361 `(("autoconf" ,autoconf)
362 ("automake" ,automake)
363 ("pkg-config" ,pkg-config)))
364 (inputs
365 `(("bzip2" ,bzip2)
366 ("e2fsprogs" ,e2fsprogs)
367 ("libgcrypt" ,libgcrypt)
368 ("lz4" ,lz4)
369 ("lzo" ,lzo)
370 ("util-linux" ,util-linux "lib")
371 ("xz" ,xz)
372 ("zlib" ,zlib)
373 ("zstd:lib" ,zstd "lib")))
374 (synopsis "File system back-up, deployment, and migration tool")
375 (description
376 "FSArchiver saves the contents of a file system to a compressed archive
377 file, and restores it to a different file system and/or partition. This
378 partition can be of a different size than the original and FSArchiver will
379 create a new file system if none exists.
380
381 All standard file attributes supported by the kernel are preserved, including
382 file permissions, timestamps, symbolic and hard links, and extended attributes.
383
384 Each file in the archive is protected by a checksum. If part of the archive
385 is corrupted you'll lose the affected file(s) but not the whole back-up.")
386 (home-page "https://www.fsarchiver.org/")
387 (license license:gpl2)))
388
389 (define-public gphotofs
390 (package
391 (name "gphotofs")
392 (version "0.5.0")
393 (source
394 (origin
395 (method url-fetch)
396 (uri
397 (string-append "mirror://sourceforge/gphoto/gphotofs/" version
398 "/gphotofs-0.5.tar.gz"))
399 (sha256
400 (base32
401 "04slwhr6ap9xcc27wphk22ad8yn79ngyy5z10lxams3k5liahvc2"))))
402 (build-system gnu-build-system)
403 (native-inputs
404 `(("pkg-config" ,pkg-config)))
405 (inputs
406 `(("fuse" ,fuse)
407 ("glib" ,glib)
408 ("libgphoto2" ,libgphoto2)))
409 (synopsis "Virtual file system for libgphoto2 using FUSE")
410 (description "GPhotoFS is a FUSE file system module to mount your camera as
411 a file system on Linux. This allow using your camera with any tool able to read
412 from a mounted file system.")
413 (home-page "http://www.gphoto.org/proj/gphotofs/")
414 (license license:gpl2+)))
415
416 (define-public bcachefs-tools
417 (let ((commit "fe1bb39aa52d9140981ba1e96f3c95ddf14006ce")
418 (revision "8"))
419 (package
420 (name "bcachefs-tools")
421 (version (git-version "0.1" revision commit))
422 (source
423 (origin
424 (method git-fetch)
425 (uri (git-reference
426 (url "https://evilpiepirate.org/git/bcachefs-tools.git")
427 (commit commit)))
428 (file-name (git-file-name name version))
429 (sha256
430 (base32 "1ks6w2v76pfpp70cv1d6znxaw1g5alz1v6hf8z9gvj15r94vgpwz"))))
431 (build-system gnu-build-system)
432 (arguments
433 `(#:make-flags
434 (list ,(string-append "VERSION=" version) ; bogus vX.Y-nogit otherwise
435 (string-append "PREFIX=" (assoc-ref %outputs "out"))
436 "INITRAMFS_DIR=$(PREFIX)/share/initramfs-tools"
437 ,(string-append "CC=" (cc-for-target))
438 ,(string-append "PKG_CONFIG=" (pkg-config-for-target))
439 "PYTEST=pytest")
440 #:phases
441 (modify-phases %standard-phases
442 (delete 'configure) ; no configure script
443 (add-after 'install 'promote-mount.bcachefs.sh
444 ;; XXX The (optional) mount.bcachefs helper requires rust:cargo.
445 ;; This alternative shell script does the job well enough for now.
446 (lambda* (#:key inputs outputs #:allow-other-keys)
447 (let ((out (assoc-ref outputs "out")))
448 (with-directory-excursion (string-append out "/sbin")
449 (rename-file "mount.bcachefs.sh" "mount.bcachefs")
450 ;; WRAP-SCRIPT causes bogus ‘Insufficient arguments’ errors.
451 (wrap-program "mount.bcachefs"
452 `("PATH" ":" prefix
453 ,(cons (string-append out "/sbin")
454 (map (lambda (input)
455 (string-append (assoc-ref inputs input)
456 "/bin"))
457 (list "coreutils"
458 "gawk"
459 "util-linux"))))))))))
460 #:tests? #f)) ; XXX 6 valgrind tests fail
461 (native-inputs
462 `(("pkg-config" ,pkg-config)
463
464 ;; For tests.
465 ("python-pytest" ,python-pytest)
466 ("valgrind" ,valgrind)))
467 (inputs
468 `(("eudev" ,eudev)
469 ("keyutils" ,keyutils)
470 ("libaio" ,libaio)
471 ("libscrypt" ,libscrypt)
472 ("libsodium" ,libsodium)
473 ("liburcu" ,liburcu)
474 ("util-linux:lib" ,util-linux "lib") ; lib{blkid,uuid}
475 ("lz4" ,lz4)
476 ("zlib" ,zlib)
477 ("zstd:lib" ,zstd "lib")
478
479 ;; Only for mount.bcachefs.sh.
480 ("coreutils" ,coreutils-minimal)
481 ("gawk" ,gawk)
482 ("util-linux" ,util-linux)))
483 (home-page "https://bcachefs.org/")
484 (synopsis "Tools to create and manage bcachefs file systems")
485 (description
486 "The bcachefs-tools are command-line utilities for creating, checking,
487 and otherwise managing bcachefs file systems.
488
489 Bcachefs is a @acronym{CoW, copy-on-write} file system supporting native
490 encryption, compression, snapshots, and (meta)data checksums. It can use
491 multiple block devices for replication and/or performance, similar to RAID.
492
493 In addition, bcachefs provides all the functionality of bcache, a block-layer
494 caching system, and lets you assign different roles to each device based on its
495 performance and other characteristics.")
496 (license license:gpl2+))))
497
498 (define-public bcachefs-tools/static
499 (package
500 (inherit bcachefs-tools)
501 (name "bcachefs-tools-static")
502 (arguments
503 (substitute-keyword-arguments (package-arguments bcachefs-tools)
504 ((#:make-flags make-flags)
505 `(append ,make-flags
506 (list "LDFLAGS=-static")))))
507 (inputs
508 `(("eudev:static" ,eudev "static")
509 ("libscrypt:static" ,libscrypt "static")
510 ("lz4:static" ,lz4 "static")
511 ("util-linux:static" ,util-linux "static") ; lib{blkid,uuid}
512 ("zlib" ,zlib "static")
513 ("zstd:static" ,zstd "static")
514 ,@(package-inputs bcachefs-tools)))))
515
516 (define-public bcachefs/static
517 (package
518 (name "bcachefs-static")
519 (version (package-version bcachefs-tools))
520 (build-system trivial-build-system)
521 (source #f)
522 (inputs
523 `(("bcachefs-tools" ,bcachefs-tools/static)))
524 (arguments
525 `(#:modules ((guix build utils))
526 #:builder
527 (begin
528 (use-modules (guix build utils)
529 (ice-9 ftw)
530 (srfi srfi-26))
531 (let* ((bcachefs-tools (assoc-ref %build-inputs "bcachefs-tools"))
532 (out (assoc-ref %outputs "out")))
533 (mkdir-p out)
534 (with-directory-excursion out
535 (install-file (string-append bcachefs-tools
536 "/sbin/bcachefs")
537 "sbin")
538 (remove-store-references "sbin/bcachefs")
539 (invoke "sbin/bcachefs" "version") ; test suite
540 #t)))))
541 (home-page (package-home-page bcachefs-tools))
542 (synopsis "Statically-linked bcachefs command from bcachefs-tools")
543 (description "This package provides the statically-linked @command{bcachefs}
544 from the bcachefs-tools package. It is meant to be used in initrds.")
545 (license (package-license bcachefs-tools))))
546
547 (define-public exfatprogs
548 (package
549 (name "exfatprogs")
550 (version "1.1.2")
551 (source
552 (origin
553 (method git-fetch)
554 (uri (git-reference
555 (url "https://github.com/exfatprogs/exfatprogs")
556 (commit version)))
557 (file-name (git-file-name name version))
558 (sha256
559 (base32 "19pbybgbfnvjb3n944ihrn1r8ch4dm8dr0d44d6w7p63dcp372xy"))))
560 (build-system gnu-build-system)
561 (arguments
562 `(#:configure-flags
563 (list "--disable-static")))
564 (native-inputs
565 `(("autoconf" ,autoconf)
566 ("automake" ,automake)
567 ("libtool" ,libtool)
568 ("pkg-config" ,pkg-config)))
569 (home-page "https://github.com/exfatprogs/exfatprogs")
570 (synopsis "Tools to create, check, and repair exFAT file systems")
571 (description
572 "These are command-line user space tools for the @acronym{exFAT,
573 Extensible File Allocation Table} file systems. Included are
574 @command{mkfs.exfat} to create (format) new exFAT file systems, and
575 @command{fsck.exfat} to check their consistency and repair them.")
576 (license license:gpl2+)))
577
578 (define-public httpfs2
579 (package
580 (name "httpfs2")
581 (version "0.1.5")
582 (source
583 (origin
584 (method url-fetch)
585 (uri (string-append "mirror://sourceforge/httpfs/httpfs2/"
586 "httpfs2-" version ".tar.gz"))
587 (sha256
588 (base32
589 "1h8ggvhw30n2r6w11n1s458ypggdqx6ldwd61ma4yd7binrlpjq1"))))
590 (build-system gnu-build-system)
591 (native-inputs
592 `(("asciidoc" ,asciidoc)
593 ("docbook-xml" ,docbook-xml)
594 ("libxml2" ,libxml2)
595 ("libxslt" ,libxslt)
596 ("pkg-config" ,pkg-config)))
597 (inputs
598 `(("fuse" ,fuse)
599 ("gnutls" ,gnutls)))
600 (arguments
601 `(#:phases
602 (modify-phases %standard-phases
603 (delete 'configure) ; no configure script
604 (replace 'install
605 ;; There's no ‘install’ target. Install all variants manually.
606 (lambda* (#:key outputs #:allow-other-keys)
607 (let* ((out (assoc-ref outputs "out"))
608 (bin (string-append out "/bin"))
609 (man1 (string-append out "/share/man/man1")))
610 (mkdir-p bin)
611 (mkdir-p man1)
612 (for-each
613 (lambda (variant)
614 (let ((man1-page (string-append variant ".1")))
615 (install-file variant bin)
616 (install-file man1-page man1)))
617 (list "httpfs2"
618 "httpfs2-mt"
619 "httpfs2-ssl"
620 "httpfs2-ssl-mt")))
621 #t)))
622 #:make-flags (list "CC=gcc")
623 #:parallel-build? #f ; can result in missing man pages
624 #:tests? #f)) ; no tests
625 (home-page "https://sourceforge.net/projects/httpfs/")
626 (synopsis "Mount remote files over HTTP")
627 (description "httpfs2 is a @code{fuse} file system for mounting any
628 @dfn{HyperText} (HTTP or HTTPS) URL. It uses HTTP/1.1 byte ranges to request
629 arbitrary bytes from the web server, without needing to download the entire
630 file. This is particularly useful with large archives such as ZIP files and
631 ISO images when you only need to inspect their contents or extract specific
632 files. Since the HTTP protocol itself has no notion of directories, only a
633 single file can be mounted.")
634 (license license:gpl2+)))
635
636 (define-public jfsutils
637 (package
638 (name "jfsutils")
639 (version "1.1.15")
640 (source
641 (origin
642 (method url-fetch)
643 (uri (string-append "http://jfs.sourceforge.net/project/pub/jfsutils-"
644 version ".tar.gz"))
645 (sha256
646 (base32 "0kbsy2sk1jv4m82rxyl25gwrlkzvl3hzdga9gshkxkhm83v1aji4"))
647 (patches (search-patches "jfsutils-add-sysmacros.patch"
648 "jfsutils-gcc-compat.patch"
649 "jfsutils-include-systypes.patch"))))
650 (build-system gnu-build-system)
651 (inputs
652 `(("util-linux" ,util-linux "lib")))
653 (home-page "http://jfs.sourceforge.net/home.html")
654 (synopsis "Utilities for managing JFS file systems")
655 (description
656 "The JFSutils are a collection of utilities for managing the @acronym{JFS,
657 Journaled File System}, a 64-bit journaling file system created by IBM and later
658 ported to the kernel Linux. The following commands are available:
659 @enumerate
660 @item @command{fsck.jfs}: check and repair a JFS file system or replay its
661 transaction log.
662 @item @command{logdump}: dump the JFS journal log.
663 @item @command{logredo}: replay the JFS journal log.
664 @item @command{mkfs.jfs}: create a new JFS file system.
665 @item @command{xchklog}: save a JFS fsck log to a file.
666 @item @command{xchkdmp}: dump the contents of such a log file.
667 @item @command{xpeek}: a JFS file system editor with a shell-like interface.
668 @end enumerate\n")
669 (license license:gpl3+))) ; no explicit version given
670
671 (define-public jfsutils/static
672 (static-package
673 (package
674 (inherit jfsutils)
675 (name "jfsutils-static")
676 (inputs
677 `(("util-linux:static" ,util-linux "static")
678 ,@(package-inputs jfsutils))))))
679
680 (define-public jfs_fsck/static
681 (package
682 (name "jfs_fsck-static")
683 (version (package-version jfsutils))
684 (source #f)
685 (build-system trivial-build-system)
686 (arguments
687 `(#:modules ((guix build utils))
688 #:builder
689 (begin
690 (use-modules (guix build utils)
691 (ice-9 ftw)
692 (srfi srfi-26))
693 (let* ((jfsutils (assoc-ref %build-inputs "jfsutils"))
694 (fsck "jfs_fsck")
695 (out (assoc-ref %outputs "out"))
696 (sbin (string-append out "/sbin")))
697 (mkdir-p sbin)
698 (with-directory-excursion sbin
699 (install-file (string-append jfsutils "/sbin/" fsck)
700 ".")
701 (remove-store-references fsck)
702 (chmod fsck #o555))
703 #t))))
704 (inputs
705 `(("jfsutils" ,jfsutils/static)))
706 (home-page (package-home-page jfsutils))
707 (synopsis "Statically-linked jfs_fsck command from jfsutils")
708 (description "This package provides statically-linked jfs_fsck command taken
709 from the jfsutils package. It is meant to be used in initrds.")
710 (license (package-license jfsutils))))
711
712 (define-public disorderfs
713 (package
714 (name "disorderfs")
715 (version "0.5.11")
716 (source
717 (origin
718 (method git-fetch)
719 (uri (git-reference
720 (url "https://salsa.debian.org/reproducible-builds/disorderfs.git")
721 (commit version)))
722 (file-name (git-file-name name version))
723 (sha256
724 (base32
725 "1pnrj0h8sgqwgsc18vz3fkqsp6vhigdbi75vdj0si1r6wgslnr7z"))))
726 (build-system gnu-build-system)
727 (native-inputs
728 `(("pkg-config" ,pkg-config)))
729 (inputs
730 `(("fuse" ,fuse)
731 ("attr" ,attr)))
732 (arguments
733 `(#:phases (modify-phases %standard-phases
734 (delete 'configure)) ; no configure script
735 #:make-flags (let ((out (assoc-ref %outputs "out")))
736 (list (string-append "PREFIX=" out)))
737 #:test-target "test"
738 ;; FIXME: Tests require 'run-parts' which is not in Guix yet.
739 #:tests? #f))
740 (home-page "https://salsa.debian.org/reproducible-builds/disorderfs")
741 (synopsis "FUSE file system that introduces non-determinism")
742 (description
743 "An overlay FUSE file system that introduces non-determinism
744 into file system metadata. For example, it can randomize the order
745 in which directory entries are read. This is useful for detecting
746 non-determinism in the build process.")
747 (license license:gpl3+)))
748
749 (define-public glusterfs
750 (package
751 (name "glusterfs")
752 (version "7.0")
753 (source
754 (origin
755 (method url-fetch)
756 (uri (string-append "https://download.gluster.org/pub/gluster/glusterfs/"
757 (version-major version) "/"
758 (version-major+minor version) "/"
759 "glusterfs-" version ".tar.gz"))
760 (sha256
761 (base32
762 "0yzhx710ypj0j3m5dcgmmgvkp7p0rmmp2p7ld0axrm4vpwc2b1wa"))))
763 (build-system gnu-build-system)
764 (arguments
765 `(#:configure-flags
766 (let ((out (assoc-ref %outputs "out"))
767 (p2 (assoc-ref %build-inputs "python-2")))
768 (list (string-append "PYTHON=" p2 "/bin/python")
769 (string-append "--with-initdir=" out "/etc/init.d")
770 (string-append "--with-mountutildir=" out "/sbin")
771 "--enable-cmocka" ; unit tests
772 ;; "--enable-debug" ; debug build options
773 ;; "--enable-asan" ; Address Sanitizer
774 ;; "--enable-tsan" ; ThreadSanitizer
775 ))
776 #:phases
777 (modify-phases %standard-phases
778 (add-before 'configure 'autogen
779 (lambda _ (invoke "./autogen.sh"))))))
780 (native-inputs
781 `(("pkg-config" ,pkg-config)
782 ("libtirpc" ,libtirpc)
783 ("rpcsvc-proto" ,rpcsvc-proto)
784 ("python-2" ,python-2) ; must be version 2
785 ("flex" ,flex)
786 ("bison" ,bison)
787 ("libtool" ,libtool)
788 ("autoconf" ,autoconf)
789 ("automake" ,automake)
790 ("cmocka" ,cmocka)))
791 (inputs
792 `(("acl" ,acl)
793 ("fuse" ,fuse)
794 ("openssl" ,openssl)
795 ("liburcu" ,liburcu)
796 ("libuuid" ,util-linux "lib")
797 ("libxml2" ,libxml2)
798 ("readline" ,readline)
799 ("zlib" ,zlib)
800 ("libaio" ,libaio)
801 ("rdma-core" ,rdma-core)))
802 (home-page "https://www.gluster.org")
803 (synopsis "Distributed file system")
804 (description "GlusterFS is a distributed scalable network file system
805 suitable for data-intensive tasks such as cloud storage and media streaming.
806 It allows rapid provisioning of additional storage based on your storage
807 consumption needs. It incorporates automatic failover as a primary feature.
808 All of this is accomplished without a centralized metadata server.")
809 ;; The user may choose either LGPLv3+ or GPLv2 only.
810 (license (list license:lgpl3+ license:gpl2+))))
811
812 (define-public curlftpfs
813 (package
814 (name "curlftpfs")
815 (version "0.9.2")
816 (source
817 (origin
818 (method url-fetch)
819 (uri (string-append "mirror://sourceforge/curlftpfs/curlftpfs/" version
820 "/curlftpfs-" version ".tar.gz"))
821 (sha256
822 (base32
823 "0n397hmv21jsr1j7zx3m21i7ryscdhkdsyqpvvns12q7qwwlgd2f"))))
824 (build-system gnu-build-system)
825 (arguments
826 `(#:phases
827 (modify-phases %standard-phases
828 (add-after 'unpack 'fix-test
829 (lambda _
830 ;; One of the 512-Byte block counts is definitely wrong.
831 ;; See <https://sourceforge.net/p/curlftpfs/bugs/73/>.
832 (substitute* "tests/ftpfs-ls_unittest.c"
833 (("4426192") "12814800"))
834 #t)))))
835 (inputs
836 `(("curl" ,curl)
837 ("glib" ,glib)
838 ("fuse" ,fuse)))
839 (native-inputs
840 `(("pkg-config" ,pkg-config)))
841 (home-page "http://curlftpfs.sourceforge.net/")
842 (synopsis "Mount remote file systems over FTP")
843 (description
844 "This is a file system client based on the FTP File Transfer Protocol.")
845 (license license:gpl2+)))
846
847 (define-public libeatmydata
848 (package
849 (name "libeatmydata")
850 (version "129")
851 (source
852 (origin
853 (method url-fetch)
854 (uri (string-append "https://www.flamingspork.com/projects/libeatmydata/"
855 "libeatmydata-" version ".tar.gz"))
856 (sha256
857 (base32 "1qycv1cvy6fr3v5rxilnsqxllwyfbqlcairlh31x2dnjsx28jnqf"))))
858 (build-system gnu-build-system)
859 (arguments
860 ;; All tests pass---but only if the host kernel allows PTRACE_TRACEME.
861 `(#:tests? #f
862 #:configure-flags
863 (list "--disable-static")
864 #:phases
865 (modify-phases %standard-phases
866 (add-after 'unpack 'patch-file-names
867 (lambda* (#:key inputs #:allow-other-keys)
868 (substitute* (list "eatmydata.in" "eatmydata.sh.in")
869 (("basename|readlink|uname" command)
870 (string-append (assoc-ref inputs "coreutils") "/bin/" command)))))
871 (add-before 'patch-file-names 'tighten-symlink-mode
872 ;; When the ‘eatmydata’ helper detects that it's a symlink, it will
873 ;; transparently invoke the command of the same name. However, it's
874 ;; *always* a link in Guix profiles and doesn't handle that well.
875 ;; Patch it to treat its own $name specially.
876 (lambda _
877 (substitute* "eatmydata.in"
878 (("-L \"\\$0\"" match)
879 (string-append match " ] && [ "
880 "\"x$(basename \"$0\")\" != \"x$name\"")))))
881 (add-after 'install 'install-debian-files
882 (lambda* (#:key inputs outputs #:allow-other-keys)
883 (let* ((debian (assoc-ref inputs "debian-files"))
884 (out (assoc-ref outputs "out"))
885 (share (string-append out "/share")))
886 (invoke "tar" "xvf" debian)
887 (with-directory-excursion "debian"
888 (install-file "eatmydata.1" (string-append share "/man/man1"))
889 (install-file "eatmydata.bash-completion"
890 (string-append share "/bash-completion"
891 "/completions")))))))))
892 (native-inputs
893 `(("debian-files" ; for the man page
894 ,(origin
895 (method url-fetch)
896 (uri (string-append "https://deb.debian.org/debian/pool/main/"
897 "libe/libeatmydata/libeatmydata_" version
898 "-1.debian.tar.xz"))
899 (sha256
900 (base32 "0q6kx1bf870jj52a2vm5p5xlrr89g2zs8wyhlpn80pys9p28nikx"))))
901 ;; For the test suite.
902 ("strace" ,strace)
903 ("which" ,which)))
904 (inputs
905 `(("coreutils" ,coreutils)))
906 (home-page "https://www.flamingspork.com/projects/libeatmydata/")
907 (synopsis "Transparently ignore calls to synchronize data safely to disk")
908 (description
909 "Libeatmydata transparently disables most ways a program might force data
910 to be written to the file system, such as @code{fsync()} or @code{open(O_SYNC)}.
911
912 Such synchronisation calls provide important data integrity guarantees but are
913 expensive to perform and can significantly slow down software that (over)uses
914 them.
915
916 This price is worth paying if you care about the files being modified---which is
917 typically the case---or when manipulating important components of your system.
918 Please, @emph{do not} use something called ``eat my data'' in such cases!
919
920 However, it does not make sense to accept this performance hit if the data is
921 unimportant and you can afford to lose all of it in the event of a crash, for
922 example when running a software test suite. Adding @code{}libeatmydata.so} to
923 the @env{LD_PRELOAD} environment of such tasks will override all C library data
924 synchronisation functions with custom @i{no-op} ones that do nothing and
925 immediately return success.
926
927 A simple @command{eatmydata} script is included that does this for you.")
928 (license license:gpl3+)))
929
930 (define-public libnfs
931 (package
932 (name "libnfs")
933 (version "4.0.0")
934 (source (origin
935 (method git-fetch)
936 (uri (git-reference
937 (url "https://github.com/sahlberg/libnfs")
938 (commit (string-append "libnfs-" version))))
939 (file-name (git-file-name name version))
940 (sha256
941 (base32
942 "0i27wd4zvhjz7620q043p4d4mkx8zv2yz9adm1byin47dynahyda"))))
943 (build-system gnu-build-system)
944 (home-page "https://github.com/sahlberg/libnfs")
945 (native-inputs
946 `(("autoconf" ,autoconf)
947 ("automake" ,automake)
948 ("libtool" ,libtool)
949 ("pkg-config" ,pkg-config)))
950 (synopsis "Client library for accessing NFS shares")
951 (description "LIBNFS is a client library for accessing NFS shares over a
952 network. LIBNFS offers three different APIs, for different use :
953
954 @enumerate
955 @item RAW, a fully asynchronous low level RPC library for NFS protocols. This
956 API provides very flexible and precise control of the RPC issued.
957 @item NFS ASYNC, a fully asynchronous library for high level vfs functions
958 @item NFS SYNC, a synchronous library for high level vfs functions.
959 @end enumerate\n")
960 (license (list license:lgpl2.1+ ; library
961 license:gpl3+ ; tests
962 license:bsd-3 ; copied nsf4 files
963 ))))
964
965 (define-public apfs-fuse
966 ;; Later versions require FUSE 3.
967 (let ((commit "7b89418e8dc27103d3c4f8fa348086ffcd634c17")
968 (revision "1"))
969 (package
970 (name "apfs-fuse")
971 (version (git-version "0.0.0" revision commit))
972 (source (origin
973 (method git-fetch)
974 (uri (git-reference
975 (url "https://github.com/sgan81/apfs-fuse")
976 (recursive? #t) ; for lzfse
977 (commit commit)))
978 (sha256
979 (base32
980 "0x2siy3cmnm9wsdfazg3xc8r3kbg73gijmnn1vjw33pp71ckylxr"))
981 (file-name (git-file-name name version))))
982 (build-system cmake-build-system)
983 (arguments
984 `(#:tests? #f ; No test suite
985 #:configure-flags
986 '("-DUSE_FUSE3=OFF") ; FUSE 3 is not packaged yet.
987 #:phases
988 (modify-phases %standard-phases
989 ;; No 'install' target in CMakeLists.txt
990 (replace 'install
991 (lambda* (#:key outputs #:allow-other-keys)
992 (let* ((out (assoc-ref outputs "out"))
993 (bin (string-append out "/bin"))
994 (lib (string-append out "/lib"))
995 (doc (string-append out "/share/doc/"
996 (string-append ,name "-" ,version))))
997 (install-file "apfs-dump" bin)
998 (install-file "apfs-dump-quick" bin)
999 (install-file "apfs-fuse" bin)
1000 (install-file "libapfs.a" lib)
1001 (install-file "../source/README.md" doc)
1002 #t))))))
1003 (inputs
1004 `(("bzip2" ,bzip2)
1005 ("fuse" ,fuse)
1006 ("zlib" ,zlib)))
1007 (synopsis "Read-only FUSE driver for the APFS file system")
1008 (description "APFS-FUSE is a read-only FUSE driver for the @dfn{Apple File
1009 System} (APFS). It is currently in an experimental state — it may not be able
1010 to read all files, and it does not support all the compression methods in
1011 APFS.")
1012 (home-page "https://github.com/sgan81/apfs-fuse")
1013 (license license:gpl2+))))
1014
1015 (define-public xfstests
1016 ;; The last release (1.1.0) is from 2011.
1017 (let ((revision "0")
1018 (commit "1c18b9ec2fcc94bd05ecdd136aa51c97bf3fa70d"))
1019 (package
1020 (name "xfstests")
1021 (version (git-version "1.1.0" revision commit))
1022 (source
1023 (origin
1024 (method git-fetch)
1025 (uri (git-reference
1026 (url "git://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git")
1027 (commit commit)))
1028 (file-name (git-file-name name version))
1029 (sha256
1030 (base32 "0rrv0rs9nhaza0jk5k0bj27w4lcd1s4a1ls8nr679qi02bgx630x"))))
1031 (build-system gnu-build-system)
1032 (arguments
1033 `(#:phases
1034 (modify-phases %standard-phases
1035 (add-after 'unpack 'patch-tool-locations
1036 (lambda* (#:key inputs #:allow-other-keys)
1037 (substitute* "common/config"
1038 ;; Make absolute file names relative.
1039 (("(MKFS_PROG=\").*(\")" _ pre post)
1040 (string-append pre "mkfs" post)))
1041 (for-each (lambda (file)
1042 (substitute* file
1043 (("( -s|#.|[= ])(/bin/sh|/bin/bash)" _ pre match)
1044 (string-append pre
1045 (assoc-ref inputs "bash")
1046 match))
1047 (("/bin/(rm|true)" match)
1048 (string-append (assoc-ref inputs "coreutils")
1049 match))
1050 (("/usr(/bin/time)" _ match)
1051 (string-append (assoc-ref inputs "time")
1052 match))))
1053 (append (find-files "common" ".*")
1054 (find-files "tests" ".*")
1055 (find-files "tools" ".*")
1056 (find-files "src" "\\.(c|sh)$")))))
1057 (replace 'bootstrap
1058 (lambda* (#:key make-flags #:allow-other-keys)
1059 (substitute* "Makefile"
1060 ;; Avoid a mysterious (to me) ‘permission denied’ error.
1061 (("cp ") "cp -f "))
1062 (substitute* "m4/package_utilies.m4"
1063 ;; Fix the bogus hard-coded paths for every single binary.
1064 (("(AC_PATH_PROG\\(.*, ).*(\\))" _ pre post)
1065 (string-append pre (getenv "PATH") post)))
1066 (apply invoke "make" "configure" make-flags)))
1067 (add-after 'install 'wrap-xfstests/check
1068 ;; Keep wrapping distinct from 'create-helper-script below: users
1069 ;; must be able to invoke xfstests/check directly if they prefer.
1070 (lambda* (#:key inputs outputs #:allow-other-keys)
1071 (let* ((out (assoc-ref outputs "out")))
1072 (wrap-program (string-append out "/xfstests/check")
1073 ;; Prefix the user's PATH with the minimum required tools.
1074 ;; The suite has many other optional dependencies and will
1075 ;; automatically select tests based on the original PATH.
1076 `("PATH" ":" prefix
1077 ,(map (lambda (name)
1078 (let ((input (assoc-ref inputs name)))
1079 (string-append input "/bin:"
1080 input "/sbin")))
1081 (list "acl"
1082 "attr"
1083 "coreutils"
1084 "inetutils"
1085 "xfsprogs")))))))
1086 (add-after 'install 'create-helper
1087 ;; Upstream installs only a ‘check’ script that's not in $PATH and
1088 ;; would try to write to the store without explaining how to change
1089 ;; that. Install a simple helper script to make it discoverable.
1090 (lambda* (#:key inputs outputs #:allow-other-keys)
1091 (let* ((out (assoc-ref outputs "out"))
1092 (check (string-append out "/xfstests/check"))
1093 (bin (string-append out "/bin"))
1094 (helper (string-append bin "/xfstests-check")))
1095 (mkdir-p bin)
1096 (with-output-to-file helper
1097 (lambda _
1098 (format #t "#!~a --no-auto-compile\n!#\n"
1099 (string-append (assoc-ref inputs "guile")
1100 "/bin/guile"))
1101 (write
1102 `(begin
1103 (define (try proc dir)
1104 "Try to PROC DIR. Return DIR on success, else #f."
1105 (with-exception-handler (const #f)
1106 (lambda _ (proc dir) dir)
1107 #:unwind? #t))
1108
1109 (define args
1110 (cdr (command-line)))
1111
1112 (when (or (member "--help" args)
1113 (member "-h" args))
1114 (format #t "Usage: ~a [OPTION]...
1115 This Guix helper sets up a new writable RESULT_BASE if it's unset, then executes
1116 xfstest's \"~a\" command (with any OPTIONs) as documented below.\n\n"
1117 ,(basename helper)
1118 ,(basename check)))
1119
1120 (let* ((gotenv-base (getenv "RESULT_BASE"))
1121 (base (or gotenv-base
1122 (let loop ((count 0))
1123 (or (try mkdir
1124 (format #f "xfstests.~a"
1125 count))
1126 (loop (+ 1 count))))))
1127 (result-base (if (string-prefix? "/" base)
1128 base
1129 (string-append (getcwd) "/"
1130 base))))
1131 (setenv "RESULT_BASE" result-base)
1132 ;; CHECK must run in its own directory or will fail.
1133 (chdir ,(dirname check))
1134 (let ((status
1135 (status:exit-val (apply system* ,check args))))
1136 (unless gotenv-base
1137 (try rmdir result-base))
1138 status))))))
1139 (chmod helper #o755)))))))
1140 (native-inputs
1141 `(("autoconf" ,autoconf)
1142 ("automake" ,automake)
1143 ("libtool" ,libtool)))
1144 (inputs
1145 `(("acl" ,acl)
1146 ("attr" ,attr)
1147 ("guile" ,guile-3.0) ; for our xfstests-check helper script
1148 ("inetutils" ,inetutils) ; for ‘hostname’
1149 ("libuuid" ,util-linux "lib")
1150 ("perl" ,perl) ; to automagically patch shebangs
1151 ("time" ,time)
1152 ("xfsprogs" ,xfsprogs)))
1153 (home-page "https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git")
1154 (synopsis "File system @acronym{QA, Quality Assurance} test suite")
1155 (description
1156 "The @acronym{FSQA, File System Quality Assurance} regression test suite,
1157 more commonly known as xfstests, comprises over 1,500 tests that exercise
1158 (@dfn{torture}) both the user- and kernel-space parts of many different file
1159 systems.
1160
1161 As the package's name subtly implies, it was originally developed to test the
1162 XFS file system. Today, xfstests is the primary test suite for all major file
1163 systems supported by the kernel Linux including XFS, ext4, and Btrfs, but also
1164 virtual and network file systems such as NFS, 9P, and the overlay file system.
1165
1166 The packaged @command{check} script is not in @env{PATH} but can be invoked
1167 with the included @command{xfstests-check} helper.")
1168 (license license:gpl2))))
1169
1170 (define-public zfs
1171 (package
1172 (name "zfs")
1173 (version "2.0.5")
1174 (outputs '("out" "module" "src"))
1175 (source
1176 (origin
1177 (method url-fetch)
1178 (uri (string-append "https://github.com/zfsonlinux/zfs/releases"
1179 "/download/zfs-" version
1180 "/zfs-" version ".tar.gz"))
1181 (sha256
1182 (base32 "1jbfm18hh9x4a9s5d7si8lapmq2aniphyriif9flrgsff26lj5rs"))))
1183 (build-system linux-module-build-system)
1184 (arguments
1185 `(;; The ZFS kernel module should not be downloaded since the license
1186 ;; terms don't allow for distributing it, only building it locally.
1187 #:substitutable? #f
1188 ;; Tests cannot run in an unprivileged build environment.
1189 #:tests? #f
1190 #:phases
1191 (modify-phases %standard-phases
1192 (add-after 'configure 'really-configure
1193 (lambda* (#:key outputs inputs #:allow-other-keys)
1194 (let ((out (assoc-ref outputs "out")))
1195 (substitute* "configure"
1196 (("-/bin/sh") (string-append "-" (which "sh"))))
1197 (invoke "./configure"
1198 "--with-config=all"
1199 (string-append "--prefix=" out)
1200 (string-append "--with-dracutdir=" out "/lib/dracut")
1201 (string-append "--with-udevdir=" out "/lib/udev")
1202 (string-append "--with-mounthelperdir=" out "/sbin")
1203 (string-append "--with-linux="
1204 (assoc-ref inputs "linux-module-builder")
1205 "/lib/modules/build")))))
1206 (add-after 'unpack 'patch-source
1207 (lambda* (#:key inputs outputs #:allow-other-keys)
1208 (let ((out (assoc-ref outputs "out"))
1209 (src (assoc-ref outputs "src"))
1210 (util-linux (assoc-ref inputs "util-linux"))
1211 (nfs-utils (assoc-ref inputs "nfs-utils"))
1212 (kmod (assoc-ref inputs "kmod-runtime")))
1213 (substitute* "etc/Makefile.in"
1214 ;; This just contains an example configuration file for
1215 ;; configuring ZFS on traditional init systems, skip it
1216 ;; since we cannot use it anyway; the install target becomes
1217 ;; misdirected.
1218 (("= default ") "= "))
1219 (substitute* "lib/libzfs/os/linux/libzfs_util_os.c"
1220 ;; Use path to /gnu/store/*-kmod in actual path that is exec'ed.
1221 (("\"/sbin/modprobe\"")
1222 (string-append "\"" kmod "/bin/modprobe" "\""))
1223 ;; Just use 'modprobe' in message to user, since Guix
1224 ;; does not have a traditional /sbin/
1225 (("'/sbin/modprobe ") "'modprobe "))
1226 (substitute* "contrib/Makefile.in"
1227 ;; This is not configurable nor is its hard-coded /usr prefix.
1228 ((" initramfs") ""))
1229 (substitute* "module/os/linux/zfs/zfs_ctldir.c"
1230 (("/usr/bin/env\", \"umount")
1231 (string-append util-linux "/bin/umount\", \"-n"))
1232 (("/usr/bin/env\", \"mount")
1233 (string-append util-linux "/bin/mount\", \"-n")))
1234 (substitute* "lib/libzfs/os/linux/libzfs_mount_os.c"
1235 (("/bin/mount") (string-append util-linux "/bin/mount"))
1236 (("/bin/umount") (string-append util-linux "/bin/umount")))
1237 (substitute* "lib/libshare/os/linux/nfs.c"
1238 (("/usr/sbin/exportfs")
1239 (string-append nfs-utils "/sbin/exportfs")))
1240 (substitute* "config/zfs-build.m4"
1241 (("\\$sysconfdir/init.d") (string-append out "/etc/init.d")))
1242 (substitute* '("etc/zfs/Makefile.am"
1243 "cmd/zed/Makefile.am")
1244 (("\\$\\(sysconfdir)") (string-append out "/etc")))
1245 (substitute* "cmd/vdev_id/vdev_id"
1246 (("PATH=/bin:/sbin:/usr/bin:/usr/sbin")
1247 (string-append "PATH="
1248 (dirname (which "chmod")) ":"
1249 (dirname (which "grep")) ":"
1250 (dirname (which "sed")) ":"
1251 (dirname (which "gawk")))))
1252 (substitute* "contrib/pyzfs/Makefile.in"
1253 ((".*install-lib.*") ""))
1254 (substitute* '("Makefile.am" "Makefile.in")
1255 (("\\$\\(prefix)/src") (string-append src "/src")))
1256 (substitute* (find-files "udev/rules.d/" ".rules.in$")
1257 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))))
1258 #t))
1259 (replace 'build
1260 (lambda _ (invoke "make")))
1261 (replace 'install
1262 (lambda* (#:key outputs inputs native-inputs #:allow-other-keys)
1263 (let* ((out (assoc-ref outputs "out"))
1264 (moddir (assoc-ref outputs "module"))
1265 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
1266 (invoke "make" "install"
1267 (string-append "DEFAULT_INITCONF_DIR=" out "/etc/default")
1268 (string-append "DEPMOD=" kmod "/bin/depmod")
1269 (string-append "INSTALL_PATH=" out)
1270 (string-append "INSTALL_MOD_PATH=" moddir)
1271 "INSTALL_MOD_STRIP=1")
1272 (install-file "contrib/bash_completion.d/zfs"
1273 (string-append out "/share/bash-completion/completions"))
1274 #t))))))
1275 (native-inputs
1276 `(("attr" ,attr)
1277 ("kmod" ,kmod)
1278 ("pkg-config" ,pkg-config)))
1279 (inputs
1280 `(("eudev" ,eudev)
1281 ("kmod-runtime" ,kmod)
1282 ("libaio" ,libaio)
1283 ("libtirpc" ,libtirpc)
1284 ("nfs-utils" ,nfs-utils)
1285 ("openssl" ,openssl)
1286 ("python" ,python)
1287 ("python-cffi" ,python-cffi)
1288 ("util-linux" ,util-linux)
1289 ("util-linux:lib" ,util-linux "lib")
1290 ("zlib" ,zlib)))
1291 (home-page "https://zfsonlinux.org/")
1292 (synopsis "OpenZFS on Linux")
1293 (description
1294 "OpenZFS is an advanced file system and volume manager which was
1295 originally developed for Solaris and is now maintained by the OpenZFS
1296 community.")
1297 (license license:cddl1.0)))
1298
1299 (define-public zfs-auto-snapshot
1300 (package
1301 (name "zfs-auto-snapshot")
1302 (version "1.2.4")
1303 (source
1304 (origin
1305 (method git-fetch)
1306 (uri (git-reference
1307 (url
1308 (string-append "https://github.com/zfsonlinux/" name))
1309 (commit
1310 (string-append "upstream/" version))))
1311 (file-name (git-file-name name version))
1312 (sha256
1313 (base32 "0m4xw7h5qlbn5zdf9wb137pcr5l7hyrr7w2dgr16dfm5ay64vvfq"))))
1314 (build-system gnu-build-system)
1315 (inputs
1316 ;; Note: if you are inheriting from the above zfs package in order
1317 ;; to provide a specific stable kernel version, you should also
1318 ;; inherit this package and replace the sole input below.
1319 `(("zfs" ,zfs)))
1320 (arguments
1321 `(#:tests? #f ; No tests
1322 #:phases
1323 (modify-phases %standard-phases
1324 (delete 'configure)
1325 (delete 'build)
1326 ;; Guix System may not have a traditional cron system, but
1327 ;; the cron scripts installed by this package are convenient
1328 ;; to use as targets for an mcron job specification, so make
1329 ;; sure they can be run in-store.
1330 (add-before 'install 'fix-scripts
1331 (lambda* (#:key outputs inputs #:allow-other-keys)
1332 (let* ((out (assoc-ref outputs "out"))
1333 (zfs-auto-snapshot (string-append
1334 out
1335 "/sbin/zfs-auto-snapshot"))
1336 (zfs-package (assoc-ref inputs "zfs"))
1337 (zpool (string-append
1338 zfs-package
1339 "/sbin/zpool"))
1340 (zfs (string-append
1341 zfs-package
1342 "/sbin/zfs")))
1343 (substitute* '("etc/zfs-auto-snapshot.cron.daily"
1344 "etc/zfs-auto-snapshot.cron.frequent"
1345 "etc/zfs-auto-snapshot.cron.hourly"
1346 "etc/zfs-auto-snapshot.cron.monthly"
1347 "etc/zfs-auto-snapshot.cron.weekly")
1348 (("zfs-auto-snapshot")
1349 zfs-auto-snapshot))
1350 (substitute* "src/zfs-auto-snapshot.sh"
1351 (("LC_ALL=C zfs list")
1352 (string-append "LC_ALL=C " zfs " list"))
1353 (("LC_ALL=C zpool status")
1354 (string-append "LC_ALL=C " zpool " status"))
1355 (("zfs snapshot")
1356 (string-append zfs " snapshot"))
1357 (("zfs destroy")
1358 (string-append zfs " destroy"))))))
1359 ;; Provide DESTDIR and PREFIX on make command.
1360 (replace 'install
1361 (lambda* (#:key outputs #:allow-other-keys)
1362 (let ((out (assoc-ref outputs "out")))
1363 (invoke "make" "install"
1364 "PREFIX="
1365 (string-append "DESTDIR=" out)))
1366 #t)))))
1367 (home-page "https://github.com/zfsonlinux/zfs-auto-snapshot")
1368 (synopsis "Automatically create, rotate and destroy ZFS snapshots")
1369 (description "An alternative implementation of the zfs-auto-snapshot
1370 service for Linux that is compatible with zfs-linux (now OpenZFS) and
1371 zfs-fuse.
1372
1373 On Guix System, you will need to invoke the included shell scripts as
1374 @code{job} definitions in your @code{operating-system} declaration.")
1375 (license license:gpl2+)))
1376
1377 (define-public mergerfs
1378 (package
1379 (name "mergerfs")
1380 (version "2.32.6")
1381 (source
1382 (origin
1383 (method url-fetch)
1384 (uri (string-append "https://github.com/trapexit/mergerfs/"
1385 "releases/download/" version "/"
1386 "mergerfs-" version ".tar.gz"))
1387 (sha256
1388 (base32 "08gwi094ll0b7nf2i44fyjxiyvr45rp766npbdyw0yzyigas8a2f"))))
1389 (build-system gnu-build-system)
1390 (arguments
1391 `(#:tests? #f ; No tests exist.
1392 #:phases
1393 (modify-phases %standard-phases
1394 (delete 'configure)
1395 (add-after 'unpack 'fix-paths
1396 (lambda* (#:key inputs outputs #:allow-other-keys)
1397 (setenv "CC" "gcc")
1398 ;; These were copied from the package libfuse.
1399 (substitute* '("libfuse/lib/mount_util.c" "libfuse/util/mount_util.c")
1400 (("/bin/(u?)mount" _ maybe-u)
1401 (string-append (assoc-ref inputs "util-linux")
1402 "/bin/" maybe-u "mount")))
1403 (substitute* '("libfuse/util/mount.mergerfs.c")
1404 (("/bin/sh")
1405 (which "sh")))
1406 ;; The Makefile does not allow overriding PREFIX via make variables.
1407 (substitute* '("Makefile" "libfuse/Makefile")
1408 (("= /usr/local") (string-append "= " (assoc-ref outputs "out")))
1409 (("= /sbin") "= $(EXEC_PREFIX)/sbin")
1410 ;; cannot chown as build user
1411 (("chown root(:root)?") "true"))
1412 #t)))))
1413 ;; mergerfs bundles a heavily modified copy of libfuse.
1414 (inputs `(("util-linux" ,util-linux)))
1415 (home-page "https://github.com/trapexit/mergerfs")
1416 (synopsis "Featureful union file system")
1417 (description "mergerfs is a union file system geared towards simplifying
1418 storage and management of files across numerous commodity storage devices. It
1419 is similar to mhddfs, unionfs, and aufs.")
1420 (license (list
1421 license:isc ; mergerfs
1422 license:gpl2 license:lgpl2.0 ; Imported libfuse code.
1423 ))))
1424
1425 (define-public mergerfs-tools
1426 (let ((commit "480296ed03d1c3c7909697d7ef96d35840ee26b8")
1427 (revision "2"))
1428 (package
1429 (name "mergerfs-tools")
1430 ;; No released version exists.
1431 (version (git-version "0.0" revision commit))
1432 (source
1433 (origin
1434 (method git-fetch)
1435 (uri (git-reference
1436 (url "https://github.com/trapexit/mergerfs-tools")
1437 (commit commit)))
1438 (file-name (git-file-name name version))
1439 (sha256
1440 (base32
1441 "0xr06gi4xcr832rzy0hkp5c1n231s7w5iq1nkjvx9kvm0dl7chpq"))))
1442 (build-system copy-build-system)
1443 (inputs
1444 `(("python" ,python)
1445 ("python-xattr" ,python-xattr)
1446 ("rsync" ,rsync)))
1447 (arguments
1448 '(#:install-plan
1449 '(("src/" "bin/"))
1450 #:phases
1451 (modify-phases %standard-phases
1452 (add-after 'unpack 'patch-paths
1453 (lambda* (#:key inputs #:allow-other-keys)
1454 (substitute* (find-files "src" "^mergerfs\\.")
1455 (("'rsync'")
1456 (string-append "'" (assoc-ref inputs "rsync") "/bin/rsync'"))
1457 (("'rm'")
1458 (string-append "'" (assoc-ref inputs "coreutils") "/bin/rm'")))
1459 (substitute* "src/mergerfs.mktrash"
1460 (("xattr")
1461 (string-append (assoc-ref inputs "python-xattr") "/bin/xattr"))
1462 (("mkdir")
1463 (string-append (assoc-ref inputs "coreutils") "/bin/mkdir")))
1464 #t)))))
1465 (synopsis "Tools to help manage data in a mergerfs pool")
1466 (description "mergerfs-tools is a suite of programs that can audit
1467 permissions and ownership of files and directories on a mergerfs volume,
1468 duplicates files and directories across branches in its pool, find and remove
1469 duplicate files, balance pool drives, consolidate files in a single mergerfs
1470 directory onto a single drive and create FreeDesktop.org Trash specification
1471 compatible directories.")
1472 (home-page "https://github.com/trapexit/mergerfs-tools")
1473 (license license:isc))))
1474
1475 (define-public python-dropbox
1476 (package
1477 (name "python-dropbox")
1478 (version "11.5.0")
1479 (source
1480 (origin
1481 (method url-fetch)
1482 (uri (pypi-uri "dropbox" version))
1483 (sha256
1484 (base32
1485 "16bxx9xqx2s4d9khrw57a0bj4q7nc6kq355wl4pfddn9cqvh9rg2"))))
1486 (build-system python-build-system)
1487 (arguments '(#:tests? #f)) ; Tests require a network connection.
1488 (native-inputs
1489 `(("python-pytest" ,python-pytest)
1490 ("python-pytest-runner" ,python-pytest-runner)))
1491 (propagated-inputs
1492 `(("python-certifi" ,python-certifi)
1493 ("python-chardet" ,python-chardet)
1494 ("python-requests" ,python-requests)
1495 ("python-six" ,python-six)
1496 ("python-stone" ,python-stone)
1497 ("python-urllib3" ,python-urllib3)))
1498 (home-page "https://www.dropbox.com/developers")
1499 (synopsis "Official Dropbox API Client")
1500 (description "This package provides a Python SDK for integrating with the
1501 Dropbox API v2.")
1502 (license license:expat)))
1503
1504 (define-public dbxfs
1505 (package
1506 (name "dbxfs")
1507 (version "1.0.51")
1508 (source
1509 (origin
1510 (method url-fetch)
1511 (uri (pypi-uri "dbxfs" version))
1512 (sha256
1513 (base32
1514 "1zz82d0mnql55397x4jx7z5rn857rf9zhjv895j93wpxdq10xwvk"))
1515 (patches (search-patches "dbxfs-remove-sentry-sdk.patch"))))
1516 (build-system python-build-system)
1517 (arguments
1518 '(#:tests? #f)) ; tests requires safefs
1519 (propagated-inputs
1520 `(("python-appdirs" ,python-appdirs)
1521 ("python-block-tracing" ,python-block-tracing)
1522 ("python-dropbox" ,python-dropbox)
1523 ("python-keyring" ,python-keyring)
1524 ("python-keyrings.alt" ,python-keyrings.alt)
1525 ("python-privy" ,python-privy)
1526 ("python-userspacefs" ,python-userspacefs)))
1527 (home-page "https://github.com/rianhunter/dbxfs")
1528 (synopsis "User-space file system for Dropbox")
1529 (description
1530 "@code{dbxfs} allows you to mount your Dropbox folder as if it were a
1531 local file system using FUSE.")
1532 (license license:gpl3+)))
1533
1534 (define-public go-github-com-hanwen-fuse
1535 (package
1536 (name "go-github-com-hanwen-fuse")
1537 (version "2.0.3")
1538 (source
1539 (origin
1540 (method git-fetch)
1541 (uri (git-reference
1542 (url "https://github.com/hanwen/go-fuse")
1543 (commit (string-append "v" version))))
1544 (file-name (git-file-name name version))
1545 (sha256
1546 (base32
1547 "1y44d08fxyis99s6jxdr6dbbw5kv3wb8lkhq3xmr886i4w41lz03"))))
1548 (build-system go-build-system)
1549 (arguments
1550 `(#:import-path "github.com/hanwen/go-fuse"))
1551 (propagated-inputs
1552 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)))
1553 (home-page "https://github.com/hanwen/go-fuse")
1554 (synopsis "FUSE bindings for Go")
1555 (description
1556 "This package provides Go native bindings for the FUSE kernel module.")
1557 (license license:bsd-3)))
1558
1559 (define-public rewritefs
1560 (let ((revision "0")
1561 ;; This is the last commit supporting our fuse@2.
1562 (commit "31e2810b596028a12e49a08664567755f4b387b2"))
1563 (package
1564 (name "rewritefs")
1565 (version (git-version "0.0.0" revision commit))
1566 (source
1567 (origin
1568 (method git-fetch)
1569 (uri (git-reference
1570 (url "https://github.com/sloonz/rewritefs")
1571 (commit commit)))
1572 (file-name (git-file-name name version))
1573 (sha256
1574 (base32 "0k1aas2bdq2l3a6q3fvmngpakcxiws8qny2w6z7ffngyqxh33fv7"))))
1575 (build-system gnu-build-system)
1576 (arguments
1577 `(#:modules ((srfi srfi-26)
1578 ,@%gnu-build-system-modules)
1579 #:make-flags
1580 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
1581 #:test-target "test"
1582 #:tests? #f ; all require a kernel with FUSE loaded
1583 #:phases
1584 (modify-phases %standard-phases
1585 (delete 'configure) ; no configure script
1586 (add-after 'install 'install-examples
1587 (lambda* (#:key outputs #:allow-other-keys)
1588 (let* ((out (assoc-ref outputs "out"))
1589 (doc (string-append out "/share/doc/" ,name "-" ,version)))
1590 (for-each (cut install-file <> (string-append doc "/examples"))
1591 (find-files "." "^config\\."))))))))
1592 (native-inputs
1593 `(("pkg-config" ,pkg-config)))
1594 (inputs
1595 `(("fuse" ,fuse)
1596 ("pcre" ,pcre)))
1597 (home-page "https://github.com/sloonz/rewritefs")
1598 (synopsis "FUSE file system that changes particular file names")
1599 (description
1600 "RewriteFS is a @acronym{FUSE, File system in USEr space} to change the
1601 name of accessed files on the fly based on any number of regular expressions.
1602 It's like the @code{rewrite} action of many Web servers, but for your file
1603 system. For example, it can help keep your home directory tidy by transparently
1604 rewriting the location of configuration files of software that doesn't follow
1605 the XDG directory specification from @file{~/.@var{name}} to
1606 @file{~/.config/@var{name}}.")
1607 (license license:gpl2+))))
1608
1609 (define-public tmsu
1610 (package
1611 (name "tmsu")
1612 (version "0.7.5")
1613 (source
1614 (origin
1615 (method git-fetch)
1616 (uri (git-reference
1617 (url "https://github.com/oniony/TMSU")
1618 (commit (string-append "v" version))))
1619 (file-name (git-file-name name version))
1620 (sha256
1621 (base32
1622 "0834hah7p6ad81w60ifnxyh9zn09ddfgrll04kwjxwp7ypbv38wq"))))
1623 (build-system go-build-system)
1624 (arguments
1625 `(#:import-path "github.com/oniony/TMSU"
1626 #:unpack-path ".."
1627 #:install-source? #f
1628 #:phases
1629 (modify-phases %standard-phases
1630 (add-after 'install 'post-install
1631 (lambda* (#:key outputs #:allow-other-keys)
1632 (let ((out (assoc-ref outputs "out")))
1633 ;; The go build system produces /bin/TMSU -> install as /bin/tmsu
1634 (rename-file (string-append out "/bin/TMSU")
1635 (string-append out "/bin/tmsu"))))))))
1636 (inputs
1637 `(("go-github-com-mattn-go-sqlite3" ,go-github-com-mattn-go-sqlite3)
1638 ("go-github-com-hanwen-fuse" ,go-github-com-hanwen-fuse)))
1639 (home-page "https://github.com/oniony/TMSU")
1640 (synopsis "Tag files and access them through a virtual file system")
1641 (description
1642 "TMSU is a tool for tagging your files. It provides a simple
1643 command-line utility for applying tags and a virtual file system to give you a
1644 tag-based view of your files from any other program. TMSU does not alter your
1645 files in any way: they remain unchanged on disk, or on the network, wherever
1646 your put them. TMSU maintains its own database and you simply gain an
1647 additional view, which you can mount where you like, based upon the tags you
1648 set up.")
1649 (license license:gpl3+)))
1650
1651 (define-public udftools
1652 (package
1653 (name "udftools")
1654 (version "2.3")
1655 (source (origin
1656 (method git-fetch)
1657 (uri (git-reference
1658 (url "https://github.com/pali/udftools")
1659 (commit version)))
1660 (sha256
1661 (base32
1662 "1nl2s61znyzaap23zhbdg3znj6l6akr313fchn5wwvjzj8k70is9"))
1663 (file-name (git-file-name name version))))
1664 (build-system gnu-build-system)
1665 (arguments
1666 `(#:configure-flags
1667 (list (string-append "--docdir=" (assoc-ref %outputs "out")
1668 "/share/doc/" ,name "-" ,version))))
1669 (native-inputs
1670 `(("automake" ,automake)
1671 ("autoconf" ,autoconf)
1672 ("libtool" ,libtool)
1673 ("pkg-config" ,pkg-config)))
1674 (home-page "https://github.com/pali/udftools")
1675 (synopsis "Tools to manage UDF file systems and DVD/CD-R(W) drives")
1676 (description "@code{udftools} is a set of programs for reading
1677 and modifying @acronym{UDF, Universal Disk Format} file systems.
1678 @acronym{UDF, Universal Disk Format} is a file system mostly used for DVDs
1679 and other optical media. It supports read-only media (DVD/CD-R)
1680 and rewritable media that wears out (DVD/CD-RW).")
1681 (license license:gpl2+)))