git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #79371 from jtojnar/hughsie-pkgs

fwupd: split daemon again

commit07281f23b690e341efbb54c79f8038ee47495c12 authorJan Tojnar <jtojnar@gmail.com> dateFri 7 Feb 2020, 00:35 (7 years ago) parent301bca0e5f7dac
4 files changed+64−5
nixos/modules/services/hardware/fwupd.nix+4−1 nixos/tests/installed-tests/fwupd.nix+2−2 pkgs/os-specific/linux/firmware/fwupd/default.nix+21−2 pkgs/os-specific/linux/firmware/fwupd/install-fwupdplugin-to-out.patch+37
nixos/modules/services/hardware/fwupd.nix+4−1
@@ -53,7 +53,7 @@ in {
5353
5454 blacklistPlugins = mkOption {
5555 type = types.listOf types.str;
56− default = [ "test" ];
56+ default = [];
5757 example = [ "udev" ];
5858 description = ''
5959 Allow blacklisting specific plugins
@@ -91,6 +91,9 @@ in {
9191
9292 ###### implementation
9393 config = mkIf cfg.enable {
94+ # Disable test related plug-ins implicitly so that users do not have to care about them.
95+ services.fwupd.blacklistPlugins = cfg.package.defaultBlacklistedPlugins;
96+
9497 environment.systemPackages = [ cfg.package ];
9598
9699 environment.etc = {
nixos/tests/installed-tests/fwupd.nix+2−2
@@ -1,11 +1,11 @@
1−{ pkgs, makeInstalledTest, ... }:
1+{ pkgs, lib, makeInstalledTest, ... }:
22
33makeInstalledTest {
44 tested = pkgs.fwupd;
55
66 testConfig = {
77 services.fwupd.enable = true;
8− services.fwupd.blacklistPlugins = []; # don't blacklist test plugin
8+ services.fwupd.blacklistPlugins = lib.mkForce []; # don't blacklist test plugin
99 services.fwupd.enableTestRemote = true;
1010 virtualisation.memorySize = 768;
1111 };
pkgs/os-specific/linux/firmware/fwupd/default.nix+21−2
@@ -1,4 +1,4 @@
1−# Updating? Keep $out/etc synchronized with passthru.filesInstalledToEtc
1+# Updating? Keep $out/etc synchronized with passthru keys
22
33{ stdenv
44, fetchurl
@@ -94,7 +94,10 @@ stdenv.mkDerivation rec {
9494 sha256 = "02mzn3whk5mba4nxyrkypawr1gzjx79n4nrkhrp8vja6mxxgsf10";
9595 };
9696
97− outputs = [ "out" "dev" "devdoc" "man" "installedTests" ];
97+ # libfwupd goes to lib
98+ # daemon, plug-ins and libfwupdplugin go to out
99+ # CLI programs go to out
100+ outputs = [ "out" "lib" "dev" "devdoc" "man" "installedTests" ];
98101
99102 nativeBuildInputs = [
100103 meson
@@ -148,6 +151,10 @@ stdenv.mkDerivation rec {
148151 ./fix-paths.patch
149152 ./add-option-for-installation-sysconfdir.patch
150153
154+ # install plug-ins and libfwupdplugin to out,
155+ # they are not really part of the library
156+ ./install-fwupdplugin-to-out.patch
157+
151158 # installed tests are installed to different output
152159 # we also cannot have fwupd-tests.conf in $out/etc since it would form a cycle
153160 (substituteAll {
@@ -203,6 +210,12 @@ stdenv.mkDerivation rec {
203210 "--localstatedir=/var"
204211 "--sysconfdir=/etc"
205212 "-Dsysconfdir_install=${placeholder "out"}/etc"
213+
214+ # We do not want to place the daemon into lib (cyclic reference)
215+ "--libexecdir=${placeholder "out"}/libexec"
216+ # Our builder only adds $lib/lib to rpath but some things link
217+ # against libfwupdplugin which is in $out/lib.
218+ "-Dc_link_args=-Wl,-rpath,${placeholder "out"}/lib"
206219 ] ++ stdenv.lib.optionals (!haveDell) [
207220 "-Dplugin_dell=false"
208221 "-Dplugin_synaptics=false"
@@ -261,6 +274,12 @@ stdenv.mkDerivation rec {
261274 "pki/fwupd-metadata/LVFS-CA.pem"
262275 ];
263276
277+ # BlacklistPlugins key in fwupd/daemon.conf
278+ defaultBlacklistedPlugins = [
279+ "test"
280+ "invalid"
281+ ];
282+
264283 tests = {
265284 installedTests = nixosTests.installed-tests.fwupd;
266285 };
pkgs/os-specific/linux/firmware/fwupd/install-fwupdplugin-to-out.patchnew file+37
@@ -0,0 +1,37 @@
1+diff --git a/libfwupdplugin/meson.build b/libfwupdplugin/meson.build
2+index 0abcd45c..51cbc912 100644
3+--- a/libfwupdplugin/meson.build
4++++ b/libfwupdplugin/meson.build
5+@@ -114,7 +114,8 @@
6+ ],
7+ link_args : vflag,
8+ link_depends : fwupdplugin_mapfile,
9+- install : true
10++ install : true,
11++ install_dir : bindir / '..' / 'lib',
12+ )
13+
14+ fwupdplugin_pkgg = import('pkgconfig')
15+@@ -167,7 +168,8 @@
16+ 'GUsb-1.0',
17+ fwupd_gir[0],
18+ ],
19+- install : true
20++ install : true,
21++ install_dir_typelib : bindir / '..' / 'lib' / 'girepository-1.0',
22+ )
23+ gnome.generate_vapi('fwupdplugin',
24+ sources : fwupd_gir[0],
25+diff --git a/meson.build b/meson.build
26+index b1a523d2..00125997 100644
27+--- a/meson.build
28++++ b/meson.build
29+@@ -389,7 +389,7 @@
30+ if host_machine.system() == 'windows'
31+ plugin_dir = 'fwupd-plugins-3'
32+ else
33+- plugin_dir = join_paths(libdir, 'fwupd-plugins-3')
34++ plugin_dir = join_paths(bindir, '..', 'lib', 'fwupd-plugins-3')
35+ endif
36+ conf.set_quoted('FWUPD_PLUGINDIR', plugin_dir)
37+ endif