Merge branch 'staging' into core-updates
[jackhill/guix/guix.git] / gnu / packages / file-systems.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
3 ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
4 ;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2018 Leo Famulari <leo@famulari.name>
6 ;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
7 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
14 ;;;
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
19 ;;;
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 (define-module (gnu packages file-systems)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix git-download)
28 #:use-module (guix build-system cmake)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix build-system linux-module)
31 #:use-module (guix build-system trivial)
32 #:use-module (guix utils)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages acl)
35 #:use-module (gnu packages attr)
36 #:use-module (gnu packages autotools)
37 #:use-module (gnu packages bison)
38 #:use-module (gnu packages check)
39 #:use-module (gnu packages compression)
40 #:use-module (gnu packages curl)
41 #:use-module (gnu packages datastructures)
42 #:use-module (gnu packages documentation)
43 #:use-module (gnu packages docbook)
44 #:use-module (gnu packages flex)
45 #:use-module (gnu packages glib)
46 #:use-module (gnu packages libffi)
47 #:use-module (gnu packages linux)
48 #:use-module (gnu packages nfs)
49 #:use-module (gnu packages onc-rpc)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages readline)
53 #:use-module (gnu packages sqlite)
54 #:use-module (gnu packages tls)
55 #:use-module (gnu packages xml))
56
57 (define-public httpfs2
58 (package
59 (name "httpfs2")
60 (version "0.1.5")
61 (source
62 (origin
63 (method url-fetch)
64 (uri (string-append "mirror://sourceforge/httpfs/httpfs2/"
65 "httpfs2-" version ".tar.gz"))
66 (sha256
67 (base32
68 "1h8ggvhw30n2r6w11n1s458ypggdqx6ldwd61ma4yd7binrlpjq1"))))
69 (build-system gnu-build-system)
70 (native-inputs
71 `(("asciidoc" ,asciidoc)
72 ("docbook-xml" ,docbook-xml)
73 ("libxml2" ,libxml2)
74 ("libxslt" ,libxslt)
75 ("pkg-config" ,pkg-config)))
76 (inputs
77 `(("fuse" ,fuse)
78 ("gnutls" ,gnutls)))
79 (arguments
80 `(#:phases
81 (modify-phases %standard-phases
82 (delete 'configure) ; no configure script
83 (replace 'install
84 ;; There's no ‘install’ target. Install all variants manually.
85 (lambda* (#:key outputs #:allow-other-keys)
86 (let* ((out (assoc-ref outputs "out"))
87 (bin (string-append out "/bin"))
88 (man1 (string-append out "/share/man/man1")))
89 (mkdir-p bin)
90 (mkdir-p man1)
91 (for-each
92 (lambda (variant)
93 (let ((man1-page (string-append variant ".1")))
94 (install-file variant bin)
95 (install-file man1-page man1)))
96 (list "httpfs2"
97 "httpfs2-mt"
98 "httpfs2-ssl"
99 "httpfs2-ssl-mt")))
100 #t)))
101 #:make-flags (list "CC=gcc")
102 #:parallel-build? #f ; can result in missing man pages
103 #:tests? #f)) ; no tests
104 (home-page "https://sourceforge.net/projects/httpfs/")
105 (synopsis "Mount remote files over HTTP")
106 (description "httpfs2 is a @code{fuse} file system for mounting any
107 @dfn{HyperText} (HTTP or HTTPS) URL. It uses HTTP/1.1 byte ranges to request
108 arbitrary bytes from the web server, without needing to download the entire
109 file. This is particularly useful with large archives such as ZIP files and
110 ISO images when you only need to inspect their contents or extract specific
111 files. Since the HTTP protocol itself has no notion of directories, only a
112 single file can be mounted.")
113 (license license:gpl2+)))
114
115 (define-public jfsutils
116 (package
117 (name "jfsutils")
118 (version "1.1.15")
119 (source
120 (origin
121 (method url-fetch)
122 (uri (string-append "http://jfs.sourceforge.net/project/pub/jfsutils-"
123 version ".tar.gz"))
124 (sha256
125 (base32 "0kbsy2sk1jv4m82rxyl25gwrlkzvl3hzdga9gshkxkhm83v1aji4"))
126 (patches (search-patches "jfsutils-add-sysmacros.patch"
127 "jfsutils-include-systypes.patch"))))
128 (build-system gnu-build-system)
129 (inputs
130 `(("util-linux" ,util-linux "lib")))
131 (home-page "http://jfs.sourceforge.net/home.html")
132 (synopsis "Utilities for managing JFS file systems")
133 (description
134 "The JFSutils are a collection of utilities for managing the @acronym{JFS,
135 Journaled File System}, a 64-bit journaling file system created by IBM and later
136 ported to the kernel Linux. The following commands are available:
137 @enumerate
138 @item @command{fsck.jfs}: check and repair a JFS file system or replay its
139 transaction log.
140 @item @command{logdump}: dump the JFS journal log.
141 @item @command{logredo}: replay the JFS journal log.
142 @item @command{mkfs.jfs}: create a new JFS file system.
143 @item @command{xchklog}: save a JFS fsck log to a file.
144 @item @command{xchkdmp}: dump the contents of such a log file.
145 @item @command{xpeek}: a JFS file system editor with a shell-like interface.
146 @end enumerate\n")
147 (license license:gpl3+))) ; no explicit version given
148
149 (define-public jfsutils/static
150 (static-package
151 (package
152 (inherit jfsutils)
153 (name "jfsutils-static")
154 (inputs
155 `(("util-linux:static" ,util-linux "static")
156 ,@(package-inputs jfsutils))))))
157
158 (define-public jfs_fsck/static
159 (package
160 (name "jfs_fsck-static")
161 (version (package-version jfsutils))
162 (source #f)
163 (build-system trivial-build-system)
164 (arguments
165 `(#:modules ((guix build utils))
166 #:builder
167 (begin
168 (use-modules (guix build utils)
169 (ice-9 ftw)
170 (srfi srfi-26))
171 (let* ((jfsutils (assoc-ref %build-inputs "jfsutils"))
172 (fsck "jfs_fsck")
173 (out (assoc-ref %outputs "out"))
174 (sbin (string-append out "/sbin")))
175 (mkdir-p sbin)
176 (with-directory-excursion sbin
177 (install-file (string-append jfsutils "/sbin/" fsck)
178 ".")
179 (remove-store-references fsck)
180 (chmod fsck #o555))
181 #t))))
182 (inputs
183 `(("jfsutils" ,jfsutils/static)))
184 (home-page (package-home-page jfsutils))
185 (synopsis "Statically-linked jfs_fsck command from jfsutils")
186 (description "This package provides statically-linked jfs_fsck command taken
187 from the jfsutils package. It is meant to be used in initrds.")
188 (license (package-license jfsutils))))
189
190 (define-public disorderfs
191 (package
192 (name "disorderfs")
193 (version "0.5.6")
194 (source
195 (origin
196 (method git-fetch)
197 (uri (git-reference
198 (url "https://salsa.debian.org/reproducible-builds/disorderfs.git")
199 (commit version)))
200 (file-name (git-file-name name version))
201 (sha256
202 (base32
203 "1zn2ydap8k9fwjl3ivgrg6l32s5p4ik6ca6j1idp7c77znlv6cpp"))))
204 (build-system gnu-build-system)
205 (native-inputs
206 `(("pkg-config" ,pkg-config)))
207 (inputs
208 `(("fuse" ,fuse)
209 ("attr" ,attr)))
210 (arguments
211 `(#:phases (modify-phases %standard-phases
212 (delete 'configure)) ; no configure script
213 #:make-flags (let ((out (assoc-ref %outputs "out")))
214 (list (string-append "PREFIX=" out)))
215 #:test-target "test"
216 ;; FIXME: Tests require 'run-parts' which is not in Guix yet.
217 #:tests? #f))
218 (home-page "https://github.com/ReproducibleBuilds/disorderfs")
219 (synopsis "FUSE file system that introduces non-determinism")
220 (description
221 "An overlay FUSE file system that introduces non-determinism
222 into file system metadata. For example, it can randomize the order
223 in which directory entries are read. This is useful for detecting
224 non-determinism in the build process.")
225 (license license:gpl3+)))
226
227 (define-public glusterfs
228 (package
229 (name "glusterfs")
230 (version "7.0")
231 (source
232 (origin
233 (method url-fetch)
234 (uri (string-append "https://download.gluster.org/pub/gluster/glusterfs/"
235 (version-major version) "/"
236 (version-major+minor version) "/"
237 "glusterfs-" version ".tar.gz"))
238 (sha256
239 (base32
240 "0yzhx710ypj0j3m5dcgmmgvkp7p0rmmp2p7ld0axrm4vpwc2b1wa"))))
241 (build-system gnu-build-system)
242 (arguments
243 `(#:configure-flags
244 (let ((out (assoc-ref %outputs "out"))
245 (p2 (assoc-ref %build-inputs "python-2")))
246 (list (string-append "PYTHON=" p2 "/bin/python")
247 (string-append "--with-initdir=" out "/etc/init.d")
248 (string-append "--with-mountutildir=" out "/sbin")
249 "--enable-cmocka" ; unit tests
250 ;; "--enable-debug" ; debug build options
251 ;; "--enable-asan" ; Address Sanitizer
252 ;; "--enable-tsan" ; ThreadSanitizer
253 ))
254 #:phases
255 (modify-phases %standard-phases
256 (add-before 'configure 'autogen
257 (lambda _ (invoke "./autogen.sh"))))))
258 (native-inputs
259 `(("pkg-config" ,pkg-config)
260 ("libtirpc", libtirpc)
261 ("rpcsvc-proto", rpcsvc-proto)
262 ("python-2" ,python-2) ; must be version 2
263 ("flex" ,flex)
264 ("bison" ,bison)
265 ("libtool" ,libtool)
266 ("autoconf" ,autoconf)
267 ("automake" ,automake)
268 ("cmocka" ,cmocka)))
269 (inputs
270 `(("acl" ,acl)
271 ("fuse", fuse)
272 ("openssl" ,openssl)
273 ("liburcu" ,liburcu)
274 ("libuuid" ,util-linux "lib")
275 ("libxml2" ,libxml2)
276 ("readline" ,readline)
277 ("zlib" ,zlib)
278 ("libaio", libaio)
279 ("rdma-core", rdma-core)))
280 (home-page "https://www.gluster.org")
281 (synopsis "Distributed file system")
282 (description "GlusterFS is a distributed scalable network file system
283 suitable for data-intensive tasks such as cloud storage and media streaming.
284 It allows rapid provisioning of additional storage based on your storage
285 consumption needs. It incorporates automatic failover as a primary feature.
286 All of this is accomplished without a centralized metadata server.")
287 ;; The user may choose either LGPLv3+ or GPLv2 only.
288 (license (list license:lgpl3+ license:gpl2+))))
289
290 (define-public curlftpfs
291 (package
292 (name "curlftpfs")
293 (version "0.9.2")
294 (source
295 (origin
296 (method url-fetch)
297 (uri (string-append "mirror://sourceforge/curlftpfs/curlftpfs/" version
298 "/curlftpfs-" version ".tar.gz"))
299 (sha256
300 (base32
301 "0n397hmv21jsr1j7zx3m21i7ryscdhkdsyqpvvns12q7qwwlgd2f"))))
302 (build-system gnu-build-system)
303 (arguments
304 `(#:phases
305 (modify-phases %standard-phases
306 (add-after 'unpack 'fix-test
307 (lambda _
308 ;; One of the 512-Byte block counts is definitely wrong.
309 ;; See <https://sourceforge.net/p/curlftpfs/bugs/73/>.
310 (substitute* "tests/ftpfs-ls_unittest.c"
311 (("4426192") "12814800"))
312 #t)))))
313 (inputs
314 `(("curl" ,curl)
315 ("glib" ,glib)
316 ("fuse" ,fuse)))
317 (native-inputs
318 `(("pkg-config" ,pkg-config)))
319 (home-page "http://curlftpfs.sourceforge.net/")
320 (synopsis "Mount remote file systems over FTP")
321 (description
322 "This is a file system client based on the FTP File Transfer Protocol.")
323 (license license:gpl2+)))
324
325 (define-public libnfs
326 (package
327 (name "libnfs")
328 (version "3.0.0")
329 (source (origin
330 (method git-fetch)
331 (uri (git-reference
332 (url "https://github.com/sahlberg/libnfs.git")
333 (commit (string-append "libnfs-" version))))
334 (file-name (git-file-name name version))
335 (sha256
336 (base32
337 "115p55y2cbs92z5lmcnjx1v29lwinpgq4sha9v1kq1vd8674h404"))))
338 (build-system gnu-build-system)
339 (home-page "https://github.com/sahlberg/libnfs")
340 (native-inputs
341 `(("autoconf" ,autoconf)
342 ("automake" ,automake)
343 ("libtool" ,libtool)
344 ("pkg-config" ,pkg-config)))
345 (synopsis "Client library for accessing NFS shares")
346 (description "LIBNFS is a client library for accessing NFS shares over a
347 network. LIBNFS offers three different APIs, for different use :
348
349 @enumerate
350 @item RAW, a fully asynchronous low level RPC library for NFS protocols. This
351 API provides very flexible and precise control of the RPC issued.
352 @item NFS ASYNC, a fully asynchronous library for high level vfs functions
353 @item NFS SYNC, a synchronous library for high level vfs functions.
354 @end enumerate\n")
355 (license (list license:lgpl2.1+ ; library
356 license:gpl3+ ; tests
357 license:bsd-3 ; copied nsf4 files
358 ))))
359
360 (define-public apfs-fuse
361 (let ((commit "c7036a3030d128bcecefc1eabc47c039ccfdcec9")
362 (revision "0"))
363 (package
364 (name "apfs-fuse")
365 (version (git-version "0.0.0" revision commit))
366 (source (origin
367 (method git-fetch)
368 (uri (git-reference
369 (url "https://github.com/sgan81/apfs-fuse")
370 (recursive? #t) ; for lzfse
371 (commit commit)))
372 (sha256
373 (base32
374 "1akd4cx1f9cyq6sfk9ybv4chhjwjlnqi8ic4z5ajnd5x0g76nz3r"))
375 (file-name (git-file-name name version))))
376 (build-system cmake-build-system)
377 (arguments
378 `(#:tests? #f ; No test suite
379 #:phases
380 (modify-phases %standard-phases
381 ;; No 'install' target in CMakeLists.txt
382 (replace 'install
383 (lambda* (#:key outputs #:allow-other-keys)
384 (let* ((out (assoc-ref outputs "out"))
385 (bin (string-append out "/bin"))
386 (lib (string-append out "/lib"))
387 (doc (string-append out "/share/doc/"
388 (string-append ,name "-" ,version))))
389 (install-file "apfs-dump" bin)
390 (install-file "apfs-dump-quick" bin)
391 (install-file "apfs-fuse" bin)
392 (install-file "libapfs.a" lib)
393 #t))))))
394 (inputs
395 `(("bzip2" ,bzip2)
396 ("fuse" ,fuse)
397 ("zlib" ,zlib)))
398 (synopsis "Read-only FUSE driver for the APFS file system")
399 (description "APFS-FUSE is a read-only FUSE driver for the @dfn{Apple File
400 System} (APFS). It is currently in an experimental state — it may not be able
401 to read all files, and it does not support all the compression methods in
402 APFS.")
403 (home-page "https://github.com/sgan81/apfs-fuse")
404 (license license:gpl2+))))
405
406 (define-public zfs
407 (package
408 (name "zfs")
409 (version "0.8.2")
410 (outputs '("out" "module" "src"))
411 (source
412 (origin
413 (method url-fetch)
414 (uri (string-append "https://github.com/zfsonlinux/zfs/releases"
415 "/download/zfs-" version
416 "/zfs-" version ".tar.gz"))
417 (sha256
418 (base32
419 "1f7aig15q3z832pr2n48j3clafic2yk1vvqlh28vpklfghjqwq27"))))
420 (build-system linux-module-build-system)
421 (arguments
422 `(;; The ZFS kernel module should not be downloaded since the license
423 ;; terms don't allow for distributing it, only building it locally.
424 #:substitutable? #f
425 ;; Tests cannot run in an unprivileged build environment.
426 #:tests? #f
427 #:phases
428 (modify-phases %standard-phases
429 (add-after 'configure 'really-configure
430 (lambda* (#:key outputs inputs #:allow-other-keys)
431 (let ((out (assoc-ref outputs "out")))
432 (substitute* "configure"
433 (("-/bin/sh") (string-append "-" (which "sh")))
434 ((" /bin/sh") (string-append " " (which "sh"))))
435 (invoke "./configure"
436 "--with-config=all"
437 (string-append "--prefix=" out)
438 (string-append "--with-dracutdir=" out "/lib/dracut")
439 (string-append "--with-udevdir=" out "/lib/udev")
440 (string-append "--with-mounthelperdir=" out "/sbin")
441 (string-append "--with-linux="
442 (assoc-ref inputs "linux-module-builder")
443 "/lib/modules/build")))))
444 (add-after 'unpack 'patch-source
445 (lambda* (#:key inputs outputs #:allow-other-keys)
446 (let ((out (assoc-ref outputs "out"))
447 (src (assoc-ref outputs "src"))
448 (util-linux (assoc-ref inputs "util-linux"))
449 (nfs-utils (assoc-ref inputs "nfs-utils")))
450 (substitute* "module/zfs/zfs_ctldir.c"
451 (("/usr/bin/env\", \"umount")
452 (string-append util-linux "/bin/umount\", \"-n"))
453 (("/usr/bin/env\", \"mount")
454 (string-append util-linux "/bin/mount\", \"-n")))
455 (substitute* "lib/libzfs/libzfs_mount.c"
456 (("/bin/mount") (string-append util-linux "/bin/mount"))
457 (("/bin/umount") (string-append util-linux "/bin/umount")))
458 (substitute* "lib/libshare/nfs.c"
459 (("/usr/sbin/exportfs")
460 (string-append nfs-utils "/sbin/exportfs")))
461 (substitute* "config/zfs-build.m4"
462 (("\\$sysconfdir/init.d") (string-append out "/etc/init.d")))
463 (substitute* '("etc/zfs/Makefile.am"
464 "cmd/zed/Makefile.am")
465 (("\\$\\(sysconfdir)") (string-append out "/etc")))
466 (substitute* "cmd/vdev_id/vdev_id"
467 (("PATH=/bin:/sbin:/usr/bin:/usr/sbin")
468 (string-append "PATH="
469 (dirname (which "chmod")) ":"
470 (dirname (which "grep")) ":"
471 (dirname (which "sed")) ":"
472 (dirname (which "gawk")))))
473 (substitute* "contrib/pyzfs/Makefile.in"
474 ((".*install-lib.*") ""))
475 (substitute* '("Makefile.am" "Makefile.in")
476 (("\\$\\(prefix)/src") (string-append src "/src"))))
477 #t))
478 (replace 'build
479 (lambda _ (invoke "make")))
480 (replace 'install
481 (lambda* (#:key outputs inputs native-inputs #:allow-other-keys)
482 (let* ((out (assoc-ref outputs "out"))
483 (moddir (assoc-ref outputs "module"))
484 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
485 (invoke "make" "install"
486 (string-append "DEFAULT_INITCONF_DIR=" out "/etc/default")
487 (string-append "DEPMOD=" kmod "/bin/depmod")
488 (string-append "INSTALL_PATH=" out)
489 (string-append "INSTALL_MOD_PATH=" moddir)
490 "INSTALL_MOD_STRIP=1")
491 (install-file "contrib/bash_completion.d/zfs"
492 (string-append out "/share/bash-completion/completions"))
493 (symlink "../share/pkgconfig/" (string-append out "/lib/pkgconfig"))
494 #t))))))
495 (native-inputs
496 `(("attr" ,attr)
497 ("pkg-config" ,pkg-config)))
498 (inputs
499 `(("eudev" ,eudev)
500 ("libaio" ,libaio)
501 ("libtirpc" ,libtirpc)
502 ("nfs-utils" ,nfs-utils)
503 ("openssl" ,openssl)
504 ("python" ,python)
505 ("python-cffi" ,python-cffi)
506 ("util-linux" ,util-linux "lib")
507 ("zlib" ,zlib)))
508 (home-page "https://zfsonlinux.org/")
509 (synopsis "Native ZFS on Linux")
510 (description
511 "ZFS on Linux is an advanced file system and volume manager which was
512 originally developed for Solaris and is now maintained by the OpenZFS
513 community.")
514 (license license:cddl1.0)))