From 50187264fae1e000d0b72663f6c5f45a4980a81f Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Sun, 29 Oct 2023 10:15:40 -0500 Subject: [PATCH] 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 a57bd8e2b8a1871dc2613984b7ca93dd7bcb5419. *: https://github.com/mesonbuild/meson/pull/12116#pullrequestreview-1575846647 --- meson.build | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 94c05ed101..345b591a8c 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 = 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