gnu: fwupd: Disable remotes by default.

* gnu/packages/firmware.scm (fwupd)
[configure-flags]: Add "-Dlvfs=disabled".
[phases]{ensure-all-remotes-are-disabled}: New phase.
This commit is contained in:
Maxim Cournoyer 2022-09-01 16:13:59 -04:00
parent 23a91e9a2e
commit 4d361a6b51
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -205,32 +205,46 @@ (define-public fwupd
"02jf052qj1nl47ppqrgz3s9qapq4pajgkf6lbj5rxr5sshlrw44n")))) "02jf052qj1nl47ppqrgz3s9qapq4pajgkf6lbj5rxr5sshlrw44n"))))
(build-system meson-build-system) (build-system meson-build-system)
(arguments (arguments
(list #:configure-flags #~(list "--wrap-mode=nofallback" (list
"-Dsystemd=false" #:configure-flags #~(list "--wrap-mode=nofallback"
(string-append "-Defi_os_dir=" "-Dsystemd=false"
#$gnu-efi "/lib") (string-append "-Defi_os_dir="
"-Defi_binary=false" #$gnu-efi "/lib")
(string-append "-Dudevdir=" "-Defi_binary=false"
#$output "/lib/udev") (string-append "-Dudevdir="
"--localstatedir=/var" #$output "/lib/udev")
(string-append "--libexecdir=" "--localstatedir=/var"
#$output "/libexec") (string-append "--libexecdir="
"-Dsupported_build=true") #$output "/libexec")
#:glib-or-gtk? #t ;To wrap binaries and/or compile schemas "-Dsupported_build=true"
#:phases #~(modify-phases %standard-phases ;; Disable LVFS, because it contains
(add-after 'unpack 'make-source-writable ;; nonfree firmwares.
(lambda _ "-Dlvfs=disabled")
(for-each make-file-writable #:glib-or-gtk? #t ;To wrap binaries and/or compile schemas
(find-files ".")) #:phases
(substitute* "src/fu-self-test.c" #~(modify-phases %standard-phases
(("/bin/sh") (add-after 'unpack 'make-source-writable
(which "sh"))))) (lambda _
(add-before 'build 'setup-home (for-each make-file-writable
(lambda _ (find-files "."))
(setenv "HOME" "/tmp"))) (substitute* "src/fu-self-test.c"
(add-before 'install 'no-polkit-magic (("/bin/sh")
(lambda _ (which "sh")))))
(setenv "PKEXEC_UID" "something")))))) (add-before 'build 'setup-home
(lambda _
(setenv "HOME" "/tmp")))
(add-before 'install 'no-polkit-magic
(lambda _
(setenv "PKEXEC_UID" "something")))
(add-after 'install 'ensure-all-remotes-are-disabled
;; Because no remote currently promises to offer only free
;; software firmwares, disable them to prevent a user to
;; unknowingly install proprietary firmware updates.
(lambda _
(substitute* (find-files (string-append #$output "/etc")
"\\.conf$")
(("Enabled=true")
"Enabled=false")))))))
(native-inputs (list gobject-introspection (native-inputs (list gobject-introspection
python-pygobject python-pygobject
python-pillow python-pillow