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 Efraim Flashner <efraim@flashner.co.il>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages file-systems)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix git-download)
28 #:use-module (guix build-system cmake)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix build-system linux-module)
31 #:use-module (guix build-system trivial)
32 #:use-module (guix utils)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages acl)
35 #:use-module (gnu packages attr)
36 #:use-module (gnu packages autotools)
37 #:use-module (gnu packages bison)
38 #:use-module (gnu packages check)
39 #:use-module (gnu packages compression)
40 #:use-module (gnu packages crypto)
41 #:use-module (gnu packages curl)
42 #:use-module (gnu packages datastructures)
43 #:use-module (gnu packages documentation)
44 #:use-module (gnu packages docbook)
45 #:use-module (gnu packages flex)
46 #:use-module (gnu packages glib)
47 #:use-module (gnu packages libffi)
48 #:use-module (gnu packages linux)
49 #:use-module (gnu packages nfs)
50 #:use-module (gnu packages onc-rpc)
51 #:use-module (gnu packages photo)
52 #:use-module (gnu packages pkg-config)
53 #:use-module (gnu packages python)
54 #:use-module (gnu packages readline)
55 #:use-module (gnu packages sqlite)
56 #:use-module (gnu packages tls)
57 #:use-module (gnu packages valgrind)
58 #:use-module (gnu packages xml))
60 (define-public gphotofs
68 (string-append "mirror://sourceforge/gphoto/gphotofs/" version
69 "/gphotofs-0.5.tar.gz"))
72 "04slwhr6ap9xcc27wphk22ad8yn79ngyy5z10lxams3k5liahvc2"))))
73 (build-system gnu-build-system)
75 `(("pkg-config" ,pkg-config)))
79 ("libgphoto2" ,libgphoto2)))
80 (synopsis "Virtual filesystem for libgphoto2 using FUSE")
81 (description "GPhotoFS is a FUSE filesystem module to mount your camera as
82 a filesystem on Linux. This allow using your camera with any tool able to read
83 from a mounted filesystem.")
84 (home-page "http://www.gphoto.org/proj/gphotofs/")
85 (license license:gpl2+)))
87 (define-public bcachefs-tools
88 (let ((commit "ab2f1ec24f5307b0cf1e3c4ad19bf350d9f54d9f")
91 (name "bcachefs-tools")
92 (version (git-version "0.1" revision commit))
97 (url "https://evilpiepirate.org/git/bcachefs-tools.git")
99 (file-name (git-file-name name version))
101 (base32 "10pafvaxg1lvwnqjv3a4rsi96bghbpcsgh3vhqilndi334k3b0hd"))))
102 (build-system gnu-build-system)
105 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
106 "INITRAMFS_DIR=$(PREFIX)/share/initramfs-tools"
110 (modify-phases %standard-phases
111 (delete 'configure)) ; no configure script
112 #:tests? #f)) ; XXX 6 valgrind tests fail
114 `(("pkg-config" ,pkg-config)
117 ("python-pytest" ,python-pytest)
118 ("valgrind" ,valgrind)))
120 `(("keyutils" ,keyutils)
122 ("libscrypt" ,libscrypt)
123 ("libsodium" ,libsodium)
125 ("util-linux" ,util-linux "lib") ; lib{blkid,uuid}
128 ("zstd:lib" ,zstd "lib")))
129 (home-page "https://bcachefs.org/")
130 (synopsis "Tools to create and manage bcachefs file systems")
132 "The bcachefs-tools are command-line utilities for creating, checking,
133 and otherwise managing bcachefs file systems.
135 Bcachefs is a @acronym{CoW, copy-on-write} file system supporting native
136 encryption, compression, snapshots, and (meta)data checksums. It can use
137 multiple block devices for replication and/or performance, similar to RAID.
139 In addition, bcachefs provides all the functionality of bcache, a block-layer
140 caching system, and lets you assign different roles to each device based on its
141 performance and other characteristics.")
142 (license license:gpl2+))))
144 (define-public httpfs2
151 (uri (string-append "mirror://sourceforge/httpfs/httpfs2/"
152 "httpfs2-" version ".tar.gz"))
155 "1h8ggvhw30n2r6w11n1s458ypggdqx6ldwd61ma4yd7binrlpjq1"))))
156 (build-system gnu-build-system)
158 `(("asciidoc" ,asciidoc)
159 ("docbook-xml" ,docbook-xml)
162 ("pkg-config" ,pkg-config)))
168 (modify-phases %standard-phases
169 (delete 'configure) ; no configure script
171 ;; There's no ‘install’ target. Install all variants manually.
172 (lambda* (#:key outputs #:allow-other-keys)
173 (let* ((out (assoc-ref outputs "out"))
174 (bin (string-append out "/bin"))
175 (man1 (string-append out "/share/man/man1")))
180 (let ((man1-page (string-append variant ".1")))
181 (install-file variant bin)
182 (install-file man1-page man1)))
188 #:make-flags (list "CC=gcc")
189 #:parallel-build? #f ; can result in missing man pages
190 #:tests? #f)) ; no tests
191 (home-page "https://sourceforge.net/projects/httpfs/")
192 (synopsis "Mount remote files over HTTP")
193 (description "httpfs2 is a @code{fuse} file system for mounting any
194 @dfn{HyperText} (HTTP or HTTPS) URL. It uses HTTP/1.1 byte ranges to request
195 arbitrary bytes from the web server, without needing to download the entire
196 file. This is particularly useful with large archives such as ZIP files and
197 ISO images when you only need to inspect their contents or extract specific
198 files. Since the HTTP protocol itself has no notion of directories, only a
199 single file can be mounted.")
200 (license license:gpl2+)))
202 (define-public jfsutils
209 (uri (string-append "http://jfs.sourceforge.net/project/pub/jfsutils-"
212 (base32 "0kbsy2sk1jv4m82rxyl25gwrlkzvl3hzdga9gshkxkhm83v1aji4"))
213 (patches (search-patches "jfsutils-add-sysmacros.patch"
214 "jfsutils-include-systypes.patch"))))
215 (build-system gnu-build-system)
217 `(("util-linux" ,util-linux "lib")))
218 (home-page "http://jfs.sourceforge.net/home.html")
219 (synopsis "Utilities for managing JFS file systems")
221 "The JFSutils are a collection of utilities for managing the @acronym{JFS,
222 Journaled File System}, a 64-bit journaling file system created by IBM and later
223 ported to the kernel Linux. The following commands are available:
225 @item @command{fsck.jfs}: check and repair a JFS file system or replay its
227 @item @command{logdump}: dump the JFS journal log.
228 @item @command{logredo}: replay the JFS journal log.
229 @item @command{mkfs.jfs}: create a new JFS file system.
230 @item @command{xchklog}: save a JFS fsck log to a file.
231 @item @command{xchkdmp}: dump the contents of such a log file.
232 @item @command{xpeek}: a JFS file system editor with a shell-like interface.
234 (license license:gpl3+))) ; no explicit version given
236 (define-public jfsutils/static
240 (name "jfsutils-static")
242 `(("util-linux:static" ,util-linux "static")
243 ,@(package-inputs jfsutils))))))
245 (define-public jfs_fsck/static
247 (name "jfs_fsck-static")
248 (version (package-version jfsutils))
250 (build-system trivial-build-system)
252 `(#:modules ((guix build utils))
255 (use-modules (guix build utils)
258 (let* ((jfsutils (assoc-ref %build-inputs "jfsutils"))
260 (out (assoc-ref %outputs "out"))
261 (sbin (string-append out "/sbin")))
263 (with-directory-excursion sbin
264 (install-file (string-append jfsutils "/sbin/" fsck)
266 (remove-store-references fsck)
270 `(("jfsutils" ,jfsutils/static)))
271 (home-page (package-home-page jfsutils))
272 (synopsis "Statically-linked jfs_fsck command from jfsutils")
273 (description "This package provides statically-linked jfs_fsck command taken
274 from the jfsutils package. It is meant to be used in initrds.")
275 (license (package-license jfsutils))))
277 (define-public disorderfs
285 (url "https://salsa.debian.org/reproducible-builds/disorderfs.git")
287 (file-name (git-file-name name version))
290 "0irgr9hkm9icx1s44m9382484yx8hddzjxbsz621ip9c946pif0g"))))
291 (build-system gnu-build-system)
293 `(("pkg-config" ,pkg-config)))
298 `(#:phases (modify-phases %standard-phases
299 (delete 'configure)) ; no configure script
300 #:make-flags (let ((out (assoc-ref %outputs "out")))
301 (list (string-append "PREFIX=" out)))
303 ;; FIXME: Tests require 'run-parts' which is not in Guix yet.
305 (home-page "https://salsa.debian.org/reproducible-builds/disorderfs")
306 (synopsis "FUSE file system that introduces non-determinism")
308 "An overlay FUSE file system that introduces non-determinism
309 into file system metadata. For example, it can randomize the order
310 in which directory entries are read. This is useful for detecting
311 non-determinism in the build process.")
312 (license license:gpl3+)))
314 (define-public glusterfs
321 (uri (string-append "https://download.gluster.org/pub/gluster/glusterfs/"
322 (version-major version) "/"
323 (version-major+minor version) "/"
324 "glusterfs-" version ".tar.gz"))
327 "0yzhx710ypj0j3m5dcgmmgvkp7p0rmmp2p7ld0axrm4vpwc2b1wa"))))
328 (build-system gnu-build-system)
331 (let ((out (assoc-ref %outputs "out"))
332 (p2 (assoc-ref %build-inputs "python-2")))
333 (list (string-append "PYTHON=" p2 "/bin/python")
334 (string-append "--with-initdir=" out "/etc/init.d")
335 (string-append "--with-mountutildir=" out "/sbin")
336 "--enable-cmocka" ; unit tests
337 ;; "--enable-debug" ; debug build options
338 ;; "--enable-asan" ; Address Sanitizer
339 ;; "--enable-tsan" ; ThreadSanitizer
342 (modify-phases %standard-phases
343 (add-before 'configure 'autogen
344 (lambda _ (invoke "./autogen.sh"))))))
346 `(("pkg-config" ,pkg-config)
347 ("libtirpc", libtirpc)
348 ("rpcsvc-proto", rpcsvc-proto)
349 ("python-2" ,python-2) ; must be version 2
353 ("autoconf" ,autoconf)
354 ("automake" ,automake)
361 ("libuuid" ,util-linux "lib")
363 ("readline" ,readline)
366 ("rdma-core", rdma-core)))
367 (home-page "https://www.gluster.org")
368 (synopsis "Distributed file system")
369 (description "GlusterFS is a distributed scalable network file system
370 suitable for data-intensive tasks such as cloud storage and media streaming.
371 It allows rapid provisioning of additional storage based on your storage
372 consumption needs. It incorporates automatic failover as a primary feature.
373 All of this is accomplished without a centralized metadata server.")
374 ;; The user may choose either LGPLv3+ or GPLv2 only.
375 (license (list license:lgpl3+ license:gpl2+))))
377 (define-public curlftpfs
384 (uri (string-append "mirror://sourceforge/curlftpfs/curlftpfs/" version
385 "/curlftpfs-" version ".tar.gz"))
388 "0n397hmv21jsr1j7zx3m21i7ryscdhkdsyqpvvns12q7qwwlgd2f"))))
389 (build-system gnu-build-system)
392 (modify-phases %standard-phases
393 (add-after 'unpack 'fix-test
395 ;; One of the 512-Byte block counts is definitely wrong.
396 ;; See <https://sourceforge.net/p/curlftpfs/bugs/73/>.
397 (substitute* "tests/ftpfs-ls_unittest.c"
398 (("4426192") "12814800"))
405 `(("pkg-config" ,pkg-config)))
406 (home-page "http://curlftpfs.sourceforge.net/")
407 (synopsis "Mount remote file systems over FTP")
409 "This is a file system client based on the FTP File Transfer Protocol.")
410 (license license:gpl2+)))
412 (define-public libnfs
419 (url "https://github.com/sahlberg/libnfs.git")
420 (commit (string-append "libnfs-" version))))
421 (file-name (git-file-name name version))
424 "115p55y2cbs92z5lmcnjx1v29lwinpgq4sha9v1kq1vd8674h404"))))
425 (build-system gnu-build-system)
426 (home-page "https://github.com/sahlberg/libnfs")
428 `(("autoconf" ,autoconf)
429 ("automake" ,automake)
431 ("pkg-config" ,pkg-config)))
432 (synopsis "Client library for accessing NFS shares")
433 (description "LIBNFS is a client library for accessing NFS shares over a
434 network. LIBNFS offers three different APIs, for different use :
437 @item RAW, a fully asynchronous low level RPC library for NFS protocols. This
438 API provides very flexible and precise control of the RPC issued.
439 @item NFS ASYNC, a fully asynchronous library for high level vfs functions
440 @item NFS SYNC, a synchronous library for high level vfs functions.
442 (license (list license:lgpl2.1+ ; library
443 license:gpl3+ ; tests
444 license:bsd-3 ; copied nsf4 files
447 (define-public apfs-fuse
448 (let ((commit "c7036a3030d128bcecefc1eabc47c039ccfdcec9")
452 (version (git-version "0.0.0" revision commit))
456 (url "https://github.com/sgan81/apfs-fuse")
457 (recursive? #t) ; for lzfse
461 "1akd4cx1f9cyq6sfk9ybv4chhjwjlnqi8ic4z5ajnd5x0g76nz3r"))
462 (file-name (git-file-name name version))))
463 (build-system cmake-build-system)
465 `(#:tests? #f ; No test suite
467 (modify-phases %standard-phases
468 ;; No 'install' target in CMakeLists.txt
470 (lambda* (#:key outputs #:allow-other-keys)
471 (let* ((out (assoc-ref outputs "out"))
472 (bin (string-append out "/bin"))
473 (lib (string-append out "/lib"))
474 (doc (string-append out "/share/doc/"
475 (string-append ,name "-" ,version))))
476 (install-file "apfs-dump" bin)
477 (install-file "apfs-dump-quick" bin)
478 (install-file "apfs-fuse" bin)
479 (install-file "libapfs.a" lib)
485 (synopsis "Read-only FUSE driver for the APFS file system")
486 (description "APFS-FUSE is a read-only FUSE driver for the @dfn{Apple File
487 System} (APFS). It is currently in an experimental state — it may not be able
488 to read all files, and it does not support all the compression methods in
490 (home-page "https://github.com/sgan81/apfs-fuse")
491 (license license:gpl2+))))
497 (outputs '("out" "module" "src"))
501 (uri (string-append "https://github.com/zfsonlinux/zfs/releases"
502 "/download/zfs-" version
503 "/zfs-" version ".tar.gz"))
506 "1f7aig15q3z832pr2n48j3clafic2yk1vvqlh28vpklfghjqwq27"))))
507 (build-system linux-module-build-system)
509 `(;; The ZFS kernel module should not be downloaded since the license
510 ;; terms don't allow for distributing it, only building it locally.
512 ;; Tests cannot run in an unprivileged build environment.
515 (modify-phases %standard-phases
516 (add-after 'configure 'really-configure
517 (lambda* (#:key outputs inputs #:allow-other-keys)
518 (let ((out (assoc-ref outputs "out")))
519 (substitute* "configure"
520 (("-/bin/sh") (string-append "-" (which "sh")))
521 ((" /bin/sh") (string-append " " (which "sh"))))
522 (invoke "./configure"
524 (string-append "--prefix=" out)
525 (string-append "--with-dracutdir=" out "/lib/dracut")
526 (string-append "--with-udevdir=" out "/lib/udev")
527 (string-append "--with-mounthelperdir=" out "/sbin")
528 (string-append "--with-linux="
529 (assoc-ref inputs "linux-module-builder")
530 "/lib/modules/build")))))
531 (add-after 'unpack 'patch-source
532 (lambda* (#:key inputs outputs #:allow-other-keys)
533 (let ((out (assoc-ref outputs "out"))
534 (src (assoc-ref outputs "src"))
535 (util-linux (assoc-ref inputs "util-linux"))
536 (nfs-utils (assoc-ref inputs "nfs-utils")))
537 (substitute* "module/zfs/zfs_ctldir.c"
538 (("/usr/bin/env\", \"umount")
539 (string-append util-linux "/bin/umount\", \"-n"))
540 (("/usr/bin/env\", \"mount")
541 (string-append util-linux "/bin/mount\", \"-n")))
542 (substitute* "lib/libzfs/libzfs_mount.c"
543 (("/bin/mount") (string-append util-linux "/bin/mount"))
544 (("/bin/umount") (string-append util-linux "/bin/umount")))
545 (substitute* "lib/libshare/nfs.c"
546 (("/usr/sbin/exportfs")
547 (string-append nfs-utils "/sbin/exportfs")))
548 (substitute* "config/zfs-build.m4"
549 (("\\$sysconfdir/init.d") (string-append out "/etc/init.d")))
550 (substitute* '("etc/zfs/Makefile.am"
551 "cmd/zed/Makefile.am")
552 (("\\$\\(sysconfdir)") (string-append out "/etc")))
553 (substitute* "cmd/vdev_id/vdev_id"
554 (("PATH=/bin:/sbin:/usr/bin:/usr/sbin")
555 (string-append "PATH="
556 (dirname (which "chmod")) ":"
557 (dirname (which "grep")) ":"
558 (dirname (which "sed")) ":"
559 (dirname (which "gawk")))))
560 (substitute* "contrib/pyzfs/Makefile.in"
561 ((".*install-lib.*") ""))
562 (substitute* '("Makefile.am" "Makefile.in")
563 (("\\$\\(prefix)/src") (string-append src "/src"))))
566 (lambda _ (invoke "make")))
568 (lambda* (#:key outputs inputs native-inputs #:allow-other-keys)
569 (let* ((out (assoc-ref outputs "out"))
570 (moddir (assoc-ref outputs "module"))
571 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
572 (invoke "make" "install"
573 (string-append "DEFAULT_INITCONF_DIR=" out "/etc/default")
574 (string-append "DEPMOD=" kmod "/bin/depmod")
575 (string-append "INSTALL_PATH=" out)
576 (string-append "INSTALL_MOD_PATH=" moddir)
577 "INSTALL_MOD_STRIP=1")
578 (install-file "contrib/bash_completion.d/zfs"
579 (string-append out "/share/bash-completion/completions"))
580 (symlink "../share/pkgconfig/" (string-append out "/lib/pkgconfig"))
584 ("pkg-config" ,pkg-config)))
588 ("libtirpc" ,libtirpc)
589 ("nfs-utils" ,nfs-utils)
592 ("python-cffi" ,python-cffi)
593 ("util-linux" ,util-linux "lib")
595 (home-page "https://zfsonlinux.org/")
596 (synopsis "Native ZFS on Linux")
598 "ZFS on Linux is an advanced file system and volume manager which was
599 originally developed for Solaris and is now maintained by the OpenZFS
601 (license license:cddl1.0)))