Add meson as a submodule for now
authorThibault Saunier <thibault.saunier@osg.samsung.com>
Mon, 10 Oct 2016 23:14:50 +0000 (01:14 +0200)
committerThibault Saunier <thibault.saunier@osg.samsung.com>
Tue, 11 Oct 2016 00:00:32 +0000 (02:00 +0200)
Allowing us to control the meson version in use so that it just works.

.gitmodules [new file with mode: 0644]
README.md
common.py [new file with mode: 0644]
configure
git-update
gst-uninstalled.py
meson [new submodule]

diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..f601ecb
--- /dev/null
@@ -0,0 +1,3 @@
+[submodule "meson"]
+       path = meson
+       url = https://github.com/mesonbuild/meson.git
index 04c154d..c7b4eaa 100644 (file)
--- a/README.md
+++ b/README.md
@@ -5,6 +5,15 @@ GStreamer [meson](http://mesonbuild.com/) based repositories aggregrator
 You can build GStreamer and all its component at once using
 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
 
 gst-all also contains a special `uninstalled` target that lets you enter
diff --git a/common.py b/common.py
new file mode 100644 (file)
index 0000000..65d5b2d
--- /dev/null
+++ b/common.py
@@ -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()
+
+
index 3629804..9d9a7e1 100755 (executable)
--- a/configure
+++ b/configure
@@ -7,26 +7,22 @@ import sys
 import shutil
 import subprocess
 
+from common import git
+from common import Colors
+
 
 PROJECTNAME = "GStreamer 'all'"
 
 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:
-%(tab)scd %(build_dir)s && %(ninja)s test
 
-uninstalled:
-%(tab)scd %(build_dir)s && %(ninja)s uninstalled
+def get_meson():
+    print("Updating meson submodule...", end='')
+    sys.stdout.flush()
+    git(['submodule', 'update', '--init'], ROOTDIR)
+    print("DONE")
 
-clean:
-%(tab)srm -Rf %(build_dir)s
-%(tab)srm Makefile
-"""
+    return os.path.join(ROOTDIR, 'meson', 'meson.py')
 
 
 def accept_command(commands):
@@ -42,19 +38,12 @@ def accept_command(commands):
 
 
 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']
 
 
 def configure_meson(args):
     """Configures meson and generate the Makefile."""
-    meson = accept_command(["meson", "meson.py"])
+    meson = get_meson()
     if not meson:
         print("Install mesonbuild to build %s: http://mesonbuild.com/\n"
               "You can simply install it with:\n"
@@ -78,11 +67,6 @@ def configure_meson(args):
         print("EXIT meson return %s" % e.returncode)
         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__":
     parser = argparse.ArgumentParser(description='Process some integers.')
index e0919b2..163574f 100755 (executable)
@@ -4,48 +4,11 @@ import os
 import subprocess
 import xml.etree.ElementTree as ET
 
+from common import git
+from common import Colors
 
-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()
+SCRIPTDIR = os.path.dirname(__file__)
 
 
 def manifest_get_commits(manifest):
index 84ba61e..17b8f11 100755 (executable)
@@ -65,6 +65,7 @@ def get_subprocess_env(options):
         "%s/subprojects/gst-editing-services/tests/validate" % SCRIPTDIR)
     prepend_env_var(env, "PATH", os.path.normpath(
         "%s/subprojects/gst-devtools/validate/tools" % options.builddir))
+    prepend_env_var(env, "PATH", os.path.join(SCRIPTDIR, 'meson'))
     env["PATH"] += os.pathsep + PATH
     env["GST_VERSION"] = options.gst_version
     env["GST_PLUGIN_SYSTEM_PATH"] = ""
diff --git a/meson b/meson
new file mode 160000 (submodule)
index 0000000..a513bcf
--- /dev/null
+++ b/meson
@@ -0,0 +1 @@
+Subproject commit a513bcfde613f2a0403f7b0cd34d4bd62674c1d8