From aa636b97c66343b25e508b9c73d8505e8c11b1d9 Mon Sep 17 00:00:00 2001
From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Fri, 1 Jul 2022 14:26:06 -0700
Subject: [PATCH] xquartz: Use correct defines when building to support Sparkle
 updates

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
---
 hw/xquartz/bundle/meson.build | 6 +-----
 hw/xquartz/meson.build        | 9 +++++++++
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/hw/xquartz/bundle/meson.build b/hw/xquartz/bundle/meson.build
index 1305ccf231..22941203b8 100644
--- a/hw/xquartz/bundle/meson.build
+++ b/hw/xquartz/bundle/meson.build
@@ -10,11 +10,7 @@ cpp_defs = [
 ]
 
 if build_sparkle
-cpp_defs += [
-    '-DXQUARTZ_SPARKLE',
-    '-DXQUARTZ_SPARKLE_FEED_URL=@0@'.format(xquartz_sparkle_feed_url),
-    '-DXQUARTZ_SPARKLE_PUBLIC_EDKEY=@0@'.format(xquartz_sparkle_public_edkey),
-]
+cpp_defs += sparkle_defs
 endif
 
 # bundle data
diff --git a/hw/xquartz/meson.build b/hw/xquartz/meson.build
index b0c7a386ec..05600fdd99 100644
--- a/hw/xquartz/meson.build
+++ b/hw/xquartz/meson.build
@@ -28,6 +28,14 @@ bundle_root = join_paths(apple_applications_dir, apple_application_name + '.app'
 build_sparkle = xquartz_sparkle_feed_url != '' and xquartz_sparkle_public_edkey != ''
 if build_sparkle
     sparkle = dependency('Sparkle', method: 'extraframework')
+
+    sparkle_defs = [
+        '-DXQUARTZ_SPARKLE',
+        '-DXQUARTZ_SPARKLE_FEED_URL=@0@'.format(xquartz_sparkle_feed_url),
+        '-DXQUARTZ_SPARKLE_PUBLIC_EDKEY=@0@'.format(xquartz_sparkle_public_edkey),
+    ]
+else
+    sparkle_defs = []
 endif
 
 # libxquartz
@@ -56,6 +64,7 @@ libxquartz_defs = [
     '-DXQUARTZ',
     '-DXSERVER_VERSION="@0@"'.format(meson.project_version()),
     bundle_id_def,
+    sparkle_defs,
 ]
 
 if cc.has_function('dispatch_async')
-- 
GitLab