From ca705e1e37e2cd20d89e707c51cdb33a4d33245e Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@musicpd.org>
Date: Wed, 1 Jul 2020 16:37:50 +0200
Subject: [PATCH] python/build/meson.py: set BOOST_ROOT for Meson 0.54

Commit
https://github.com/mesonbuild/meson/commit/08224dafcba1b694fb624553e7d84deb565aae22
changed Meson to require BOOST_ROOT for cross builds.
---
 NEWS                  | 2 ++
 python/build/meson.py | 7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index c43b3b4f8..99c52a92b 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ ver 0.21.25 (not yet released)
 * input
   - file: detect premature end of file
   - smbclient: don't send credentials to MPD clients
+* Windows/Android:
+  - fix Boost detection after breaking change in Meson 0.54
 
 ver 0.21.24 (2020/06/10)
 * protocol
diff --git a/python/build/meson.py b/python/build/meson.py
index 93797f382..377969b28 100644
--- a/python/build/meson.py
+++ b/python/build/meson.py
@@ -91,7 +91,12 @@ def configure(toolchain, src, build, args=()):
         '--cross-file', cross_file,
     ] + args
 
-    subprocess.check_call(configure, env=toolchain.env)
+    env = toolchain.env.copy()
+
+    # Meson 0.54 requires the BOOST_ROOT environment variable
+    env['BOOST_ROOT'] = toolchain.install_prefix
+
+    subprocess.check_call(configure, env=env)
 
 class MesonProject(Project):
     def __init__(self, url, md5, installed, configure_args=[],