[mutter/gbsneto/graphene] build: Use graphene as a fallback subproject



commit 73baaf9b34c2ce3a0cbd50439863c51223c06666
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Jun 5 16:07:10 2019 -0300

    build: Use graphene as a fallback subproject
    
    This allows building and testing mutter with graphene
    even without the unreleased version from master. It also
    helps CI -- not only GitLab's CI, but also Continuous.
    
    When graphene 1.10 is released and broadly distributed,
    we can remove this.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/458

 .gitmodules           | 3 +++
 cogl/cogl/meson.build | 2 +-
 meson.build           | 9 ++++++++-
 subprojects/graphene  | 1 +
 4 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 000000000..dce6d82f0
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "subprojects/graphene"]
+       path = subprojects/graphene
+       url = https://github.com/ebassi/graphene.git
diff --git a/cogl/cogl/meson.build b/cogl/cogl/meson.build
index d9f11d8db..b337eceeb 100644
--- a/cogl/cogl/meson.build
+++ b/cogl/cogl/meson.build
@@ -494,7 +494,7 @@ if have_introspection
     sources: cogl_introspected_headers,
     nsversion: libmutter_api_version,
     namespace: 'Cogl',
-    includes: ['GL-1.0', 'GObject-2.0', 'Graphene-1.0'],
+    includes: ['GL-1.0', 'GObject-2.0', graphene_gir_inc],
     dependencies: [cogl_deps],
     extra_args: introspection_args + [
       '-UCOGL_COMPILATION',
diff --git a/meson.build b/meson.build
index dcf0b4930..8916097ec 100644
--- a/meson.build
+++ b/meson.build
@@ -82,7 +82,8 @@ mutter_installed_tests_libexecdir = join_paths(
 
 m_dep = cc.find_library('m', required: true)
 x11_dep = dependency('x11')
-graphene_dep = dependency('graphene-gobject-1.0', version: graphene_req)
+graphene_dep = dependency('graphene-gobject-1.0', version: graphene_req,
+                          fallback: ['graphene', 'graphene_dep'])
 gtk3_dep = dependency('gtk+-3.0', version: gtk3_req)
 gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0')
 pango_dep = dependency('pango', version: pango_req)
@@ -247,6 +248,12 @@ if have_introspection
   ]
 endif
 
+if graphene_dep.type_name() == 'internal'
+  graphene_gir_inc = subproject('graphene').get_variable('graphene_gir').get(0)
+else
+  graphene_gir_inc = 'Graphene-1.0'
+endif
+
 have_tests = get_option('tests')
 have_core_tests = false
 have_cogl_tests = false
diff --git a/subprojects/graphene b/subprojects/graphene
new file mode 160000
index 000000000..48570b109
--- /dev/null
+++ b/subprojects/graphene
@@ -0,0 +1 @@
+Subproject commit 48570b10981831e40da1dcd683a440896fd6fd01


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]