summary refs log tree commit diff
path: root/pkgs/os-specific/linux/firmware/fwupd
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2019-03-01 08:31:58 -0600
committerworldofpeace <worldofpeace@protonmail.ch>2019-07-11 11:10:19 -0400
commit5dc9fec732d3bdd00ea75bff0cef78406c11d98b (patch)
treeefa9b05770e9b6f2c7315997d6b1c1d2f6e4d63d /pkgs/os-specific/linux/firmware/fwupd
parentf633bf64e9b1f4c75e8e00a755f9d35c6abfb3fe (diff)
downloadnixpkgs-5dc9fec732d3bdd00ea75bff0cef78406c11d98b.tar
nixpkgs-5dc9fec732d3bdd00ea75bff0cef78406c11d98b.tar.gz
nixpkgs-5dc9fec732d3bdd00ea75bff0cef78406c11d98b.tar.bz2
nixpkgs-5dc9fec732d3bdd00ea75bff0cef78406c11d98b.tar.lz
nixpkgs-5dc9fec732d3bdd00ea75bff0cef78406c11d98b.tar.xz
nixpkgs-5dc9fec732d3bdd00ea75bff0cef78406c11d98b.tar.zst
nixpkgs-5dc9fec732d3bdd00ea75bff0cef78406c11d98b.zip
fwupd: patch in paths to tools used as runtime deps
Diffstat (limited to 'pkgs/os-specific/linux/firmware/fwupd')
-rw-r--r--pkgs/os-specific/linux/firmware/fwupd/default.nix12
-rw-r--r--pkgs/os-specific/linux/firmware/fwupd/fix-paths.patch58
2 files changed, 68 insertions, 2 deletions
diff --git a/pkgs/os-specific/linux/firmware/fwupd/default.nix b/pkgs/os-specific/linux/firmware/fwupd/default.nix
index 48b502448be..a60417d8e23 100644
--- a/pkgs/os-specific/linux/firmware/fwupd/default.nix
+++ b/pkgs/os-specific/linux/firmware/fwupd/default.nix
@@ -5,6 +5,7 @@
 , ninja, gcab, gnutls, python3, wrapGAppsHook, json-glib, bash-completion
 , shared-mime-info, umockdev, vala, makeFontsConf, freefont_ttf
 , cairo, freetype, fontconfig, pango
+, bubblewrap, efibootmgr, flashrom, tpm2-tools
 }:
 
 # Updating? Keep $out/etc synchronized with passthru.filesInstalledToEtc
