From 8030f6a30c4d899e554bf67ae6a89de3e15429ba Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Mon, 10 Dec 2018 15:03:17 -0600
Subject: [PATCH] qtwebengine: find_sdk respect CONDA_BUILD_SYSROOT

---
 chromium/build/mac/find_sdk.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/qtwebengine/src/3rdparty/chromium/build/mac/find_sdk.py b/qtwebengine/src/3rdparty/chromium/build/mac/find_sdk.py
index 540a3202e4..4b004aa48e 100755
--- a/qtwebengine/src/3rdparty/chromium/build/mac/find_sdk.py
+++ b/qtwebengine/src/3rdparty/chromium/build/mac/find_sdk.py
@@ -51,6 +51,13 @@ def main():
   if options.developer_dir:
     os.environ['DEVELOPER_DIR'] = options.developer_dir
 
+  # Avoid this nonsense, and it really is nonsense (options.sdk_path does nothing)
+  if 'CONDA_BUILD_SYSROOT' in os.environ:
+    result = os.environ['CONDA_BUILD_SYSROOT']
+    if options.print_sdk_path:
+      print(result)
+    return result
+
   job = subprocess.Popen(['xcode-select', '-print-path'],
                          stdout=subprocess.PIPE,
                          stderr=subprocess.STDOUT)
@@ -99,7 +106,5 @@ def main():
 
 
 if __name__ == '__main__':
-  if sys.platform != 'darwin':
-    raise Exception("This script only runs on Mac")
   print main()
   sys.exit(0)
-- 
2.19.1

