gnu: rasdaemon: Add missing inputs and rewrite using G-Exps.

* gnu/packages/linux.scm (rasdaemon)[arguments]: Rewrite using
G-Expressions.  Add 'fix-dmidecode-and-modprobe' and 'wrap-rasdaemon'
phases.
[inputs]: Add perl-dbd-sqlite, dmidecode, and kmod.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Bruno Victal 2022-12-06 15:51:34 +00:00 committed by Ludovic Courtès
parent acab89748d
commit 8125c22ea2
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -9512,15 +9512,16 @@ (define-public rasdaemon
(sha256 (sha256
(base32 "0r0339mg4rc12p63iiq2kwdqn1zjakyiv014i2a2l9s8v5rjik41")))) (base32 "0r0339mg4rc12p63iiq2kwdqn1zjakyiv014i2a2l9s8v5rjik41"))))
(native-inputs (list autoconf automake libtool)) (native-inputs (list autoconf automake libtool))
(inputs (list perl sqlite)) (inputs (list perl perl-dbd-sqlite sqlite dmidecode kmod))
(arguments (arguments
`(#:configure-flags (list
(list "--enable-all" #:configure-flags
#~(list "--enable-all"
;; Don't install unused /etc/sysconfig/rasdaemon environment file. ;; Don't install unused /etc/sysconfig/rasdaemon environment file.
"--with-sysconfdefdir=." "--with-sysconfdefdir=."
"--localstatedir=/var") "--localstatedir=/var")
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-before 'configure 'munge-autotools (add-before 'configure 'munge-autotools
(lambda _ (lambda _
;; For some reason upstream forces sysconfdir=/etc. This results ;; For some reason upstream forces sysconfdir=/etc. This results
@ -9532,7 +9533,16 @@ (define-public rasdaemon
;; This results in EPERM on guix. Instead, the service should ;; This results in EPERM on guix. Instead, the service should
;; create this at activation time. ;; create this at activation time.
(substitute* "Makefile.am" (substitute* "Makefile.am"
(("^\\s*\\$\\(install_sh\\) -d .*@RASSTATEDIR@.*$") ""))))))) (("^\\s*\\$\\(install_sh\\) -d .*@RASSTATEDIR@.*$") ""))))
(add-after 'install 'fix-dmidecode-and-modprobe
(lambda _
(substitute* (string-append #$output "/sbin/ras-mc-ctl")
(("find_prog \\(\"dmidecode\"\\).*$") (format #f "~s;~%" (string-append #$dmidecode "/sbin/dmidecode")))
(("find_prog \\(\"modprobe\"\\).*$") (format #f "~s;~%" (string-append #$kmod "/bin/modprobe"))))))
(add-after 'wrap 'wrap-rasdaemon
(lambda _
(wrap-program (string-append #$output "/sbin/ras-mc-ctl")
`("PERL5LIB" ":" prefix ,(string-split (getenv "PERL5LIB") #\:))))))))
(build-system gnu-build-system) (build-system gnu-build-system)
(home-page "https://github.com/mchehab/rasdaemon") (home-page "https://github.com/mchehab/rasdaemon")
(synopsis "Platform Reliability, Availability, and Serviceability tools") (synopsis "Platform Reliability, Availability, and Serviceability tools")