mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 02:01:12 +00:00
Get absolute path to run meson
It is necessary now that we explicitly run it through the python interpreter.
This commit is contained in:
parent
b2b737dc1b
commit
4c2f97525f
1 changed files with 9 additions and 11 deletions
20
setup
20
setup
|
@ -19,19 +19,18 @@ ROOTDIR = os.path.abspath(os.path.dirname(__file__))
|
||||||
def get_meson():
|
def get_meson():
|
||||||
meson = os.path.join(ROOTDIR, 'meson', 'meson.py')
|
meson = os.path.join(ROOTDIR, 'meson', 'meson.py')
|
||||||
if os.path.exists(meson):
|
if os.path.exists(meson):
|
||||||
return meson
|
mesonconf = os.path.join(ROOTDIR, 'meson', 'mesonconf.py')
|
||||||
|
return meson, mesonconf
|
||||||
|
|
||||||
return accept_command(["meson.py", "meson"])
|
return accept_command(["meson.py", "meson"]), accept_command(["mesonconf.py", "mesonconf"])
|
||||||
|
|
||||||
|
|
||||||
def accept_command(commands):
|
def accept_command(commands):
|
||||||
"""Checks if @command --version works."""
|
"""Search @commands and returns the first found absolute path."""
|
||||||
for command in commands:
|
for command in commands:
|
||||||
try:
|
command = shutil.which(command)
|
||||||
subprocess.check_output([command, "--version"])
|
if command:
|
||||||
return command
|
return command
|
||||||
except FileNotFoundError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -42,7 +41,7 @@ def get_configs(meson):
|
||||||
|
|
||||||
def configure_meson(args, options):
|
def configure_meson(args, options):
|
||||||
"""Configures meson and generate the Makefile."""
|
"""Configures meson and generate the Makefile."""
|
||||||
meson = get_meson()
|
meson, mesonconf = get_meson()
|
||||||
if not meson:
|
if not meson:
|
||||||
print("Install mesonbuild to build %s: http://mesonbuild.com/\n"
|
print("Install mesonbuild to build %s: http://mesonbuild.com/\n"
|
||||||
"You can simply install it with:\n"
|
"You can simply install it with:\n"
|
||||||
|
@ -61,9 +60,8 @@ def configure_meson(args, options):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
subprocess.check_call([sys.executable, meson, "../"] + args, cwd=build_dir)
|
subprocess.check_call([sys.executable, meson, "../"] + args, cwd=build_dir)
|
||||||
subprocess.check_call([sys.executable, os.path.join(ROOTDIR, 'meson', 'mesonconf.py')]
|
subprocess.check_call([sys.executable, mesonconf] + get_configs(meson), cwd=build_dir)
|
||||||
+ get_configs(meson), cwd=build_dir)
|
print("\nYou can now build GStreamer and its various subprojects running:\n"
|
||||||
print("You can now build GStreamer and its various subprojects running:\n"
|
|
||||||
" $ ninja -C %s" % build_dir)
|
" $ ninja -C %s" % build_dir)
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
print("EXIT meson return %s" % e.returncode)
|
print("EXIT meson return %s" % e.returncode)
|
||||||
|
|
Loading…
Reference in a new issue