From 0881b78bbabb5aab59b2abedf41b05d46c3f6e4d Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 27 Apr 2020 00:27:52 -0400 Subject: Don't override finding executables when using pre-built tools. Actually, we shouldn't really need this. We are building `native: false` binaries so when we look up a `native: true` binary the override should not apply. I've fixed this upstream in meson in https://github.com/NixOS/nixpkgs/pull/86080, though some backwards compatibility migration might be in order. In the meantime, we can make `gi_cross_use_host_gi` prevent the overrides from happening, which will achieve the desired behavior. Finally, this allows us to use `find_program` in `scanner_command`, unconditionally, letting the presence of the override dictate whether a freshly-built or pre-built `g-ir-scanner` is used. --- gir/meson.build | 26 ++++++++------------------ tools/meson.build | 13 +++++++++---- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/gir/meson.build b/gir/meson.build index 04f9371a..b37fdb81 100644 --- a/gir/meson.build +++ b/gir/meson.build @@ -41,24 +41,14 @@ gir_files = [ typelibdir = join_paths(get_option('libdir'), 'girepository-1.0') install_data(gir_files, install_dir: girdir) -if get_option('gi_cross_use_host_gi') - scanner_command = [ - 'g-ir-scanner', - ] -else - scanner_command = [ - python, - girscanner, - ] -endif - -scanner_command += [ - '--output=@OUTPUT@', - '--no-libtool', - '--quiet', - '--reparse-validate', - '--add-include-path', join_paths(meson.current_build_dir()), - '--add-include-path', join_paths(meson.current_source_dir()), +scanner_command = [ + find_program('g-ir-scanner', native: true), + '--output=@OUTPUT@', + '--no-libtool', + '--quiet', + '--reparse-validate', + '--add-include-path', join_paths(meson.current_build_dir()), + '--add-include-path', join_paths(meson.current_source_dir()), ] dep_type = glib_dep.type_name() diff --git a/tools/meson.build b/tools/meson.build index 103480c4..50641c19 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -34,7 +34,9 @@ foreach tool : tools ) tool_output += tool_bin # Provide tools for others when we're a subproject and they use the Meson GNOME module - meson.override_find_program(tool[0], tool_bin) + if not get_option('gi_cross_use_host_gi') + meson.override_find_program(tool[0], tool_bin) + endif endforeach girscanner = tool_output[0] @@ -58,7 +60,6 @@ gircompiler = executable('g-ir-compiler', 'compiler.c', install: true, c_args: custom_c_args, ) -meson.override_find_program('g-ir-compiler', gircompiler) girgenerate = executable('g-ir-generate', 'generate.c', dependencies: [ @@ -68,11 +69,15 @@ girgenerate = executable('g-ir-generate', 'generate.c', install: true, c_args: custom_c_args, ) -meson.override_find_program('g-ir-generate', girgenerate) girinspect = executable('g-ir-inspect', 'g-ir-inspect.c', dependencies: girepo_dep, install: true, c_args: custom_c_args, ) -meson.override_find_program('g-ir-inspect', girinspect) \ No newline at end of file + +if not get_option('gi_cross_use_host_gi') + meson.override_find_program('g-ir-compiler', gircompiler) + meson.override_find_program('g-ir-generate', girgenerate) + meson.override_find_program('g-ir-inspect', girinspect) +endif -- cgit v1.2.1