diff options
author | m154k1 <139042094+m154k1@users.noreply.github.com> | 2023-10-28 12:16:44 +0300 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-10-28 18:26:08 +0000 |
commit | a57bd8e2b8a1871dc2613984b7ca93dd7bcb5419 (patch) | |
tree | 105a56e7e65943ecfef12015fa937939986f2879 /meson.build | |
parent | e76660cc54751726eee041c9b2ebd1beaff68599 (diff) | |
download | mpv-a57bd8e2b8a1871dc2613984b7ca93dd7bcb5419.tar.bz2 mpv-a57bd8e2b8a1871dc2613984b7ca93dd7bcb5419.tar.xz |
meson: import python module
- Use import to find Python installation.
- Run macos-sdk-version.py with Python provided by meson.
This fixes an error when meson and python-packaging are installed from
Homebrew. Currently, the Python executable from python@3.12 is installed as
python3.12 so python3 is referring to system installation, which may not
have packaging module. meson can provide the correct executable via import.
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/meson.build b/meson.build index 345b591a8c..94c05ed101 100644 --- a/meson.build +++ b/meson.build @@ -13,7 +13,7 @@ project('mpv', build_root = meson.project_build_root() source_root = meson.project_source_root() -python = find_program('python3') +python = import('python').find_installation() # ffmpeg libavcodec = dependency('libavcodec', version: '>= 58.134.100') @@ -1475,7 +1475,10 @@ endif macos_sdk_path = '' macos_sdk_version = '0.0' if darwin and macos_sdk_version_py.found() - macos_sdk_info = run_command(macos_sdk_version_py, check: true).stdout().split(',') + # Execute macos-sdk-version.py with Python provided by meson. + # In some cases, Python executable with the necessary modules might not refer to python3 + # (e.g. python@3.12 and python-packaging Homebrew packages). + macos_sdk_info = run_command(python, macos_sdk_version_py, check: true).stdout().split(',') macos_sdk_path = macos_sdk_info[0].strip() macos_sdk_version = macos_sdk_info[1] endif |