2025-05-28 17:35:27 -07:00
|
|
|
python_plugins = [
|
2019-12-14 04:19:44 -08:00
|
|
|
{ 'name': 'colorxhtml' },
|
2017-11-01 06:27:13 -07:00
|
|
|
{ 'name': 'file-openraster' },
|
|
|
|
|
{ 'name': 'foggify' },
|
2019-09-15 01:17:29 -07:00
|
|
|
{ 'name': 'gradients-save-as-css' },
|
2019-12-26 10:10:44 -08:00
|
|
|
{ 'name': 'histogram-export' },
|
2025-05-02 04:34:06 -07:00
|
|
|
{ 'name': 'palette-export-as-kpl' },
|
2017-11-01 06:27:13 -07:00
|
|
|
{ 'name': 'palette-offset' },
|
2020-05-04 09:03:22 -07:00
|
|
|
{ 'name': 'palette-sort' },
|
2017-11-01 06:27:13 -07:00
|
|
|
{ 'name': 'palette-to-gradient' },
|
2019-12-15 16:11:10 -08:00
|
|
|
{ 'name': 'python-eval' },
|
2017-11-01 06:27:13 -07:00
|
|
|
{ 'name': 'spyro-plus' },
|
|
|
|
|
]
|
|
|
|
|
|
2024-09-05 13:44:10 -07:00
|
|
|
if not stable or not release
|
2025-05-28 17:35:27 -07:00
|
|
|
python_plugins += [
|
2022-09-05 16:28:35 -07:00
|
|
|
{ 'name': 'test-dialog' },
|
|
|
|
|
]
|
|
|
|
|
endif
|
|
|
|
|
|
2017-11-01 06:27:13 -07:00
|
|
|
subdir('python-console')
|
2023-11-22 08:56:38 -08:00
|
|
|
subdir('tests')
|
2017-11-01 06:27:13 -07:00
|
|
|
|
2025-05-28 17:35:27 -07:00
|
|
|
foreach plugin : python_plugins
|
2017-11-01 06:27:13 -07:00
|
|
|
name = plugin.get('name')
|
build, plug-ins, gitlab: make GIMP runnable from build directory without…
… being installed.
There is already most of the main code logic for this, though now plug-ins need
to be in their own subdirectories, which breaks for plug-ins/common/ and
plug-ins/python/, while I needed plug-ins in both these categories to generate
the Windows installer welcome images (file-png, and python-fu-eval in
particular).
Once again, meson was not very helpful, since all its functions still refuse to
output generated files in subdirectories, so I end up duplicating plug-in files
with a custom Python script.
This should fix the CI. It was working on my machine as GIMP was installed, but
such a build rule should work even without GIMP installed.
This will also be useful in the future when we'll want to run unit tests of
plug-ins through the finale GIMP binary itself.
2023-06-27 08:41:04 -07:00
|
|
|
srcs = plugin.get('srcs', [name + '.py'])
|
2017-11-01 06:27:13 -07:00
|
|
|
|
2024-08-08 16:01:58 -07:00
|
|
|
install_data(srcs, install_dir: gimpplugindir / 'plug-ins' / name,
|
|
|
|
|
install_mode: 'rwxr-xr-x')
|
build, plug-ins, gitlab: make GIMP runnable from build directory without…
… being installed.
There is already most of the main code logic for this, though now plug-ins need
to be in their own subdirectories, which breaks for plug-ins/common/ and
plug-ins/python/, while I needed plug-ins in both these categories to generate
the Windows installer welcome images (file-png, and python-fu-eval in
particular).
Once again, meson was not very helpful, since all its functions still refuse to
output generated files in subdirectories, so I end up duplicating plug-in files
with a custom Python script.
This should fix the CI. It was working on my machine as GIMP was installed, but
such a build rule should work even without GIMP installed.
This will also be useful in the future when we'll want to run unit tests of
plug-ins through the finale GIMP binary itself.
2023-06-27 08:41:04 -07:00
|
|
|
|
|
|
|
|
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.
|
2024-04-24 09:42:26 -07:00
|
|
|
# To be run even if we don't install Python plug-ins so that we can
|
|
|
|
|
# still run them for in-build scripts.
|
2025-09-24 05:06:01 -07:00
|
|
|
run_command(python, meson.project_source_root() / 'tools/cp-plug-in-subfolder.py',
|
build, plug-ins, gitlab: make GIMP runnable from build directory without…
… being installed.
There is already most of the main code logic for this, though now plug-ins need
to be in their own subdirectories, which breaks for plug-ins/common/ and
plug-ins/python/, while I needed plug-ins in both these categories to generate
the Windows installer welcome images (file-png, and python-fu-eval in
particular).
Once again, meson was not very helpful, since all its functions still refuse to
output generated files in subdirectories, so I end up duplicating plug-in files
with a custom Python script.
This should fix the CI. It was working on my machine as GIMP was installed, but
such a build rule should work even without GIMP installed.
This will also be useful in the future when we'll want to run unit tests of
plug-ins through the finale GIMP binary itself.
2023-06-27 08:41:04 -07:00
|
|
|
meson.current_source_dir() / src, meson.current_build_dir() / name, check: true)
|
|
|
|
|
endforeach
|
2017-11-01 06:27:13 -07:00
|
|
|
endforeach
|
|
|
|
|
|
2025-11-09 07:29:10 -08:00
|
|
|
#.interp file read by gimp_interpreter_db_load_interp_file in gimpinterpreterdb.c
|
2025-07-22 10:44:36 -07:00
|
|
|
if (platform_windows or platform_osx) and not meson.is_cross_build() and python.found()
|
2024-08-08 16:01:58 -07:00
|
|
|
python_config = configuration_data()
|
2025-07-22 10:44:36 -07:00
|
|
|
if platform_windows
|
2025-11-09 07:29:10 -08:00
|
|
|
# python.exe is needed for plug-ins error output if `gimp*.exe` is run from console
|
|
|
|
|
python_config.set('PYTHON_EXE', 'python.exe')
|
|
|
|
|
|
|
|
|
|
# pythonw.exe is needed to run plug-ins silently if `gimp*.exe` is run from shortcut
|
|
|
|
|
install_data('pygimp_win.interp',
|
|
|
|
|
install_dir: gimpplugindir / 'interpreters',
|
|
|
|
|
)
|
2026-01-15 13:39:32 -08:00
|
|
|
elif platform_osx
|
|
|
|
|
# python* is needed to run plug-ins with right build-time interpreter when non-relocatable
|
|
|
|
|
if not relocatable_bundle
|
|
|
|
|
python_config.set('PYTHON_EXE', python.path())
|
|
|
|
|
|
|
|
|
|
# python3 is needed to run plug-ins with right bundled interpreter when relocatable
|
|
|
|
|
else
|
|
|
|
|
python_config.set('PYTHON_EXE', 'python3')
|
|
|
|
|
endif
|
2024-11-18 10:50:23 -08:00
|
|
|
endif
|
2024-04-24 09:42:26 -07:00
|
|
|
|
2024-08-08 16:01:58 -07:00
|
|
|
configure_file(input : 'pygimp.interp.in',
|
|
|
|
|
output: 'pygimp.interp',
|
|
|
|
|
configuration: python_config,
|
|
|
|
|
install: true,
|
|
|
|
|
install_dir: gimpplugindir / 'interpreters')
|
2017-11-01 06:27:13 -07:00
|
|
|
endif
|