From 3fbf34dabc8caef813564e7050cbe7ac27120be5 Mon Sep 17 00:00:00 2001 From: Jehan Date: Wed, 24 Apr 2024 18:42:26 +0200 Subject: [PATCH] meson: fails to compile with -Dpython=disabled flag. We compile GObject-Introspection anyway (except for cross-builds, where anyway we don't rely on local Python scripts), so even if not installing the Python plug-ins, still use them locally. --- meson.build | 2 +- plug-ins/python/meson.build | 34 +++++++++++++++++----------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/meson.build b/meson.build index 201371b5f1..6e52ebb5f3 100644 --- a/meson.build +++ b/meson.build @@ -1852,7 +1852,7 @@ subdir('app-tools') gimp_run_env=environment() gimp_run_env.set('GIMP_GLOBAL_BUILD_ROOT', meson.global_build_root()) -if meson.can_run_host_binaries() +if meson.can_run_host_binaries() and have_gobject_introspection if enable_console_bin gimp_real_exe = gimpconsole_exe else diff --git a/plug-ins/python/meson.build b/plug-ins/python/meson.build index efefe1f7da..80f71404ca 100644 --- a/plug-ins/python/meson.build +++ b/plug-ins/python/meson.build @@ -1,7 +1,3 @@ -if not have_python - subdir_done() -endif - plugins = [ { 'name': 'colorxhtml' }, { 'name': 'file-openraster' }, @@ -27,27 +23,31 @@ foreach plugin : plugins name = plugin.get('name') srcs = plugin.get('srcs', [name + '.py']) - install_data(srcs, install_dir: gimpplugindir / 'plug-ins' / name, - install_mode: 'rwxr-xr-x') + if have_python + install_data(srcs, install_dir: gimpplugindir / 'plug-ins' / name, + install_mode: 'rwxr-xr-x') + endif foreach src : srcs # Ugly trick to copy Python plug-ins into subfolders so that we can run GIMP # from the build directory without installing it. + # To be run even if we don't install Python plug-ins so that we can + # still run them for in-build scripts. run_command(python, meson.project_source_root() / '.gitlab/cp-plug-in-subfolder.py', meson.current_source_dir() / src, meson.current_build_dir() / name, check: true) endforeach endforeach -# Fallback fix to the problem of non-configured interpreters -if platform_windows and not meson.is_cross_build() and python.found() - python_config = configuration_data() - python_config.set('PYTHON_PATH', '') +if have_python + # Fallback fix to the problem of non-configured interpreters + if platform_windows and not meson.is_cross_build() and python.found() + python_config = configuration_data() + python_config.set('PYTHON_PATH', '') - configure_file( - input : 'pygimp.interp.in', - output: 'pygimp.interp', - configuration: python_config, - install: true, - install_dir: gimpplugindir / 'interpreters', - ) + configure_file(input : 'pygimp.interp.in', + output: 'pygimp.interp', + configuration: python_config, + install: true, + install_dir: gimpplugindir / 'interpreters') + endif endif