Archived
1
0
Fork 0

gnu: drbd-utils: Use new style.

* gnu/packages/cluster.scm (drbd-utils)[arguments]: Use G-expression.
[native-inputs]: Remove labels.
This commit is contained in:
Marius Bakke 2022-06-20 15:34:01 +02:00
parent 1216eb5a5a
commit 946ec002b0
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -2,7 +2,7 @@
;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org> ;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019 Andrew Miloradovsky <andrew@interpretmath.pw> ;;; Copyright © 2019 Andrew Miloradovsky <andrew@interpretmath.pw>
;;; Copyright © 2020 Marius Bakke <marius@gnu.org> ;;; Copyright © 2020, 2022 Marius Bakke <marius@gnu.org>
;;; Copyright © 2021 Dion Mendel <guix@dm9.info> ;;; Copyright © 2021 Dion Mendel <guix@dm9.info>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
@ -22,6 +22,7 @@
(define-module (gnu packages cluster) (define-module (gnu packages cluster)
#:use-module ((guix licenses) #:prefix license:) #:use-module ((guix licenses) #:prefix license:)
#:use-module (guix gexp)
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix git-download) #:use-module (guix git-download)
@ -65,62 +66,59 @@
(substitute* "configure" (substitute* "configure"
;; Use a sensible default udev rules directory. ;; Use a sensible default udev rules directory.
(("default_udevdir=/lib/udev") (("default_udevdir=/lib/udev")
"default_udevdir='${prefix}/lib/udev'")) "default_udevdir='${prefix}/lib/udev'"))))))
#t))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:configure-flags '(;; Do not install sysv or systemd init scripts. (list
"--with-initscripttype=none" #:configure-flags
;; Use the pre-built manual pages present in release #~(list "--sysconfdir=/etc"
;; tarballs instead of generating them from scratch. "--localstatedir=/var"
"--with-prebuiltman" ;; Do not install sysv or systemd init scripts.
;; Disable support for DRBD 8.3 as it is only for "--with-initscripttype=none"
;; Linux-Libre versions < 3.8. 8.4 is the latest ;; Use the pre-built manual pages present in release
;; kernel driver as of Linux 5.7. ;; tarballs instead of generating them from scratch.
"--without-83support" "--with-prebuiltman"
"--sysconfdir=/etc" ;; Disable support for DRBD 8.3 as it is only for
"--localstatedir=/var") ;; Linux-Libre versions < 3.8. 8.4 is the latest
#:test-target "test" ;; kernel driver as of Linux 5.18.
#:make-flags '("WANT_DRBD_REPRODUCIBLE_BUILD=yesplease") "--without-83support")
#:phases #:test-target "test"
(modify-phases %standard-phases #:make-flags #~(list "WANT_DRBD_REPRODUCIBLE_BUILD=yesplease")
(add-after 'patch-generated-file-shebangs 'patch-documentation #:phases
(lambda _ #~(modify-phases %standard-phases
;; The preceding phase misses some Makefiles with unusual file (add-after 'patch-generated-file-shebangs 'patch-documentation
;; names, so we handle those here. (lambda _
(for-each patch-makefile-SHELL (find-files "documentation/common" ;; The preceding phase misses some Makefiles with unusual file
"^Makefile")) ;; names, so we handle those here.
#t)) (for-each patch-makefile-SHELL (find-files "documentation/common"
(add-before 'configure 'use-absolute-/lib/drbd "^Makefile"))))
(lambda* (#:key outputs #:allow-other-keys) (add-before 'configure 'use-absolute-/lib/drbd
(let ((out (assoc-ref outputs "out"))) (lambda _
;; Look for auxiliary executables below exec_prefix instead ;; Look for auxiliary executables below exec_prefix instead
;; of assuming /lib/drbd (see TODO comment in the file). ;; of assuming /lib/drbd (see TODO comment in the file).
(substitute* "user/v9/drbdtool_common.c" (substitute* "user/v9/drbdtool_common.c"
(("\"/lib/drbd\"") (("\"/lib/drbd\"")
(string-append "\"" out "/lib/drbd\""))) (string-append "\"" #$output "/lib/drbd\"")))))
#t))) (add-after 'configure 'adjust-installation-directories
(add-after 'configure 'adjust-installation-directories (lambda _
(lambda _ ;; Do not attempt to create /etc or /var.
;; Do not attempt to create /etc or /var. (substitute* "scripts/Makefile"
(substitute* "scripts/Makefile" (("\\$\\(DESTDIR\\)\\$\\(sysconfdir\\)")
(("\\$\\(DESTDIR\\)\\$\\(sysconfdir\\)") "$(DESTDIR)$(prefix)$(sysconfdir)"))
"$(DESTDIR)$(prefix)$(sysconfdir)")) (substitute* "user/v84/Makefile"
(substitute* "user/v84/Makefile" (("\\$\\(DESTDIR\\)\\$\\(localstatedir\\)")
(("\\$\\(DESTDIR\\)\\$\\(localstatedir\\)") "$(DESTDIR)$(prefix)$(localstatedir)")
"$(DESTDIR)$(prefix)$(localstatedir)") (("\\$\\(DESTDIR\\)/lib/drbd")
(("\\$\\(DESTDIR\\)/lib/drbd") "$(DESTDIR)$(prefix)/lib/drbd"))
"$(DESTDIR)$(prefix)/lib/drbd")) (substitute* "user/v9/Makefile"
(substitute* "user/v9/Makefile" (("\\$\\(DESTDIR\\)\\$\\(localstatedir\\)")
(("\\$\\(DESTDIR\\)\\$\\(localstatedir\\)") "$(DESTDIR)$(prefix)$(localstatedir)")
"$(DESTDIR)$(prefix)$(localstatedir)") (("\\$\\(DESTDIR\\)\\$\\(DRBD_LIB_DIR\\)")
(("\\$\\(DESTDIR\\)\\$\\(DRBD_LIB_DIR\\)") "$(DESTDIR)$(prefix)$(DRBD_LIB_DIR)")))))))
"$(DESTDIR)$(prefix)$(DRBD_LIB_DIR)"))
#t)))))
(native-inputs (native-inputs
`(("clitest" ,clitest) (list clitest
("flex" ,flex) eudev ;just to satisfy a configure check
("udev" ,eudev))) ;just to satisfy a configure check flex))
(home-page "https://www.linbit.com/drbd/") (home-page "https://www.linbit.com/drbd/")
(synopsis "Replicate block devices between machines") (synopsis "Replicate block devices between machines")
(description (description