Skip to content

Commit

Permalink
Revert "meson: import python module"
Browse files Browse the repository at this point in the history
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 a57bd8e.

*: mesonbuild/meson#12116 (review)
  • Loading branch information
Dudemanguy committed Oct 29, 2023
1 parent a57bd8e commit 5018726
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5018726

Please sign in to comment.