Commit 7e338d40 authored by Christoph Reiter's avatar Christoph Reiter 🐍

meson: don't autodetect pycairo support, force it and add an option to disable it

If you don't want pycairo support pass "-Dpycairo=false"
parent c8507597
Pipeline #10769 passed with stages
in 11 minutes and 15 seconds
......@@ -28,6 +28,7 @@ if [[ "${PYIMPL}" != "PyPy" ]]; then
# https://github.com/mesonbuild/meson/pull/3445
/usr/bin/python3 -m pip install --user meson
export PATH="${HOME}/.local/bin:${PATH}"
export PKG_CONFIG_PATH="$(python -c 'import sys; sys.stdout.write(sys.prefix)')/lib/pkgconfig"
meson _build -Dpython="$(which python)"
ninja -C _build
rm -Rf _build
......
......@@ -73,7 +73,7 @@ giext = python.extension_module('_gi', sources,
c_args: pyext_c_args + main_c_args
)
if pycairo_dep.found() and cairo_dep.found() and cairo_gobject_dep.found()
if with_pycairo
gicairoext = python.extension_module('_gi_cairo', ['pygi-foreign-cairo.c'],
dependencies : [python_dep, glib_dep, gi_dep, ffi_dep, pycairo_dep, cairo_dep, cairo_gobject_dep],
install: true,
......
......@@ -35,13 +35,17 @@ gmodule_dep = dependency('gmodule-2.0', version : glib_version_req,
ffi_dep = dependency('libffi', version : '>= 3.0',
fallback : ['libffi', 'ffi_dep'])
cairo_dep = dependency('cairo', required: false)
cairo_gobject_dep = dependency('cairo-gobject', required: false)
with_pycairo = get_option('pycairo')
if python.language_version().version_compare('>= 3.0')
pycairo_dep = dependency('py3cairo', version : pycairo_version_req, required: false)
else
pycairo_dep = dependency('pycairo', version : pycairo_version_req, required: false)
if with_pycairo
cairo_dep = dependency('cairo')
cairo_gobject_dep = dependency('cairo-gobject')
if python.language_version().version_compare('>= 3.0')
pycairo_dep = dependency('py3cairo', version : pycairo_version_req)
else
pycairo_dep = dependency('pycairo', version : pycairo_version_req)
endif
endif
cc = meson.get_compiler('c')
......
option('python', type : 'string', value : 'python3')
option('pycairo', type : 'boolean', value : true, description : 'build with pycairo integration')
......@@ -67,7 +67,7 @@ regress_headers += ['regressextra.h']
regress_deps = [glib_dep, gobject_dep, gio_dep, gmodule_dep]
regress_c_args = []
if cairo_dep.found() and cairo_gobject_dep.found()
if with_pycairo
regress_deps += [cairo_dep, cairo_gobject_dep]
else
regress_c_args += ['-D_GI_DISABLE_CAIRO']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment