From 3291bd40ce0db5c04be8ad8b4b76eb3434b6cbe0 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Sat, 27 Nov 2021 13:22:37 +0000 Subject: [PATCH] Make Upower and powerd support optional In some cases you really know that the daemon is never going to exist. --- contrib/PKGBUILD | 1 + contrib/ci/build_windows.sh | 2 ++ contrib/ci/debian_s390x.sh | 1 + contrib/debian/rules | 2 +- contrib/fwupd.spec.in | 2 +- meson_options.txt | 2 ++ plugins/powerd/meson.build | 2 +- plugins/upower/meson.build | 2 +- snap/snapcraft.yaml | 1 + 9 files changed, 11 insertions(+), 4 deletions(-) diff --git a/contrib/PKGBUILD b/contrib/PKGBUILD index e796576c7..6070c2bc6 100644 --- a/contrib/PKGBUILD +++ b/contrib/PKGBUILD @@ -29,6 +29,7 @@ build() { fi arch-meson -D b_lto=false $CI ../build \ -Dplugin_intel_spi=true \ + -Dplugin_powerd=false \ -Dlzma=true \ -Ddocs=gtkdoc \ -Defi_binary=false \ diff --git a/contrib/ci/build_windows.sh b/contrib/ci/build_windows.sh index d02d56895..5b4e75e75 100755 --- a/contrib/ci/build_windows.sh +++ b/contrib/ci/build_windows.sh @@ -43,6 +43,8 @@ meson .. \ -Dplugin_thunderbolt=false \ -Dplugin_synaptics_mst=false \ -Dplugin_synaptics_rmi=false \ + -Dplugin_upower=false \ + -Dplugin_powerd=false \ -Dman=false \ -Dmetainfo=false \ -Dsoup_session_compat=false \ diff --git a/contrib/ci/debian_s390x.sh b/contrib/ci/debian_s390x.sh index fa75ca1a8..ce1ef38d2 100755 --- a/contrib/ci/debian_s390x.sh +++ b/contrib/ci/debian_s390x.sh @@ -24,6 +24,7 @@ meson .. \ -Dplugin_msr=false \ -Dplugin_mtd=false \ -Dplugin_redfish=false \ + -Dplugin_powerd=false \ -Dintrospection=false \ -Ddocs=none \ -Dlibxmlb:introspection=false \ diff --git a/contrib/debian/rules b/contrib/debian/rules index 2a3f82b0a..b3edc4e67 100755 --- a/contrib/debian/rules +++ b/contrib/debian/rules @@ -44,7 +44,7 @@ ifneq ($(QUBES_OPTION),) CONFARGS += -Dqubes=true endif -CONFARGS += -Dplugin_dummy=true -Ddocs=gtkdoc -Dsupported_build=true +CONFARGS += -Dplugin_dummy=true -Dplugin_powerd=false -Ddocs=gtkdoc -Dsupported_build=true %: dh $@ --with gir diff --git a/contrib/fwupd.spec.in b/contrib/fwupd.spec.in index 980658b64..64a932d28 100644 --- a/contrib/fwupd.spec.in +++ b/contrib/fwupd.spec.in @@ -278,6 +278,7 @@ fwupd wrapper for Qubes OS %endif -Dman=true \ -Dbluez=true \ + -Dplugin_powerd=false \ -Dsupported_build=true %meson_build @@ -454,7 +455,6 @@ done %{_libdir}/fwupd-plugins-%{fwupdplugin_version}/libfu_plugin_pci_bcr.so %{_libdir}/fwupd-plugins-%{fwupdplugin_version}/libfu_plugin_pci_mei.so %{_libdir}/fwupd-plugins-%{fwupdplugin_version}/libfu_plugin_pixart_rf.so -%{_libdir}/fwupd-plugins-%{fwupdplugin_version}/libfu_plugin_powerd.so %{_libdir}/fwupd-plugins-%{fwupdplugin_version}/libfu_plugin_realtek_mst.so %{_libdir}/fwupd-plugins-%{fwupdplugin_version}/libfu_plugin_redfish.so %{_libdir}/fwupd-plugins-%{fwupdplugin_version}/libfu_plugin_rts54hid.so diff --git a/meson_options.txt b/meson_options.txt index 4cff25a98..a7e0e2941 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -36,6 +36,8 @@ option('plugin_mtd', type : 'boolean', value : true, description : 'enable MTD s option('plugin_flashrom', type : 'boolean', value : false, description : 'enable libflashrom support') option('plugin_platform_integrity', type : 'boolean', value : false, description : 'enable platform integrity support') option('plugin_intel_spi', type : 'boolean', value : false, description : 'enable Intel SPI support') +option('plugin_upower', type : 'boolean', value : true, description : 'enable support for UPower') +option('plugin_powerd', type : 'boolean', value : true, description : 'enable support for powerd') option('qubes', type : 'boolean', value : false, description : 'build packages for Qubes OS') option('supported_build', type : 'boolean', value : false, description: 'distribution package with upstream support') option('systemd', type : 'boolean', value : true, description : 'enable systemd support') diff --git a/plugins/powerd/meson.build b/plugins/powerd/meson.build index 9d09183f9..1f58d49e1 100644 --- a/plugins/powerd/meson.build +++ b/plugins/powerd/meson.build @@ -1,4 +1,4 @@ -if host_machine.system() == 'linux' and gio.version().version_compare('>=2.58') +if get_option('plugin_powerd') and host_machine.system() == 'linux' and gio.version().version_compare('>=2.58') cargs = ['-DG_LOG_DOMAIN="FuPluginPowerd"'] shared_module('fu_plugin_powerd', diff --git a/plugins/upower/meson.build b/plugins/upower/meson.build index ecf726a68..e7c2a4b94 100644 --- a/plugins/upower/meson.build +++ b/plugins/upower/meson.build @@ -1,4 +1,4 @@ -if host_machine.system() == 'linux' +if get_option('plugin_upower') and host_machine.system() == 'linux' cargs = ['-DG_LOG_DOMAIN="FuPluginUpower"'] shared_module('fu_plugin_upower', diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 7fb4614d0..84e7312ad 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -175,6 +175,7 @@ parts: -Dintrospection=false, -Dman=false, -Dplugin_modem_manager=true, + -Dplugin_powerd=false, -Dudevdir=$SNAPCRAFT_STAGE/lib/udev, "-Dgusb:tests=false", "-Dgusb:docs=false",