Revert "meson: import python module"

Since distutils was dropped from python 3.12, we can't rely on a
standard library implementation for version comparison anymore hence
the switch to packaging instead which is essentially supposed to be the
replacement. This is problematic though because macOS can have several
ways of managing python can result in the build calling the wrong python
binary that doesn't have the actual packaging library installed. This
commit was a workaround for that since it would fetch the python used to
run the build (which is probably the one the user wants), but apparently
upstream doesn't like this and it's subject to change*. So instead,
let's solve try, and solve this a different way.

This reverts commit a57bd8e2b8.

*: https://github.com/mesonbuild/meson/pull/12116#pullrequestreview-1575846647
This commit is contained in:
Dudemanguy 2023-10-29 10:15:40 -05:00
parent a57bd8e2b8
commit 50187264fa
1 changed files with 2 additions and 5 deletions

View File

@ -13,7 +13,7 @@ project('mpv',
build_root = meson.project_build_root()
source_root = meson.project_source_root()
python = import('python').find_installation()
python = find_program('python3')
# ffmpeg
libavcodec = dependency('libavcodec', version: '>= 58.134.100')
@ -1475,10 +1475,7 @@ endif
macos_sdk_path = ''
macos_sdk_version = '0.0'
if darwin and macos_sdk_version_py.found()
# 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_info = run_command(macos_sdk_version_py, check: true).stdout().split(',')
macos_sdk_path = macos_sdk_info[0].strip()
macos_sdk_version = macos_sdk_info[1]
endif