mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 03:31:05 +00:00
meson: use python.get_install_dir() to find the pygobject overrides dir
Instead of trying to hardcode site-packages paths for different platforms just use python.get_install_dir() from meson and let it deal with the rest. Also no longer try to import pygobject, which would otherwise not be required at build time. python.get_install_dir() was at the beginning broken on Windows, but that was fixed in 0.60 via https://github.com/mesonbuild/meson/pull/9156 and since ges now requires >0.60 this can be ignored. This change was motivated by the install path being wrong under MSYS2, where the unix install layout is used and the detection code not taking that into account. This MR is a continuation of https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/230 see the discussion there for extra context. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3012>
This commit is contained in:
parent
46dbf194bd
commit
472dc4b743
1 changed files with 5 additions and 38 deletions
|
@ -278,48 +278,15 @@ if not get_option('examples').disabled()
|
||||||
endif
|
endif
|
||||||
subdir('docs')
|
subdir('docs')
|
||||||
|
|
||||||
override_detector = '''
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
|
|
||||||
prefix = sys.argv[1]
|
|
||||||
version = sys.version_info
|
|
||||||
|
|
||||||
# If we are installing in the same prefix as PyGobject
|
|
||||||
# make sure to install in the right place.
|
|
||||||
import gi.overrides
|
|
||||||
|
|
||||||
overrides_path = os.path.dirname(gi.overrides.__file__)
|
|
||||||
if os.path.commonprefix([overrides_path, prefix]) == prefix:
|
|
||||||
print(overrides_path)
|
|
||||||
exit(0)
|
|
||||||
|
|
||||||
# Otherwise follow python's way of install site packages inside
|
|
||||||
# the provided prefix
|
|
||||||
if os.name == 'posix':
|
|
||||||
print(os.path.join(
|
|
||||||
prefix, 'lib', 'python%d.%d' % (version.major, version.minor),
|
|
||||||
'site-packages', 'gi', 'overrides'))
|
|
||||||
else:
|
|
||||||
print(os.path.join(
|
|
||||||
prefix, 'Lib', 'Python%d%d' % (version.major, version.minor),
|
|
||||||
'site-packages', 'gi', 'overrides'))
|
|
||||||
'''
|
|
||||||
pygi_override_dir = get_option('pygi-overrides-dir')
|
pygi_override_dir = get_option('pygi-overrides-dir')
|
||||||
if pygi_override_dir == ''
|
if pygi_override_dir == ''
|
||||||
cres = run_command(python3, '-c', override_detector, get_option('prefix'), check: false)
|
pygi_override_dir = python3.get_install_dir(
|
||||||
if cres.returncode() == 0
|
subdir : join_paths('gi', 'overrides')
|
||||||
pygi_override_dir = cres.stdout().strip()
|
)
|
||||||
endif
|
|
||||||
if cres.stderr() != ''
|
|
||||||
message(cres.stderr())
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if pygi_override_dir != ''
|
message('pygobject overrides directory = @0@'.format(pygi_override_dir))
|
||||||
message('pygobject overrides directory ' + pygi_override_dir)
|
subdir('bindings/python')
|
||||||
subdir('bindings/python')
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Set release date
|
# Set release date
|
||||||
if gst_version_nano == 0
|
if gst_version_nano == 0
|
||||||
|
|
Loading…
Reference in a new issue