(address . bug-guix@gnu.org)
The package description for fwupd looks for polkit actions in the polkit
output. There are multiple ways to patch this.
Toggle snippet (11 lines)
(add-before 'configure 'set-polkit-rules-dir
;; Locate actions in our {output,etc-dir}, not that of the polkit input.
(lambda _
(setenv "PKG_CONFIG_POLKIT_GOBJECT_1_ACTIONDIR"
;; This makes it 'Just Work':
;; (string-append #$output "/share/polkit-1/actions")
;; This only makes it work when we extend polkit-service-type:
(string-append "/etc/polkit-1/actions")
)))
Example service definition:
Toggle snippet (23 lines)
(define (fwupd-shepherd-service package)
"Return a Shepherd service to start fwupd."
(list (shepherd-service
(requirement '(dbus-system))
(provision '(fwupd))
(start #~(make-forkexec-constructor
(list #$(file-append package "/libexec/fwupd/fwupd"))))
(stop #~(make-kill-destructor)))))
(define-public fwupd-service-type
(service-type
(name 'fwupd)
(description "Setup the firmware update deamon.")
(default-value fwupd)
(extensions
(list
(service-extension profile-service-type list)
(service-extension polkit-service-type list)
(service-extension dbus-root-service-type list)
(service-extension shepherd-root-service-type
fwupd-shepherd-service)))))
If we go for the first fix, the polkit-service-type extension is not
required. If we go for the /etc fix, the polkit-service-type extension
is required. I know too little about polkit to make an informed choice
here, so with some guidance I could work on a patch to close this issue.
- Jelle