projects/guix·blob javascript-team · refs

2651 lines · 111.0 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2017, 2018, 2020–2022, 2024 Tobias Geerinckx-Rice <[email protected]>
3;;; Copyright © 2017 Gábor Boskovits <[email protected]>
4;;; Copyright © 2017, 2018, 2021, 2023 Ricardo Wurmus <[email protected]>
5;;; Copyright © 2018 Leo Famulari <[email protected]>
6;;; Copyright © 2019-2023, 2025 Efraim Flashner <[email protected]>
7;;; Copyright © 2020 Raghav Gururajan <[email protected]>
8;;; Copyright © 2020 Morgan Smith <[email protected]>
9;;; Copyright © 2021 raid5atemyhomework <[email protected]>
10;;; Copyright © 2021 Stefan Reichör <[email protected]>
11;;; Copyright © 2021 Noisytoot <[email protected]>
12;;; Copyright © 2021, 2023 Kaelyn Takata <[email protected]>
13;;; Copyright © 2022 Brian Cully <[email protected]>
14;;; Copyright © 2023, 2024 Aaron Covrig <[email protected]>
15;;; Copyright © 2024 Ahmad Draidi <[email protected]>
16;;; Copyright © 2024 Zheng Junjie <[email protected]>
17;;; Copyright © 2025 Julian Flake <[email protected]>
18;;; Copyright © 2025-2026 Ashish SHUKLA <[email protected]>
19;;; Copyright © 2020-2025 Maxim Cournoyer <[email protected]>
20;;; Copyright © 2025 45mg <[email protected]>
21;;; Copyright © 2025 Janneke Nieuwenhuizen <[email protected]>
22;;; Copyright © 2026 Giacomo Leidi <[email protected]>
23;;; Copyright © 2026 Daniel Littlewood <[email protected]>
24;;; Copyright © 2026 Artyom V. Poptsov <[email protected]>
25;;;
26;;; This file is part of GNU Guix.
27;;;
28;;; GNU Guix is free software; you can redistribute it and/or modify it
29;;; under the terms of the GNU General Public License as published by
30;;; the Free Software Foundation; either version 3 of the License, or (at
31;;; your option) any later version.
32;;;
33;;; GNU Guix is distributed in the hope that it will be useful, but
34;;; WITHOUT ANY WARRANTY; without even the implied warranty of
35;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36;;; GNU General Public License for more details.
37;;;
38;;; You should have received a copy of the GNU General Public License
39;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
40
41(define-module (gnu packages file-systems)
42 #:use-module (guix gexp)
43 #:use-module ((guix licenses) #:prefix license:)
44 #:use-module (guix packages)
45 #:use-module (guix platform)
46 #:use-module (guix download)
47 #:use-module (guix git-download)
48 #:use-module (guix build-system cargo)
49 #:use-module (guix build-system cmake)
50 #:use-module (guix build-system copy)
51 #:use-module (guix build-system gnu)
52 #:use-module (guix build-system go)
53 #:use-module (guix build-system linux-module)
54 #:use-module (guix build-system pyproject)
55 #:use-module (guix build-system qt)
56 #:use-module (guix build-system trivial)
57 #:use-module (guix utils)
58 #:use-module (gnu packages)
59 #:use-module (gnu packages acl)
60 #:use-module (gnu packages admin)
61 #:use-module (gnu packages algebra)
62 #:use-module (gnu packages attr)
63 #:use-module (gnu packages autotools)
64 #:use-module (gnu packages backup)
65 #:use-module (gnu packages base)
66 #:use-module (gnu packages bash)
67 #:use-module (gnu packages bison)
68 #:use-module (gnu packages boost)
69 #:use-module (gnu packages check)
70 #:use-module (gnu packages compression)
71 #:use-module (gnu packages cpp)
72 #:use-module (gnu packages crypto)
73 #:use-module (gnu packages curl)
74 #:use-module (gnu packages cyrus-sasl)
75 #:use-module (gnu packages datastructures)
76 #:use-module (gnu packages digest)
77 #:use-module (gnu packages documentation)
78 #:use-module (gnu packages docbook)
79 #:use-module (gnu packages elf)
80 #:use-module (gnu packages file)
81 #:use-module (gnu packages compiler-tools)
82 #:use-module (gnu packages freedesktop)
83 #:use-module (gnu packages gawk)
84 #:use-module (gnu packages gettext)
85 #:use-module (gnu packages glib)
86 #:use-module (gnu packages gnome)
87 #:use-module (gnu packages gnupg)
88 #:use-module (gnu packages golang)
89 #:use-module (gnu packages golang-build)
90 #:use-module (gnu packages golang-check)
91 #:use-module (gnu packages golang-crypto)
92 #:use-module (gnu packages golang-web)
93 #:use-module (gnu packages golang-xyz)
94 #:use-module (gnu packages guile)
95 #:use-module (gnu packages haskell-xyz)
96 #:use-module (gnu packages jemalloc)
97 #:use-module (gnu packages kerberos)
98 #:use-module (gnu packages libevent)
99 #:use-module (gnu packages libffi)
100 #:use-module (gnu packages libunwind)
101 #:use-module (gnu packages linux)
102 #:use-module (gnu packages llvm)
103 #:use-module (gnu packages maths)
104 #:use-module (gnu packages man)
105 #:use-module (gnu packages m4)
106 #:use-module (gnu packages ncurses)
107 #:use-module (gnu packages nfs)
108 #:use-module (gnu packages onc-rpc)
109 #:use-module (gnu packages openldap)
110 #:use-module (gnu packages password-utils)
111 #:use-module (gnu packages pcre)
112 #:use-module (gnu packages perl)
113 #:use-module (gnu packages photo)
114 #:use-module (gnu packages pkg-config)
115 #:use-module (gnu packages popt)
116 #:use-module (gnu packages pretty-print)
117 #:use-module (gnu packages python)
118 #:use-module (gnu packages python-build)
119 #:use-module (gnu packages python-crypto)
120 #:use-module (gnu packages python-web)
121 #:use-module (gnu packages python-xyz)
122 #:use-module (gnu packages qt)
123 #:use-module (gnu packages readline)
124 #:use-module (gnu packages rsync)
125 #:use-module (gnu packages rust)
126 #:use-module (gnu packages rust-apps)
127 #:use-module (gnu packages serialization)
128 #:use-module (gnu packages sssd)
129 #:use-module (gnu packages sqlite)
130 #:use-module (gnu packages textutils)
131 #:use-module (gnu packages time)
132 #:use-module (gnu packages tls)
133 #:use-module (gnu packages valgrind)
134 #:use-module (gnu packages version-control)
135 #:use-module (gnu packages vim)
136 #:use-module (gnu packages web)
137 #:use-module (gnu packages xiph)
138 #:use-module (gnu packages xml))
139
140(define-public autofs
141 (package
142 (name "autofs")
143 (version "5.1.9")
144 (source
145 (origin
146 (method url-fetch)
147 (uri (string-append "mirror://kernel.org/linux/daemons/autofs/"
148 "v" (version-major version) "/"
149 "autofs-" version ".tar.xz"))
150 (sha256
151 (base32 "0jy2nf9j8pf8888rxm9cr7vva8vx1vjq35six9i98jvr0dmazrl7"))))
152 (build-system gnu-build-system)
153 (arguments
154 `(#:configure-flags
155 (list "--enable-ignore-busy" ; during shutdown
156 "--enable-sloppy-mount" ; support mount(8) -s
157 "--with-libtirpc"
158 (string-append "--with-openldap="
159 (assoc-ref %build-inputs "openldap"))
160 (string-append "--with-sasl="
161 (assoc-ref %build-inputs "cyrus-sasl"))
162 "HAVE_SSS_AUTOFS=1" ; required to make sssldir click
163 (string-append "sssldir="
164 (assoc-ref %build-inputs "sssd")
165 "/lib/sssd/modules"))
166 #:make-flags '("CC=gcc -Wno-error=incompatible-pointer-types")
167 #:tests? #f ; no test suite
168 #:phases
169 (modify-phases %standard-phases
170 (add-before 'configure 'fix-hard-coded-search-path
171 (lambda _
172 (substitute* "configure"
173 (("^searchpath=\".*\"")
174 "searchpath=\"$PATH\""))))
175 (add-before 'configure 'fix-rpath
176 (lambda* (#:key outputs #:allow-other-keys)
177 (let ((out (assoc-ref outputs "out")))
178 (substitute* "Makefile.rules"
179 (("^AUTOFS_LIB_LINK.*=" match)
180 (string-append match " -Wl,-rpath=" out "/lib")))))))))
181 (native-inputs
182 (list bison flex pkg-config rpcsvc-proto))
183 (inputs
184 (list cyrus-sasl
185 e2fsprogs ; for e[234]fsck
186 libnsl ; needed for NIS/YP
187 libtirpc
188 libxml2 ; needed for LDAP, SASL
189 mit-krb5 ; needed for LDAP, SASL
190 nfs-utils ; for mount.nfs
191 openldap
192 openssl ; needed for SASL
193 sssd
194 util-linux)) ; for mount, umount
195 ;; XXX A directory index is the closest thing this has to a home page.
196 (home-page "https://www.kernel.org/pub/linux/daemons/autofs/")
197 (synopsis "Kernel-based automounter for Linux")
198 (description
199 "Autofs is a kernel-based automounter for use with the Linux autofs4
200module. It automatically mounts selected file systems when they are used and
201unmounts them after a set period of inactivity. This provides
202centrally-managed, consistent file names for users and applications, even in a
203large and/or frequently changing (network) environment.")
204 ;; fedfs/ is GPL-2-only but not built.
205 (license (list license:bsd-3 ; modules/cyrus-sasl.c
206 license:gpl2+)))) ; the rest
207
208(define-public bindfs
209 (package
210 (name "bindfs")
211 (version "1.17.4")
212 (source (origin
213 (method url-fetch)
214 (uri (string-append "https://bindfs.org/downloads/bindfs-"
215 version ".tar.gz"))
216 (sha256
217 (base32
218 "1k1xkyjk8ms11djbhlmykkzfbcids6ls5vpq7rhdnazcladszm3g"))))
219 (build-system gnu-build-system)
220 (arguments
221 ;; XXX: The tests have no hope of passing until there is a "nogroup"
222 ;; entry (or at least some group to which the guix builder does
223 ;; not belong) in the /etc/group file of the build environment.
224 ;; Currently we do not have such a group. Disable tests for now.
225 '(#:tests? #f))
226 (native-inputs
227 ;; Native inputs to run the tests
228 ;; ("ruby" ,ruby)
229 ;; ("valgrind" ,valgrind/pinned)
230 ;; ("which" ,which)
231 (list pkg-config))
232 (inputs
233 (list fuse-2))
234 (home-page "https://bindfs.org")
235 (synopsis "Bind mount a directory and alter permission bits")
236 (description
237 "@command{bindfs} is a FUSE file system for mounting a directory to
238another location, similar to @command{mount --bind}. It can be used for:
239@itemize
240@item Making a directory read-only.
241@item Making all executables non-executable.
242@item Sharing a directory with a list of users (or groups).
243@item Modifying permission bits using rules with chmod-like syntax.
244@item Changing the permissions with which files are created.
245@end itemize")
246 (license license:gpl2+)))
247
248(define-public cachefilesd-inotify
249 (package
250 (name "cachefilesd-inotify")
251 (version "0.11.0")
252 (source
253 (origin
254 (method git-fetch)
255 (uri (git-reference
256 (url "https://gitlab.com/tomalok/cachefilesd-inotify")
257 (commit version)))
258 (file-name (git-file-name name version))
259 (sha256
260 (base32 "0qkrpz69ql6fb3fwh0l35hhf9znnqyxhgv5fzd1gl2a2kz13rq5a"))))
261 (build-system gnu-build-system)
262 (arguments
263 `(#:make-flags
264 (list (string-append "CC=" ,(cc-for-target))
265 ;; The Makefile doesn't support prefix= or similar.
266 (string-append "DESTDIR=" (assoc-ref %outputs "out"))
267 "MANDIR=/share/man")
268 #:tests? #f ; no test suite
269 #:phases
270 (modify-phases %standard-phases
271 (delete 'configure)))) ; no configure script
272 (home-page "https://gitlab.com/tomalok/cachefilesd-inotify")
273 (synopsis
274 "CacheFiles file system cache management daemon (using @code{inotify})")
275 (description
276 "This package provides the user space component of CacheFiles, a caching
277back end that uses a directory on a locally mounted file system (such as ext4)
278as a cache to speed up (by reducing) access to a slower file system and make it
279appear more reliable.
280
281The cached file system is often a network file system such as NFS or CIFS, but
282can also be a local file system like ISO 9660 on a slow optical drive.
283
284CacheFiles itself is part of the kernel but relies on this user space
285@command{cachefilesd} daemon to perform maintenance tasks like culling and
286reaping stale nodes. Only one such daemon can be running at a time, and
287communicates with the kernel through the @file{/dev/cachefiles} character
288device.
289
290This version modifies David Howells original cachefilesd---which appears
291unmaintained---to use the @code{inotify} API instead of the deprecated
292@code{dnotify} to monitor file changes.")
293 (license license:gpl2+)))
294
295(define-public avfs
296 (package
297 (name "avfs")
298 (version "1.1.5")
299 (source (origin
300 (method url-fetch)
301 (uri (string-append "mirror://sourceforge/avf/avfs/" version
302 "/avfs-" version ".tar.bz2"))
303 (sha256
304 (base32
305 "1kvjaaj2dlps98alpc8rhnzhk4vriw46f3y7b2h0jq2d21j3p7xd"))))
306 (build-system gnu-build-system)
307 (arguments
308 '(#:configure-flags '("--enable-library" "--enable-fuse")))
309 (native-inputs (list pkg-config))
310 (inputs (list xz fuse-2))
311 (synopsis "Virtual file system that allows browsing of compressed files")
312 (description
313 "AVFS is a FUSE-based filesystem that allows browsing of compressed
314files. It provides the @command{mountavfs} command that starts a small
315@command{avfsd} daemon. When a specially formatted path under @file{~/.avfs}
316is accessed, the daemon provides listings and content access on the fly. The
317canonical form of virtual file name is:
318
319@example
320[basepath]#handler[options][:parameters][/internalpath]
321@end example
322
323Example file names:
324@itemize
325@item @file{~/.avfs/home/user/archive.tar.gz#ugz#utar/path/file}
326@item @file{~/.avfs/#http:localhost|some|path}
327@end itemize
328
329@code{emacs-dired-hacks} has @code{dired-avfs} module which enables seamless
330integration with @code{avfs}.")
331 (home-page "https://avf.sourceforge.net")
332 (license license:gpl2+)))
333
334(define-public davfs2
335 (package
336 (name "davfs2")
337 (version "1.7.1")
338 (source
339 (origin
340 (method url-fetch)
341 (uri (string-append "https://download.savannah.nongnu.org/releases/"
342 "davfs2/davfs2-" version ".tar.gz"))
343 (sha256
344 (base32 "1b5izj2qivys6nkqjy08nznjwszar8d46ajmw5cf5jvkcw6dv3i9"))))
345 (build-system gnu-build-system)
346 (arguments
347 `(#:configure-flags
348 (list "--sysconfdir=/etc" ; so man pages & binaries contain /etc
349 (string-append "--docdir=" (assoc-ref %outputs "out")
350 "/share/doc/" ,name "-" ,version)
351 (string-append "ssbindir=" (assoc-ref %outputs "out") "/sbin")
352 ;; The default ‘davfs2’ user and group don't exist on most systems.
353 "dav_user=nobody"
354 "dav_group=nogroup")
355 #:phases
356 (modify-phases %standard-phases
357 (add-after 'unpack 'omit-redundancy
358 ;; Don't install redundant copies of /etc examples into /share.
359 (lambda _
360 (substitute* "etc/Makefile.in"
361 (("(dist_pkgdata_DATA =.*) davfs2.conf secrets(.*)"
362 _ prefix suffix)
363 (string-append prefix suffix)))))
364 (add-after 'unpack 'patch-file-names
365 (lambda _
366 ;; Don't auto-load the FUSE kernel module. That's up to root.
367 ;; XXX If/when we restore the previous behaviour, make sure not
368 ;; to introduce a security hole when mount.davfs is setuid.
369 (substitute* "src/kernel_interface.c"
370 (("/sbin/modprobe") "/modprobe/disabled"))))
371 (replace 'install
372 (lambda* (#:key make-flags outputs #:allow-other-keys)
373 (let ((out (assoc-ref outputs "out")))
374 (apply invoke "make" "install"
375 (string-append "pkgsysconfdir=" out "/etc")
376 make-flags)))))))
377 (inputs
378 (list neon
379 ;; Neon requires but doesn't propagate zlib, nor would we want that.
380 ;; XZ as well, but that's already present in the build environment.
381 zlib))
382 (home-page "https://savannah.nongnu.org/projects/davfs2")
383 (synopsis "Mount remote WebDAV resources in the local file system")
384 (description
385 "The @acronym{WebDAV, Web Distributed Authoring and Versioning} extension
386to the HTTP protocol defines a standard way to author resources on a remote Web
387server. Davfs2 exposes such resources as a typical file system which can be
388used by standard applications with no built-in support for WebDAV, such as the
389GNU coreutils (@command{cp}, @command{mv}, etc.) or a graphical word processor.
390
391Davfs2 works with most WebDAV servers with no or little configuration. It
392supports TLS (HTTPS), HTTP proxies, HTTP basic and digest authentication, and
393client certificates. It performs extensive caching to avoid unnecessary network
394traffic, stay responsive even over slow or unreliable connections, and prevent
395data loss. It aims to make use by unprivileged users as easy and secure as
396possible.
397
398However, davfs2 is not a full-featured WebDAV client. The file system interface
399and the WebDAV protocol are quite different. Translating between the two is not
400always possible.")
401 (license (list license:bsd-2 ; src/fuse_kernel.h
402 license:gpl3+)))) ; everything else
403
404(define-public exfat-utils
405 (package
406 (name "exfat-utils")
407 (version "1.4.0")
408 (source
409 (origin
410 (method url-fetch)
411 (uri (string-append
412 "https://github.com/relan/exfat/releases/download/v"
413 version "/exfat-utils-" version ".tar.gz"))
414 (sha256
415 (base32 "0sdzflmwcxjjliq1yqhidy46kbkvj16kxrbrgsj0ci0hjgx7a594"))))
416 (build-system gnu-build-system)
417 (home-page "https://github.com/relan/exfat")
418 (synopsis "Utilities to manipulate exFAT file systems")
419 (description
420 "This package provides an implementation of the exFAT file system,
421including command-line tools to validate exFAT file systems and to create new
422ones.")
423 (license license:gpl2+)))
424
425(define-public fsarchiver
426 (package
427 (name "fsarchiver")
428 (version "0.8.9")
429 (source
430 (origin
431 (method git-fetch)
432 (uri
433 (git-reference
434 (url "https://github.com/fdupoux/fsarchiver")
435 (commit version)))
436 (file-name (git-file-name name version))
437 (sha256
438 (base32 "0wyq140yzhhqzg364ai7m21z2kgvyi6dmqlw5ycblryf0zkvd7vq"))))
439 (build-system gnu-build-system)
440 (native-inputs
441 (list autoconf-2.72 automake pkg-config))
442 (inputs
443 (list bzip2
444 e2fsprogs
445 libgcrypt
446 lz4
447 lzo
448 `(,util-linux "lib")
449 xz
450 zlib
451 `(,zstd "lib")))
452 (synopsis "File system back-up, deployment, and migration tool")
453 (description
454 "FSArchiver saves the contents of a file system to a compressed archive
455file, and restores it to a different file system and/or partition. This
456partition can be of a different size than the original and FSArchiver will
457create a new file system if none exists.
458
459All standard file attributes supported by the kernel are preserved, including
460file permissions, timestamps, symbolic and hard links, and extended attributes.
461
462Each file in the archive is protected by a checksum. If part of the archive
463is corrupted you'll lose the affected file(s) but not the whole back-up.")
464 (home-page "https://www.fsarchiver.org/")
465 (license license:gpl2)))
466
467(define-public fscrypt
468 (package
469 (name "fscrypt")
470 (version "0.3.5")
471 (source
472 (origin
473 (method git-fetch)
474 (uri (git-reference
475 (url "https://github.com/google/fscrypt")
476 (commit (string-append "v" version))))
477 (file-name (git-file-name name version))
478 (sha256
479 (base32 "15b89g7imv4691aq16xn9q6nh6fcdldkxmvysc7igm6a8p1n6bai"))))
480 (build-system go-build-system)
481 (arguments
482 (list
483 #:import-path "github.com/google/fscrypt"
484 #:install-source? #f
485 #:test-flags
486 #~(list "-skip"
487 (string-join (list
488 ;; These tests expect to be able to find /home,
489 ;; /mnt and /tmp.
490 "TestLoadReadOnlyMount"
491 "TestReadWriteMountIsPreferredOverReadOnlyMount"
492 "TestLoadAmbiguousMounts"
493 "TestRootSubtreeIsPreferred") "|")
494 ;; Disable go vet in go 1.24+
495 "-vet=off")
496 #:phases
497 #~(modify-phases %standard-phases
498 (add-before 'build 'fix-version-detection
499 ;; We don't have .git in the build directory.
500 (lambda _
501 (substitute* "src/github.com/google/fscrypt/Makefile"
502 (("\\$\\(shell git describe --tags\\)")
503 (string-append "v" #$version)))))
504 (replace 'build
505 (lambda* (#:key parallel-build? #:allow-other-keys)
506 (with-directory-excursion "src/github.com/google/fscrypt"
507 (invoke "make"
508 "-j" (if parallel-build?
509 (number->string (parallel-job-count))
510 "1")
511 (string-append "CC=" #$(cc-for-target))))))
512 (replace 'install
513 (lambda _
514 (with-directory-excursion "src/github.com/google/fscrypt"
515 (invoke "make" "install"
516 (string-append "PREFIX=" #$output))))))))
517 (native-inputs (list gnu-make
518 go-github-com-client9-misspell
519 go-github-com-pkg-errors
520 go-github-com-urfave-cli
521 go-github-com-wadey-gocovmerge
522 go-golang-org-x-crypto
523 go-golang-org-x-sys
524 go-golang-org-x-term
525 go-golang-org-x-tools
526 go-google-golang-org-protobuf
527 go-honnef-co-go-tools
528 linux-pam
529 m4))
530 (home-page "https://github.com/google/fscrypt")
531 (synopsis "Go tool for managing Linux filesystem encryption")
532 (description "@command{fscrypt} is a high-level tool for the management of
533Linux native filesystem encryption. It manages metadata, key generation, key
534wrapping, PAM integration, and provides a uniform interface for creating and
535modifying encrypted directories.")
536 (license license:asl2.0)))
537
538(define-public fscryptctl
539 (package
540 (name "fscryptctl")
541 (version "1.2.0")
542 (source
543 (origin
544 (method git-fetch)
545 (uri (git-reference
546 (url "https://github.com/google/fscryptctl")
547 (commit (string-append "v" version))))
548 (file-name (git-file-name name version))
549 (sha256
550 (base32 "15zbmh9jlhqbai7lcaqyvymrjjcdi0l9zli9j51skwap59sq9jz6"))))
551 (build-system gnu-build-system)
552 (arguments
553 (list
554 #:make-flags #~(list (string-append "PREFIX=" #$output)
555 (string-append "CC=" #$(cc-for-target)))
556 #:tests? #f ;Test setup requires root
557 #:phases
558 #~(modify-phases %standard-phases
559 ;; No ./configure script
560 (delete 'configure))))
561 (native-inputs (list pandoc))
562 (home-page "https://github.com/google/fscryptctl")
563 (synopsis "Small C tool for Linux filesystem encryption")
564 (description "@command{fscryptctl} is a low-level tool written in C that
565handles raw keys and manages policies for Linux filesystem encryption,
566specifically the @code{fscrypt} kernel interface which is supported by the
567ext4, f2fs, UBIFS, and CephFS filesystems.")
568 (license license:asl2.0)))
569
570(define-public fstransform
571 (package
572 (name "fstransform")
573 (version "0.9.4")
574 (source
575 (origin
576 (method git-fetch)
577 (uri (git-reference
578 (url "https://github.com/cosmos72/fstransform")
579 (commit version)))
580 (file-name (git-file-name name version))
581 (sha256
582 (base32 "0vhypb6pbghja95av62ds4mhldbg0h8g4yg94k9r7lsxm7bgpfr3"))))
583 (build-system gnu-build-system)
584 (arguments
585 (list #:phases
586 #~(modify-phases %standard-phases
587 (add-after 'install 'install-README
588 ;; There are no man pages. Install a poor substitute.
589 (lambda* (#:key outputs #:allow-other-keys)
590 (let* ((out (assoc-ref outputs "out"))
591 (doc (string-append out "/share/doc/" #$name)))
592 (install-file "README" doc)))))))
593 (inputs (list e2fsprogs))
594 (home-page "https://github.com/cosmos72/fstransform")
595 (synopsis "Convert file system types in place without copying all data")
596 (description
597 "This package provides several command-line tools to transform a supported
598file system, such as XFS, into one of a different supported type, such as ext4.
599All existing file contents, names, and directories are preserved.
600
601The conversion happens @dfn{in place}, without the need to create a complete
602copy of the original data. This lets you transform almost full file systems on
603systems where adding (sufficient) additional storage space is not an option.
604
605Do @emph{not} use this package when you could simply create an empty file system
606from scratch and restore from a back-up. Transformation is limited, slow, and
607significantly increases the risk of irreversible data loss!")
608 ;; Please follow <https://github.com/cosmos72/fstransform/issues/46>.
609 (license (list license:gpl2 ; fsattr/src/e4attr.* → sbin/fsattr
610 license:gpl3+)))) ; the rest
611
612(define-public gocryptfs
613 (package
614 (name "gocryptfs")
615 (version "2.6.1")
616 (source (origin
617 (method git-fetch)
618 (uri (git-reference
619 (url "https://github.com/rfjakob/gocryptfs")
620 (commit (string-append "v" version))))
621 (file-name (git-file-name name version))
622 (sha256
623 (base32
624 "09cmvfjkv0nazw52f9vxf4br75wlyng81s6vslk5zqydlrqwa0mr"))))
625 (build-system go-build-system)
626 (arguments
627 (list
628 #:install-source? #f
629 #:import-path "github.com/rfjakob/gocryptfs"
630 #:build-flags
631 #~(list
632 "-ldflags" (string-append
633 "-X main.GitVersion=" #$version
634 " -X main.GitVersionFuse=" #$(package-version
635 go-github-com-hanwen-go-fuse-v2)
636 " -X main.BuildDate=" "[reproducible]"))
637 #:test-flags
638 #~(list "-skip" (string-join
639 (list "TestPrepareAtSyscall"
640 "TestPrepareAtSyscallPlaintextnames"
641 "TestGetdents")
642 "|")
643 ;; disable go vet for go 1.24+
644 "-vet=off")
645 ;; XXX: Test suit requires a root access to mount, limit to some unit
646 ;; tests, figure out how to enable most of the them.
647 #:test-subdirs #~(list "internal/...")
648 #:phases
649 #~(modify-phases %standard-phases
650 ;; after 'check phase, should maybe unmount leftover mounts as in
651 ;; https://github.com/rfjakob/gocryptfs/blob/a55b3cc15a6d9bce116a90f33df4bc99d9dd6a10/test.bash#L28
652 (add-after 'unpack 'fix-paths
653 (lambda* (#:key import-path #:allow-other-keys)
654 (let* ((fusermount3 "/run/setuid-programs/fusermount3"))
655 (substitute* (format #f "src/~a/mount.go" import-path)
656 (("/bin/fusermount") fusermount3)))))
657 (replace 'build
658 (lambda arguments
659 (for-each
660 (lambda (directory)
661 (apply (assoc-ref %standard-phases 'build)
662 (append arguments (list #:import-path directory))))
663 (list
664 "github.com/rfjakob/gocryptfs"
665 "github.com/rfjakob/gocryptfs/gocryptfs-xray"
666 "github.com/rfjakob/gocryptfs/contrib/statfs"
667 "github.com/rfjakob/gocryptfs/contrib/findholes"
668 "github.com/rfjakob/gocryptfs/contrib/atomicrename")))))))
669 (native-inputs (list
670 go-github-com-aperturerobotics-jacobsa-crypto
671 go-github-com-hanwen-go-fuse-v2
672 go-github-com-moby-sys-mountinfo
673 go-github-com-pkg-xattr
674 go-github-com-rfjakob-eme
675 go-github-com-sabhiram-go-gitignore
676 go-github-com-spf13-pflag
677 go-golang-org-x-crypto
678 go-golang-org-x-sys
679 go-golang-org-x-term
680 openssl
681 pkg-config))
682 (inputs (list
683 fuse))
684 (home-page "https://github.com/rfjakob/gocryptfs")
685 (synopsis "Encrypted overlay filesystem")
686 (description
687 "Gocryptfs is an encrypted overlay filesystem written in Go. It
688features a file-based encryption that is implemented as a mountable
689FUSE filesystem.
690
691Gocryptfs was inspired by EncFS and strives to fix its security issues
692while providing good performance. Gocryptfs is as fast as EncFS in the
693default mode and significantly faster than paranoia mode in EncFS,
694which provides a security level comparable to Gocryptfs.
695
696On CPUs without AES-NI, gocryptfs uses OpenSSL through a thin wrapper
697called stupidgcm. This provides a 4x speedup compared to Go's builtin
698AES-GCM implementation.")
699 (license license:expat)))
700
701(define-public gphotofs
702 (package
703 (name "gphotofs")
704 (version "0.5.0")
705 (source
706 (origin
707 (method url-fetch)
708 (uri
709 (string-append "mirror://sourceforge/gphoto/gphotofs/" version
710 "/gphotofs-0.5.tar.gz"))
711 (sha256
712 (base32
713 "04slwhr6ap9xcc27wphk22ad8yn79ngyy5z10lxams3k5liahvc2"))))
714 (build-system gnu-build-system)
715 (native-inputs
716 (list pkg-config))
717 (inputs
718 (list fuse-2 glib libgphoto2))
719 (synopsis "Virtual file system for libgphoto2 using FUSE")
720 (description "GPhotoFS is a FUSE file system module to mount your camera as
721a file system on Linux. This allow using your camera with any tool able to read
722from a mounted file system.")
723 (home-page "http://www.gphoto.org/proj/gphotofs/")
724 (license license:gpl2+)))
725
726(define (bcachefs-tools-rust-target)
727 (platform-rust-target (lookup-platform-by-target-or-system
728 (or (%current-target-system)
729 (%current-system)))))
730
731(define (bcachefs-tools-target/release)
732 (string-append "target/" (bcachefs-tools-rust-target) "/release"))
733
734(define (bcachefs-tools-cargo-args)
735 ;; Distinct from -MAKE-FLAGS for use with ‘cargo test’ in 'check.
736 #~(list "--release"
737 (string-append "--target=" #$(bcachefs-tools-rust-target))))
738
739;; XXX We want to share common make flags across different packages & phases,
740;; but the cargo-build-system doesn't allow #:make-flags.
741(define (bcachefs-tools-make-flags)
742 ;; These result of these flags should be as minimal as possible.
743 ;; Enable any optional features in the bcachefs-tools package instead.
744 #~(list (string-append "CARGO_BUILD_ARGS="
745 (string-join #$(bcachefs-tools-cargo-args) " "))
746 (string-append "CC=" #$(cc-for-target))
747 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))))
748
749(define (bcachefs-tools-make-install-flags)
750 #~(cons* (string-append "PREFIX=" #$output)
751 "INITRAMFS_DIR=$(PREFIX)/share/initramfs-tools"
752 "PKGCONFIG_UDEVRULESDIR=$(PREFIX)/lib/udev/rules.d"
753 #$(bcachefs-tools-make-flags)))
754
755(define bcachefs-tools-minimal
756 ;; This ‘minimal’ package is not *that* minimal, and not different enough to
757 ;; export. It's used as-is only when cross-compiling, as an input to the
758 ;; public bcachefs-tools package that inherits from it to generate the shell
759 ;; completions by running a native bcachefs binary at build time.
760 (package
761 (name "bcachefs-tools-minimal")
762 (version "1.39.6")
763 (source
764 (origin
765 (method git-fetch)
766 (uri (git-reference
767 (url "https://evilpiepirate.org/git/bcachefs-tools.git")
768 (commit (string-append "v" version))))
769 (file-name (git-file-name name version))
770 (sha256
771 (base32 "0sfv218870pvhinh3vlwci5qfr5dp26y3a799rmkwbcy1vz2f5kh"))))
772 (build-system cargo-build-system)
773 (arguments
774 (list
775 #:install-source? #f
776 ;; The Makefile CCs *every* C file anywhere beneath the build directory,
777 ;; even in Rust crates, creating ludicrous and totally bogus dependencies
778 ;; such as the Android SDK. Put our crates elsewhere.
779 #:vendor-dir "../guix-vendor"
780 #:phases
781 #~(modify-phases %standard-phases
782 (add-after 'unpack 'add-version
783 (lambda _
784 (with-output-to-file ".version"
785 (lambda ()
786 (display #$version)))))
787 (replace 'build
788 (lambda* (#:key parallel-build? #:allow-other-keys)
789 (apply invoke "make"
790 "-j" (if parallel-build?
791 (number->string (parallel-job-count))
792 "1")
793 (string-append "VERSION=" #$version)
794 #$(bcachefs-tools-make-flags))))
795 (add-before 'install 'patch-install
796 ;; ‘make install’ hard-codes target/release/bcachefs, which is
797 ;; incorrect when passing --target, as required to cross-compile or
798 ;; even just link statically. We always pass it, so always patch.
799 ;; 'make install' also always installs sources for kernel module
800 ;; build, which is packaged separately in Guix, so disable here.
801 (lambda _
802 (substitute* "Makefile"
803 (("install: all install_dkms")
804 "install: all")
805 (("target/release")
806 #$(bcachefs-tools-target/release)))))
807 (replace 'check
808 (lambda* (#:key tests? #:allow-other-keys)
809 (when tests?
810 (apply invoke "cargo" "test"
811 "--lib" "--bins" "--tests"
812 "--examples" ; Omitting "--docs" to skip doctests
813 #$(bcachefs-tools-cargo-args)))))
814 (replace 'install
815 (lambda _
816 (apply invoke "make" "install"
817 #$(bcachefs-tools-make-install-flags)))))))
818 (native-inputs
819 (list pkg-config
820 rust
821 rust-bindgen-cli
822 rust-cbindgen))
823 (inputs
824 (cons* clang-18 ;Same version as used for rust-bindgen-cli
825 eudev
826 keyutils
827 libaio
828 libscrypt
829 libsodium
830 liburcu
831 libunwind
832 `(,util-linux "lib") ;libblkid
833 lz4
834 xz ;for liblzma
835 zlib
836 `(,zstd "lib")
837 (cargo-inputs 'bcachefs-tools)))
838 (home-page "https://bcachefs.org/")
839 (synopsis "Tools to create and manage bcachefs file systems")
840 (description
841 "This package provides the @command{bcachefs} command-line tool with many
842subcommands for creating, checking, and otherwise managing bcachefs file
843systems. Traditional aliases like @command{mkfs.bcachefs} are also included.
844
845@dfn{Bcachefs} is a @acronym{CoW, copy-on-write} file system supporting native
846encryption, compression, snapshots, and (meta)data checksums. It can use
847multiple block devices for replication and/or performance, similar to RAID.
848
849In addition, bcachefs provides all the functionality of bcache, a block-layer
850caching system, and lets you assign different roles to each device based on its
851performance and other characteristics.")
852 (license license:gpl2+)))
853
854(define-public bcachefs-tools
855 ;; The final public package with shell completion even when cross-compiling,
856 ;; as well as optional features.
857 (package
858 (inherit bcachefs-tools-minimal)
859 (name "bcachefs-tools")
860 (arguments
861 (substitute-keyword-arguments
862 (package-arguments bcachefs-tools-minimal)
863 ((#:modules modules '())
864 `(,@modules
865 (guix build cargo-build-system)
866 (guix build utils)
867 (srfi srfi-26)))
868 ((#:phases phases #~%standard-phases)
869 #~(modify-phases #$phases
870 (add-after 'install 'install-completions
871 (lambda* (#:key native-inputs #:allow-other-keys)
872 (define bcachefs
873 (or (false-if-exception (search-input-file native-inputs
874 "sbin/bcachefs"))
875 (string-append #$(bcachefs-tools-target/release)
876 "/bcachefs")))
877
878 (define (output-completions shell file)
879 (let ((output (string-append #$output "/" file)))
880 (mkdir-p (dirname output))
881 (with-output-to-file output
882 (lambda _
883 (invoke bcachefs "completions" shell)))))
884
885 (for-each (cut apply output-completions <>)
886 '(("bash"
887 "share/bash-completion/completions/bcachefs")
888 ("fish"
889 "share/fish/vendor_completions.d/bcachefs.fish")
890 ("zsh"
891 "share/zsh/site-functions/_bcachefs")))))))))
892 (native-inputs
893 (append (package-native-inputs bcachefs-tools-minimal)
894 (if (%current-target-system)
895 (list bcachefs-tools-minimal)
896 (list))))))
897
898(define-public bcachefs-tools-minimal/static
899 ;; The static variant is public for consistency with the other file system
900 ;; tools packages, but ours is based on the private minimal package. We
901 ;; don't need/want a bcachefs with FUSE support in the initrd, and nobody
902 ;; is likely to complain about the lack of a non-minimal bcachefs-static…
903 (package
904 (inherit bcachefs-tools-minimal)
905 (name "bcachefs-tools-minimal-static")
906 (arguments
907 (substitute-keyword-arguments arguments
908 ((#:phases phases #~%standard-phases)
909 #~(modify-phases #$phases
910 (add-after 'unpack 'patch-makefile
911 (lambda _
912 ;; Change in v1.13.0 (commit 3666da87) adds
913 ;; default-linker-libraries to RUSTFLAGS which breaks
914 ;; static builds by trying to link against libc
915 (substitute* "Makefile"
916 (("export RUSTFLAGS:=\\$\\(RUSTFLAGS\\) -C default-linker-libraries")
917 "export RUSTFLAGS:=$(RUSTFLAGS)"))))
918 (add-after 'configure 'set-rust-flags
919 (lambda _
920 (setenv "RUSTFLAGS" (string-join
921 '("-C" "link-arg=-z"
922 "-C" "link-arg=muldefs"
923 "-C" "link-arg=-llzma"
924 "-C" "target-feature=+crt-static"
925 "-C" "relocation-model=static")
926 " "))))
927 (replace 'build
928 (lambda* (#:key parallel-build? #:allow-other-keys)
929 (apply invoke "make"
930 "-j" (if parallel-build?
931 (number->string (parallel-job-count))
932 "1")
933 (string-append "VERSION="
934 #$(package-version this-package))
935 #$(bcachefs-tools-make-flags))))
936 (replace 'install
937 (lambda _
938 (apply invoke "make" "install"
939 (string-append "PREFIX=" #$output)
940 #$(bcachefs-tools-make-install-flags))))))))
941 (inputs (modify-inputs inputs
942 (prepend `(,eudev "static")
943 `(,keyutils "static")
944 `(,libscrypt "static")
945 libunwind-static
946 `(,lz4 "static")
947 `(,util-linux "static")
948 `(,xz "static")
949 `(,zlib "static")
950 `(,zstd "static"))))
951 (synopsis "Statically-linked, minimal variant of bcachefs-tools")))
952
953(define-public bcachefs/static
954 (package
955 (name "bcachefs-static")
956 (version (package-version bcachefs-tools-minimal/static))
957 (source #f)
958 (build-system trivial-build-system)
959 (arguments
960 (list #:modules '((guix build utils))
961 #:builder
962 #~(begin
963 (use-modules (guix build utils))
964 (let ((target (string-append #$output "/sbin/bcachefs")))
965 (install-file (search-input-file %build-inputs "sbin/bcachefs")
966 (dirname target))
967 (remove-store-references target)))))
968 (inputs
969 (list bcachefs-tools-minimal/static))
970 (home-page (package-home-page bcachefs-tools-minimal/static))
971 (synopsis "Statically-linked bcachefs command from bcachefs-tools")
972 (description
973 "This package provides the statically-linked @command{bcachefs} from a
974minimal bcachefs-tools package. It is meant to be used in initrds.")
975 (license (package-license bcachefs-tools-minimal/static))))
976
977(define-public bcachefs-linux-module
978 (package
979 (name "bcachefs-linux-module")
980 (version (package-version bcachefs-tools-minimal))
981 (source (package-source bcachefs-tools-minimal))
982 (build-system linux-module-build-system)
983 (arguments
984 (list
985 #:make-flags #~(list "BCACHEFS_DKMS=1")
986 #:tests? #f ;no 'check' target
987 #:source-directory "build/src/fs/bcachefs"
988 #:phases
989 #~(modify-phases %standard-phases
990 (add-after 'unpack 'add-version
991 (lambda _
992 (with-output-to-file ".version"
993 (lambda ()
994 (display #$version)))))
995 (add-before 'configure 'prepare-build-directory
996 (lambda* (#:key make-flags #:allow-other-keys)
997 (apply invoke "make" "install_dkms"
998 (string-append "DESTDIR="
999 (getcwd) "/")
1000 "DKMSDIR=build/"
1001 make-flags))))))
1002 (native-inputs (list pkg-config rust rust-bindgen-cli rust-cbindgen))
1003 (home-page (package-home-page bcachefs-tools-minimal))
1004 (synopsis "Bcachefs Linux kernel module")
1005 (description
1006 "This package provides the Linux kernel module for Bcachefs.
1007
1008@dfn{Bcachefs} is a @acronym{CoW, copy-on-write} file system supporting native
1009encryption, compression, snapshots, and (meta)data checksums. It can use
1010multiple block devices for replication and/or performance, similar to RAID.
1011
1012In addition, Bcachefs provides all the functionality of bcache, a block-layer
1013caching system, and lets you assign different roles to each device based on its
1014performance and other characteristics.")
1015 (license license:gpl2)))
1016
1017(define-public exfatprogs
1018 (package
1019 (name "exfatprogs")
1020 (version "1.2.9")
1021 (source
1022 (origin
1023 (method git-fetch)
1024 (uri (git-reference
1025 (url "https://github.com/exfatprogs/exfatprogs")
1026 (commit version)))
1027 (file-name (git-file-name name version))
1028 (sha256
1029 (base32 "0phimvrm13kjrfdlsvzkapy8hgfgf4w62yz3zg4y4yjvzsal2hqh"))))
1030 (build-system gnu-build-system)
1031 (arguments
1032 (list
1033 #:configure-flags
1034 #~(list "--disable-static")
1035 #:tests? #f)) ;the tests require QEMU
1036 (native-inputs
1037 (list autoconf-2.72 automake libtool pkg-config))
1038 (home-page "https://github.com/exfatprogs/exfatprogs")
1039 (synopsis "Tools to create, check, and repair exFAT file systems")
1040 (description
1041 "These are command-line user space tools for the @acronym{exFAT,
1042Extensible File Allocation Table} file systems. Included are
1043@command{mkfs.exfat} to create (format) new exFAT file systems, and
1044@command{fsck.exfat} to check their consistency and repair them.")
1045 (license license:gpl2+)))
1046
1047(define-public httpfs2
1048 (package
1049 (name "httpfs2")
1050 (version "0.1.5")
1051 (source
1052 (origin
1053 (method url-fetch)
1054 (uri (string-append "mirror://sourceforge/httpfs/httpfs2/"
1055 "httpfs2-" version ".tar.gz"))
1056 (sha256
1057 (base32
1058 "1h8ggvhw30n2r6w11n1s458ypggdqx6ldwd61ma4yd7binrlpjq1"))))
1059 (build-system gnu-build-system)
1060 (native-inputs
1061 (list asciidoc docbook-xml libxml2 libxslt pkg-config))
1062 (inputs
1063 (list fuse-2 gnutls))
1064 (arguments
1065 (list #:phases
1066 #~(modify-phases %standard-phases
1067 (delete 'configure) ; no configure script
1068 (replace 'install
1069 ;; There's no ‘install’ target. Install all variants manually.
1070 (lambda _
1071 (let* ((bin (string-append #$output "/bin"))
1072 (man1 (string-append #$output "/share/man/man1")))
1073 (mkdir-p bin)
1074 (mkdir-p man1)
1075 (for-each
1076 (lambda (variant)
1077 (let ((man1-page (string-append variant ".1")))
1078 (install-file variant bin)
1079 (install-file man1-page man1)))
1080 (list "httpfs2"
1081 "httpfs2-mt"
1082 "httpfs2-ssl"
1083 "httpfs2-ssl-mt"))))))
1084 #:make-flags
1085 #~(list (string-append "CC=" #$(cc-for-target)))
1086 #:parallel-build? #f ; can result in missing man pages
1087 #:tests? #f)) ; no tests
1088 (home-page "https://sourceforge.net/projects/httpfs/")
1089 (synopsis "Mount remote files over HTTP")
1090 (description "httpfs2 is a @code{fuse} file system for mounting any
1091@dfn{HyperText} (HTTP or HTTPS) URL. It uses HTTP/1.1 byte ranges to request
1092arbitrary bytes from the web server, without needing to download the entire
1093file. This is particularly useful with large archives such as ZIP files and
1094ISO images when you only need to inspect their contents or extract specific
1095files. Since the HTTP protocol itself has no notion of directories, only a
1096single file can be mounted.")
1097 (license license:gpl2+)))
1098
1099(define-public jfsutils
1100 (package
1101 (name "jfsutils")
1102 (version "1.1.15")
1103 (source
1104 (origin
1105 (method url-fetch)
1106 (uri (string-append "http://jfs.sourceforge.net/project/pub/jfsutils-"
1107 version ".tar.gz"))
1108 (sha256
1109 (base32 "0kbsy2sk1jv4m82rxyl25gwrlkzvl3hzdga9gshkxkhm83v1aji4"))
1110 (patches (search-patches "jfsutils-add-sysmacros.patch"
1111 "jfsutils-gcc-compat.patch"
1112 "jfsutils-include-systypes.patch"))))
1113 (build-system gnu-build-system)
1114 (inputs
1115 (list `(,util-linux "lib")))
1116 (home-page "https://jfs.sourceforge.net/home.html")
1117 (synopsis "Utilities for managing JFS file systems")
1118 (description
1119 "The JFSutils are a collection of utilities for managing the @acronym{JFS,
1120Journaled File System}, a 64-bit journaling file system created by IBM and later
1121ported to the kernel Linux. The following commands are available:
1122@enumerate
1123@item @command{fsck.jfs}: check and repair a JFS file system or replay its
1124transaction log.
1125@item @command{logdump}: dump the JFS journal log.
1126@item @command{logredo}: replay the JFS journal log.
1127@item @command{mkfs.jfs}: create a new JFS file system.
1128@item @command{xchklog}: save a JFS fsck log to a file.
1129@item @command{xchkdmp}: dump the contents of such a log file.
1130@item @command{xpeek}: a JFS file system editor with a shell-like interface.
1131@end enumerate\n")
1132 (license license:gpl3+))) ; no explicit version given
1133
1134(define-public jfsutils/static
1135 (static-package
1136 (package
1137 (inherit jfsutils)
1138 (name "jfsutils-static")
1139 (inputs
1140 (modify-inputs inputs
1141 (prepend (list util-linux "static")))))))
1142
1143(define-public jfs_fsck/static
1144 (package
1145 (name "jfs_fsck-static")
1146 (version (package-version jfsutils))
1147 (source #f)
1148 (build-system trivial-build-system)
1149 (arguments
1150 (list
1151 #:modules '((guix build utils))
1152 #:builder
1153 #~(begin
1154 (use-modules (guix build utils))
1155 (let* ((sbin (string-append #$output "/sbin"))
1156 (fsck (string-append sbin "/jfs_fsck")))
1157 (install-file (search-input-file %build-inputs "sbin/jfs_fsck")
1158 sbin)
1159 (remove-store-references fsck)
1160 (chmod fsck #o555)))))
1161 (inputs
1162 (list jfsutils/static))
1163 (home-page (package-home-page jfsutils))
1164 (synopsis "Statically-linked jfs_fsck command from jfsutils")
1165 (description
1166 "This package provides statically-linked jfs_fsck command taken
1167from the jfsutils package. It is meant to be used in initrds.")
1168 (license (package-license jfsutils))))
1169
1170(define-public nilfs-utils
1171 (package
1172 (name "nilfs-utils")
1173 (version "2.2.11")
1174 (source
1175 (origin
1176 (method url-fetch)
1177 (uri (string-append "https://nilfs.sourceforge.io/download"
1178 "/nilfs-utils-" version ".tar.bz2"))
1179 (sha256
1180 (base32 "1k9l5kzhdph3jh04kxz4dn5yb210205iycbnpklrpi6jy1zqj0l6"))))
1181 (build-system gnu-build-system)
1182 (arguments
1183 (list
1184 #:configure-flags
1185 #~(list "--enable-static=no")
1186 #:phases
1187 #~(modify-phases %standard-phases
1188 (add-before 'bootstrap 'force-bootstrap
1189 (lambda _
1190 (delete-file "configure")
1191 (substitute* "configure.ac"
1192 (("\\[/etc\\]") "[${prefix}/etc]")
1193 (("\\[/sbin\\]") "[${prefix}/sbin]")))))))
1194 (inputs
1195 (list (list util-linux "lib")))
1196 (native-inputs (list autoconf automake libtool))
1197 (home-page "https://nilfs.sourceforge.io/")
1198 (synopsis "Continuous Snapshotting Filesystem")
1199 (description
1200 "NILFS is a log-structured file system supporting versioning of the entire
1201file system and continuous snapshotting, which allows users to even restore
1202files mistakenly overwritten or destroyed just a few seconds ago.")
1203 (license license:gpl3+)))
1204
1205(define-public disorderfs
1206 (package
1207 (name "disorderfs")
1208 (version "0.7.0")
1209 (source
1210 (origin
1211 (method git-fetch)
1212 (uri (git-reference
1213 (url "https://salsa.debian.org/reproducible-builds/disorderfs.git")
1214 (commit version)))
1215 (file-name (git-file-name name version))
1216 (sha256
1217 (base32
1218 "11y9py2sllpj0kv0skb2y43f4cacqaqba3a0bph1pcayyvyvkrg5"))))
1219 (build-system gnu-build-system)
1220 (native-inputs
1221 (list pkg-config))
1222 (inputs
1223 (list fuse attr))
1224 (arguments
1225 `(#:phases (modify-phases %standard-phases
1226 (delete 'configure)) ; no configure script
1227 #:make-flags (let ((out (assoc-ref %outputs "out")))
1228 (list (string-append "PREFIX=" out)))
1229 #:test-target "test"
1230 ;; FIXME: Tests require 'run-parts' which is not in Guix yet.
1231 #:tests? #f))
1232 (home-page "https://salsa.debian.org/reproducible-builds/disorderfs")
1233 (synopsis "FUSE file system that introduces non-determinism")
1234 (description
1235 "An overlay FUSE file system that introduces non-determinism
1236into file system metadata. For example, it can randomize the order
1237in which directory entries are read. This is useful for detecting
1238non-determinism in the build process.")
1239 (license license:gpl3+)))
1240
1241(define-public curlftpfs
1242 (package
1243 (name "curlftpfs")
1244 (version "0.9.2")
1245 (source
1246 (origin
1247 (method url-fetch)
1248 (uri (string-append "mirror://sourceforge/curlftpfs/curlftpfs/" version
1249 "/curlftpfs-" version ".tar.gz"))
1250 (sha256
1251 (base32 "0n397hmv21jsr1j7zx3m21i7ryscdhkdsyqpvvns12q7qwwlgd2f"))
1252 (patches
1253 (search-patches "curlftpfs-fix-error-closing-file.patch"
1254 "curlftpfs-fix-file-names.patch"
1255 "curlftpfs-fix-memory-leak.patch"
1256 "curlftpfs-fix-no_verify_hostname.patch"))))
1257 (build-system gnu-build-system)
1258 (arguments
1259 `(#:phases
1260 (modify-phases %standard-phases
1261 (add-after 'unpack 'fix-test
1262 (lambda _
1263 ;; One of the 512-Byte block counts is definitely wrong.
1264 ;; See <https://sourceforge.net/p/curlftpfs/bugs/73/>.
1265 (substitute* "tests/ftpfs-ls_unittest.c"
1266 (("4426192") "12814800"))
1267 #t)))))
1268 (inputs
1269 (list curl glib fuse-2))
1270 (native-inputs
1271 (list pkg-config))
1272 (home-page "https://curlftpfs.sourceforge.net/")
1273 (synopsis "Mount remote file systems over FTP")
1274 (description
1275 "This is a file system client based on the FTP File Transfer Protocol.")
1276 (license license:gpl2+)))
1277
1278(define-public libeatmydata
1279 (package
1280 (name "libeatmydata")
1281 (version "131") ; also update the "debian-files" input if available
1282 (source
1283 (origin
1284 (method url-fetch)
1285 (uri (string-append "https://www.flamingspork.com/projects/libeatmydata/"
1286 "libeatmydata-" version ".tar.gz"))
1287 (sha256
1288 (base32 "1i5bp9a2vmljci3ihzlxf8482106di2ayy1lpr0qb8rq472sh66g"))))
1289 (build-system gnu-build-system)
1290 (arguments
1291 ;; All tests pass---but only if the host kernel allows PTRACE_TRACEME.
1292 `(#:tests? #f
1293 #:configure-flags
1294 (list "--disable-static")
1295 #:phases
1296 (modify-phases %standard-phases
1297 (add-after 'unpack 'patch-file-names
1298 (lambda* (#:key inputs #:allow-other-keys)
1299 (substitute* (list "eatmydata.in" "eatmydata.sh.in")
1300 (("basename|readlink|uname" command)
1301 (search-input-file inputs
1302 (string-append "bin/" command))))))
1303 (add-before 'patch-file-names 'tighten-symlink-mode
1304 ;; When the ‘eatmydata’ helper detects that it's a symlink, it will
1305 ;; transparently invoke the command of the same name. However, it's
1306 ;; *always* a link in Guix profiles and doesn't handle that well.
1307 ;; Patch it to treat its own $name specially.
1308 (lambda _
1309 (substitute* "eatmydata.in"
1310 (("-L \"\\$0\"" match)
1311 (string-append match " ] && [ "
1312 "\"x$(basename \"$0\")\" != \"x$name\"")))))
1313 (add-after 'install 'install-debian-files
1314 (lambda* (#:key inputs outputs #:allow-other-keys)
1315 (let* ((debian (assoc-ref inputs "debian-files"))
1316 (out (assoc-ref outputs "out"))
1317 (share (string-append out "/share")))
1318 (invoke "tar" "xvf" debian)
1319 (with-directory-excursion "debian"
1320 (install-file "eatmydata.1" (string-append share "/man/man1"))
1321 (install-file "eatmydata.bash-completion"
1322 (string-append share "/bash-completion"
1323 "/completions")))))))))
1324 (native-inputs
1325 `(("debian-files" ; for the man page
1326 ,(origin
1327 ;; Debian being what it is, its version can lag behind a bit. This
1328 ;; is tolerable as the man page is general and the command stable.
1329 (method url-fetch)
1330 (uri (string-append "https://deb.debian.org/debian/pool/main/"
1331 "libe/libeatmydata/libeatmydata_130-2"
1332 ".debian.tar.xz"))
1333 (sha256
1334 (base32 "1sg9g1nv3wl9ymzz33ig4ns563npkbxj67a64m7p34cc813jl95w"))))
1335 ;; For the test suite.
1336 ("strace" ,strace)
1337 ("which" ,which)))
1338 (inputs
1339 (list coreutils))
1340 (home-page "https://www.flamingspork.com/projects/libeatmydata/")
1341 (synopsis "Transparently ignore calls to synchronize data safely to disk")
1342 (description
1343 "Libeatmydata transparently disables most ways a program might force data
1344to be written to the file system, such as @code{fsync()} or @code{open(O_SYNC)}.
1345
1346Such synchronisation calls provide important data integrity guarantees but are
1347expensive to perform and can significantly slow down software that (over)uses
1348them.
1349
1350This price is worth paying if you care about the files being modified---which is
1351typically the case---or when manipulating important components of your system.
1352Please, @emph{do not} use something called ``eat my data'' in such cases!
1353
1354However, it does not make sense to accept this performance hit if the data is
1355unimportant and you can afford to lose all of it in the event of a crash, for
1356example when running a software test suite. Adding @file{libeatmydata.so} to
1357the @env{LD_PRELOAD} environment of such tasks will override all C library data
1358synchronisation functions with custom @i{no-op} ones that do nothing and
1359immediately return success.
1360
1361A simple @command{eatmydata} script is included that does this for you.")
1362 (license license:gpl3+)))
1363
1364(define-public libnfs
1365 (package
1366 (name "libnfs")
1367 (version "4.0.0")
1368 (source (origin
1369 (method git-fetch)
1370 (uri (git-reference
1371 (url "https://github.com/sahlberg/libnfs")
1372 (commit (string-append "libnfs-" version))))
1373 (file-name (git-file-name name version))
1374 (sha256
1375 (base32
1376 "0i27wd4zvhjz7620q043p4d4mkx8zv2yz9adm1byin47dynahyda"))))
1377 (build-system gnu-build-system)
1378 (home-page "https://github.com/sahlberg/libnfs")
1379 (native-inputs
1380 (list autoconf automake libtool pkg-config))
1381 (synopsis "Client library for accessing NFS shares")
1382 (description "LIBNFS is a client library for accessing NFS shares over a
1383network. LIBNFS offers three different APIs, for different use :
1384
1385@enumerate
1386@item RAW, a fully asynchronous low level RPC library for NFS protocols. This
1387 API provides very flexible and precise control of the RPC issued.
1388@item NFS ASYNC, a fully asynchronous library for high level vfs functions
1389@item NFS SYNC, a synchronous library for high level vfs functions.
1390@end enumerate\n")
1391 (license (list license:lgpl2.1+ ; library
1392 license:gpl3+ ; tests
1393 license:bsd-3 ; copied nsf4 files
1394 ))))
1395
1396(define-public apfs-fuse
1397 (let ((commit "66b86bd525e8cb90f9012543be89b1f092b75cf3")
1398 (revision "2"))
1399 (package
1400 (name "apfs-fuse")
1401 (version (git-version "0.0.0" revision commit))
1402 (source (origin
1403 (method git-fetch)
1404 (uri (git-reference
1405 (url "https://github.com/sgan81/apfs-fuse")
1406 (recursive? #t) ; for lzfse
1407 (commit commit)))
1408 (sha256
1409 (base32 "0f63slyzv8fbgshpzrx2g01x9h73g5yvh5kis4yazl19fjm2b05r"))
1410 (file-name (git-file-name name version))))
1411 (build-system cmake-build-system)
1412 (arguments
1413 `(#:tests? #f ; No test suite
1414 #:phases
1415 (modify-phases %standard-phases
1416 ;; No 'install' target in CMakeLists.txt
1417 (replace 'install
1418 (lambda* (#:key outputs #:allow-other-keys)
1419 (let* ((out (assoc-ref outputs "out"))
1420 (bin (string-append out "/bin"))
1421 (lib (string-append out "/lib"))
1422 (doc (string-append out "/share/doc/"
1423 (string-append ,name "-" ,version))))
1424 (install-file "apfs-dump" bin)
1425 (install-file "apfs-dump-quick" bin)
1426 (install-file "apfs-fuse" bin)
1427 (install-file "../source/README.md" doc)))))))
1428 (inputs
1429 (list bzip2 fuse zlib))
1430 (synopsis "Read-only FUSE driver for the APFS file system")
1431 (description "APFS-FUSE is a read-only FUSE driver for the @dfn{Apple File
1432System} (APFS). It is currently in an experimental state — it may not be able
1433to read all files, and it does not support all the compression methods in
1434APFS.")
1435 (home-page "https://github.com/sgan81/apfs-fuse")
1436 (license license:gpl2+))))
1437
1438(define-public snapper
1439 (package
1440 (name "snapper")
1441 (version "0.12.1")
1442 (source
1443 (origin
1444 (method git-fetch)
1445 (uri (git-reference
1446 (url "https://github.com/openSUSE/snapper")
1447 (commit (string-append "v" version))))
1448 (file-name (git-file-name name version))
1449 (sha256
1450 (base32 "1i5623cnhzivf64zr0g1nlyn9sjgabhyawhpsffykdxvcrnyqn69"))
1451 (modules '((guix build utils)))
1452 (snippet
1453 '(begin
1454 (delete-file-recursively "dists")
1455 (delete-file-recursively "zypp-plugin")
1456 (substitute* '("configure.ac" "doc/Makefile.am")
1457 ((".*dists.*") "")
1458 ((".*zypp-plugin.*") ""))
1459 (substitute* "Makefile.am"
1460 (("zypp-plugin") ""))))))
1461 (build-system gnu-build-system)
1462 (arguments
1463 (list #:phases #~(modify-phases %standard-phases
1464 (add-after 'unpack 'relative-file-locations
1465 (lambda* (#:key outputs #:allow-other-keys)
1466 (let* ((out (assoc-ref outputs "out")))
1467 (substitute* '("scripts/Makefile.am"
1468 "client/systemd-helper/Makefile.am"
1469 "client/installation-helper/Makefile.am"
1470 "data/Makefile.am")
1471 (("/usr/share")
1472 (string-append out "/share"))
1473 (("/usr/lib")
1474 (string-append out "/lib"))
1475 (("/etc/")
1476 (string-append out "/etc/")))
1477 (substitute* (cons "data/org.opensuse.Snapper.service"
1478 (find-files "scripts/" "\\.sh"))
1479 (("/usr/bin/snapper")
1480 (string-append out "/bin/snapper"))
1481 (("/usr/sbin/snapperd")
1482 (string-append out "/sbin/snapperd"))
1483 (("/sbin/btrfs")
1484 (which "btrfs")))
1485 (substitute* "scripts/snapper-hourly"
1486 (("PATH=.*$")
1487 (format #f "PATH=~a/sbin:~a/bin\n"
1488 out out)))
1489 (substitute* (find-files "." "Makefile.am")
1490 (("/usr/lib")
1491 "@libdir@"))))))))
1492 (home-page "https://snapper.io")
1493 (native-inputs
1494 (list
1495 (libc-locales-for-target (%current-system))
1496 autoconf automake libtool pkg-config))
1497 (inputs
1498 (list btrfs-progs
1499 e2fsprogs
1500 `(,util-linux "lib")
1501 linux-pam
1502 dbus
1503 libxml2
1504 json-c
1505 acl
1506 boost-1.83
1507 ncurses/tinfo
1508 libxslt
1509 docbook-xsl
1510 gettext-minimal))
1511 (synopsis "Manage Btrfs file system snapshots and allow roll-backs")
1512 (description "This package provides Snapper, a tool that helps with
1513managing snapshots of Btrfs subvolumes and thin-provisioned LVM volumes. It
1514can create and compare snapshots, revert differences between them, and
1515supports automatic snapshots timelines.")
1516 (license license:gpl2)))
1517
1518(define-public xfstests
1519 (package
1520 (name "xfstests")
1521 (version "2026.03.20")
1522 (source
1523 (origin
1524 (method git-fetch)
1525 (uri (git-reference
1526 (url "git://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git")
1527 (commit (string-append "v" version))))
1528 (file-name (git-file-name name version))
1529 (sha256
1530 (base32 "04x24izan3g2znnq6lzn3zlq0bl34qad530cp4ynm412w6q97kbz"))))
1531 (build-system gnu-build-system)
1532 (arguments
1533 (list
1534 #:make-flags
1535 #~(list (string-append "INSTALL="
1536 (search-input-file %build-inputs "/bin/install")))
1537 #:phases
1538 #~(modify-phases %standard-phases
1539 (add-after 'unpack 'patch-tool-locations
1540 (lambda* (#:key inputs #:allow-other-keys)
1541 (substitute* "common/config"
1542 ;; Make absolute file names relative.
1543 (("(MKFS_PROG=\").*(\")" _ pre post)
1544 (string-append pre "mkfs" post)))
1545 (for-each (lambda (file)
1546 (substitute* file
1547 (("( -s|#.|[= ])(/bin/sh|/bin/bash)" _ pre match)
1548 (string-append pre
1549 (search-input-file inputs match)))
1550 (("/bin/(rm|true)" match)
1551 (search-input-file inputs match))
1552 (("/usr(/bin/time)" _ match)
1553 (search-input-file inputs match))))
1554 (append (find-files "common" ".*")
1555 (find-files "tests" ".*")
1556 (find-files "tools" ".*")
1557 (find-files "src" "\\.(c|sh)$")))))
1558 (add-before 'bootstrap 'fix-hardcoded-binaries
1559 (lambda* (#:key make-flags #:allow-other-keys)
1560 (substitute* "m4/package_utilies.m4"
1561 ;; Fix the bogus hard-coded paths for every single binary.
1562 (("(AC_PATH_PROG\\(.*, ).*(\\))" _ pre post)
1563 (string-append pre (getenv "PATH") post)))))
1564 (add-after 'install 'wrap-xfstests/check
1565 ;; Keep wrapping distinct from 'create-helper-script below: users
1566 ;; must be able to invoke xfstests/check directly if they prefer.
1567 (lambda* (#:key inputs #:allow-other-keys)
1568 (wrap-program (string-append #$output "/xfstests/check")
1569 ;; Prefix the user's PATH with the minimum required tools.
1570 ;; The suite has many other optional dependencies and will
1571 ;; automatically select tests based on the original PATH.
1572 `("PATH" ":" prefix
1573 ,(map (lambda (file)
1574 (dirname (search-input-file inputs file)))
1575 (list "bin/setfacl" ; acl
1576 "bin/attr" ; attr
1577 "bin/bc" ; bc
1578 "bin/df" ; coreutils
1579 "bin/hostname" ; inetutils
1580 "bin/perl" ; perl
1581 "sbin/mkfs.xfs")))))) ; xfsprogs
1582 (add-after 'install 'create-helper
1583 ;; Upstream installs only a ‘check’ script that's not in $PATH and
1584 ;; would try to write to the store without explaining how to change
1585 ;; that. Install a simple helper script to make it discoverable.
1586 (lambda* (#:key inputs #:allow-other-keys)
1587 (let* ((check (string-append #$output "/xfstests/check"))
1588 (bin (string-append #$output "/bin"))
1589 (helper (string-append bin "/xfstests-check")))
1590 (mkdir-p bin)
1591 (with-output-to-file helper
1592 (lambda _
1593 (format #t "#!~a --no-auto-compile\n!#\n"
1594 (search-input-file inputs "/bin/guile"))
1595 (write
1596 `(begin
1597 (define (try proc dir)
1598 "Try to PROC DIR. Return DIR on success, else #f."
1599 (with-exception-handler (const #f)
1600 (lambda _ (proc dir) dir)
1601 #:unwind? #t))
1602
1603 (define args
1604 (cdr (command-line)))
1605
1606 (when (or (member "--help" args)
1607 (member "-h" args))
1608 (format #t "Usage: ~a [OPTION]...
1609This Guix helper sets up a new writable RESULT_BASE if it's unset, then executes
1610xfstest's \"~a\" command (with any OPTIONs) as documented below.\n\n"
1611 ,(basename helper)
1612 ,(basename check)))
1613
1614 (let* ((gotenv-base (getenv "RESULT_BASE"))
1615 (base (or gotenv-base
1616 (let loop ((count 0))
1617 (or (try mkdir
1618 (format #f "xfstests.~a"
1619 count))
1620 (loop (+ 1 count))))))
1621 (result-base (if (string-prefix? "/" base)
1622 base
1623 (string-append (getcwd) "/"
1624 base))))
1625 (setenv "RESULT_BASE" result-base)
1626 ;; CHECK must run in its own directory or will fail.
1627 (chdir ,(dirname check))
1628 (let ((status
1629 (status:exit-val (apply system* ,check args))))
1630 (unless gotenv-base
1631 (try rmdir result-base))
1632 status))))))
1633 (chmod helper #o755)))))))
1634 (native-inputs
1635 (list autoconf-2.71 automake libtool pkg-config))
1636 (inputs
1637 (list acl
1638 attr
1639 bash-minimal
1640 bc
1641 guile-3.0 ; for our xfstests-check helper script
1642 inetutils
1643 `(,util-linux "lib")
1644 perl
1645 time
1646 xfsprogs))
1647 (home-page "https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git")
1648 (synopsis "File system @acronym{QA, Quality Assurance} test suite")
1649 (description
1650 "The @acronym{FSQA, File System Quality Assurance} regression test suite,
1651more commonly known as xfstests, comprises over 1,500 tests that exercise
1652(@dfn{torture}) both the user- and kernel-space parts of many different file
1653systems.
1654
1655As the package's name subtly implies, it was originally developed to test the
1656XFS file system. Today, xfstests is the primary test suite for all major file
1657systems supported by the kernel Linux including XFS, ext4, and Btrfs, but also
1658virtual and network file systems such as NFS, 9P, and the overlay file system.
1659
1660The packaged @command{check} script is not in @env{PATH} but can be invoked
1661with the included @command{xfstests-check} helper.")
1662 (license license:gpl2)))
1663
1664(define-public zfs
1665 (package
1666 (name "zfs")
1667 (version "2.4.4")
1668 (outputs '("out" "module" "src"))
1669 (source
1670 (origin
1671 (method url-fetch)
1672 (uri (string-append "https://github.com/openzfs/zfs/releases"
1673 "/download/zfs-" version
1674 "/zfs-" version ".tar.gz"))
1675 (sha256
1676 (base32 "1cf893wgqbn93ms3g38ixc0h4lv6mn0hx9lmi9hp3k1pbbap0g1a"))))
1677 (build-system linux-module-build-system)
1678 (arguments
1679 (list
1680 ;; The ZFS kernel module should not be downloaded since the license
1681 ;; terms don't allow for distributing it, only building it locally.
1682 #:substitutable? #f
1683 ;; Tests cannot run in an unprivileged build environment.
1684 #:tests? #f
1685 #:linux linux-libre-lts
1686 #:phases
1687 #~(modify-phases %standard-phases
1688 (add-after 'configure 'really-configure
1689 (lambda* (#:key inputs #:allow-other-keys)
1690 (substitute* "configure"
1691 (("-/bin/sh") (string-append "-" (which "sh"))))
1692 (invoke "./configure"
1693 "--with-config=all"
1694 (string-append "--prefix=" #$output)
1695 (string-append "--with-dracutdir=" #$output
1696 "/lib/dracut")
1697 (string-append "--with-udevdir=" #$output
1698 "/lib/udev")
1699 (string-append "--with-mounthelperdir=" #$output
1700 "/sbin")
1701 (string-append "--with-linux="
1702 (search-input-directory
1703 inputs
1704 "lib/modules/build")))))
1705 (add-after 'bootstrap 'patch-source
1706 (lambda* (#:key inputs #:allow-other-keys)
1707 ;; New feature "compatibility=" in 2.1.0.
1708 ;; This feature looks up in two locations:
1709 ;; /etc/zfs/compatibility.d/
1710 ;; /usr/share/zfs/compatibility.d/
1711 ;; The first is intended for system-specific compatibility
1712 ;; sets, while the second is what is installed with the
1713 ;; OpenZFS package, so use the absolute path for the first
1714 ;; (which requires patching in the file) and the store path
1715 ;; for the second (which it gets by default).
1716 (substitute* "include/sys/fs/zfs.h"
1717 (("#define\tZPOOL_SYSCONF_COMPAT_D.*$")
1718 ;; Use absolute path.
1719 "#define\tZPOOL_SYSCONF_COMPAT_D\t\"/etc/zfs/compatibility.d\"\n"))
1720 ;; Also update the manual, which uses absolute paths, so that
1721 ;; /usr/share/zfs/compatibility.d/ is referred via the store.
1722 (substitute* '("man/man7/zpoolprops.7"
1723 "man/man7/zpool-features.7")
1724 (("/usr/share/zfs/compatibility.d")
1725 (string-append #$output "/share/zfs/compatibility.d")))
1726 (substitute* "lib/libzfs/os/linux/libzfs_util_os.c"
1727 ;; Use path to /gnu/store/*-kmod in actual path that is
1728 ;; exec'ed.
1729 (("\"/sbin/modprobe\"")
1730 (string-append "\""
1731 (search-input-file inputs "/bin/modprobe")
1732 "\""))
1733 ;; Just use 'modprobe' in message to user, since Guix
1734 ;; does not have a traditional /sbin/
1735 (("'/sbin/modprobe ") "'modprobe "))
1736 (substitute* "configure"
1737 (("/etc/default")
1738 (string-append #$output "/etc/default"))
1739 (("/etc/bash_completion.d")
1740 (string-append #$output "/etc/bash_completion.d")))
1741 (substitute* "Makefile.in"
1742 (("/usr/share/initramfs-tools")
1743 (string-append #$output "/usr/share/initramfs-tools")))
1744 (substitute* "contrib/initramfs/Makefile.am"
1745 (("/usr/share/initramfs-tools")
1746 (string-append #$output "/usr/share/initramfs-tools")))
1747 (substitute* "module/os/linux/zfs/zfs_ctldir.c"
1748 (("/usr/bin/env\", \"umount")
1749 (string-append (search-input-file inputs "/bin/umount")
1750 "\", \"-n"))
1751 (("/usr/bin/env\", \"mount")
1752 (string-append (search-input-file inputs "/bin/mount")
1753 "\", \"-n")))
1754 (substitute* "lib/libzfs/os/linux/libzfs_mount_os.c"
1755 (("/bin/mount") (search-input-file inputs "/bin/mount"))
1756 (("/bin/umount") (search-input-file inputs "/bin/umount")))
1757 (substitute* "lib/libshare/os/linux/nfs.c"
1758 (("/usr/sbin/exportfs")
1759 (search-input-file inputs "/sbin/exportfs")))
1760 (substitute* "config/zfs-build.m4"
1761 (("\\$sysconfdir/init.d")
1762 (string-append #$output "/etc/init.d")))
1763 (substitute* '("cmd/zed/Makefile.am")
1764 (("\\$\\(sysconfdir)") (string-append #$output "/etc")))
1765 (substitute* "udev/vdev_id"
1766 (("PATH=/bin:/sbin:/usr/bin:/usr/sbin")
1767 (format #f "PATH=~a"
1768 (list->search-path-as-string
1769 (map (lambda (name)
1770 (dirname (search-input-file inputs name)))
1771 '("bin/chmod"
1772 "bin/grep"
1773 "bin/sed"
1774 "bin/gawk"))
1775 ":"))))
1776 (substitute* '("Makefile.am" "Makefile.in")
1777 (("\\$\\(prefix)/src") (string-append #$output:src "/src")))
1778 (substitute* (find-files "udev/rules.d/" ".rules.in$")
1779 (("/sbin/modprobe")
1780 (search-input-file inputs "/bin/modprobe")))))
1781 (replace 'build
1782 (lambda* (#:key inputs make-flags parallel-build?
1783 #:allow-other-keys)
1784 (let ((kernel-dir
1785 (search-input-directory inputs "lib/modules/build")))
1786 (apply invoke "make"
1787 ;; Avoid introducing store paths into the build output.
1788 ;; https://codeberg.org/guix/guix/issues/10409
1789 (format #f "KCFLAGS=-ffile-prefix-map=~a=" kernel-dir)
1790 `(,@(if parallel-build?
1791 `("-j" ,(number->string (parallel-job-count)))
1792 '())
1793 ,@make-flags)))))
1794 (replace 'install
1795 (lambda* (#:key inputs native-inputs
1796 make-flags parallel-build? #:allow-other-keys)
1797 (apply invoke "make" "install"
1798 (string-append "DEFAULT_INITCONF_DIR="
1799 #$output "/etc/default")
1800 (string-append "DEPMOD="
1801 (search-input-file
1802 (or native-inputs inputs)
1803 "/bin/depmod"))
1804 (string-append "INSTALL_PATH=" #$output)
1805 (string-append "INSTALL_MOD_PATH=" #$output:module)
1806 "INSTALL_MOD_STRIP=1"
1807 `(,@(if parallel-build?
1808 `("-j" ,(number->string (parallel-job-count)))
1809 '())
1810 ,@make-flags))
1811 (install-file
1812 "contrib/bash_completion.d/zfs"
1813 (string-append #$output
1814 "/share/bash-completion/completions")))))))
1815 (native-inputs
1816 (list attr autoconf automake libtool kmod pkg-config))
1817 (inputs (list coreutils-minimal
1818 eudev
1819 gawk
1820 grep
1821 kmod
1822 libaio
1823 libtirpc
1824 nfs-utils
1825 openssl
1826 python
1827 python-cffi
1828 sed
1829 util-linux
1830 `(,util-linux "lib")
1831 zlib))
1832 (home-page "https://zfsonlinux.org/")
1833 (synopsis "OpenZFS on Linux")
1834 (description
1835 "OpenZFS is an advanced file system and volume manager which was
1836originally developed for Solaris and is now maintained by the OpenZFS
1837community.")
1838 (license license:cddl1.0)))
1839
1840(define-public zfs-auto-snapshot
1841 (package
1842 (name "zfs-auto-snapshot")
1843 (version "1.2.4")
1844 (source
1845 (origin
1846 (method git-fetch)
1847 (uri (git-reference
1848 (url
1849 (string-append "https://github.com/zfsonlinux/" name))
1850 (commit
1851 (string-append "upstream/" version))))
1852 (file-name (git-file-name name version))
1853 (sha256
1854 (base32 "0m4xw7h5qlbn5zdf9wb137pcr5l7hyrr7w2dgr16dfm5ay64vvfq"))))
1855 (build-system gnu-build-system)
1856 (inputs
1857 ;; Note: if you are inheriting from the above zfs package in order
1858 ;; to provide a specific stable kernel version, you should also
1859 ;; inherit this package and replace the sole input below.
1860 (list zfs))
1861 (arguments
1862 `(#:tests? #f ; No tests
1863 #:phases
1864 (modify-phases %standard-phases
1865 (delete 'configure)
1866 (delete 'build)
1867 ;; Guix System may not have a traditional cron system, but
1868 ;; the cron scripts installed by this package are convenient
1869 ;; to use as targets for an mcron job specification, so make
1870 ;; sure they can be run in-store.
1871 (add-before 'install 'fix-scripts
1872 (lambda* (#:key outputs inputs #:allow-other-keys)
1873 (let* ((out (assoc-ref outputs "out"))
1874 (zfs-auto-snapshot (string-append
1875 out
1876 "/sbin/zfs-auto-snapshot"))
1877 (zfs-package (assoc-ref inputs "zfs"))
1878 (zpool (string-append
1879 zfs-package
1880 "/sbin/zpool"))
1881 (zfs (string-append
1882 zfs-package
1883 "/sbin/zfs")))
1884 (substitute* '("etc/zfs-auto-snapshot.cron.daily"
1885 "etc/zfs-auto-snapshot.cron.frequent"
1886 "etc/zfs-auto-snapshot.cron.hourly"
1887 "etc/zfs-auto-snapshot.cron.monthly"
1888 "etc/zfs-auto-snapshot.cron.weekly")
1889 (("zfs-auto-snapshot")
1890 zfs-auto-snapshot))
1891 (substitute* "src/zfs-auto-snapshot.sh"
1892 (("LC_ALL=C zfs list")
1893 (string-append "LC_ALL=C " zfs " list"))
1894 (("LC_ALL=C zpool status")
1895 (string-append "LC_ALL=C " zpool " status"))
1896 (("zfs snapshot")
1897 (string-append zfs " snapshot"))
1898 (("zfs destroy")
1899 (string-append zfs " destroy"))))))
1900 ;; Provide DESTDIR and PREFIX on make command.
1901 (replace 'install
1902 (lambda* (#:key outputs #:allow-other-keys)
1903 (let ((out (assoc-ref outputs "out")))
1904 (invoke "make" "install"
1905 "PREFIX="
1906 (string-append "DESTDIR=" out)))
1907 #t)))))
1908 (home-page "https://github.com/zfsonlinux/zfs-auto-snapshot")
1909 (synopsis "Automatically create, rotate and destroy ZFS snapshots")
1910 (description "An alternative implementation of the zfs-auto-snapshot
1911service for Linux that is compatible with zfs-linux (now OpenZFS) and
1912zfs-fuse.
1913
1914On Guix System, you will need to invoke the included shell scripts as
1915@code{job} definitions in your @code{operating-system} declaration.")
1916 (license license:gpl2+)))
1917
1918(define-public mergerfs
1919 (package
1920 (name "mergerfs")
1921 (version "2.33.5")
1922 (source
1923 (origin
1924 (method url-fetch)
1925 (uri (string-append "https://github.com/trapexit/mergerfs/"
1926 "releases/download/" version "/"
1927 "mergerfs-" version ".tar.gz"))
1928 (sha256
1929 (base32 "0m0fg191ax855yb20vqpvn6v2gc3i5xdizx09pgpymj1ybxc7yyw"))))
1930 (build-system gnu-build-system)
1931 (arguments
1932 `(#:make-flags
1933 (list (string-append "CC=" ,(cc-for-target))
1934 (string-append "CXX=" ,(cxx-for-target))
1935 (string-append "PREFIX=" (assoc-ref %outputs "out")))
1936 #:tests? #f ; all require a kernel with FUSE loaded
1937 #:phases
1938 (modify-phases %standard-phases
1939 (delete 'configure) ; no configure script
1940 (add-after 'unpack 'set-file-names
1941 (lambda* (#:key inputs outputs #:allow-other-keys)
1942 (substitute* "libfuse/Makefile"
1943 (("/sbin") "$(EXEC_PREFIX)/sbin")
1944 (("chown") "true") ; disallowed in the build environment
1945 (("strip") "true")) ; breaks cross-compilation
1946 ;; These were copied from the fuse-2 package.
1947 (substitute* '("libfuse/lib/mount_util.c"
1948 "libfuse/util/mount_util.c")
1949 (("/bin/(u?)mount" _ maybe-u)
1950 (search-input-file inputs
1951 (string-append "bin/" maybe-u
1952 "mount"))))
1953 (substitute* '("libfuse/util/mount.mergerfs.c")
1954 (("/bin/sh" command)
1955 (string-append (assoc-ref inputs "bash-minimal") command))
1956 ;; mount.mergerfs tries to execute `mergerfs`, which cannot be found
1957 ;; without an absolute path. Hard-coding the path is fine, since we don’t
1958 ;; link mount.mergerfs to mount.fuse anyway.
1959 (("add_arg\\(&command, type\\);")
1960 (string-append "add_arg(&command, \"" (assoc-ref outputs "out")
1961 "/bin/mergerfs\");"))))))))
1962 ;; Mergerfs bundles a heavily modified copy of fuse.
1963 (inputs
1964 (list bash-minimal util-linux))
1965 (home-page "https://github.com/trapexit/mergerfs")
1966 (synopsis "Featureful union file system")
1967 (description "mergerfs is a union file system geared towards simplifying
1968storage and management of files across numerous commodity storage devices. It
1969is similar to mhddfs, unionfs, and aufs.")
1970 (license (list
1971 license:isc ; mergerfs
1972 license:gpl2 license:lgpl2.0 ; Imported libfuse code.
1973 ))))
1974
1975(define-public mergerfs-tools
1976 (let ((commit "3b6fe008517aeda715c306eaf4914f6f537da88d")
1977 (revision "3"))
1978 (package
1979 (name "mergerfs-tools")
1980 ;; No released version exists.
1981 (version (git-version "0.0.0" revision commit))
1982 (source
1983 (origin
1984 (method git-fetch)
1985 (uri (git-reference
1986 (url "https://github.com/trapexit/mergerfs-tools")
1987 (commit commit)))
1988 (file-name (git-file-name name version))
1989 (sha256
1990 (base32 "15pgym6c4viy57ccgp28dnqwh12f3gr02axg86y578aqa2yaa0ad"))))
1991 (build-system copy-build-system)
1992 (inputs
1993 (list python python-xattr rsync))
1994 (arguments
1995 '(#:install-plan
1996 '(("src/" "bin/"))
1997 #:phases
1998 (modify-phases %standard-phases
1999 (add-after 'unpack 'patch-paths
2000 (lambda* (#:key inputs #:allow-other-keys)
2001 (substitute* (find-files "src" "^mergerfs\\.")
2002 (("'rsync'")
2003 (string-append "'" (assoc-ref inputs "rsync") "/bin/rsync'"))
2004 (("'rm'")
2005 (string-append "'" (assoc-ref inputs "coreutils") "/bin/rm'")))
2006 (substitute* "src/mergerfs.mktrash"
2007 (("xattr")
2008 (search-input-file inputs "/bin/xattr"))
2009 (("mkdir")
2010 (search-input-file inputs "/bin/mkdir"))))))))
2011 (synopsis "Tools to help manage data in a mergerfs pool")
2012 (description "mergerfs-tools is a suite of programs that can audit
2013permissions and ownership of files and directories on a mergerfs volume,
2014duplicates files and directories across branches in its pool, find and remove
2015duplicate files, balance pool drives, consolidate files in a single mergerfs
2016directory onto a single drive and create FreeDesktop.org Trash specification
2017compatible directories.")
2018 (home-page "https://github.com/trapexit/mergerfs-tools")
2019 (license license:isc))))
2020
2021(define-public dbxfs
2022 (package
2023 (name "dbxfs")
2024 (version "2.1.1")
2025 (source
2026 (origin
2027 (method url-fetch)
2028 (uri (pypi-uri "dbxfs" version))
2029 (sha256
2030 (base32 "1q0xakkddsf359wcsqi2z8pmzk65qps14yl5wwq8kv5i1i0w1y8q"))))
2031 (build-system pyproject-build-system)
2032 (arguments
2033 (list
2034 ;; XXX: No tests in Pypi archive. git-fetch fails to download the
2035 ;; git source upstream though.
2036 #:tests? #f
2037 #:phases
2038 #~(modify-phases %standard-phases
2039 (add-after 'unpack 'relax-requirements
2040 (lambda _
2041 (substitute* "setup.py"
2042 (("\"sentry_sdk.*\",")
2043 ""))
2044 (substitute* "dbxfs/main.py"
2045 (("import sentry_sdk")
2046 "")
2047 (("^(\\s)sentry_sdk\\.init" all space)
2048 (string-append space "import sentry_sdk\n" all))
2049 ;; Don't check for package updates.
2050 (("if version")
2051 "if False")))))))
2052 (inputs
2053 (list python-block-tracing
2054 python-dropbox
2055 python-platformdirs
2056 python-privy
2057 python-psutil
2058 python-userspacefs))
2059 (native-inputs
2060 (list python-setuptools))
2061 (home-page "https://thelig.ht/code/dbxfs/")
2062 (synopsis "User-space file system for Dropbox")
2063 (description
2064 "@code{dbxfs} allows you to mount your Dropbox folder as if it were a
2065local file system using FUSE.")
2066 (license license:gpl3+)))
2067
2068(define-public python-linux-procfs
2069 (package
2070 (name "python-linux-procfs")
2071 (version "0.7.4")
2072 (source
2073 (origin
2074 (method git-fetch)
2075 (uri (git-reference
2076 (url (string-append "https://git.kernel.org/pub/scm/libs/python/"
2077 "python-linux-procfs/python-linux-procfs"))
2078 (commit (string-append "v" version))))
2079 (file-name (git-file-name name version))
2080 (sha256
2081 (base32 "09409sjncz7n9m2ia5nfzy10q7c23dvpgjdkc3j9bjs4f5hvc9aq"))))
2082 (build-system pyproject-build-system)
2083 (arguments
2084 (list
2085 #:test-backend #~'custom
2086 #:test-flags #~(list "bitmasklist_test.py")))
2087 (native-inputs
2088 (list python-setuptools
2089 python-setuptools-scm))
2090 (home-page
2091 (string-append "https://git.kernel.org/pub/scm/libs/python/"
2092 "python-linux-procfs/python-linux-procfs.git/"))
2093 (synopsis
2094 "Python abstractions to extract information from @code{/proc} files")
2095 (description
2096 "The proc filesystem is a pseudo-filesystem which provides an interface to
2097kernel data structures. This package provides a means to query that system from
2098a Python module. See @code{proc(5)} for more details.")
2099 (license license:gpl2)))
2100
2101(define-public rewritefs
2102 (let ((revision "1")
2103 (commit "3a56de8b5a2d44968b8bc3885c7d661d46367306"))
2104 (package
2105 (name "rewritefs")
2106 (version (git-version "0.0.0" revision commit))
2107 (source
2108 (origin
2109 (method git-fetch)
2110 (uri (git-reference
2111 (url "https://github.com/sloonz/rewritefs")
2112 (commit commit)))
2113 (file-name (git-file-name name version))
2114 (sha256
2115 (base32 "1w2rik0lhqm3wr68x51zs45gqfx79l7fi4p0sqznlfq7sz5s8xxn"))))
2116 (build-system gnu-build-system)
2117 (arguments
2118 (list
2119 #:modules
2120 '((guix build gnu-build-system)
2121 (guix build utils)
2122 (srfi srfi-26))
2123 #:make-flags
2124 #~(list (string-append "PREFIX=" #$output))
2125 #:test-target "test"
2126 #:tests? #f ; all require a kernel with FUSE loaded
2127 #:phases
2128 #~(modify-phases %standard-phases
2129 (delete 'configure) ; no configure script
2130 (add-after 'install 'install-examples
2131 (lambda _
2132 (let ((doc (string-append #$output "/share/doc/"
2133 #$name "-" #$version)))
2134 (for-each (cut install-file <> (string-append doc "/examples"))
2135 (find-files "." "^config\\."))))))))
2136 (native-inputs
2137 (list pkg-config))
2138 (inputs
2139 (list fuse pcre))
2140 (home-page "https://github.com/sloonz/rewritefs")
2141 (synopsis "FUSE file system that changes particular file names")
2142 (description
2143 "RewriteFS is a @acronym{FUSE, File system in USEr space} to change the
2144name of accessed files on the fly based on any number of regular expressions.
2145It's like the @code{rewrite} action of many Web servers, but for your file
2146system. For example, it can help keep your home directory tidy by transparently
2147rewriting the location of configuration files of software that doesn't follow
2148the XDG directory specification from @file{~/.@var{name}} to
2149@file{~/.config/@var{name}}.")
2150 (license license:gpl2+))))
2151
2152(define-public s5cmd
2153 (package
2154 (name "s5cmd")
2155 (version "2.3.0")
2156 (source
2157 (origin
2158 (method git-fetch)
2159 (uri (git-reference
2160 (url "https://github.com/peak/s5cmd")
2161 (commit (string-append "v" version))))
2162 (file-name (git-file-name name version))
2163 (sha256
2164 (base32 "1y1bwma6f68j00jfdjxvw5flp9l4cdys7dgkrr0yvfz68lk9a17v"))
2165 (snippet
2166 #~(begin (use-modules (guix build utils))
2167 (delete-file-recursively "vendor")))))
2168 (build-system go-build-system)
2169 (arguments
2170 (list
2171 #:install-source? #f
2172 #:import-path "github.com/peak/s5cmd/v2"
2173 #:test-flags
2174 #~(list "-vet=off"
2175 ;; cp_test.go:74: assertion failed: text/plain; charset=utf-8
2176 ;; (tc.expectedContentType string) != text/html; charset=utf-8
2177 ;; (string)
2178 "-skip" "TestGuessContentType")
2179 #:test-subdirs
2180 ;; build flag -mod=vendor only valid when using modules
2181 ;; /<...>/peak/s5cmd/v2/e2e/util_test.go:417 +0x3b9
2182 ;; /<...>/peak/s5cmd/v2/e2e/main_test.go:12 +0x65
2183 #~(list "command/..."
2184 "orderedwriter/..."
2185 "progressbar/..."
2186 "storage/..."
2187 "storage/url/..."
2188 "strutil/...")
2189 #:phases
2190 #~(modify-phases %standard-phases
2191 (add-after 'install 'rename-binaries
2192 (lambda _
2193 (rename-file
2194 (string-append #$output "/bin/v2")
2195 (string-append #$output "/bin/s5cmd")))))))
2196 (native-inputs
2197 (list go-github-com-aws-aws-sdk-go
2198 go-github-com-cheggaaa-pb-v3
2199 go-github-com-google-go-cmp
2200 go-github-com-hashicorp-go-multierror
2201 go-github-com-iancoleman-strcase
2202 go-github-com-igungor-gofakes3
2203 go-github-com-karrick-godirwalk
2204 go-github-com-kballard-go-shellquote
2205 go-github-com-lanrat-extsort-1.0.2
2206 go-github-com-termie-go-shutil
2207 go-github-com-urfave-cli-v2
2208 go-go-uber-org-mock
2209 go-gotest-tools-v3
2210 go-honnef-co-go-tools
2211 go-mvdan-cc-unparam))
2212 (home-page "https://github.com/peak/s5cmd")
2213 (synopsis "Parallel S3 and local filesystem execution tool")
2214 (description
2215 "@code{s5cmd} is a fast S3 and local filesystem execution tool. It comes
2216with support for a multitude of operations including tab completion and
2217wildcard support for files, which can be handy for object storage workflow
2218while working with large number of files.")
2219 (license license:expat)))
2220
2221(define-public squashfuse
2222 (package
2223 (name "squashfuse")
2224 (version "0.6.1")
2225 (source
2226 (origin
2227 (method git-fetch)
2228 (uri (git-reference
2229 (url "https://github.com/vasi/squashfuse")
2230 (commit version)))
2231 (file-name (git-file-name name version))
2232 (sha256
2233 (base32 "16ds2xlk6hb5cggi6di8s0aalir3mrx7rk24rw5daad1xw4dbq0y"))))
2234 (build-system gnu-build-system)
2235 (arguments
2236 (list
2237 #:phases
2238 #~(modify-phases %standard-phases
2239 (add-after 'unpack 'fix-cross-compile
2240 (lambda _
2241 (substitute* "autogen.sh"
2242 (("pkg-config")
2243 #$(pkg-config-for-target))))))))
2244 (native-inputs (list autoconf automake libtool pkg-config))
2245 (inputs (list attr fuse-2 xz zlib `(,zstd "lib")))
2246 (home-page "https://github.com/vasi/squashfuse")
2247 (synopsis "Fuse filesystem to mount squashfs archives")
2248 (description
2249 "Squashfuse lets you mount SquashFS archives in user-space. It supports
2250almost all features of the SquashFS format, yet is still fast and
2251memory-efficient.")
2252 (license license:bsd-2)))
2253
2254(define-public squashfuse-for-appimage
2255 (package
2256 (inherit squashfuse)
2257 (name "squashfuse-for-appimage")
2258 (arguments
2259 (cons*
2260 #:configure-flags
2261 #~'("CFLAGS=-ffunction-sections -fdata-sections -Os -no-pie"
2262 "LDFLAGS=-static")
2263 (substitute-keyword-arguments arguments
2264 ((#:phases phases)
2265 #~(modify-phases #$phases
2266 (add-after 'install 'install-private-headers
2267 (lambda _
2268 (install-file "fuseprivate.h"
2269 (string-append #$output
2270 "/include/squashfuse/")))))))))
2271 (inputs (list `(,fuse "out")
2272 `(,fuse "static")
2273 `(,zstd "lib")
2274 `(,zstd "static")
2275 `(,zlib "out")
2276 `(,zlib "static")))))
2277
2278(define-public tmsu
2279 (package
2280 (name "tmsu")
2281 ;; XXX: 0.7.5 was released in 2019, since that time master branch
2282 ;; accumulated a lot of fixes and support for a fresh Go version, use the
2283 ;; latest (2022), commit from master's HEAD. Project closed Issues and
2284 ;; Pull Requests, potentially it's abandoned one.
2285 (properties '((commit . "0bf4b8031cbeffc0347007d85647062953e90571")
2286 (revision . "0")))
2287 (version (git-version "0.7.5"
2288 (assoc-ref properties 'revision)
2289 (assoc-ref properties 'commit)))
2290 (source
2291 (origin
2292 (method git-fetch)
2293 (uri (git-reference
2294 (url "https://github.com/oniony/TMSU")
2295 (commit (assoc-ref properties 'commit))))
2296 (file-name (git-file-name name version))
2297 (sha256
2298 (base32
2299 "1kyncrmbaxhhqys2mhnvbz95zh72arv3an9hfhjbdcxa12b9w6g5"))))
2300 (build-system go-build-system)
2301 (arguments
2302 (list
2303 #:install-source? #f
2304 #:import-path "github.com/oniony/TMSU"
2305 #:build-flags
2306 #~(list "-tags=libsqlite3")
2307 #:test-flags
2308 #~(list "-vet=off" "-tags=libsqlite3")
2309 #:phases
2310 #~(modify-phases %standard-phases
2311 (add-after 'install 'fix-bin-name
2312 (lambda _
2313 (rename-file (string-append #$output "/bin/TMSU")
2314 (string-append #$output "/bin/tmsu"))))
2315 (add-after 'install 'install-misc
2316 (lambda* (#:key import-path #:allow-other-keys)
2317 (with-directory-excursion (string-append "src/" import-path)
2318 (let ((bin (string-append #$output "/bin"))
2319 (sbin (string-append #$output "/sbin")))
2320 (for-each (lambda (f) (install-file f bin))
2321 (list "misc/bin/tmsu-fs-merge"
2322 "misc/bin/tmsu-fs-mv"
2323 "misc/bin/tmsu-fs-rm"))
2324 (install-file "misc/bin/mount.tmsu" sbin)))))
2325 (add-after 'install 'install-shell-completions
2326 (lambda* (#:key import-path #:allow-other-keys)
2327 (with-directory-excursion (string-append "src/" import-path)
2328 (let ((bash (string-append #$output "/etc/bash_completion.d"))
2329 (zsh (string-append #$output "/share/zsh/site-functions")))
2330 (for-each mkdir-p (list bash zsh))
2331 (copy-file "misc/bash/tmsu" (string-append bash "/tmsu"))
2332 (copy-file "misc/zsh/_tmsu" (string-append zsh "/_tmsu"))))))
2333 (add-after 'install 'install-man-pages
2334 (lambda* (#:key import-path #:allow-other-keys)
2335 (with-directory-excursion (string-append "src/" import-path)
2336 (install-file "misc/man/tmsu.1"
2337 (string-append #$output "/share/man/man1"))))))))
2338 (inputs
2339 (list go-github-com-mattn-go-sqlite3
2340 go-github-com-hanwen-go-fuse
2341 go-golang-org-x-crypto
2342 sqlite))
2343 (home-page "https://github.com/oniony/TMSU")
2344 (synopsis "Tag files and access them through a virtual file system")
2345 (description
2346 "TMSU is a tool for tagging your files. It provides a simple
2347command-line utility for applying tags and a virtual file system to give you a
2348tag-based view of your files from any other program. TMSU does not alter your
2349files in any way: they remain unchanged on disk, or on the network, wherever
2350your put them. TMSU maintains its own database and you simply gain an
2351additional view, which you can mount where you like, based upon the tags you
2352set up.")
2353 (license license:gpl3+)))
2354
2355(define-public udftools
2356 (package
2357 (name "udftools")
2358 (version "2.3")
2359 (source (origin
2360 (method git-fetch)
2361 (uri (git-reference
2362 (url "https://github.com/pali/udftools")
2363 (commit version)))
2364 (sha256
2365 (base32
2366 "1nl2s61znyzaap23zhbdg3znj6l6akr313fchn5wwvjzj8k70is9"))
2367 (file-name (git-file-name name version))))
2368 (build-system gnu-build-system)
2369 (arguments
2370 `(#:configure-flags
2371 (list (string-append "--docdir=" (assoc-ref %outputs "out")
2372 "/share/doc/" ,name "-" ,version))))
2373 (native-inputs
2374 (list automake autoconf libtool pkg-config))
2375 (home-page "https://github.com/pali/udftools")
2376 (synopsis "Tools to manage UDF file systems and DVD/CD-R(W) drives")
2377 (description "@code{udftools} is a set of programs for reading
2378and modifying @acronym{UDF, Universal Disk Format} file systems.
2379@acronym{UDF, Universal Disk Format} is a file system mostly used for DVDs
2380and other optical media. It supports read-only media (DVD/CD-R)
2381and rewritable media that wears out (DVD/CD-RW).")
2382 (license license:gpl2+)))
2383
2384(define-public fuse-overlayfs
2385 (package
2386 (name "fuse-overlayfs")
2387 (version "1.13")
2388 (source (origin
2389 (method git-fetch)
2390 (uri (git-reference
2391 (url "https://github.com/containers/fuse-overlayfs")
2392 (commit (string-append "v" version))))
2393 (sha256
2394 (base32
2395 "03gqb4czswqhx6zrv9jj88mf3mczk4m7azcjgr785c2lmga442ly"))
2396 (file-name (git-file-name name version))))
2397 (build-system gnu-build-system)
2398 (native-inputs
2399 (list automake autoconf libtool pkg-config))
2400 (inputs
2401 (list fuse))
2402 (home-page "https://github.com/containers/fuse-overlayfs")
2403 (synopsis "FUSE implementation of overlayfs")
2404 (description "This package provides an implementation of overlay+shiftfs
2405in FUSE for rootless containers.")
2406 (license license:gpl3)))
2407
2408(define-public bees
2409 (package
2410 (name "bees")
2411 (version "0.10")
2412 (source (origin
2413 (method git-fetch)
2414 (uri (git-reference
2415 (url "https://github.com/Zygo/bees")
2416 (commit (string-append "v" version))))
2417 (file-name (git-file-name name version))
2418 (modules '((guix build utils)))
2419 (snippet
2420 ;; Unbundle cityhash.
2421 #~(begin
2422 (for-each delete-file
2423 '("lib/city.cc" "include/crucible/city.h"))
2424 (substitute* "lib/Makefile"
2425 (("city.o.*") ""))
2426 (substitute* "src/bees-hash.cc"
2427 (("#include .crucible/city.h.") "#include <city.h>"))))
2428 (sha256
2429 (base32
2430 "1j1v9bxijs8gvrb7rg0q1158xjvmfc8dlzwx768fxf3w8w2gfwvz"))))
2431 (build-system gnu-build-system)
2432 (arguments
2433 (list #:test-target "test"
2434 #:make-flags
2435 #~(list (string-append "CC=" #$(cc-for-target))
2436 (string-append "DESTDIR=" #$output)
2437 (string-append "BEES_VERSION=" #$version)
2438 "PREFIX=''")
2439 #:phases
2440 #~(modify-phases %standard-phases
2441 (delete 'configure)
2442 (add-after 'unpack 'fixpath
2443 (lambda* (#:key inputs #:allow-other-keys)
2444 (substitute* "scripts/beesd.in"
2445 (((string-append "\\<(" (string-join (list "realpath"
2446 "uuidparse"
2447 "grep"
2448 "false"
2449 "sed"
2450 "true"
2451 "head"
2452 "mkdir"
2453 "mount"
2454 "touch"
2455 "du"
2456 "cut"
2457 "rm"
2458 "truncate"
2459 "chmod")
2460 "|") ")\\>") command)
2461 (search-input-file inputs (string-append "/bin/" command)))
2462
2463 (("btrfs sub")
2464 (string-append (search-input-file inputs "/bin/btrfs")
2465 " sub"))))))))
2466 (inputs (list btrfs-progs cityhash util-linux))
2467 (home-page "https://github.com/Zygo/bees")
2468 (synopsis "Deduplication agent for btrfs file systems")
2469 (description
2470 "@acronym{BEES, Best-Effort Extent-Same} is a block-oriented, user-space
2471deduplication agent designed for large btrfs file systems. It combines off-line
2472data deduplication with incremental scanning to minimize the time your data
2473spend on disk between being written and being deduplicated.")
2474 (license (list license:gpl3+ ; the combined work
2475 license:zlib ; lib/crc64.cc
2476 license:gpl2)))) ; include/crucible/btrfs.h
2477
2478(define-public dwarfs
2479 (package
2480 (name "dwarfs")
2481 (version "0.14.1")
2482 (source (origin
2483 (method url-fetch)
2484 ;; The release archive is needed so that version.h is included.
2485 (uri (string-append "https://github.com/mhx/dwarfs/releases/download/v"
2486 version "/dwarfs-" version ".tar.xz"))
2487 (sha256
2488 (base32
2489 "1i990m6radrzdc1ccy9j7kr4vgy30h3sfljmq27myahl5rzz4332"))
2490 (snippet
2491 #~(begin
2492 (use-modules (guix build utils))
2493 ;; Prefer system libraries instead of submodules.
2494 ;; TODO: Package fbthrift. (only source is needed)
2495 ;; TODO: Package fsst.
2496 ;; TODO: Package ricepp.
2497 ;; NOTE: Packaging folly seperately and unbundling isn't
2498 ;; necessary since a fork is used.
2499 (for-each delete-file-recursively
2500 '(;; "fbthrift"
2501 ;; "ricepp"
2502 ;; "fsst"
2503 "fast_float"))))))
2504 (build-system cmake-build-system)
2505 (arguments
2506 (list
2507 #:tests? #f
2508 #:configure-flags
2509 #~(list "-DPREFER_SYSTEM_FAST_FLOAT=ON"
2510 "-DPREFER_SYSTEM_GTEST=ON"
2511 "-DWITH_TESTS=OFF"
2512 ;; Disable man pages since ronn fails to run without hpricot.
2513 "-DWITH_MAN_PAGES=OFF")
2514 #:phases
2515 #~(modify-phases %standard-phases
2516 ;; these tests require a FUSE device to work, so disable
2517 ;; FIXME: this doesn't work so all tests are disabled above.
2518 (add-before 'check 'set-test-filter
2519 (lambda _
2520 (let* ((privileged-tests
2521 '("dwarfs/tools_test.end_to_end/*"
2522 "dwarfs/tools_test.mutating_and_error_ops/*"
2523 "dwarfs/tools_test.categorize/*"))
2524 (filter (string-append "-" ;"-" disables all following tests
2525 (string-join privileged-tests ":"))))
2526 (setenv "GTEST_FILTER" filter)))))))
2527 (native-inputs
2528 (list
2529 ;; FIXME: Building with ronn fails because hpricot is missing from Guix.
2530 folly googletest libdwarf libevent pkg-config))
2531 (inputs
2532 (list
2533 boost
2534 double-conversion
2535 fast-float
2536 file ;for libmagic
2537 flac
2538 fmt-10
2539 fuse
2540 gflags
2541 jemalloc
2542 libarchive
2543 libunwind
2544 lz4
2545 nlohmann-json
2546 openssl
2547 parallel-hashmap
2548 range-v3
2549 utfcpp
2550 xxhash
2551 xz
2552 `(,zstd "lib")))
2553 (home-page "https://github.com/mhx/dwarfs")
2554 (synopsis "Fast high compression read-only file system")
2555 (description "DwarFS is a read-only file system with a focus on achieving
2556very high compression ratios in particular for very redundant data.
2557
2558DwarFS also doesn't compromise on speed and for some cases it is on par with
2559or performs better than SquashFS. For the primary use case, DwarFS
2560compression is an order of magnitude better than SquashFS compression, it's 6
2561times faster to build the file system, it's typically faster to access files
2562on DwarFS and it uses less CPU resources.
2563
2564Distinct features of DwarFS are:
2565
2566@itemize
2567
2568@item Clustering of files by similarity using a similarity hash function. This
2569makes it easier to exploit the redundancy across file boundaries.
2570
2571@item Segmentation analysis across file system blocks in order to reduce the
2572size of the uncompressed file system. This saves memory when using the
2573compressed file system and thus potentially allows for higher cache hit rates
2574as more data can be kept in the cache.
2575
2576@item Highly multi-threaded implementation. Both the file system creation tool
2577as well as the FUSE driver are able to make good use of the many cores of your
2578system.
2579
2580@item Optional experimental Python scripting support to provide custom
2581filtering and ordering functionality.
2582
2583@end itemize\n")
2584 (license license:gpl3)))
2585
2586(define-public sirikali
2587 (package
2588 (name "sirikali")
2589 (version "1.8.4")
2590 (source (origin
2591 (method git-fetch)
2592 (uri (git-reference
2593 (url "https://github.com/mhogomchungu/sirikali")
2594 (commit version)))
2595 (file-name (git-file-name name version))
2596 (sha256
2597 (base32 "0z144ki7664aclnv3p0bpjlzknlsgldl85v76hs2bhnk1jjlgf5y"))))
2598 (build-system qt-build-system)
2599 (arguments
2600 (list
2601 #:tests? #f ;No tests
2602 #:qtbase qtbase
2603 #:configure-flags #~(list "-DBUILD_WITH_QT6=true")))
2604 (inputs (list xdg-utils libpwquality libgcrypt libsecret qtwayland))
2605 (native-inputs (list pkg-config))
2606 (home-page "https://mhogomchungu.github.io/sirikali/")
2607 (synopsis "GUI front end to file system encryption utilities")
2608 (description
2609 "SiriKali is a Qt/C++ GUI application for managing encrypted folders. It
2610supports various backends, including eCryptfs, CryFS, EncFS, gocryptfs, fscrypt,
2611securefs, SSHFS, and Cryptomator.")
2612 (license license:gpl3+)))
2613
2614(define-public watcher
2615 (package
2616 (name "watcher")
2617 (version "0.13.8")
2618 (source (origin
2619 (method git-fetch)
2620 (uri (git-reference
2621 (url "https://github.com/e-dant/watcher")
2622 (commit (string-append "release/" version))))
2623 (file-name (git-file-name name version))
2624 (sha256
2625 (base32
2626 "118zkz6zfj57rny1ysy80ib3sqy3lfjpf611j5b4rw29dzwsa1xi"))
2627 (patches (search-patches "watcher-fix-pkg-config.patch"))))
2628 (build-system cmake-build-system)
2629 (arguments
2630 (list
2631 #:configure-flags
2632 #~(list "-DBUILD_TESTING=ON"
2633 ;; This is needed to find 'snitch' from the system.
2634 "-DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=ALWAYS")))
2635 (native-inputs (list jq snitch))
2636 (home-page "https://github.com/e-dant/watcher")
2637 (synopsis "File system watcher program and library")
2638 (description "Watcher may be used as a library or a program that can be
2639used to efficiently watch a file system for changes. This package provides
2640the following components:
2641@table @asis
2642@item @file{include/wtr/watcher.hpp}
2643C++ header library
2644@item @samp{watcher-c}
2645C shared and static library
2646@item @command{wtr.watcher}
2647Command-line interface (CLI)
2648@item @command{tw}
2649Minimal, more human-readable CLI variant
2650@end table")
2651 (license license:expat)))