Blame SOURCES/0001-Fix-compiling-with-new-versions-of-efivar.patch

66d618
From e74d38bfd3097471fe60dbe843a68c16516a78da Mon Sep 17 00:00:00 2001
66d618
From: Richard Hughes <richard@hughsie.com>
66d618
Date: Mon, 17 Jan 2022 14:50:47 +0000
66d618
Subject: [PATCH] Fix compiling with new versions of efivar
66d618
66d618
Fixes https://github.com/fwupd/fwupd/issues/4181
66d618
---
66d618
 meson.build                           | 5 +++++
66d618
 plugins/uefi-capsule/fu-uefi-common.h | 3 +++
66d618
 2 files changed, 8 insertions(+)
66d618
66d618
diff --git a/meson.build b/meson.build
66d618
index 833bdbf56..691cc8a58 100644
66d618
--- a/meson.build
66d618
+++ b/meson.build
66d618
@@ -412,6 +412,11 @@ endif
66d618
 if build_standalone and get_option('plugin_uefi_capsule')
66d618
   efiboot = dependency('efiboot')
66d618
 
66d618
+  efivar = dependency('efivar')
66d618
+  if cc.has_header_symbol('efivar/efivar-types.h', 'efi_time_t', dependencies : efivar)
66d618
+    conf.set('HAVE_EFI_TIME_T', '1')
66d618
+  endif
66d618
+
66d618
   efi_app_location = join_paths(libexecdir, 'fwupd', 'efi')
66d618
   conf.set_quoted('EFI_APP_LOCATION', efi_app_location)
66d618
 
66d618
diff --git a/plugins/uefi-capsule/fu-uefi-common.h b/plugins/uefi-capsule/fu-uefi-common.h
66d618
index a21806d6b..1d616c9e0 100644
66d618
--- a/plugins/uefi-capsule/fu-uefi-common.h
66d618
+++ b/plugins/uefi-capsule/fu-uefi-common.h
66d618
@@ -9,6 +9,7 @@
66d618
 
66d618
 #include <fwupdplugin.h>
66d618
 
66d618
+#include <efivar/efivar.h>
66d618
 #include <glib.h>
66d618
 
66d618
 #define EFI_CAPSULE_HEADER_FLAGS_PERSIST_ACROSS_RESET  0x00010000
66d618
@@ -17,6 +18,7 @@
66d618
 
66d618
 #define EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED 0x0000000000000004ULL
66d618
 
66d618
+#ifndef HAVE_EFI_TIME_T
66d618
 typedef struct __attribute__((__packed__)) {
66d618
 	guint16 year;
66d618
 	guint8 month;
66d618
@@ -30,6 +32,7 @@ typedef struct __attribute__((__packed__)) {
66d618
 	guint8 daylight;
66d618
 	guint8 pad2;
66d618
 } efi_time_t;
66d618
+#endif
66d618
 
66d618
 typedef struct __attribute__((__packed__)) {
66d618
 	fwupd_guid_t guid;
66d618
-- 
66d618
2.35.1
66d618