meson: Add python-exe option to override target Python installation

Fixes #4185

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8337>
This commit is contained in:
L. E. Segovia 2025-01-22 10:44:33 -03:00 committed by GStreamer Marge Bot
parent 7abece4416
commit 41b779e57c
5 changed files with 8 additions and 3 deletions

View file

@ -12,6 +12,7 @@ option('vaapi', type : 'feature', value : 'disabled')
option('gst-examples', type : 'feature', value : 'auto', description : 'Build gst-examples subproject')
# Bindings
option('python', type : 'feature', value : 'auto')
option('python-exe', type: 'string', value: 'python3', description: 'Path or name of the Python interpreter to build for')
option('sharp', type : 'feature', value : 'disabled')
# External subprojects
option('tls', type : 'feature', value : 'auto', description : 'TLS support using glib-networking as a subproject')

View file

@ -147,7 +147,7 @@ gir_init_section = [ '--add-init-section=' + \
pymod = import('python')
python_opt = get_option('python')
python = pymod.find_installation(required: python_opt)
python = pymod.find_installation(get_option('python-exe'), required: python_opt)
has_python = false
static_build = get_option('default_library') == 'static'
if static_build

View file

@ -19,6 +19,8 @@ option('xptv', type : 'feature', value : 'auto',
description : 'Build the deprecated xptv formatter')
option('python', type : 'feature', value : 'auto', yield: true,
description: 'Enable python formatters.')
option('python-exe', type : 'string', value: 'python3', yield: true,
description: 'Path or name of the Python interpreter to build for.')
option('libpython-dir', type : 'string', value : '',
description: 'Path to find libpythonXX.so')
option('validate', type : 'feature', value : 'auto', yield: true,

View file

@ -27,7 +27,7 @@ libdl = cc.find_library('dl', required: false)
pygobject_dep = dependency('pygobject-3.0', fallback: ['pygobject', 'pygobject_dep'], version : '>= 3.8')
pymod = import('python')
python = pymod.find_installation(get_option('python'))
python = pymod.find_installation(get_option('python-exe'), required: true)
pythonver = python.language_version()
if pythonver.version_compare('<3.0')
error('Python2 is not supported anymore, please port your code to python3 (@0@ specified)'.format(python.language_version()))

View file

@ -2,6 +2,8 @@ option('pygi-overrides-dir', type : 'string', value : '',
description: 'Path to pygobject overrides directory')
option('libpython-dir', type : 'string', value : '',
description: 'Path to find libpythonXX.so')
option('python', type : 'string')
option('python', type : 'string', deprecated: 'python-exe')
option('python-exe', type : 'string', value : 'python3', yield: true,
description: 'Path or name of the Python interpreter to build for.')
option('tests', type : 'feature', value : 'auto', yield : true)
option('plugin', type : 'feature', value : 'auto')