@@ -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"