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.
This commit is contained in:
Jehan 2024-04-24 18:42:26 +02:00
parent 106706ca31
commit 3fbf34dabc
2 changed files with 18 additions and 18 deletions

View File

@ -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

View File

@ -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