git.iko.soy/typeable/nixpkgs
on master help sign in
fwupd: split daemon again

In 1.3.5, fwupdprivate library was made into a shared fwupdplugin library. This library is considered semi-private and is used by fwupd daemon and fwupd plug-ins and now possibly third party plug-ins. The fwupdplugin library refers to the plug-in directory in fwupd.out causing a dependency cycle. For that reason we need to move it to out.

commitc942013dbc270cdeb3f36c8d36d9b0c29b57c057 authorJan Tojnar <jtojnar@gmail.com> dateThu 6 Feb 2020, 18:49 (7 years ago) parent444538e
2 files changed+51−1
pkgs/os-specific/linux/firmware/fwupd/default.nix+14−1 pkgs/os-specific/linux/firmware/fwupd/install-fwupdplugin-to-out.patch+37
pkgs/os-specific/linux/firmware/fwupd/default.nix+14−1
@@ -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"
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