X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=meson.build;h=00898f8cd014a57fc97d8b66c73b0467a1c14ab1;hb=af4ade37435fcc31c8489f4d7c7496fef5f74b05;hp=f42f0ed0c99fb9eec9719110949e689dd7c2384b;hpb=c32670e405767a1f07589faf5b24bbbc57fa508b;p=platform%2Fupstream%2Fgstreamer.git diff --git a/meson.build b/meson.build index f42f0ed..00898f8 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('gst-python', 'c', 'cpp', - version : '1.11.2.1', - meson_version : '>= 0.36.0', + version : '1.15.0.1', + meson_version : '>= 0.40.0', default_options : [ 'warning_level=1', 'c_std=gnu99', 'buildtype=debugoptimized' ]) @@ -11,6 +11,8 @@ gst_version_major = version_arr[0] gst_version_minor = version_arr[1] api_version = '@0@.0'.format(gst_version_major) +add_project_arguments('-DHAVE_CONFIG_H', language: 'c') + gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor) gst_dep = dependency('gstreamer-1.0', version : gst_req, @@ -18,20 +20,44 @@ gst_dep = dependency('gstreamer-1.0', version : gst_req, gstbase_dep = dependency('gstreamer-base-1.0', version : gst_req, fallback : ['gstreamer', 'gst_base_dep']) gmodule_dep = dependency('gmodule-2.0') -pygobject_dep = dependency('pygobject-3.0', version : '>= 3.0') +pygobject_dep = dependency('pygobject-3.0', fallback: ['pygobject', 'pygobject_dep'], version : '>= 3.8') python_dep = dependency('python3') -python = find_program('python3') -pythondetector = find_program('pythondetector') -py_so_suffix = run_command(pythondetector, '--sosuffix').stdout().strip() -python_abi_flags = run_command(pythondetector, '--abiflags').stdout().strip() -pylib_loc = run_command(pythondetector, '--libloc').stdout().strip() -assert(pylib_loc != 'None', 'Python dynamic library path could not be determined') +pymod = import('python') +python = pymod.find_installation(get_option('python')) +python_dep = python.dependency(required : true) + +python_abi_flags = python.get_variable('ABIFLAGS', '') +pylib_loc = python.get_variable('LIBPL', '') +if host_machine.system() != 'windows' + assert(pylib_loc != '', 'Python dynamic library path could not be determined') +endif +message('python_abi_flags = @0@'.format(python_abi_flags)) +message('pylib_loc = @0@'.format(pylib_loc)) + pygi_override_dir = get_option('pygi-overrides-dir') if pygi_override_dir == '' - pygi_override_dir = run_command(pythondetector, '--pygi-overridedir').stdout().strip() + cres = run_command(python, '-c',''' +import os, sys, gi.overrides +paths = gi.overrides.__path__ +prefix = os.path.abspath(sys.argv[1]) +for path in paths: + path = os.path.abspath(path) + if os.path.commonprefix([path, prefix]) == prefix: + print(path) + exit(0) +exit(1) +''', get_option('prefix')) + + if cres.returncode() != 0 + error('Could not detect PyGObject overrides location' + cres.stdout() + cres.stderr()) + endif + pygi_override_dir = cres.stdout().strip() + if cres.stderr() != '' + message(cres.stderr()) + endif endif -message('pygobject overrides directory ' + pygi_override_dir) +message('pygobject overrides directory = @0@'.format(pygi_override_dir)) pylib_suffix = 'so' if host_machine.system() == 'windows' @@ -39,7 +65,6 @@ if host_machine.system() == 'windows' elif host_machine.system() == 'darwin' pylib_suffix = 'dylib' endif - cdata = configuration_data() cdata.set('PACKAGE', '"gst-python"') cdata.set('VERSION', '"@0@"'.format(gst_version)) @@ -51,14 +76,11 @@ cdata.set('PY_LIB_LOC', '"@0@"'.format(pylib_loc)) cdata.set('PY_ABI_FLAGS', '"@0@"'.format(python_abi_flags)) cdata.set('PY_LIB_SUFFIX', '"@0@"'.format(pylib_suffix)) cdata.set('PYTHON_VERSION', '"@0@"'.format(python_dep.version())) -configure_file(input : 'config.h.meson', - output : 'config.h', - configuration : cdata) +configure_file(output : 'config.h', configuration : cdata) configinc = include_directories('.') subdir('gi') subdir('plugin') subdir('testsuite') -python3 = find_program('python3') -run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")') +run_command(python, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')