me
/
guix
Archived
1
0
Fork 0

gnu: zfs: Use new package style.

* gnu/packages/file-systems.scm (zfs): Comment style.
[arguments]: Rewrite using gexps.
[inputs]: Remove labels.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Brian Cully 2022-05-12 11:05:16 -04:00 committed by Ludovic Courtès
parent 0b1473e967
commit 7b6818359c
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 128 additions and 120 deletions

View File

@ -1158,34 +1158,33 @@ with the included @command{xfstests-check} helper.")
(base32 "1xmcy4f0damf1pkb1sy1339ir1jkky0dwzd8vhwgc1pqjgac0liv")))) (base32 "1xmcy4f0damf1pkb1sy1339ir1jkky0dwzd8vhwgc1pqjgac0liv"))))
(build-system linux-module-build-system) (build-system linux-module-build-system)
(arguments (arguments
`(;; The ZFS kernel module should not be downloaded since the license (list
;; The ZFS kernel module should not be downloaded since the license
;; terms don't allow for distributing it, only building it locally. ;; terms don't allow for distributing it, only building it locally.
#:substitutable? #f #:substitutable? #f
;; Tests cannot run in an unprivileged build environment. ;; Tests cannot run in an unprivileged build environment.
#:tests? #f #:tests? #f
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'configure 'really-configure (add-after 'configure 'really-configure
(lambda* (#:key outputs inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(substitute* "configure" (substitute* "configure"
(("-/bin/sh") (string-append "-" (which "sh")))) (("-/bin/sh") (string-append "-" (which "sh"))))
(invoke "./configure" (invoke "./configure"
"--with-config=all" "--with-config=all"
(string-append "--prefix=" out) (string-append "--prefix=" #$output)
(string-append "--with-dracutdir=" out "/lib/dracut") (string-append "--with-dracutdir=" #$output
(string-append "--with-udevdir=" out "/lib/udev") "/lib/dracut")
(string-append "--with-mounthelperdir=" out "/sbin") (string-append "--with-udevdir=" #$output
"/lib/udev")
(string-append "--with-mounthelperdir=" #$output
"/sbin")
(string-append "--with-linux=" (string-append "--with-linux="
(assoc-ref inputs "linux-module-builder") (search-input-directory
"/lib/modules/build"))))) inputs
"lib/modules/build")))))
(add-after 'unpack 'patch-source (add-after 'unpack 'patch-source
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(src (assoc-ref outputs "src"))
(util-linux (assoc-ref inputs "util-linux"))
(nfs-utils (assoc-ref inputs "nfs-utils"))
(kmod (assoc-ref inputs "kmod-runtime")))
;; New feature "compatibility=" in 2.1.0. ;; New feature "compatibility=" in 2.1.0.
;; This feature looks up in two locations: ;; This feature looks up in two locations:
;; /etc/zfs/compatibility.d/ ;; /etc/zfs/compatibility.d/
@ -1197,14 +1196,14 @@ with the included @command{xfstests-check} helper.")
;; for the second (which it gets by default). ;; for the second (which it gets by default).
(substitute* "include/sys/fs/zfs.h" (substitute* "include/sys/fs/zfs.h"
(("#define\tZPOOL_SYSCONF_COMPAT_D.*$") (("#define\tZPOOL_SYSCONF_COMPAT_D.*$")
; Use absolute path. ;; Use absolute path.
"#define\tZPOOL_SYSCONF_COMPAT_D\t\"/etc/zfs/compatibility.d\"\n")) "#define\tZPOOL_SYSCONF_COMPAT_D\t\"/etc/zfs/compatibility.d\"\n"))
;; Also update the manual, which uses absolute paths, so that ;; Also update the manual, which uses absolute paths, so that
;; /usr/share/zfs/compatibility.d/ is referred via the store. ;; /usr/share/zfs/compatibility.d/ is referred via the store.
(substitute* '("man/man7/zpoolprops.7" (substitute* '("man/man7/zpoolprops.7"
"man/man7/zpool-features.7") "man/man7/zpool-features.7")
(("/usr/share/zfs/compatibility.d") (("/usr/share/zfs/compatibility.d")
(string-append out "/share/zfs/compatibility.d"))) (string-append #$output "/share/zfs/compatibility.d")))
(substitute* "etc/Makefile.in" (substitute* "etc/Makefile.in"
;; This just contains an example configuration file for ;; This just contains an example configuration file for
;; configuring ZFS on traditional init systems, skip it ;; configuring ZFS on traditional init systems, skip it
@ -1212,9 +1211,12 @@ with the included @command{xfstests-check} helper.")
;; misdirected. ;; misdirected.
(("= default ") "= ")) (("= default ") "= "))
(substitute* "lib/libzfs/os/linux/libzfs_util_os.c" (substitute* "lib/libzfs/os/linux/libzfs_util_os.c"
;; Use path to /gnu/store/*-kmod in actual path that is exec'ed. ;; Use path to /gnu/store/*-kmod in actual path that is
;; exec'ed.
(("\"/sbin/modprobe\"") (("\"/sbin/modprobe\"")
(string-append "\"" kmod "/bin/modprobe" "\"")) (string-append "\""
(search-input-file inputs "/bin/modprobe")
"\""))
;; Just use 'modprobe' in message to user, since Guix ;; Just use 'modprobe' in message to user, since Guix
;; does not have a traditional /sbin/ ;; does not have a traditional /sbin/
(("'/sbin/modprobe ") "'modprobe ")) (("'/sbin/modprobe ") "'modprobe "))
@ -1223,20 +1225,23 @@ with the included @command{xfstests-check} helper.")
((" initramfs") "")) ((" initramfs") ""))
(substitute* "module/os/linux/zfs/zfs_ctldir.c" (substitute* "module/os/linux/zfs/zfs_ctldir.c"
(("/usr/bin/env\", \"umount") (("/usr/bin/env\", \"umount")
(string-append util-linux "/bin/umount\", \"-n")) (string-append (search-input-file inputs "/bin/umount")
"\", \"-n"))
(("/usr/bin/env\", \"mount") (("/usr/bin/env\", \"mount")
(string-append util-linux "/bin/mount\", \"-n"))) (string-append (search-input-file inputs "/bin/mount")
"\", \"-n")))
(substitute* "lib/libzfs/os/linux/libzfs_mount_os.c" (substitute* "lib/libzfs/os/linux/libzfs_mount_os.c"
(("/bin/mount") (string-append util-linux "/bin/mount")) (("/bin/mount") (search-input-file inputs "/bin/mount"))
(("/bin/umount") (string-append util-linux "/bin/umount"))) (("/bin/umount") (search-input-file inputs "/bin/umount")))
(substitute* "lib/libshare/os/linux/nfs.c" (substitute* "lib/libshare/os/linux/nfs.c"
(("/usr/sbin/exportfs") (("/usr/sbin/exportfs")
(string-append nfs-utils "/sbin/exportfs"))) (search-input-file inputs "/sbin/exportfs")))
(substitute* "config/zfs-build.m4" (substitute* "config/zfs-build.m4"
(("\\$sysconfdir/init.d") (string-append out "/etc/init.d"))) (("\\$sysconfdir/init.d")
(string-append #$output "/etc/init.d")))
(substitute* '("etc/zfs/Makefile.am" (substitute* '("etc/zfs/Makefile.am"
"cmd/zed/Makefile.am") "cmd/zed/Makefile.am")
(("\\$\\(sysconfdir)") (string-append out "/etc"))) (("\\$\\(sysconfdir)") (string-append #$output "/etc")))
(substitute* "cmd/vdev_id/vdev_id" (substitute* "cmd/vdev_id/vdev_id"
(("PATH=/bin:/sbin:/usr/bin:/usr/sbin") (("PATH=/bin:/sbin:/usr/bin:/usr/sbin")
(string-append "PATH=" (string-append "PATH="
@ -1247,39 +1252,42 @@ with the included @command{xfstests-check} helper.")
(substitute* "contrib/pyzfs/Makefile.in" (substitute* "contrib/pyzfs/Makefile.in"
((".*install-lib.*") "")) ((".*install-lib.*") ""))
(substitute* '("Makefile.am" "Makefile.in") (substitute* '("Makefile.am" "Makefile.in")
(("\\$\\(prefix)/src") (string-append src "/src"))) (("\\$\\(prefix)/src") (string-append #$output:src "/src")))
(substitute* (find-files "udev/rules.d/" ".rules.in$") (substitute* (find-files "udev/rules.d/" ".rules.in$")
(("/sbin/modprobe") (string-append kmod "/bin/modprobe")))))) (("/sbin/modprobe")
(search-input-file inputs "/bin/modprobe")))))
(replace 'build (replace 'build
(lambda _ (invoke "make"))) (lambda _ (invoke "make")))
(replace 'install (replace 'install
(lambda* (#:key outputs inputs native-inputs #:allow-other-keys) (lambda* (#:key inputs native-inputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((kmod (assoc-ref (or native-inputs inputs) "kmod")))
(moddir (assoc-ref outputs "module"))
(kmod (assoc-ref (or native-inputs inputs) "kmod")))
(invoke "make" "install" (invoke "make" "install"
(string-append "DEFAULT_INITCONF_DIR=" out "/etc/default") (string-append "DEFAULT_INITCONF_DIR="
(string-append "DEPMOD=" kmod "/bin/depmod") #$output "/etc/default")
(string-append "INSTALL_PATH=" out) (string-append "DEPMOD="
(string-append "INSTALL_MOD_PATH=" moddir) (search-input-file
(or native-inputs inputs)
"/bin/depmod"))
(string-append "INSTALL_PATH=" #$output)
(string-append "INSTALL_MOD_PATH=" #$output:module)
"INSTALL_MOD_STRIP=1") "INSTALL_MOD_STRIP=1")
(install-file "contrib/bash_completion.d/zfs" (install-file
(string-append out "contrib/bash_completion.d/zfs"
(string-append #$output
"/share/bash-completion/completions")))))))) "/share/bash-completion/completions"))))))))
(native-inputs (native-inputs
(list attr kmod pkg-config)) (list attr kmod pkg-config))
(inputs (inputs (list eudev
`(("eudev" ,eudev) kmod
("kmod-runtime" ,kmod) libaio
("libaio" ,libaio) libtirpc
("libtirpc" ,libtirpc) nfs-utils
("nfs-utils" ,nfs-utils) openssl
("openssl" ,openssl) python
("python" ,python) python-cffi
("python-cffi" ,python-cffi) util-linux
("util-linux" ,util-linux) `(,util-linux "lib")
("util-linux:lib" ,util-linux "lib") zlib))
("zlib" ,zlib)))
(home-page "https://zfsonlinux.org/") (home-page "https://zfsonlinux.org/")
(synopsis "OpenZFS on Linux") (synopsis "OpenZFS on Linux")
(description (description