@@ -38,7 +39,12 @@ in stdenv.mkDerivation rec {
   ];
 
   patches = [
-    ./fix-paths.patch
+    (substituteAll {
+      src = ./fix-paths.patch;
+      inherit flashrom efibootmgr bubblewrap;
+      tpm2_tools = "${tpm2-tools}";
+    })
+
     ./add-option-for-installation-sysconfdir.patch
 
     # installed tests are installed to different output
@@ -61,6 +67,10 @@ in stdenv.mkDerivation rec {
     substituteInPlace meson.build \
       --replace "plugin_dir = join_paths(libdir, 'fwupd-plugins-3')" \
                 "plugin_dir = join_paths('${placeholder "out"}', 'fwupd_plugins-3')"
+
+    substituteInPlace data/meson.build --replace \
+      "install_dir: systemd.get_pkgconfig_variable('systemdshutdowndir')" \
+      "install_dir: '${placeholder "out"}/lib/systemd/system-shutdown'"
   '';
 
   # /etc/os-release not available in sandbox
diff --git a/pkgs/os-specific/linux/firmware/fwupd/fix-paths.patch b/pkgs/os-specific/linux/firmware/fwupd/fix-paths.patch
index d1024438d8a..51adef2e787 100644
--- a/pkgs/os-specific/linux/firmware/fwupd/fix-paths.patch
+++ b/pkgs/os-specific/linux/firmware/fwupd/fix-paths.patch
@@ -1,15 +1,71 @@
+diff --git a/data/builder/meson.build b/data/builder/meson.build
+index c7a430c0..e69de29b 100644
 --- a/data/builder/meson.build
 +++ b/data/builder/meson.build
 @@ -1,3 +0,0 @@
 -install_data('README.md',
 -  install_dir : join_paths(localstatedir, 'lib', 'fwupd', 'builder')
 -)
+diff --git a/meson_post_install.sh b/meson_post_install.sh
+index 0cbb6f41..d757a81a 100755
 --- a/meson_post_install.sh
 +++ b/meson_post_install.sh
-@@ -11,6 +11,4 @@
+@@ -11,6 +11,4 @@ LOCALSTATEDIR=$2
      echo 'Updating systemd deps'
      mkdir -p ${DESTDIR}${SYSTEMDUNITDIR}/system-update.target.wants
      ln -sf ../fwupd-offline-update.service ${DESTDIR}${SYSTEMDUNITDIR}/system-update.target.wants/fwupd-offline-update.service
 -    echo 'Creating stateful directory'
 -    mkdir -p ${DESTDIR}${LOCALSTATEDIR}/lib/fwupd
  #fi
+diff --git a/plugins/flashrom/fu-plugin-flashrom.c b/plugins/flashrom/fu-plugin-flashrom.c
+index 598e0c42..a0a2c4a7 100644
+--- a/plugins/flashrom/fu-plugin-flashrom.c
++++ b/plugins/flashrom/fu-plugin-flashrom.c
+@@ -52,7 +52,7 @@ fu_plugin_startup (FuPlugin *plugin, GError **error)
+ 	g_autoptr(GError) error_local = NULL;
+
+ 	/* we need flashrom from the host system */
+-	data->flashrom_fn = fu_common_find_program_in_path ("flashrom", &error_local);
++	data->flashrom_fn = fu_common_find_program_in_path ("@flashrom@/bin/flashrom", &error_local);
+
+ 	/* search for devices */
+ 	hwids = fu_plugin_get_hwids (plugin);
+diff --git a/plugins/uefi/fu-plugin-uefi.c b/plugins/uefi/fu-plugin-uefi.c
+index 9293715c..e2e77c58 100644
+--- a/plugins/uefi/fu-plugin-uefi.c
++++ b/plugins/uefi/fu-plugin-uefi.c
+@@ -416,7 +416,7 @@ fu_plugin_update (FuPlugin *plugin,
+ 	fu_plugin_add_report_metadata (plugin, "MissingCapsuleHeader", str);
+
+ 	/* record boot information to system log for future debugging */
+-	efibootmgr_path = fu_common_find_program_in_path ("efibootmgr", NULL);
++	efibootmgr_path = fu_common_find_program_in_path ("@efibootmgr@/bin/efibootmgr", NULL);
+ 	if (efibootmgr_path != NULL) {
+ 		if (!g_spawn_command_line_sync ("efibootmgr -v",
+ 						&boot_variables, NULL, NULL, error))
+diff --git a/plugins/uefi/fu-uefi-pcrs.c b/plugins/uefi/fu-uefi-pcrs.c
+index 5c7e5239..01acbf7f 100644
+--- a/plugins/uefi/fu-uefi-pcrs.c
++++ b/plugins/uefi/fu-uefi-pcrs.c
+@@ -147,7 +147,7 @@ fu_uefi_pcrs_setup (FuUefiPcrs *self, GError **error)
+ 		/* old name, then new name */
+ 		argv0 = fu_common_find_program_in_path ("tpm2_listpcrs", NULL);
+ 		if (argv0 == NULL)
+-			argv0 = fu_common_find_program_in_path ("tpm2_pcrlist", error);
++			argv0 = fu_common_find_program_in_path ("@tpm2_tools@/bin/tpm2_pcrlist", error);
+ 		if (argv0 == NULL)
+ 			return FALSE;
+ 		if (!fu_uefi_pcrs_setup_tpm20 (self, argv0, error))
+diff --git a/src/fu-common.c b/src/fu-common.c
+index bd6faeef..45ba2a60 100644
+--- a/src/fu-common.c
++++ b/src/fu-common.c
+@@ -436,7 +436,7 @@ fu_common_firmware_builder (GBytes *bytes,
+ 	g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+ 	/* find bwrap in the path */
+-	bwrap_fn = fu_common_find_program_in_path ("bwrap", error);
++	bwrap_fn = fu_common_find_program_in_path ("@bubblewrap@/bin/bwrap", error);
+ 	if (bwrap_fn == NULL)
+ 		return NULL;
+