Fix build with Python 3.8 by also checking for python-3.X-embed.pc
authorSebastian Dröge <sebastian@centricular.com>
Wed, 11 Mar 2020 11:42:50 +0000 (13:42 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 11 Mar 2020 11:42:50 +0000 (13:42 +0200)
Since Python 3.8 the normal checks don't include the Python libraries
anymore and linking of the Python formatters would fail.

See also https://github.com/mesonbuild/meson/issues/5629
and https://gitlab.freedesktop.org/gstreamer/gst-python/issues/28

meson.build

index db28c3c..d1d4af9 100644 (file)
@@ -130,7 +130,12 @@ if build_gir
   pymod = import('python')
   python = pymod.find_installation(required: get_option('python'))
   if python.found()
-    python_dep = python.dependency(required : get_option('python'))
+    # Workaround for https://github.com/mesonbuild/meson/issues/5629
+    pythonver = python.language_version()
+    python_dep = dependency('python-@0@-embed'.format(pythonver), version: '>=3', required: false)
+    if not python_dep.found()
+      python_dep = python.dependency(required : get_option('python'))
+    endif
   else
     python_dep = dependency('', required: false)
   endif