diff options
author | Christoph Reiter <reiter.christoph@gmail.com> | 2018-06-23 22:27:58 +0200 |
---|---|---|
committer | Christoph Reiter <reiter.christoph@gmail.com> | 2018-06-24 03:06:08 +0000 |
commit | beed17372f3dc09aa422ee8dff5ec3bb187b86c3 (patch) | |
tree | a9e747045ee6558d0793f803646fc8051026a4e6 | |
parent | 898bbe50005223f5f04994764b3e95f13dffe2d2 (diff) | |
download | pygobject-beed17372f3dc09aa422ee8dff5ec3bb187b86c3.tar.gz |
meson: support building pycairo as a subproject
-rw-r--r-- | meson.build | 11 | ||||
-rw-r--r-- | subprojects/pycairo.wrap | 4 | ||||
-rw-r--r-- | tests/meson.build | 7 |
3 files changed, 19 insertions, 3 deletions
diff --git a/meson.build b/meson.build index 43b56cbf..70279b85 100644 --- a/meson.build +++ b/meson.build @@ -42,10 +42,17 @@ if with_pycairo cairo_gobject_dep = dependency('cairo-gobject') if python.language_version().version_compare('>= 3.0') - pycairo_dep = dependency('py3cairo', version : pycairo_version_req) + pycairo_name = 'py3cairo' else - pycairo_dep = dependency('pycairo', version : pycairo_version_req) + pycairo_name = 'pycairo' endif + + pycairo_dep = dependency( + pycairo_name, + version: pycairo_version_req, + fallback: ['pycairo', 'pycairo_dep'], + default_options: ['python=' + get_option('python')], + ) endif cc = meson.get_compiler('c') diff --git a/subprojects/pycairo.wrap b/subprojects/pycairo.wrap new file mode 100644 index 00000000..87eac571 --- /dev/null +++ b/subprojects/pycairo.wrap @@ -0,0 +1,4 @@ +[wrap-git] +directory=pycairo +url=https://github.com/pygobject/pycairo.git +revision=master diff --git a/tests/meson.build b/tests/meson.build index 5933ddba..f72ead0f 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -118,7 +118,12 @@ endif if host_machine.system() == 'windows' envdata.prepend('PATH', join_paths(get_option('prefix'), get_option('bindir'))) endif -envdata.append('PYTHONPATH', join_paths(meson.current_build_dir(), '..')) + +python_paths = [join_paths(meson.current_build_dir(), '..')] +if with_pycairo and pycairo_dep.type_name() == 'internal' + python_paths += [join_paths(meson.build_root(), 'subprojects', 'pycairo')] +endif +envdata.append('PYTHONPATH', python_paths) envdata.append('TESTS_BUILDDIR', meson.current_build_dir()) test('pygobject-test-suite', python, |