Add meson as a submodule for now

Allowing us to control the meson version in use so that it just works.
This commit is contained in:
Thibault Saunier 2016-10-11 01:14:50 +02:00
parent 2f3c89b321
commit 76e946465f
7 changed files with 71 additions and 66 deletions

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "meson"]
path = meson
url = https://github.com/mesonbuild/meson.git

View file

@ -5,6 +5,15 @@ GStreamer [meson](http://mesonbuild.com/) based repositories aggregrator
You can build GStreamer and all its component at once using You can build GStreamer and all its component at once using
meson and its "subproject" feature. meson and its "subproject" feature.
## Getting started
We have an helper script to get started, will get the right [meson](http://mesonbuild.com/)
version and get you ready to build. You can just get all GStreamer built running:
```
./configure && ninja -C build/
```
## GStreamer uninstalled ## GStreamer uninstalled
gst-all also contains a special `uninstalled` target that lets you enter gst-all also contains a special `uninstalled` target that lets you enter

44
common.py Normal file
View file

@ -0,0 +1,44 @@
import argparse
import subprocess
class Colors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
force_disable = False
@classmethod
def disable(cls):
cls.HEADER = ''
cls.OKBLUE = ''
cls.OKGREEN = ''
cls.WARNING = ''
cls.FAIL = ''
cls.ENDC = ''
@classmethod
def enable(cls):
if cls.force_disable:
return
cls.HEADER = '\033[95m'
cls.OKBLUE = '\033[94m'
cls.OKGREEN = '\033[92m'
cls.WARNING = '\033[93m'
cls.FAIL = '\033[91m'
cls.ENDC = '\033[0m'
def git(args, repository_path):
if not isinstance(args, list):
args = [args]
return subprocess.check_output(["git"] + args, cwd=repository_path,
stderr=subprocess.STDOUT).decode()

36
configure vendored
View file

@ -7,26 +7,22 @@ import sys
import shutil import shutil
import subprocess import subprocess
from common import git
from common import Colors
PROJECTNAME = "GStreamer 'all'" PROJECTNAME = "GStreamer 'all'"
ROOTDIR = os.path.abspath(os.path.dirname(__file__)) ROOTDIR = os.path.abspath(os.path.dirname(__file__))
MAKEFILE_TMPL = """all:
%(tab)scd %(build_dir)s && %(ninja)s -k 100; %(ninja)s
install:
%(tab)scd %(build_dir)s && DESTDIR="${DESTDIR}" %(ninja)s install
check: def get_meson():
%(tab)scd %(build_dir)s && %(ninja)s test print("Updating meson submodule...", end='')
sys.stdout.flush()
git(['submodule', 'update', '--init'], ROOTDIR)
print("DONE")
uninstalled: return os.path.join(ROOTDIR, 'meson', 'meson.py')
%(tab)scd %(build_dir)s && %(ninja)s uninstalled
clean:
%(tab)srm -Rf %(build_dir)s
%(tab)srm Makefile
"""
def accept_command(commands): def accept_command(commands):
@ -42,19 +38,12 @@ def accept_command(commands):
def get_configs(meson): def get_configs(meson):
meson_version = subprocess.check_output([meson, '--version']).decode().strip()
if meson_version <= '0.33.0':
print("Disabling the introspection as support for the introspection with subproject was introduced in 0.34")
return ['-Dgstreamer:disable_introspection=true',
'-Dgst-editing-services:disable_introspection=true',
'-Dgst-devtools:disable_introspection=true']
return ['-Dwerror=true'] return ['-Dwerror=true']
def configure_meson(args): def configure_meson(args):
"""Configures meson and generate the Makefile.""" """Configures meson and generate the Makefile."""
meson = accept_command(["meson", "meson.py"]) meson = 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"
@ -78,11 +67,6 @@ def configure_meson(args):
print("EXIT meson return %s" % e.returncode) print("EXIT meson return %s" % e.returncode)
exit(1) exit(1)
with open(os.path.join(ROOTDIR, "Makefile"), "w") as makefile:
makefile.write(MAKEFILE_TMPL %
{"build_dir": build_dir,
"ninja": ninja,
"tab": " "})
if __name__ == "__main__": if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Process some integers.') parser = argparse.ArgumentParser(description='Process some integers.')

View file

@ -4,49 +4,12 @@ import os
import subprocess import subprocess
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
from common import git
from common import Colors
SCRIPTDIR = os.path.dirname(__file__) SCRIPTDIR = os.path.dirname(__file__)
class Colors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
force_disable = False
@classmethod
def disable(cls):
cls.HEADER = ''
cls.OKBLUE = ''
cls.OKGREEN = ''
cls.WARNING = ''
cls.FAIL = ''
cls.ENDC = ''
@classmethod
def enable(cls):
if cls.force_disable:
return
cls.HEADER = '\033[95m'
cls.OKBLUE = '\033[94m'
cls.OKGREEN = '\033[92m'
cls.WARNING = '\033[93m'
cls.FAIL = '\033[91m'
cls.ENDC = '\033[0m'
def git(args, repository_path):
if not isinstance(args, list):
args = [args]
return subprocess.check_output(["git"] + args, cwd=repository_path,
stderr=subprocess.STDOUT).decode()
def manifest_get_commits(manifest): def manifest_get_commits(manifest):
res = {} res = {}

View file

@ -65,6 +65,7 @@ def get_subprocess_env(options):
"%s/subprojects/gst-editing-services/tests/validate" % SCRIPTDIR) "%s/subprojects/gst-editing-services/tests/validate" % SCRIPTDIR)
prepend_env_var(env, "PATH", os.path.normpath( prepend_env_var(env, "PATH", os.path.normpath(
"%s/subprojects/gst-devtools/validate/tools" % options.builddir)) "%s/subprojects/gst-devtools/validate/tools" % options.builddir))
prepend_env_var(env, "PATH", os.path.join(SCRIPTDIR, 'meson'))
env["PATH"] += os.pathsep + PATH env["PATH"] += os.pathsep + PATH
env["GST_VERSION"] = options.gst_version env["GST_VERSION"] = options.gst_version
env["GST_PLUGIN_SYSTEM_PATH"] = "" env["GST_PLUGIN_SYSTEM_PATH"] = ""

1
meson Submodule

@ -0,0 +1 @@
Subproject commit a513bcfde613f2a0403f7b0cd34d4bd62674c1d8