Merge remote-tracking branch 'origin/staging-next' into staging
[jackhill/guix/guix.git] / gnu / packages / file-systems.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
3 ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
4 ;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2018 Leo Famulari <leo@famulari.name>
6 ;;; Copyright © 2019, 2020 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 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
16 ;;;
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25 (define-module (gnu packages file-systems)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix git-download)
30 #:use-module (guix build-system cmake)
31 #:use-module (guix build-system copy)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system linux-module)
34 #:use-module (guix build-system python)
35 #:use-module (guix build-system trivial)
36 #:use-module (guix utils)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages acl)
39 #:use-module (gnu packages attr)
40 #:use-module (gnu packages autotools)
41 #:use-module (gnu packages bison)
42 #:use-module (gnu packages check)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages crypto)
45 #:use-module (gnu packages curl)
46 #:use-module (gnu packages cyrus-sasl)
47 #:use-module (gnu packages datastructures)
48 #:use-module (gnu packages documentation)
49 #:use-module (gnu packages docbook)
50 #:use-module (gnu packages flex)
51 #:use-module (gnu packages glib)
52 #:use-module (gnu packages gnupg)
53 #:use-module (gnu packages kerberos)
54 #:use-module (gnu packages libffi)
55 #:use-module (gnu packages linux)
56 #:use-module (gnu packages nfs)
57 #:use-module (gnu packages onc-rpc)
58 #:use-module (gnu packages openldap)
59 #:use-module (gnu packages photo)
60 #:use-module (gnu packages pkg-config)
61 #:use-module (gnu packages python)
62 #:use-module (gnu packages python-crypto)
63 #:use-module (gnu packages python-web)
64 #:use-module (gnu packages python-xyz)
65 #:use-module (gnu packages readline)
66 #:use-module (gnu packages rsync)
67 #:use-module (gnu packages sssd)
68 #:use-module (gnu packages sqlite)
69 #:use-module (gnu packages tls)
70 #:use-module (gnu packages valgrind)
71 #:use-module (gnu packages xml))
72
73 (define-public autofs
74 (package
75 (name "autofs")
76 (version "5.1.6")
77 (source
78 (origin
79 (method url-fetch)
80 (uri (string-append "mirror://kernel.org/linux/daemons/autofs/"
81 "v" (version-major version) "/"
82 "autofs-" version ".tar.xz"))
83 (sha256
84 (base32 "1vya21mb4izj3khcr3flibv7xc15vvx2v0rjfk5yd31qnzcy7pnx"))))
85 (build-system gnu-build-system)
86 (arguments
87 `(#:configure-flags
88 (list "--enable-ignore-busy" ; during shutdown
89 "--enable-sloppy-mount" ; support mount(8) -s
90 "--with-libtirpc"
91 (string-append "--with-openldap="
92 (assoc-ref %build-inputs "openldap"))
93 (string-append "--with-sasl="
94 (assoc-ref %build-inputs "cyrus-sasl"))
95 "HAVE_SSS_AUTOFS=1" ; required to make sssldir click
96 (string-append "sssldir="
97 (assoc-ref %build-inputs "sssd")
98 "/lib/sssd/modules"))
99 #:tests? #f ; no test suite
100 #:phases
101 (modify-phases %standard-phases
102 (add-before 'configure 'fix-hard-coded-search-path
103 (lambda _
104 (substitute* "configure"
105 (("^searchpath=\".*\"")
106 "searchpath=\"$PATH\""))
107 #t))
108 (add-before 'install 'omit-obsolete-lookup_nis.so-link
109 ;; Building lookup_yp.so depends on $(YPCLNT) but this doesn't,
110 ;; leading to a make error. Since it's broken, comment it out.
111 (lambda _
112 (substitute* "modules/Makefile"
113 (("ln -fs lookup_yp.so" match)
114 (string-append "# " match)))
115 #t)))))
116 (native-inputs
117 `(("bison" ,bison)
118 ("flex" ,flex)
119 ("pkg-config" ,pkg-config)
120 ("rpcsvc-proto" ,rpcsvc-proto)))
121 (inputs
122 `(("cyrus-sasl" ,cyrus-sasl)
123 ("e2fsprogs" ,e2fsprogs) ; for e[234]fsck
124 ("libtirpc" ,libtirpc)
125 ("libxml2" ,libxml2) ; needed for LDAP, SASL
126 ("mit-krb5" ,mit-krb5) ; needed for LDAP, SASL
127 ("nfs-utils" ,nfs-utils) ; for mount.nfs
128 ("openldap" ,openldap)
129 ("openssl" ,openssl) ; needed for SASL
130 ("sssd" ,sssd)
131 ("util-linux" ,util-linux))) ; for mount, umount
132 ;; XXX A directory index is the closest thing this has to a home page.
133 (home-page "https://www.kernel.org/pub/linux/daemons/autofs/")
134 (synopsis "Kernel-based automounter for Linux")
135 (description
136 "Autofs is a kernel-based automounter for use with the Linux autofs4
137 module. It automatically mounts selected file systems when they are used and
138 unmounts them after a set period of inactivity. This provides
139 centrally-managed, consistent file names for users and applications, even in a
140 large and/or frequently changing (network) environment.")
141 ;; fedfs/ is GPL-2-only but not built.
142 (license (list license:bsd-3 ; modules/cyrus-sasl.c
143 license:gpl2+)))) ; the rest
144
145 (define-public bindfs
146 (package
147 (name "bindfs")
148 (version "1.14.8")
149 (source (origin
150 (method url-fetch)
151 (uri (string-append "https://bindfs.org/downloads/bindfs-"
152 version ".tar.gz"))
153 (sha256
154 (base32
155 "15y4brlcrqhxl6z73785m0dr1vp2q3wc6xss08x9jjr0apzmmjp5"))))
156 (build-system gnu-build-system)
157 (arguments
158 ;; XXX: The tests have no hope of passing until there is a "nogroup"
159 ;; entry (or at least some group to which the guix builder does
160 ;; not belong) in the /etc/group file of the build environment.
161 ;; Currently we do not have such a group. Disable tests for now.
162 '(#:tests? #f))
163 (native-inputs
164 ;; Native inputs to run the tests
165 ;; ("ruby" ,ruby)
166 ;; ("valgrind" ,valgrind)
167 ;; ("which" ,which)
168 `(("pkg-config" ,pkg-config)))
169 (inputs
170 `(("fuse" ,fuse)))
171 (home-page "https://bindfs.org")
172 (synopsis "Bind mount a directory and alter permission bits")
173 (description
174 "@command{bindfs} is a FUSE filesystem for mounting a directory to
175 another location, similar to @command{mount --bind}. It can be used for:
176 @itemize
177 @item Making a directory read-only.
178 @item Making all executables non-executable.
179 @item Sharing a directory with a list of users (or groups).
180 @item Modifying permission bits using rules with chmod-like syntax.
181 @item Changing the permissions with which files are created.
182 @end itemize ")
183 (license license:gpl2+)))
184
185 (define-public fsarchiver
186 (package
187 (name "fsarchiver")
188 (version "0.8.5")
189 (source
190 (origin
191 (method git-fetch)
192 (uri
193 (git-reference
194 (url "https://github.com/fdupoux/fsarchiver")
195 (commit version)))
196 (file-name (git-file-name name version))
197 (sha256
198 (base32 "1rvwq5v3rl14bqxjm1ibfapyicf0sa44nw7451v10kx39lp56ylp"))))
199 (build-system gnu-build-system)
200 (native-inputs
201 `(("autoconf" ,autoconf)
202 ("automake" ,automake)
203 ("pkg-config" ,pkg-config)))
204 (inputs
205 `(("bzip2" ,bzip2)
206 ("e2fsprogs" ,e2fsprogs)
207 ("libgcrypt" ,libgcrypt)
208 ("lz4" ,lz4)
209 ("lzo" ,lzo)
210 ("util-linux" ,util-linux "lib")
211 ("xz" ,xz)
212 ("zlib" ,zlib)
213 ("zstd:lib" ,zstd "lib")))
214 (synopsis "File system back-up, deployment, and migration tool")
215 (description
216 "FSArchiver saves the contents of a file system to a compressed archive
217 file, and restores it to a different file system and/or partition. This
218 partition can be of a different size than the original and FSArchiver will
219 create a new file system if none exists.
220
221 All standard file attributes supported by the kernel are preserved, including
222 file permissions, timestamps, symbolic and hard links, and extended attributes.
223
224 Each file in the archive is protected by a checksum. If part of the archive
225 is corrupted you'll lose the affected file(s) but not the whole back-up.")
226 (home-page "https://www.fsarchiver.org/")
227 (license license:gpl2)))
228
229 (define-public gphotofs
230 (package
231 (name "gphotofs")
232 (version "0.5.0")
233 (source
234 (origin
235 (method url-fetch)
236 (uri
237 (string-append "mirror://sourceforge/gphoto/gphotofs/" version
238 "/gphotofs-0.5.tar.gz"))
239 (sha256
240 (base32
241 "04slwhr6ap9xcc27wphk22ad8yn79ngyy5z10lxams3k5liahvc2"))))
242 (build-system gnu-build-system)
243 (native-inputs
244 `(("pkg-config" ,pkg-config)))
245 (inputs
246 `(("fuse" ,fuse)
247 ("glib" ,glib)
248 ("libgphoto2" ,libgphoto2)))
249 (synopsis "Virtual file system for libgphoto2 using FUSE")
250 (description "GPhotoFS is a FUSE file system module to mount your camera as
251 a file system on Linux. This allow using your camera with any tool able to read
252 from a mounted file system.")
253 (home-page "http://www.gphoto.org/proj/gphotofs/")
254 (license license:gpl2+)))
255
256 (define-public bcachefs-tools
257 (let ((commit "742dbbdbb90efb786f05a8576917fcd0e9cbd57e")
258 (revision "1"))
259 (package
260 (name "bcachefs-tools")
261 (version (git-version "0.1" revision commit))
262 (source
263 (origin
264 (method git-fetch)
265 (uri (git-reference
266 (url "https://evilpiepirate.org/git/bcachefs-tools.git")
267 (commit commit)))
268 (file-name (git-file-name name version))
269 (sha256
270 (base32 "0kn8y3kqylz6scv47mzfmwrlh21kbb14z5vs65vks8w50i26sxnc"))))
271 (build-system gnu-build-system)
272 (arguments
273 `(#:make-flags
274 (list ,(string-append "VERSION=" version) ; bogus vX.Y-nogit otherwise
275 (string-append "PREFIX=" (assoc-ref %outputs "out"))
276 "INITRAMFS_DIR=$(PREFIX)/share/initramfs-tools"
277 "CC=gcc"
278 "PYTEST=pytest")
279 #:phases
280 (modify-phases %standard-phases
281 (delete 'configure)) ; no configure script
282 #:tests? #f)) ; XXX 6 valgrind tests fail
283 (native-inputs
284 `(("pkg-config" ,pkg-config)
285
286 ;; For tests.
287 ("python-pytest" ,python-pytest)
288 ("valgrind" ,valgrind)))
289 (inputs
290 `(("eudev" ,eudev)
291 ("keyutils" ,keyutils)
292 ("libaio" ,libaio)
293 ("libscrypt" ,libscrypt)
294 ("libsodium" ,libsodium)
295 ("liburcu" ,liburcu)
296 ("util-linux" ,util-linux "lib") ; lib{blkid,uuid}
297 ("lz4" ,lz4)
298 ("zlib" ,zlib)
299 ("zstd:lib" ,zstd "lib")))
300 (home-page "https://bcachefs.org/")
301 (synopsis "Tools to create and manage bcachefs file systems")
302 (description
303 "The bcachefs-tools are command-line utilities for creating, checking,
304 and otherwise managing bcachefs file systems.
305
306 Bcachefs is a @acronym{CoW, copy-on-write} file system supporting native
307 encryption, compression, snapshots, and (meta)data checksums. It can use
308 multiple block devices for replication and/or performance, similar to RAID.
309
310 In addition, bcachefs provides all the functionality of bcache, a block-layer
311 caching system, and lets you assign different roles to each device based on its
312 performance and other characteristics.")
313 (license license:gpl2+))))
314
315 (define-public exfatprogs
316 (package
317 (name "exfatprogs")
318 (version "1.0.4")
319 (source
320 (origin
321 (method git-fetch)
322 (uri (git-reference
323 (url "https://github.com/exfatprogs/exfatprogs")
324 (commit version)))
325 (file-name (git-file-name name version))
326 (sha256
327 (base32 "1braffz1wc4ki3nb42q85l5zg2dl2hwjr64rk27nc85wcsrbavnl"))))
328 (build-system gnu-build-system)
329 (arguments
330 `(#:configure-flags
331 (list "--disable-static")))
332 (native-inputs
333 `(("autoconf" ,autoconf)
334 ("automake" ,automake)
335 ("libtool" ,libtool)
336 ("pkg-config" ,pkg-config)))
337 (home-page "https://github.com/exfatprogs/exfatprogs")
338 (synopsis "Tools to create, check, and repair exFAT file systems")
339 (description
340 "These are command-line user space tools for the @acronym{exFAT,
341 Extensible File Allocation Table} file systems. Included are
342 @command{mkfs.exfat} to create (format) new exFAT file systems, and
343 @command{fsck.exfat} to check their consistency and repair them.")
344 (license license:gpl2+)))
345
346 (define-public httpfs2
347 (package
348 (name "httpfs2")
349 (version "0.1.5")
350 (source
351 (origin
352 (method url-fetch)
353 (uri (string-append "mirror://sourceforge/httpfs/httpfs2/"
354 "httpfs2-" version ".tar.gz"))
355 (sha256
356 (base32
357 "1h8ggvhw30n2r6w11n1s458ypggdqx6ldwd61ma4yd7binrlpjq1"))))
358 (build-system gnu-build-system)
359 (native-inputs
360 `(("asciidoc" ,asciidoc)
361 ("docbook-xml" ,docbook-xml)
362 ("libxml2" ,libxml2)
363 ("libxslt" ,libxslt)
364 ("pkg-config" ,pkg-config)))
365 (inputs
366 `(("fuse" ,fuse)
367 ("gnutls" ,gnutls)))
368 (arguments
369 `(#:phases
370 (modify-phases %standard-phases
371 (delete 'configure) ; no configure script
372 (replace 'install
373 ;; There's no ‘install’ target. Install all variants manually.
374 (lambda* (#:key outputs #:allow-other-keys)
375 (let* ((out (assoc-ref outputs "out"))
376 (bin (string-append out "/bin"))
377 (man1 (string-append out "/share/man/man1")))
378 (mkdir-p bin)
379 (mkdir-p man1)
380 (for-each
381 (lambda (variant)
382 (let ((man1-page (string-append variant ".1")))
383 (install-file variant bin)
384 (install-file man1-page man1)))
385 (list "httpfs2"
386 "httpfs2-mt"
387 "httpfs2-ssl"
388 "httpfs2-ssl-mt")))
389 #t)))
390 #:make-flags (list "CC=gcc")
391 #:parallel-build? #f ; can result in missing man pages
392 #:tests? #f)) ; no tests
393 (home-page "https://sourceforge.net/projects/httpfs/")
394 (synopsis "Mount remote files over HTTP")
395 (description "httpfs2 is a @code{fuse} file system for mounting any
396 @dfn{HyperText} (HTTP or HTTPS) URL. It uses HTTP/1.1 byte ranges to request
397 arbitrary bytes from the web server, without needing to download the entire
398 file. This is particularly useful with large archives such as ZIP files and
399 ISO images when you only need to inspect their contents or extract specific
400 files. Since the HTTP protocol itself has no notion of directories, only a
401 single file can be mounted.")
402 (license license:gpl2+)))
403
404 (define-public jfsutils
405 (package
406 (name "jfsutils")
407 (version "1.1.15")
408 (source
409 (origin
410 (method url-fetch)
411 (uri (string-append "http://jfs.sourceforge.net/project/pub/jfsutils-"
412 version ".tar.gz"))
413 (sha256
414 (base32 "0kbsy2sk1jv4m82rxyl25gwrlkzvl3hzdga9gshkxkhm83v1aji4"))
415 (patches (search-patches "jfsutils-add-sysmacros.patch"
416 "jfsutils-include-systypes.patch"))))
417 (build-system gnu-build-system)
418 (inputs
419 `(("util-linux" ,util-linux "lib")))
420 (home-page "http://jfs.sourceforge.net/home.html")
421 (synopsis "Utilities for managing JFS file systems")
422 (description
423 "The JFSutils are a collection of utilities for managing the @acronym{JFS,
424 Journaled File System}, a 64-bit journaling file system created by IBM and later
425 ported to the kernel Linux. The following commands are available:
426 @enumerate
427 @item @command{fsck.jfs}: check and repair a JFS file system or replay its
428 transaction log.
429 @item @command{logdump}: dump the JFS journal log.
430 @item @command{logredo}: replay the JFS journal log.
431 @item @command{mkfs.jfs}: create a new JFS file system.
432 @item @command{xchklog}: save a JFS fsck log to a file.
433 @item @command{xchkdmp}: dump the contents of such a log file.
434 @item @command{xpeek}: a JFS file system editor with a shell-like interface.
435 @end enumerate\n")
436 (license license:gpl3+))) ; no explicit version given
437
438 (define-public jfsutils/static
439 (static-package
440 (package
441 (inherit jfsutils)
442 (name "jfsutils-static")
443 (inputs
444 `(("util-linux:static" ,util-linux "static")
445 ,@(package-inputs jfsutils))))))
446
447 (define-public jfs_fsck/static
448 (package
449 (name "jfs_fsck-static")
450 (version (package-version jfsutils))
451 (source #f)
452 (build-system trivial-build-system)
453 (arguments
454 `(#:modules ((guix build utils))
455 #:builder
456 (begin
457 (use-modules (guix build utils)
458 (ice-9 ftw)
459 (srfi srfi-26))
460 (let* ((jfsutils (assoc-ref %build-inputs "jfsutils"))
461 (fsck "jfs_fsck")
462 (out (assoc-ref %outputs "out"))
463 (sbin (string-append out "/sbin")))
464 (mkdir-p sbin)
465 (with-directory-excursion sbin
466 (install-file (string-append jfsutils "/sbin/" fsck)
467 ".")
468 (remove-store-references fsck)
469 (chmod fsck #o555))
470 #t))))
471 (inputs
472 `(("jfsutils" ,jfsutils/static)))
473 (home-page (package-home-page jfsutils))
474 (synopsis "Statically-linked jfs_fsck command from jfsutils")
475 (description "This package provides statically-linked jfs_fsck command taken
476 from the jfsutils package. It is meant to be used in initrds.")
477 (license (package-license jfsutils))))
478
479 (define-public disorderfs
480 (package
481 (name "disorderfs")
482 (version "0.5.10")
483 (source
484 (origin
485 (method git-fetch)
486 (uri (git-reference
487 (url "https://salsa.debian.org/reproducible-builds/disorderfs.git")
488 (commit version)))
489 (file-name (git-file-name name version))
490 (sha256
491 (base32
492 "0lsisx5118k0qk0b5klbxl03rvhycnznyfx05yxmjawh85bfhmlh"))))
493 (build-system gnu-build-system)
494 (native-inputs
495 `(("pkg-config" ,pkg-config)))
496 (inputs
497 `(("fuse" ,fuse)
498 ("attr" ,attr)))
499 (arguments
500 `(#:phases (modify-phases %standard-phases
501 (delete 'configure)) ; no configure script
502 #:make-flags (let ((out (assoc-ref %outputs "out")))
503 (list (string-append "PREFIX=" out)))
504 #:test-target "test"
505 ;; FIXME: Tests require 'run-parts' which is not in Guix yet.
506 #:tests? #f))
507 (home-page "https://salsa.debian.org/reproducible-builds/disorderfs")
508 (synopsis "FUSE file system that introduces non-determinism")
509 (description
510 "An overlay FUSE file system that introduces non-determinism
511 into file system metadata. For example, it can randomize the order
512 in which directory entries are read. This is useful for detecting
513 non-determinism in the build process.")
514 (license license:gpl3+)))
515
516 (define-public glusterfs
517 (package
518 (name "glusterfs")
519 (version "7.0")
520 (source
521 (origin
522 (method url-fetch)
523 (uri (string-append "https://download.gluster.org/pub/gluster/glusterfs/"
524 (version-major version) "/"
525 (version-major+minor version) "/"
526 "glusterfs-" version ".tar.gz"))
527 (sha256
528 (base32
529 "0yzhx710ypj0j3m5dcgmmgvkp7p0rmmp2p7ld0axrm4vpwc2b1wa"))))
530 (build-system gnu-build-system)
531 (arguments
532 `(#:configure-flags
533 (let ((out (assoc-ref %outputs "out"))
534 (p2 (assoc-ref %build-inputs "python-2")))
535 (list (string-append "PYTHON=" p2 "/bin/python")
536 (string-append "--with-initdir=" out "/etc/init.d")
537 (string-append "--with-mountutildir=" out "/sbin")
538 "--enable-cmocka" ; unit tests
539 ;; "--enable-debug" ; debug build options
540 ;; "--enable-asan" ; Address Sanitizer
541 ;; "--enable-tsan" ; ThreadSanitizer
542 ))
543 #:phases
544 (modify-phases %standard-phases
545 (add-before 'configure 'autogen
546 (lambda _ (invoke "./autogen.sh"))))))
547 (native-inputs
548 `(("pkg-config" ,pkg-config)
549 ("libtirpc" ,libtirpc)
550 ("rpcsvc-proto" ,rpcsvc-proto)
551 ("python-2" ,python-2) ; must be version 2
552 ("flex" ,flex)
553 ("bison" ,bison)
554 ("libtool" ,libtool)
555 ("autoconf" ,autoconf)
556 ("automake" ,automake)
557 ("cmocka" ,cmocka)))
558 (inputs
559 `(("acl" ,acl)
560 ("fuse" ,fuse)
561 ("openssl" ,openssl)
562 ("liburcu" ,liburcu)
563 ("libuuid" ,util-linux "lib")
564 ("libxml2" ,libxml2)
565 ("readline" ,readline)
566 ("zlib" ,zlib)
567 ("libaio" ,libaio)
568 ("rdma-core" ,rdma-core)))
569 (home-page "https://www.gluster.org")
570 (synopsis "Distributed file system")
571 (description "GlusterFS is a distributed scalable network file system
572 suitable for data-intensive tasks such as cloud storage and media streaming.
573 It allows rapid provisioning of additional storage based on your storage
574 consumption needs. It incorporates automatic failover as a primary feature.
575 All of this is accomplished without a centralized metadata server.")
576 ;; The user may choose either LGPLv3+ or GPLv2 only.
577 (license (list license:lgpl3+ license:gpl2+))))
578
579 (define-public curlftpfs
580 (package
581 (name "curlftpfs")
582 (version "0.9.2")
583 (source
584 (origin
585 (method url-fetch)
586 (uri (string-append "mirror://sourceforge/curlftpfs/curlftpfs/" version
587 "/curlftpfs-" version ".tar.gz"))
588 (sha256
589 (base32
590 "0n397hmv21jsr1j7zx3m21i7ryscdhkdsyqpvvns12q7qwwlgd2f"))))
591 (build-system gnu-build-system)
592 (arguments
593 `(#:phases
594 (modify-phases %standard-phases
595 (add-after 'unpack 'fix-test
596 (lambda _
597 ;; One of the 512-Byte block counts is definitely wrong.
598 ;; See <https://sourceforge.net/p/curlftpfs/bugs/73/>.
599 (substitute* "tests/ftpfs-ls_unittest.c"
600 (("4426192") "12814800"))
601 #t)))))
602 (inputs
603 `(("curl" ,curl)
604 ("glib" ,glib)
605 ("fuse" ,fuse)))
606 (native-inputs
607 `(("pkg-config" ,pkg-config)))
608 (home-page "http://curlftpfs.sourceforge.net/")
609 (synopsis "Mount remote file systems over FTP")
610 (description
611 "This is a file system client based on the FTP File Transfer Protocol.")
612 (license license:gpl2+)))
613
614 (define-public libnfs
615 (package
616 (name "libnfs")
617 (version "3.0.0")
618 (source (origin
619 (method git-fetch)
620 (uri (git-reference
621 (url "https://github.com/sahlberg/libnfs")
622 (commit (string-append "libnfs-" version))))
623 (file-name (git-file-name name version))
624 (sha256
625 (base32
626 "115p55y2cbs92z5lmcnjx1v29lwinpgq4sha9v1kq1vd8674h404"))))
627 (build-system gnu-build-system)
628 (home-page "https://github.com/sahlberg/libnfs")
629 (native-inputs
630 `(("autoconf" ,autoconf)
631 ("automake" ,automake)
632 ("libtool" ,libtool)
633 ("pkg-config" ,pkg-config)))
634 (synopsis "Client library for accessing NFS shares")
635 (description "LIBNFS is a client library for accessing NFS shares over a
636 network. LIBNFS offers three different APIs, for different use :
637
638 @enumerate
639 @item RAW, a fully asynchronous low level RPC library for NFS protocols. This
640 API provides very flexible and precise control of the RPC issued.
641 @item NFS ASYNC, a fully asynchronous library for high level vfs functions
642 @item NFS SYNC, a synchronous library for high level vfs functions.
643 @end enumerate\n")
644 (license (list license:lgpl2.1+ ; library
645 license:gpl3+ ; tests
646 license:bsd-3 ; copied nsf4 files
647 ))))
648
649 (define-public apfs-fuse
650 ;; Later versions require FUSE 3.
651 (let ((commit "7b89418e8dc27103d3c4f8fa348086ffcd634c17")
652 (revision "1"))
653 (package
654 (name "apfs-fuse")
655 (version (git-version "0.0.0" revision commit))
656 (source (origin
657 (method git-fetch)
658 (uri (git-reference
659 (url "https://github.com/sgan81/apfs-fuse")
660 (recursive? #t) ; for lzfse
661 (commit commit)))
662 (sha256
663 (base32
664 "0x2siy3cmnm9wsdfazg3xc8r3kbg73gijmnn1vjw33pp71ckylxr"))
665 (file-name (git-file-name name version))))
666 (build-system cmake-build-system)
667 (arguments
668 `(#:tests? #f ; No test suite
669 #:configure-flags
670 '("-DUSE_FUSE3=OFF") ; FUSE 3 is not packaged yet.
671 #:phases
672 (modify-phases %standard-phases
673 ;; No 'install' target in CMakeLists.txt
674 (replace 'install
675 (lambda* (#:key outputs #:allow-other-keys)
676 (let* ((out (assoc-ref outputs "out"))
677 (bin (string-append out "/bin"))
678 (lib (string-append out "/lib"))
679 (doc (string-append out "/share/doc/"
680 (string-append ,name "-" ,version))))
681 (install-file "apfs-dump" bin)
682 (install-file "apfs-dump-quick" bin)
683 (install-file "apfs-fuse" bin)
684 (install-file "libapfs.a" lib)
685 (install-file "../source/README.md" doc)
686 #t))))))
687 (inputs
688 `(("bzip2" ,bzip2)
689 ("fuse" ,fuse)
690 ("zlib" ,zlib)))
691 (synopsis "Read-only FUSE driver for the APFS file system")
692 (description "APFS-FUSE is a read-only FUSE driver for the @dfn{Apple File
693 System} (APFS). It is currently in an experimental state — it may not be able
694 to read all files, and it does not support all the compression methods in
695 APFS.")
696 (home-page "https://github.com/sgan81/apfs-fuse")
697 (license license:gpl2+))))
698
699 (define-public zfs
700 (package
701 (name "zfs")
702 (version "0.8.5")
703 (outputs '("out" "module" "src"))
704 (source
705 (origin
706 (method url-fetch)
707 (uri (string-append "https://github.com/zfsonlinux/zfs/releases"
708 "/download/zfs-" version
709 "/zfs-" version ".tar.gz"))
710 (sha256
711 (base32 "0gfdnynmsxbhi97q73smrgmcw1k8zmlr1hgljfn38sk0kimivd6v"))))
712 (build-system linux-module-build-system)
713 (arguments
714 `(;; The ZFS kernel module should not be downloaded since the license
715 ;; terms don't allow for distributing it, only building it locally.
716 #:substitutable? #f
717 ;; Tests cannot run in an unprivileged build environment.
718 #:tests? #f
719 #:phases
720 (modify-phases %standard-phases
721 (add-after 'configure 'really-configure
722 (lambda* (#:key outputs inputs #:allow-other-keys)
723 (let ((out (assoc-ref outputs "out")))
724 (substitute* "configure"
725 (("-/bin/sh") (string-append "-" (which "sh"))))
726 (invoke "./configure"
727 "--with-config=all"
728 (string-append "--prefix=" out)
729 (string-append "--with-dracutdir=" out "/lib/dracut")
730 (string-append "--with-udevdir=" out "/lib/udev")
731 (string-append "--with-mounthelperdir=" out "/sbin")
732 (string-append "--with-linux="
733 (assoc-ref inputs "linux-module-builder")
734 "/lib/modules/build")))))
735 (add-after 'unpack 'patch-source
736 (lambda* (#:key inputs outputs #:allow-other-keys)
737 (let ((out (assoc-ref outputs "out"))
738 (src (assoc-ref outputs "src"))
739 (util-linux (assoc-ref inputs "util-linux"))
740 (nfs-utils (assoc-ref inputs "nfs-utils")))
741 (substitute* "contrib/Makefile.in"
742 ;; This is not configurable nor is its hard-coded /usr prefix.
743 ((" initramfs") ""))
744 (substitute* "module/zfs/zfs_ctldir.c"
745 (("/usr/bin/env\", \"umount")
746 (string-append util-linux "/bin/umount\", \"-n"))
747 (("/usr/bin/env\", \"mount")
748 (string-append util-linux "/bin/mount\", \"-n")))
749 (substitute* "lib/libzfs/libzfs_mount.c"
750 (("/bin/mount") (string-append util-linux "/bin/mount"))
751 (("/bin/umount") (string-append util-linux "/bin/umount")))
752 (substitute* "lib/libshare/nfs.c"
753 (("/usr/sbin/exportfs")
754 (string-append nfs-utils "/sbin/exportfs")))
755 (substitute* "config/zfs-build.m4"
756 (("\\$sysconfdir/init.d") (string-append out "/etc/init.d")))
757 (substitute* '("etc/zfs/Makefile.am"
758 "cmd/zed/Makefile.am")
759 (("\\$\\(sysconfdir)") (string-append out "/etc")))
760 (substitute* "cmd/vdev_id/vdev_id"
761 (("PATH=/bin:/sbin:/usr/bin:/usr/sbin")
762 (string-append "PATH="
763 (dirname (which "chmod")) ":"
764 (dirname (which "grep")) ":"
765 (dirname (which "sed")) ":"
766 (dirname (which "gawk")))))
767 (substitute* "contrib/pyzfs/Makefile.in"
768 ((".*install-lib.*") ""))
769 (substitute* '("Makefile.am" "Makefile.in")
770 (("\\$\\(prefix)/src") (string-append src "/src"))))
771 #t))
772 (replace 'build
773 (lambda _ (invoke "make")))
774 (replace 'install
775 (lambda* (#:key outputs inputs native-inputs #:allow-other-keys)
776 (let* ((out (assoc-ref outputs "out"))
777 (moddir (assoc-ref outputs "module"))
778 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
779 (invoke "make" "install"
780 (string-append "DEFAULT_INITCONF_DIR=" out "/etc/default")
781 (string-append "DEPMOD=" kmod "/bin/depmod")
782 (string-append "INSTALL_PATH=" out)
783 (string-append "INSTALL_MOD_PATH=" moddir)
784 "INSTALL_MOD_STRIP=1")
785 (install-file "contrib/bash_completion.d/zfs"
786 (string-append out "/share/bash-completion/completions"))
787 #t))))))
788 (native-inputs
789 `(("attr" ,attr)
790 ("kmod" ,kmod)
791 ("pkg-config" ,pkg-config)))
792 (inputs
793 `(("eudev" ,eudev)
794 ("libaio" ,libaio)
795 ("libtirpc" ,libtirpc)
796 ("nfs-utils" ,nfs-utils)
797 ("openssl" ,openssl)
798 ("python" ,python)
799 ("python-cffi" ,python-cffi)
800 ("util-linux" ,util-linux "lib")
801 ("zlib" ,zlib)))
802 (home-page "https://zfsonlinux.org/")
803 (synopsis "Native ZFS on Linux")
804 (description
805 "ZFS on Linux is an advanced file system and volume manager which was
806 originally developed for Solaris and is now maintained by the OpenZFS
807 community.")
808 (license license:cddl1.0)))
809
810 (define-public mergerfs
811 (package
812 (name "mergerfs")
813 (version "2.31.0")
814 (source
815 (origin
816 (method url-fetch)
817 (uri (string-append "https://github.com/trapexit/mergerfs/releases/download/"
818 version "/mergerfs-" version ".tar.gz"))
819 (sha256
820 (base32
821 "0k4asbg5n9dhy5jpjkw6simqqnr1zira2y4i71cq05091dfwm90p"))))
822 (build-system gnu-build-system)
823 (arguments
824 `(#:tests? #f ; No tests exist.
825 #:phases
826 (modify-phases %standard-phases
827 (delete 'configure)
828 (add-after 'unpack 'fix-paths
829 (lambda* (#:key inputs outputs #:allow-other-keys)
830 (setenv "CC" "gcc")
831 ;; These were copied from the package libfuse.
832 (substitute* '("libfuse/lib/mount_util.c" "libfuse/util/mount_util.c")
833 (("/bin/(u?)mount" _ maybe-u)
834 (string-append (assoc-ref inputs "util-linux")
835 "/bin/" maybe-u "mount")))
836 (substitute* '("libfuse/util/mount.mergerfs.c")
837 (("/bin/sh")
838 (which "sh")))
839 ;; The Makefile does not allow overriding PREFIX via make variables.
840 (substitute* '("Makefile" "libfuse/Makefile")
841 (("= /usr/local") (string-append "= " (assoc-ref outputs "out")))
842 (("= /sbin") "= $(EXEC_PREFIX)/sbin")
843 ;; cannot chown as build user
844 (("chown root(:root)?") "true"))
845 #t)))))
846 ;; mergerfs bundles a heavily modified copy of libfuse.
847 (inputs `(("util-linux" ,util-linux)))
848 (home-page "https://github.com/trapexit/mergerfs")
849 (synopsis "Featureful union file system")
850 (description "mergerfs is a union file system geared towards simplifying
851 storage and management of files across numerous commodity storage devices. It
852 is similar to mhddfs, unionfs, and aufs.")
853 (license (list
854 license:isc ; mergerfs
855 license:gpl2 license:lgpl2.0 ; Imported libfuse code.
856 ))))
857
858 (define-public mergerfs-tools
859 (let ((commit "480296ed03d1c3c7909697d7ef96d35840ee26b8")
860 (revision "2"))
861 (package
862 (name "mergerfs-tools")
863 ;; No released version exists.
864 (version (git-version "0.0" revision commit))
865 (source
866 (origin
867 (method git-fetch)
868 (uri (git-reference
869 (url "https://github.com/trapexit/mergerfs-tools")
870 (commit commit)))
871 (file-name (git-file-name name version))
872 (sha256
873 (base32
874 "0xr06gi4xcr832rzy0hkp5c1n231s7w5iq1nkjvx9kvm0dl7chpq"))))
875 (build-system copy-build-system)
876 (inputs
877 `(("python" ,python)
878 ("python-xattr" ,python-xattr)
879 ("rsync" ,rsync)))
880 (arguments
881 '(#:install-plan
882 '(("src/" "bin/"))
883 #:phases
884 (modify-phases %standard-phases
885 (add-after 'unpack 'patch-paths
886 (lambda* (#:key inputs #:allow-other-keys)
887 (substitute* (find-files "src" "^mergerfs\\.")
888 (("'rsync'")
889 (string-append "'" (assoc-ref inputs "rsync") "/bin/rsync'"))
890 (("'rm'")
891 (string-append "'" (assoc-ref inputs "coreutils") "/bin/rm'")))
892 (substitute* "src/mergerfs.mktrash"
893 (("xattr")
894 (string-append (assoc-ref inputs "python-xattr") "/bin/xattr"))
895 (("mkdir")
896 (string-append (assoc-ref inputs "coreutils") "/bin/mkdir")))
897 #t)))))
898 (synopsis "Tools to help manage data in a mergerfs pool")
899 (description "mergerfs-tools is a suite of programs that can audit
900 permissions and ownership of files and directories on a mergerfs volume,
901 duplicates files and directories across branches in its pool, find and remove
902 duplicate files, balance pool drives, consolidate files in a single mergerfs
903 directory onto a single drive and create FreeDesktop.org Trash specification
904 compatible directories.")
905 (home-page "https://github.com/trapexit/mergerfs-tools")
906 (license license:isc))))
907
908 (define-public python-dropbox
909 (package
910 (name "python-dropbox")
911 (version "10.3.1")
912 (source
913 (origin
914 (method url-fetch)
915 (uri (pypi-uri "dropbox" version))
916 (sha256
917 (base32
918 "137rn9fs1bg1p1khd5lcccfxh8jsx27dh2ix5wwd8cmddbrzdrbd"))))
919 (build-system python-build-system)
920 (arguments '(#:tests? #f)) ; Tests require a network connection.
921 (native-inputs
922 `(("python-pytest" ,python-pytest)
923 ("python-pytest-runner" ,python-pytest-runner)))
924 (propagated-inputs
925 `(("python-certifi" ,python-certifi)
926 ("python-chardet" ,python-chardet)
927 ("python-requests" ,python-requests)
928 ("python-six" ,python-six)
929 ("python-urllib3" ,python-urllib3)))
930 (home-page "https://www.dropbox.com/developers")
931 (synopsis "Official Dropbox API Client")
932 (description "This package provides a Python SDK for integrating with the
933 Dropbox API v2.")
934 (license license:expat)))
935
936 (define-public dbxfs
937 (package
938 (name "dbxfs")
939 (version "1.0.43")
940 (source
941 (origin
942 (method url-fetch)
943 (uri (pypi-uri "dbxfs" version))
944 (sha256
945 (base32
946 "1f9sy2ax215dxiwszrrcadffjdsmrlxm4kwrbiap9dhxvzm226ks"))
947 (patches (search-patches "dbxfs-remove-sentry-sdk.patch"))))
948 (build-system python-build-system)
949 (arguments
950 '(#:tests? #f)) ; tests requires safefs
951 (propagated-inputs
952 `(("python-appdirs" ,python-appdirs)
953 ("python-block-tracing" ,python-block-tracing)
954 ("python-dropbox" ,python-dropbox)
955 ("python-keyring" ,python-keyring)
956 ("python-keyrings.alt" ,python-keyrings.alt)
957 ("python-privy" ,python-privy)
958 ("python-userspacefs" ,python-userspacefs)))
959 (home-page "https://github.com/rianhunter/dbxfs")
960 (synopsis "User-space file system for Dropbox")
961 (description
962 "@code{dbxfs} allows you to mount your Dropbox folder as if it were a
963 local file system using FUSE.")
964 (license license:gpl3+)))