gnu: Add bindfs.
[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 "ab2f1ec24f5307b0cf1e3c4ad19bf350d9f54d9f")
258 (revision "0"))
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 "10pafvaxg1lvwnqjv3a4rsi96bghbpcsgh3vhqilndi334k3b0hd"))))
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 `(("keyutils" ,keyutils)
291 ("libaio" ,libaio)
292 ("libscrypt" ,libscrypt)
293 ("libsodium" ,libsodium)
294 ("liburcu" ,liburcu)
295 ("util-linux" ,util-linux "lib") ; lib{blkid,uuid}
296 ("lz4" ,lz4)
297 ("zlib" ,zlib)
298 ("zstd:lib" ,zstd "lib")))
299 (home-page "https://bcachefs.org/")
300 (synopsis "Tools to create and manage bcachefs file systems")
301 (description
302 "The bcachefs-tools are command-line utilities for creating, checking,
303 and otherwise managing bcachefs file systems.
304
305 Bcachefs is a @acronym{CoW, copy-on-write} file system supporting native
306 encryption, compression, snapshots, and (meta)data checksums. It can use
307 multiple block devices for replication and/or performance, similar to RAID.
308
309 In addition, bcachefs provides all the functionality of bcache, a block-layer
310 caching system, and lets you assign different roles to each device based on its
311 performance and other characteristics.")
312 (license license:gpl2+))))
313
314 (define-public exfatprogs
315 (package
316 (name "exfatprogs")
317 (version "1.0.4")
318 (source
319 (origin
320 (method git-fetch)
321 (uri (git-reference
322 (url "https://github.com/exfatprogs/exfatprogs")
323 (commit version)))
324 (file-name (git-file-name name version))
325 (sha256
326 (base32 "1braffz1wc4ki3nb42q85l5zg2dl2hwjr64rk27nc85wcsrbavnl"))))
327 (build-system gnu-build-system)
328 (arguments
329 `(#:configure-flags
330 (list "--disable-static")))
331 (native-inputs
332 `(("autoconf" ,autoconf)
333 ("automake" ,automake)
334 ("libtool" ,libtool)
335 ("pkg-config" ,pkg-config)))
336 (home-page "https://github.com/exfatprogs/exfatprogs")
337 (synopsis "Tools to create, check, and repair exFAT file systems")
338 (description
339 "These are command-line user space tools for the @acronym{exFAT,
340 Extensible File Allocation Table} file systems. Included are
341 @command{mkfs.exfat} to create (format) new exFAT file systems, and
342 @command{fsck.exfat} to check their consistency and repair them.")
343 (license license:gpl2+)))
344
345 (define-public httpfs2
346 (package
347 (name "httpfs2")
348 (version "0.1.5")
349 (source
350 (origin
351 (method url-fetch)
352 (uri (string-append "mirror://sourceforge/httpfs/httpfs2/"
353 "httpfs2-" version ".tar.gz"))
354 (sha256
355 (base32
356 "1h8ggvhw30n2r6w11n1s458ypggdqx6ldwd61ma4yd7binrlpjq1"))))
357 (build-system gnu-build-system)
358 (native-inputs
359 `(("asciidoc" ,asciidoc)
360 ("docbook-xml" ,docbook-xml)
361 ("libxml2" ,libxml2)
362 ("libxslt" ,libxslt)
363 ("pkg-config" ,pkg-config)))
364 (inputs
365 `(("fuse" ,fuse)
366 ("gnutls" ,gnutls)))
367 (arguments
368 `(#:phases
369 (modify-phases %standard-phases
370 (delete 'configure) ; no configure script
371 (replace 'install
372 ;; There's no ‘install’ target. Install all variants manually.
373 (lambda* (#:key outputs #:allow-other-keys)
374 (let* ((out (assoc-ref outputs "out"))
375 (bin (string-append out "/bin"))
376 (man1 (string-append out "/share/man/man1")))
377 (mkdir-p bin)
378 (mkdir-p man1)
379 (for-each
380 (lambda (variant)
381 (let ((man1-page (string-append variant ".1")))
382 (install-file variant bin)
383 (install-file man1-page man1)))
384 (list "httpfs2"
385 "httpfs2-mt"
386 "httpfs2-ssl"
387 "httpfs2-ssl-mt")))
388 #t)))
389 #:make-flags (list "CC=gcc")
390 #:parallel-build? #f ; can result in missing man pages
391 #:tests? #f)) ; no tests
392 (home-page "https://sourceforge.net/projects/httpfs/")
393 (synopsis "Mount remote files over HTTP")
394 (description "httpfs2 is a @code{fuse} file system for mounting any
395 @dfn{HyperText} (HTTP or HTTPS) URL. It uses HTTP/1.1 byte ranges to request
396 arbitrary bytes from the web server, without needing to download the entire
397 file. This is particularly useful with large archives such as ZIP files and
398 ISO images when you only need to inspect their contents or extract specific
399 files. Since the HTTP protocol itself has no notion of directories, only a
400 single file can be mounted.")
401 (license license:gpl2+)))
402
403 (define-public jfsutils
404 (package
405 (name "jfsutils")
406 (version "1.1.15")
407 (source
408 (origin
409 (method url-fetch)
410 (uri (string-append "http://jfs.sourceforge.net/project/pub/jfsutils-"
411 version ".tar.gz"))
412 (sha256
413 (base32 "0kbsy2sk1jv4m82rxyl25gwrlkzvl3hzdga9gshkxkhm83v1aji4"))
414 (patches (search-patches "jfsutils-add-sysmacros.patch"
415 "jfsutils-include-systypes.patch"))))
416 (build-system gnu-build-system)
417 (inputs
418 `(("util-linux" ,util-linux "lib")))
419 (home-page "http://jfs.sourceforge.net/home.html")
420 (synopsis "Utilities for managing JFS file systems")
421 (description
422 "The JFSutils are a collection of utilities for managing the @acronym{JFS,
423 Journaled File System}, a 64-bit journaling file system created by IBM and later
424 ported to the kernel Linux. The following commands are available:
425 @enumerate
426 @item @command{fsck.jfs}: check and repair a JFS file system or replay its
427 transaction log.
428 @item @command{logdump}: dump the JFS journal log.
429 @item @command{logredo}: replay the JFS journal log.
430 @item @command{mkfs.jfs}: create a new JFS file system.
431 @item @command{xchklog}: save a JFS fsck log to a file.
432 @item @command{xchkdmp}: dump the contents of such a log file.
433 @item @command{xpeek}: a JFS file system editor with a shell-like interface.
434 @end enumerate\n")
435 (license license:gpl3+))) ; no explicit version given
436
437 (define-public jfsutils/static
438 (static-package
439 (package
440 (inherit jfsutils)
441 (name "jfsutils-static")
442 (inputs
443 `(("util-linux:static" ,util-linux "static")
444 ,@(package-inputs jfsutils))))))
445
446 (define-public jfs_fsck/static
447 (package
448 (name "jfs_fsck-static")
449 (version (package-version jfsutils))
450 (source #f)
451 (build-system trivial-build-system)
452 (arguments
453 `(#:modules ((guix build utils))
454 #:builder
455 (begin
456 (use-modules (guix build utils)
457 (ice-9 ftw)
458 (srfi srfi-26))
459 (let* ((jfsutils (assoc-ref %build-inputs "jfsutils"))
460 (fsck "jfs_fsck")
461 (out (assoc-ref %outputs "out"))
462 (sbin (string-append out "/sbin")))
463 (mkdir-p sbin)
464 (with-directory-excursion sbin
465 (install-file (string-append jfsutils "/sbin/" fsck)
466 ".")
467 (remove-store-references fsck)
468 (chmod fsck #o555))
469 #t))))
470 (inputs
471 `(("jfsutils" ,jfsutils/static)))
472 (home-page (package-home-page jfsutils))
473 (synopsis "Statically-linked jfs_fsck command from jfsutils")
474 (description "This package provides statically-linked jfs_fsck command taken
475 from the jfsutils package. It is meant to be used in initrds.")
476 (license (package-license jfsutils))))
477
478 (define-public disorderfs
479 (package
480 (name "disorderfs")
481 (version "0.5.10")
482 (source
483 (origin
484 (method git-fetch)
485 (uri (git-reference
486 (url "https://salsa.debian.org/reproducible-builds/disorderfs.git")
487 (commit version)))
488 (file-name (git-file-name name version))
489 (sha256
490 (base32
491 "0lsisx5118k0qk0b5klbxl03rvhycnznyfx05yxmjawh85bfhmlh"))))
492 (build-system gnu-build-system)
493 (native-inputs
494 `(("pkg-config" ,pkg-config)))
495 (inputs
496 `(("fuse" ,fuse)
497 ("attr" ,attr)))
498 (arguments
499 `(#:phases (modify-phases %standard-phases
500 (delete 'configure)) ; no configure script
501 #:make-flags (let ((out (assoc-ref %outputs "out")))
502 (list (string-append "PREFIX=" out)))
503 #:test-target "test"
504 ;; FIXME: Tests require 'run-parts' which is not in Guix yet.
505 #:tests? #f))
506 (home-page "https://salsa.debian.org/reproducible-builds/disorderfs")
507 (synopsis "FUSE file system that introduces non-determinism")
508 (description
509 "An overlay FUSE file system that introduces non-determinism
510 into file system metadata. For example, it can randomize the order
511 in which directory entries are read. This is useful for detecting
512 non-determinism in the build process.")
513 (license license:gpl3+)))
514
515 (define-public glusterfs
516 (package
517 (name "glusterfs")
518 (version "7.0")
519 (source
520 (origin
521 (method url-fetch)
522 (uri (string-append "https://download.gluster.org/pub/gluster/glusterfs/"
523 (version-major version) "/"
524 (version-major+minor version) "/"
525 "glusterfs-" version ".tar.gz"))
526 (sha256
527 (base32
528 "0yzhx710ypj0j3m5dcgmmgvkp7p0rmmp2p7ld0axrm4vpwc2b1wa"))))
529 (build-system gnu-build-system)
530 (arguments
531 `(#:configure-flags
532 (let ((out (assoc-ref %outputs "out"))
533 (p2 (assoc-ref %build-inputs "python-2")))
534 (list (string-append "PYTHON=" p2 "/bin/python")
535 (string-append "--with-initdir=" out "/etc/init.d")
536 (string-append "--with-mountutildir=" out "/sbin")
537 "--enable-cmocka" ; unit tests
538 ;; "--enable-debug" ; debug build options
539 ;; "--enable-asan" ; Address Sanitizer
540 ;; "--enable-tsan" ; ThreadSanitizer
541 ))
542 #:phases
543 (modify-phases %standard-phases
544 (add-before 'configure 'autogen
545 (lambda _ (invoke "./autogen.sh"))))))
546 (native-inputs
547 `(("pkg-config" ,pkg-config)
548 ("libtirpc" ,libtirpc)
549 ("rpcsvc-proto" ,rpcsvc-proto)
550 ("python-2" ,python-2) ; must be version 2
551 ("flex" ,flex)
552 ("bison" ,bison)
553 ("libtool" ,libtool)
554 ("autoconf" ,autoconf)
555 ("automake" ,automake)
556 ("cmocka" ,cmocka)))
557 (inputs
558 `(("acl" ,acl)
559 ("fuse" ,fuse)
560 ("openssl" ,openssl)
561 ("liburcu" ,liburcu)
562 ("libuuid" ,util-linux "lib")
563 ("libxml2" ,libxml2)
564 ("readline" ,readline)
565 ("zlib" ,zlib)
566 ("libaio" ,libaio)
567 ("rdma-core" ,rdma-core)))
568 (home-page "https://www.gluster.org")
569 (synopsis "Distributed file system")
570 (description "GlusterFS is a distributed scalable network file system
571 suitable for data-intensive tasks such as cloud storage and media streaming.
572 It allows rapid provisioning of additional storage based on your storage
573 consumption needs. It incorporates automatic failover as a primary feature.
574 All of this is accomplished without a centralized metadata server.")
575 ;; The user may choose either LGPLv3+ or GPLv2 only.
576 (license (list license:lgpl3+ license:gpl2+))))
577
578 (define-public curlftpfs
579 (package
580 (name "curlftpfs")
581 (version "0.9.2")
582 (source
583 (origin
584 (method url-fetch)
585 (uri (string-append "mirror://sourceforge/curlftpfs/curlftpfs/" version
586 "/curlftpfs-" version ".tar.gz"))
587 (sha256
588 (base32
589 "0n397hmv21jsr1j7zx3m21i7ryscdhkdsyqpvvns12q7qwwlgd2f"))))
590 (build-system gnu-build-system)
591 (arguments
592 `(#:phases
593 (modify-phases %standard-phases
594 (add-after 'unpack 'fix-test
595 (lambda _
596 ;; One of the 512-Byte block counts is definitely wrong.
597 ;; See <https://sourceforge.net/p/curlftpfs/bugs/73/>.
598 (substitute* "tests/ftpfs-ls_unittest.c"
599 (("4426192") "12814800"))
600 #t)))))
601 (inputs
602 `(("curl" ,curl)
603 ("glib" ,glib)
604 ("fuse" ,fuse)))
605 (native-inputs
606 `(("pkg-config" ,pkg-config)))
607 (home-page "http://curlftpfs.sourceforge.net/")
608 (synopsis "Mount remote file systems over FTP")
609 (description
610 "This is a file system client based on the FTP File Transfer Protocol.")
611 (license license:gpl2+)))
612
613 (define-public libnfs
614 (package
615 (name "libnfs")
616 (version "3.0.0")
617 (source (origin
618 (method git-fetch)
619 (uri (git-reference
620 (url "https://github.com/sahlberg/libnfs")
621 (commit (string-append "libnfs-" version))))
622 (file-name (git-file-name name version))
623 (sha256
624 (base32
625 "115p55y2cbs92z5lmcnjx1v29lwinpgq4sha9v1kq1vd8674h404"))))
626 (build-system gnu-build-system)
627 (home-page "https://github.com/sahlberg/libnfs")
628 (native-inputs
629 `(("autoconf" ,autoconf)
630 ("automake" ,automake)
631 ("libtool" ,libtool)
632 ("pkg-config" ,pkg-config)))
633 (synopsis "Client library for accessing NFS shares")
634 (description "LIBNFS is a client library for accessing NFS shares over a
635 network. LIBNFS offers three different APIs, for different use :
636
637 @enumerate
638 @item RAW, a fully asynchronous low level RPC library for NFS protocols. This
639 API provides very flexible and precise control of the RPC issued.
640 @item NFS ASYNC, a fully asynchronous library for high level vfs functions
641 @item NFS SYNC, a synchronous library for high level vfs functions.
642 @end enumerate\n")
643 (license (list license:lgpl2.1+ ; library
644 license:gpl3+ ; tests
645 license:bsd-3 ; copied nsf4 files
646 ))))
647
648 (define-public apfs-fuse
649 ;; Later versions require FUSE 3.
650 (let ((commit "7b89418e8dc27103d3c4f8fa348086ffcd634c17")
651 (revision "1"))
652 (package
653 (name "apfs-fuse")
654 (version (git-version "0.0.0" revision commit))
655 (source (origin
656 (method git-fetch)
657 (uri (git-reference
658 (url "https://github.com/sgan81/apfs-fuse")
659 (recursive? #t) ; for lzfse
660 (commit commit)))
661 (sha256
662 (base32
663 "0x2siy3cmnm9wsdfazg3xc8r3kbg73gijmnn1vjw33pp71ckylxr"))
664 (file-name (git-file-name name version))))
665 (build-system cmake-build-system)
666 (arguments
667 `(#:tests? #f ; No test suite
668 #:configure-flags
669 '("-DUSE_FUSE3=OFF") ; FUSE 3 is not packaged yet.
670 #:phases
671 (modify-phases %standard-phases
672 ;; No 'install' target in CMakeLists.txt
673 (replace 'install
674 (lambda* (#:key outputs #:allow-other-keys)
675 (let* ((out (assoc-ref outputs "out"))
676 (bin (string-append out "/bin"))
677 (lib (string-append out "/lib"))
678 (doc (string-append out "/share/doc/"
679 (string-append ,name "-" ,version))))
680 (install-file "apfs-dump" bin)
681 (install-file "apfs-dump-quick" bin)
682 (install-file "apfs-fuse" bin)
683 (install-file "libapfs.a" lib)
684 (install-file "../source/README.md" doc)
685 #t))))))
686 (inputs
687 `(("bzip2" ,bzip2)
688 ("fuse" ,fuse)
689 ("zlib" ,zlib)))
690 (synopsis "Read-only FUSE driver for the APFS file system")
691 (description "APFS-FUSE is a read-only FUSE driver for the @dfn{Apple File
692 System} (APFS). It is currently in an experimental state — it may not be able
693 to read all files, and it does not support all the compression methods in
694 APFS.")
695 (home-page "https://github.com/sgan81/apfs-fuse")
696 (license license:gpl2+))))
697
698 (define-public zfs
699 (package
700 (name "zfs")
701 (version "0.8.2")
702 (outputs '("out" "module" "src"))
703 (source
704 (origin
705 (method url-fetch)
706 (uri (string-append "https://github.com/zfsonlinux/zfs/releases"
707 "/download/zfs-" version
708 "/zfs-" version ".tar.gz"))
709 (sha256
710 (base32
711 "1f7aig15q3z832pr2n48j3clafic2yk1vvqlh28vpklfghjqwq27"))))
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 ((" /bin/sh") (string-append " " (which "sh"))))
727 (invoke "./configure"
728 "--with-config=all"
729 (string-append "--prefix=" out)
730 (string-append "--with-dracutdir=" out "/lib/dracut")
731 (string-append "--with-udevdir=" out "/lib/udev")
732 (string-append "--with-mounthelperdir=" out "/sbin")
733 (string-append "--with-linux="
734 (assoc-ref inputs "linux-module-builder")
735 "/lib/modules/build")))))
736 (add-after 'unpack 'patch-source
737 (lambda* (#:key inputs outputs #:allow-other-keys)
738 (let ((out (assoc-ref outputs "out"))
739 (src (assoc-ref outputs "src"))
740 (util-linux (assoc-ref inputs "util-linux"))
741 (nfs-utils (assoc-ref inputs "nfs-utils")))
742 (substitute* "module/zfs/zfs_ctldir.c"
743 (("/usr/bin/env\", \"umount")
744 (string-append util-linux "/bin/umount\", \"-n"))
745 (("/usr/bin/env\", \"mount")
746 (string-append util-linux "/bin/mount\", \"-n")))
747 (substitute* "lib/libzfs/libzfs_mount.c"
748 (("/bin/mount") (string-append util-linux "/bin/mount"))
749 (("/bin/umount") (string-append util-linux "/bin/umount")))
750 (substitute* "lib/libshare/nfs.c"
751 (("/usr/sbin/exportfs")
752 (string-append nfs-utils "/sbin/exportfs")))
753 (substitute* "config/zfs-build.m4"
754 (("\\$sysconfdir/init.d") (string-append out "/etc/init.d")))
755 (substitute* '("etc/zfs/Makefile.am"
756 "cmd/zed/Makefile.am")
757 (("\\$\\(sysconfdir)") (string-append out "/etc")))
758 (substitute* "cmd/vdev_id/vdev_id"
759 (("PATH=/bin:/sbin:/usr/bin:/usr/sbin")
760 (string-append "PATH="
761 (dirname (which "chmod")) ":"
762 (dirname (which "grep")) ":"
763 (dirname (which "sed")) ":"
764 (dirname (which "gawk")))))
765 (substitute* "contrib/pyzfs/Makefile.in"
766 ((".*install-lib.*") ""))
767 (substitute* '("Makefile.am" "Makefile.in")
768 (("\\$\\(prefix)/src") (string-append src "/src"))))
769 #t))
770 (replace 'build
771 (lambda _ (invoke "make")))
772 (replace 'install
773 (lambda* (#:key outputs inputs native-inputs #:allow-other-keys)
774 (let* ((out (assoc-ref outputs "out"))
775 (moddir (assoc-ref outputs "module"))
776 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
777 (invoke "make" "install"
778 (string-append "DEFAULT_INITCONF_DIR=" out "/etc/default")
779 (string-append "DEPMOD=" kmod "/bin/depmod")
780 (string-append "INSTALL_PATH=" out)
781 (string-append "INSTALL_MOD_PATH=" moddir)
782 "INSTALL_MOD_STRIP=1")
783 (install-file "contrib/bash_completion.d/zfs"
784 (string-append out "/share/bash-completion/completions"))
785 (symlink "../share/pkgconfig/" (string-append out "/lib/pkgconfig"))
786 #t))))))
787 (native-inputs
788 `(("attr" ,attr)
789 ("kmod" ,kmod)
790 ("pkg-config" ,pkg-config)))
791 (inputs
792 `(("eudev" ,eudev)
793 ("libaio" ,libaio)
794 ("libtirpc" ,libtirpc)
795 ("nfs-utils" ,nfs-utils)
796 ("openssl" ,openssl)
797 ("python" ,python)
798 ("python-cffi" ,python-cffi)
799 ("util-linux" ,util-linux "lib")
800 ("zlib" ,zlib)))
801 (home-page "https://zfsonlinux.org/")
802 (synopsis "Native ZFS on Linux")
803 (description
804 "ZFS on Linux is an advanced file system and volume manager which was
805 originally developed for Solaris and is now maintained by the OpenZFS
806 community.")
807 (license license:cddl1.0)))
808
809 (define-public mergerfs
810 (package
811 (name "mergerfs")
812 (version "2.31.0")
813 (source
814 (origin
815 (method url-fetch)
816 (uri (string-append "https://github.com/trapexit/mergerfs/releases/download/"
817 version "/mergerfs-" version ".tar.gz"))
818 (sha256
819 (base32
820 "0k4asbg5n9dhy5jpjkw6simqqnr1zira2y4i71cq05091dfwm90p"))))
821 (build-system gnu-build-system)
822 (arguments
823 `(#:tests? #f ; No tests exist.
824 #:phases
825 (modify-phases %standard-phases
826 (delete 'configure)
827 (add-after 'unpack 'fix-paths
828 (lambda* (#:key inputs outputs #:allow-other-keys)
829 (setenv "CC" "gcc")
830 ;; These were copied from the package libfuse.
831 (substitute* '("libfuse/lib/mount_util.c" "libfuse/util/mount_util.c")
832 (("/bin/(u?)mount" _ maybe-u)
833 (string-append (assoc-ref inputs "util-linux")
834 "/bin/" maybe-u "mount")))
835 (substitute* '("libfuse/util/mount.mergerfs.c")
836 (("/bin/sh")
837 (which "sh")))
838 ;; The Makefile does not allow overriding PREFIX via make variables.
839 (substitute* '("Makefile" "libfuse/Makefile")
840 (("= /usr/local") (string-append "= " (assoc-ref outputs "out")))
841 (("= /sbin") "= $(EXEC_PREFIX)/sbin")
842 ;; cannot chown as build user
843 (("chown root(:root)?") "true"))
844 #t)))))
845 ;; mergerfs bundles a heavily modified copy of libfuse.
846 (inputs `(("util-linux" ,util-linux)))
847 (home-page "https://github.com/trapexit/mergerfs")
848 (synopsis "Featureful union file system")
849 (description "mergerfs is a union file system geared towards simplifying
850 storage and management of files across numerous commodity storage devices. It
851 is similar to mhddfs, unionfs, and aufs.")
852 (license (list
853 license:isc ; mergerfs
854 license:gpl2 license:lgpl2.0 ; Imported libfuse code.
855 ))))
856
857 (define-public mergerfs-tools
858 (let ((commit "480296ed03d1c3c7909697d7ef96d35840ee26b8")
859 (revision "2"))
860 (package
861 (name "mergerfs-tools")
862 ;; No released version exists.
863 (version (git-version "0.0" revision commit))
864 (source
865 (origin
866 (method git-fetch)
867 (uri (git-reference
868 (url "https://github.com/trapexit/mergerfs-tools")
869 (commit commit)))
870 (file-name (git-file-name name version))
871 (sha256
872 (base32
873 "0xr06gi4xcr832rzy0hkp5c1n231s7w5iq1nkjvx9kvm0dl7chpq"))))
874 (build-system copy-build-system)
875 (inputs
876 `(("python" ,python)
877 ("python-xattr" ,python-xattr)
878 ("rsync" ,rsync)))
879 (arguments
880 '(#:install-plan
881 '(("src/" "bin/"))
882 #:phases
883 (modify-phases %standard-phases
884 (add-after 'unpack 'patch-paths
885 (lambda* (#:key inputs #:allow-other-keys)
886 (substitute* (find-files "src" "^mergerfs\\.")
887 (("'rsync'")
888 (string-append "'" (assoc-ref inputs "rsync") "/bin/rsync'"))
889 (("'rm'")
890 (string-append "'" (assoc-ref inputs "coreutils") "/bin/rm'")))
891 (substitute* "src/mergerfs.mktrash"
892 (("xattr")
893 (string-append (assoc-ref inputs "python-xattr") "/bin/xattr"))
894 (("mkdir")
895 (string-append (assoc-ref inputs "coreutils") "/bin/mkdir")))
896 #t)))))
897 (synopsis "Tools to help manage data in a mergerfs pool")
898 (description "mergerfs-tools is a suite of programs that can audit
899 permissions and ownership of files and directories on a mergerfs volume,
900 duplicates files and directories across branches in its pool, find and remove
901 duplicate files, balance pool drives, consolidate files in a single mergerfs
902 directory onto a single drive and create FreeDesktop.org Trash specification
903 compatible directories.")
904 (home-page "https://github.com/trapexit/mergerfs-tools")
905 (license license:isc))))
906
907 (define-public python-dropbox
908 (package
909 (name "python-dropbox")
910 (version "10.3.1")
911 (source
912 (origin
913 (method url-fetch)
914 (uri (pypi-uri "dropbox" version))
915 (sha256
916 (base32
917 "137rn9fs1bg1p1khd5lcccfxh8jsx27dh2ix5wwd8cmddbrzdrbd"))))
918 (build-system python-build-system)
919 (arguments '(#:tests? #f)) ; Tests require a network connection.
920 (native-inputs
921 `(("python-pytest" ,python-pytest)
922 ("python-pytest-runner" ,python-pytest-runner)))
923 (propagated-inputs
924 `(("python-certifi" ,python-certifi)
925 ("python-chardet" ,python-chardet)
926 ("python-requests" ,python-requests)
927 ("python-six" ,python-six)
928 ("python-urllib3" ,python-urllib3)))
929 (home-page "https://www.dropbox.com/developers")
930 (synopsis "Official Dropbox API Client")
931 (description "This package provides a Python SDK for integrating with the
932 Dropbox API v2.")
933 (license license:expat)))
934
935 (define-public dbxfs
936 (package
937 (name "dbxfs")
938 (version "1.0.43")
939 (source
940 (origin
941 (method url-fetch)
942 (uri (pypi-uri "dbxfs" version))
943 (sha256
944 (base32
945 "1f9sy2ax215dxiwszrrcadffjdsmrlxm4kwrbiap9dhxvzm226ks"))
946 (patches (search-patches "dbxfs-remove-sentry-sdk.patch"))))
947 (build-system python-build-system)
948 (arguments
949 '(#:tests? #f)) ; tests requires safefs
950 (propagated-inputs
951 `(("python-appdirs" ,python-appdirs)
952 ("python-block-tracing" ,python-block-tracing)
953 ("python-dropbox" ,python-dropbox)
954 ("python-keyring" ,python-keyring)
955 ("python-keyrings.alt" ,python-keyrings.alt)
956 ("python-privy" ,python-privy)
957 ("python-userspacefs" ,python-userspacefs)))
958 (home-page "https://github.com/rianhunter/dbxfs")
959 (synopsis "User-space file system for Dropbox")
960 (description
961 "@code{dbxfs} allows you to mount your Dropbox folder as if it were a
962 local file system using FUSE.")
963 (license license:gpl3+)))