From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id iBCQMa8ifWLGHwEAbAwnHQ (envelope-from ) for ; Thu, 12 May 2022 17:07:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id mD2PMa8ifWLpUwAAauVa8A (envelope-from ) for ; Thu, 12 May 2022 17:07:27 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3612BE613 for ; Thu, 12 May 2022 17:07:27 +0200 (CEST) Received: from localhost ([::1]:44532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npAPV-00014o-RU for larch@yhetil.org; Thu, 12 May 2022 11:07:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npAPC-00014Y-Pm for guix-patches@gnu.org; Thu, 12 May 2022 11:07:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48068) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npAP7-0007Mu-Ta for guix-patches@gnu.org; Thu, 12 May 2022 11:07:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1npAP7-0005fe-JH for guix-patches@gnu.org; Thu, 12 May 2022 11:07:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55369] [PATCH v3 1/2] gnu: zfs: Use new package style. References: <9c79808be27869958987782313cec824787b651f.1652276252.git.bjc@spork.org> In-Reply-To: <9c79808be27869958987782313cec824787b651f.1652276252.git.bjc@spork.org> Resent-From: Brian Cully Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 12 May 2022 15:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55369 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55369@debbugs.gnu.org Cc: Brian Cully Received: via spool by 55369-submit@debbugs.gnu.org id=B55369.165236801821788 (code B ref 55369); Thu, 12 May 2022 15:07:01 +0000 Received: (at 55369) by debbugs.gnu.org; 12 May 2022 15:06:58 +0000 Received: from localhost ([127.0.0.1]:41965 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npAP3-0005fJ-Nm for submit@debbugs.gnu.org; Thu, 12 May 2022 11:06:58 -0400 Received: from coleridge.kublai.com ([166.84.7.167]:52114 helo=mail.spork.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npAOx-0005f7-WA for 55369@debbugs.gnu.org; Thu, 12 May 2022 11:06:57 -0400 Received: from guix.jhoto.kublai.com (unknown [IPv6:2001:470:1f07:1b9:c714:ed8b:7cf4:a700]) by mail.spork.org (Postfix) with ESMTPSA id 7AF926584; Thu, 12 May 2022 11:06:51 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1652368011; bh=WPGHdtppDgfEkDSJF9QmiQxwTikzLSXZu+CVSDKjH5s=; h=From:To:Cc:Subject:Date; b=wwB9eI+CIXSZ1EmP1SfitXq1TAae2GfnON/jRy2woBHPQljDHoc9BdM+Jn8RBUHaJ SHz47ejUAoIF3V8IILmjJlFwGsRrVHypTr+FMEGWSPY61ADSjAGuONaMJQsk2/ZcIH zykFaVgfbAD1yneEnUXLx2XKvDpGqu9mGgEM7dmc= Date: Thu, 12 May 2022 11:05:16 -0400 Message-Id: <421366c9802d6a5627c4bff3c7010ac376334b07.1652367916.git.bjc@spork.org> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Brian Cully X-ACL-Warn: , Brian Cully via Guix-patches From: Brian Cully via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652368047; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=zOZYh49Grywvnx5fH66U26GRuIxw4beUsKT/EMHDjRU=; b=X9/J5wPf7tYmuY41N2NmO93V2BY4cTOx5LzPqTCQl1XVDahbSQAWUZyaAJHLPWkgirBlQj vcJY+qVY9fXxljy+fKOUMC3r95LauZUKrfyIIwGLVxsCYItv1ptSz4mJGCiYJz8bUHqV7e lnR0snF7yFYqIvsxkRaiBVc1jhrAVEmOtofaHdO8P9bfZSP+B44I/+BuulglfqF72fo8b2 mSJTDMO9VwkpJwHvlBlv9UaaKSx6HToE1Vu5OtZzOOmd8fJqn7TJEi7K2GrGt1vzBtsHf2 Nhk5ABoKa0zVfLI56KEL2TfvC9lMWaLs8w7+0ixq9wqsPig+4SKh8GNFK3frIg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652368047; a=rsa-sha256; cv=none; b=WHUhG3hVF7fBrEhPWFGQLyRxK3e4UBf3DwBX1I0YMZ7H657kzs3cye4Thm/EKmo3Nk3RsP sR4I8pbX09MfWNY1kuBIqRFOBYy2lc5C5XWIDLGPQcGFks9hBCyi5+rj8oSwwLgcaV6ByH Rlip15IVnIL2X3MF+CebsriMsD8SHyq+mDky3/D9l9vyImKaHmsosdkIB2UpD9EeQ8fqoa AQPdJTc2F/pGERYXxyeS2jygGomH2Om5HGhDJRbsdIc6fbWvjaIisCRFiQ+zwoixjgHMNJ DCFdArfvqW5ULrGRiGuoACnMXwfmeANBGyEY3H4jJyfG3CbOor5K5Gkt+a7XCw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=spork.org header.s=dkim header.b=wwB9eI+C; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.01 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=spork.org header.s=dkim header.b=wwB9eI+C; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 3612BE613 X-Spam-Score: -3.01 X-Migadu-Scanner: scn1.migadu.com X-TUID: 5C+4U3n58lYO From: Brian Cully * gnu/packages/file-systems.scm (zfs): Comment style. [arguments]: Rewrite using gexps. [inputs]: Remove labels. --- This changes the use of (assoc-ref inputs "linux-module-builder") to an invocation of (search-input-directory inputs "lib/modules/build"). gnu/packages/file-systems.scm | 248 ++++++++++++++++++---------------- 1 file changed, 128 insertions(+), 120 deletions(-) diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm index e6ec51fe40..3d93f59585 100644 --- a/gnu/packages/file-systems.scm +++ b/gnu/packages/file-systems.scm @@ -1158,128 +1158,136 @@ (define-public zfs (base32 "1xmcy4f0damf1pkb1sy1339ir1jkky0dwzd8vhwgc1pqjgac0liv")))) (build-system linux-module-build-system) (arguments - `(;; The ZFS kernel module should not be downloaded since the license - ;; terms don't allow for distributing it, only building it locally. - #:substitutable? #f - ;; Tests cannot run in an unprivileged build environment. - #:tests? #f - #:phases - (modify-phases %standard-phases - (add-after 'configure 'really-configure - (lambda* (#:key outputs inputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (substitute* "configure" - (("-/bin/sh") (string-append "-" (which "sh")))) - (invoke "./configure" - "--with-config=all" - (string-append "--prefix=" out) - (string-append "--with-dracutdir=" out "/lib/dracut") - (string-append "--with-udevdir=" out "/lib/udev") - (string-append "--with-mounthelperdir=" out "/sbin") - (string-append "--with-linux=" - (assoc-ref inputs "linux-module-builder") - "/lib/modules/build"))))) - (add-after 'unpack 'patch-source - (lambda* (#:key inputs outputs #: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. - ;; This feature looks up in two locations: - ;; /etc/zfs/compatibility.d/ - ;; /usr/share/zfs/compatibility.d/ - ;; The first is intended for system-specific compatibility - ;; sets, while the second is what is installed with the - ;; OpenZFS package, so use the absolute path for the first - ;; (which requires patching in the file) and the store path - ;; for the second (which it gets by default). - (substitute* "include/sys/fs/zfs.h" - (("#define\tZPOOL_SYSCONF_COMPAT_D.*$") - ; Use absolute path. - "#define\tZPOOL_SYSCONF_COMPAT_D\t\"/etc/zfs/compatibility.d\"\n")) - ;; Also update the manual, which uses absolute paths, so that - ;; /usr/share/zfs/compatibility.d/ is referred via the store. - (substitute* '("man/man7/zpoolprops.7" - "man/man7/zpool-features.7") - (("/usr/share/zfs/compatibility.d") - (string-append out "/share/zfs/compatibility.d"))) - (substitute* "etc/Makefile.in" - ;; This just contains an example configuration file for - ;; configuring ZFS on traditional init systems, skip it - ;; since we cannot use it anyway; the install target becomes - ;; misdirected. - (("= default ") "= ")) - (substitute* "lib/libzfs/os/linux/libzfs_util_os.c" - ;; Use path to /gnu/store/*-kmod in actual path that is exec'ed. - (("\"/sbin/modprobe\"") - (string-append "\"" kmod "/bin/modprobe" "\"")) - ;; Just use 'modprobe' in message to user, since Guix - ;; does not have a traditional /sbin/ - (("'/sbin/modprobe ") "'modprobe ")) - (substitute* "contrib/Makefile.in" - ;; This is not configurable nor is its hard-coded /usr prefix. - ((" initramfs") "")) - (substitute* "module/os/linux/zfs/zfs_ctldir.c" - (("/usr/bin/env\", \"umount") - (string-append util-linux "/bin/umount\", \"-n")) - (("/usr/bin/env\", \"mount") - (string-append util-linux "/bin/mount\", \"-n"))) - (substitute* "lib/libzfs/os/linux/libzfs_mount_os.c" - (("/bin/mount") (string-append util-linux "/bin/mount")) - (("/bin/umount") (string-append util-linux "/bin/umount"))) - (substitute* "lib/libshare/os/linux/nfs.c" - (("/usr/sbin/exportfs") - (string-append nfs-utils "/sbin/exportfs"))) - (substitute* "config/zfs-build.m4" - (("\\$sysconfdir/init.d") (string-append out "/etc/init.d"))) - (substitute* '("etc/zfs/Makefile.am" - "cmd/zed/Makefile.am") - (("\\$\\(sysconfdir)") (string-append out "/etc"))) - (substitute* "cmd/vdev_id/vdev_id" - (("PATH=/bin:/sbin:/usr/bin:/usr/sbin") - (string-append "PATH=" - (dirname (which "chmod")) ":" - (dirname (which "grep")) ":" - (dirname (which "sed")) ":" - (dirname (which "gawk"))))) - (substitute* "contrib/pyzfs/Makefile.in" - ((".*install-lib.*") "")) - (substitute* '("Makefile.am" "Makefile.in") - (("\\$\\(prefix)/src") (string-append src "/src"))) - (substitute* (find-files "udev/rules.d/" ".rules.in$") - (("/sbin/modprobe") (string-append kmod "/bin/modprobe")))))) - (replace 'build - (lambda _ (invoke "make"))) - (replace 'install - (lambda* (#:key outputs inputs native-inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (moddir (assoc-ref outputs "module")) - (kmod (assoc-ref (or native-inputs inputs) "kmod"))) - (invoke "make" "install" - (string-append "DEFAULT_INITCONF_DIR=" out "/etc/default") - (string-append "DEPMOD=" kmod "/bin/depmod") - (string-append "INSTALL_PATH=" out) - (string-append "INSTALL_MOD_PATH=" moddir) - "INSTALL_MOD_STRIP=1") - (install-file "contrib/bash_completion.d/zfs" - (string-append out - "/share/bash-completion/completions")))))))) + (list + ;; The ZFS kernel module should not be downloaded since the license + ;; terms don't allow for distributing it, only building it locally. + #:substitutable? #f + ;; Tests cannot run in an unprivileged build environment. + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (add-after 'configure 'really-configure + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "configure" + (("-/bin/sh") (string-append "-" (which "sh")))) + (invoke "./configure" + "--with-config=all" + (string-append "--prefix=" #$output) + (string-append "--with-dracutdir=" #$output + "/lib/dracut") + (string-append "--with-udevdir=" #$output + "/lib/udev") + (string-append "--with-mounthelperdir=" #$output + "/sbin") + (string-append "--with-linux=" + (search-input-directory + inputs + "lib/modules/build"))))) + (add-after 'unpack 'patch-source + (lambda* (#:key inputs #:allow-other-keys) + ;; New feature "compatibility=" in 2.1.0. + ;; This feature looks up in two locations: + ;; /etc/zfs/compatibility.d/ + ;; /usr/share/zfs/compatibility.d/ + ;; The first is intended for system-specific compatibility + ;; sets, while the second is what is installed with the + ;; OpenZFS package, so use the absolute path for the first + ;; (which requires patching in the file) and the store path + ;; for the second (which it gets by default). + (substitute* "include/sys/fs/zfs.h" + (("#define\tZPOOL_SYSCONF_COMPAT_D.*$") + ;; Use absolute path. + "#define\tZPOOL_SYSCONF_COMPAT_D\t\"/etc/zfs/compatibility.d\"\n")) + ;; Also update the manual, which uses absolute paths, so that + ;; /usr/share/zfs/compatibility.d/ is referred via the store. + (substitute* '("man/man7/zpoolprops.7" + "man/man7/zpool-features.7") + (("/usr/share/zfs/compatibility.d") + (string-append #$output "/share/zfs/compatibility.d"))) + (substitute* "etc/Makefile.in" + ;; This just contains an example configuration file for + ;; configuring ZFS on traditional init systems, skip it + ;; since we cannot use it anyway; the install target becomes + ;; misdirected. + (("= default ") "= ")) + (substitute* "lib/libzfs/os/linux/libzfs_util_os.c" + ;; Use path to /gnu/store/*-kmod in actual path that is + ;; exec'ed. + (("\"/sbin/modprobe\"") + (string-append "\"" + (search-input-file inputs "/bin/modprobe") + "\"")) + ;; Just use 'modprobe' in message to user, since Guix + ;; does not have a traditional /sbin/ + (("'/sbin/modprobe ") "'modprobe ")) + (substitute* "contrib/Makefile.in" + ;; This is not configurable nor is its hard-coded /usr prefix. + ((" initramfs") "")) + (substitute* "module/os/linux/zfs/zfs_ctldir.c" + (("/usr/bin/env\", \"umount") + (string-append (search-input-file inputs "/bin/umount") + "\", \"-n")) + (("/usr/bin/env\", \"mount") + (string-append (search-input-file inputs "/bin/mount") + "\", \"-n"))) + (substitute* "lib/libzfs/os/linux/libzfs_mount_os.c" + (("/bin/mount") (search-input-file inputs "/bin/mount")) + (("/bin/umount") (search-input-file inputs "/bin/umount"))) + (substitute* "lib/libshare/os/linux/nfs.c" + (("/usr/sbin/exportfs") + (search-input-file inputs "/sbin/exportfs"))) + (substitute* "config/zfs-build.m4" + (("\\$sysconfdir/init.d") + (string-append #$output "/etc/init.d"))) + (substitute* '("etc/zfs/Makefile.am" + "cmd/zed/Makefile.am") + (("\\$\\(sysconfdir)") (string-append #$output "/etc"))) + (substitute* "cmd/vdev_id/vdev_id" + (("PATH=/bin:/sbin:/usr/bin:/usr/sbin") + (string-append "PATH=" + (dirname (which "chmod")) ":" + (dirname (which "grep")) ":" + (dirname (which "sed")) ":" + (dirname (which "gawk"))))) + (substitute* "contrib/pyzfs/Makefile.in" + ((".*install-lib.*") "")) + (substitute* '("Makefile.am" "Makefile.in") + (("\\$\\(prefix)/src") (string-append #$output:src "/src"))) + (substitute* (find-files "udev/rules.d/" ".rules.in$") + (("/sbin/modprobe") + (search-input-file inputs "/bin/modprobe"))))) + (replace 'build + (lambda _ (invoke "make"))) + (replace 'install + (lambda* (#:key inputs native-inputs #:allow-other-keys) + (let* ((kmod (assoc-ref (or native-inputs inputs) "kmod"))) + (invoke "make" "install" + (string-append "DEFAULT_INITCONF_DIR=" + #$output "/etc/default") + (string-append "DEPMOD=" + (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-file + "contrib/bash_completion.d/zfs" + (string-append #$output + "/share/bash-completion/completions")))))))) (native-inputs (list attr kmod pkg-config)) - (inputs - `(("eudev" ,eudev) - ("kmod-runtime" ,kmod) - ("libaio" ,libaio) - ("libtirpc" ,libtirpc) - ("nfs-utils" ,nfs-utils) - ("openssl" ,openssl) - ("python" ,python) - ("python-cffi" ,python-cffi) - ("util-linux" ,util-linux) - ("util-linux:lib" ,util-linux "lib") - ("zlib" ,zlib))) + (inputs (list eudev + kmod + libaio + libtirpc + nfs-utils + openssl + python + python-cffi + util-linux + `(,util-linux "lib") + zlib)) (home-page "https://zfsonlinux.org/") (synopsis "OpenZFS on Linux") (description -- 2.36.0