2017-11-01 14:27:13 +01:00
|
|
|
rootAppInclude = include_directories('.')
|
|
|
|
|
|
|
|
subdir('actions')
|
|
|
|
subdir('core')
|
|
|
|
subdir('dialogs')
|
|
|
|
subdir('display')
|
|
|
|
subdir('file')
|
|
|
|
subdir('file-data')
|
|
|
|
subdir('gegl')
|
|
|
|
subdir('gui')
|
|
|
|
subdir('menus')
|
|
|
|
subdir('operations')
|
|
|
|
subdir('paint')
|
2025-07-07 15:43:07 +02:00
|
|
|
subdir('path')
|
2017-11-01 14:27:13 +01:00
|
|
|
subdir('pdb')
|
|
|
|
subdir('plug-in')
|
|
|
|
subdir('propgui')
|
|
|
|
subdir('text')
|
|
|
|
subdir('tools')
|
|
|
|
subdir('widgets')
|
|
|
|
subdir('xcf')
|
|
|
|
|
|
|
|
|
|
|
|
# For app/config
|
|
|
|
app_debug_files = files(
|
|
|
|
'gimp-debug.c',
|
|
|
|
'gimp-log.c',
|
|
|
|
)
|
|
|
|
|
|
|
|
# Top-level library
|
|
|
|
|
|
|
|
libapp_sources = [
|
|
|
|
'app.c',
|
|
|
|
'errors.c',
|
2022-02-07 10:02:19 +00:00
|
|
|
'gimpcoreapp.c',
|
|
|
|
'gimpconsoleapp.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimp-debug.c',
|
|
|
|
'gimp-log.c',
|
2019-12-09 03:00:57 +01:00
|
|
|
'gimp-update.c',
|
2017-11-01 14:27:13 +01:00
|
|
|
'gimp-version.c',
|
|
|
|
'language.c',
|
|
|
|
'sanity.c',
|
|
|
|
'signals.c',
|
|
|
|
'unique.c',
|
|
|
|
gitversion_h,
|
|
|
|
gimpdbusservice_gen,
|
|
|
|
]
|
|
|
|
|
2020-05-11 05:55:37 +02:00
|
|
|
if platform_windows
|
|
|
|
# for GimpDashboard and GimpBacktrace
|
|
|
|
psapi_cflags = [ '-DPSAPI_VERSION=1' ]
|
|
|
|
link_args = [ '-lpsapi' ]
|
|
|
|
|
|
|
|
else
|
|
|
|
psapi_cflags = [ ]
|
|
|
|
link_args = []
|
|
|
|
endif
|
|
|
|
|
|
|
|
if platform_osx
|
|
|
|
link_args += osx_ldflags
|
|
|
|
endif
|
|
|
|
|
2023-06-11 17:39:33 +02:00
|
|
|
libapp_c_args = [
|
|
|
|
'-DG_LOG_DOMAIN="Gimp"',
|
|
|
|
'-DGIMP_APP_GLUE_COMPILATION',
|
|
|
|
psapi_cflags,
|
|
|
|
]
|
|
|
|
|
|
|
|
# Put GIMP core in a lib so we can conveniently link against that in test cases
|
|
|
|
# and main GIMP executable. Note that we should not use this static library for
|
|
|
|
# the console executable as it uses different macro flags.
|
|
|
|
libapp = static_library('app',
|
|
|
|
libapp_sources,
|
|
|
|
include_directories: [ rootInclude, rootAppInclude, configInclude, ],
|
|
|
|
c_args: libapp_c_args,
|
|
|
|
dependencies: [ gdk_pixbuf, gegl, gexiv2, gtk3, ],
|
|
|
|
)
|
|
|
|
|
|
|
|
gimpconsole_deps = [
|
|
|
|
cairo,
|
|
|
|
dbghelp,
|
|
|
|
drmingw,
|
|
|
|
gdk_pixbuf,
|
|
|
|
gegl,
|
|
|
|
gexiv2,
|
|
|
|
gio,
|
|
|
|
gio_specific,
|
|
|
|
lcms,
|
|
|
|
libbacktrace,
|
|
|
|
pangocairo,
|
|
|
|
pangoft2,
|
|
|
|
rpc,
|
|
|
|
]
|
|
|
|
|
|
|
|
console_libapps = [
|
2020-05-11 05:55:37 +02:00
|
|
|
libappcore,
|
|
|
|
libappfile,
|
|
|
|
libappfiledata,
|
|
|
|
libappgegl,
|
|
|
|
libappinternalprocs,
|
|
|
|
libapplayermodes,
|
|
|
|
libapplayermodeslegacy,
|
|
|
|
libappoperations,
|
|
|
|
libapppaint,
|
2025-07-07 15:43:07 +02:00
|
|
|
libapppath,
|
2020-05-11 05:55:37 +02:00
|
|
|
libapppdb,
|
|
|
|
libappplugin,
|
|
|
|
libapptext,
|
|
|
|
libappxcf,
|
2023-06-11 17:39:33 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
libapp_dep = declare_dependency(
|
|
|
|
dependencies: [
|
|
|
|
gimpconsole_deps,
|
|
|
|
gtk3,
|
|
|
|
],
|
|
|
|
link_with: [
|
|
|
|
libapp,
|
|
|
|
console_libapps,
|
2020-05-11 05:55:37 +02:00
|
|
|
],
|
|
|
|
include_directories: [
|
|
|
|
rootInclude,
|
|
|
|
rootAppInclude,
|
|
|
|
],
|
|
|
|
compile_args: psapi_cflags,
|
|
|
|
link_args: link_args,
|
|
|
|
)
|
|
|
|
|
2019-09-21 17:10:46 +00:00
|
|
|
# Those subdirs need to link against the first ones
|
2017-11-01 14:27:13 +01:00
|
|
|
subdir('config')
|
2020-05-10 15:51:07 +02:00
|
|
|
subdir('tests')
|
2017-11-01 14:27:13 +01:00
|
|
|
|
2023-06-11 17:39:33 +02:00
|
|
|
console_libapps += [ libappconfig ]
|
2017-11-01 14:27:13 +01:00
|
|
|
|
2023-06-11 17:39:33 +02:00
|
|
|
app_libgimps = [
|
2017-11-01 14:27:13 +01:00
|
|
|
libgimpbase,
|
|
|
|
libgimpcolor,
|
|
|
|
libgimpconfig,
|
|
|
|
libgimpmath,
|
|
|
|
libgimpmodule,
|
|
|
|
libgimpthumb,
|
|
|
|
]
|
|
|
|
|
2023-06-11 17:39:33 +02:00
|
|
|
gui_libapps = [
|
|
|
|
console_libapps,
|
2017-11-01 14:27:13 +01:00
|
|
|
libappactions,
|
|
|
|
libappdialogs,
|
|
|
|
libappdisplay,
|
|
|
|
libappgui,
|
|
|
|
libappmenus,
|
|
|
|
libapppropgui,
|
|
|
|
libapptools,
|
|
|
|
libappwidgets,
|
|
|
|
libgimpwidgets,
|
|
|
|
]
|
|
|
|
|
|
|
|
# Executables
|
|
|
|
|
|
|
|
if platform_windows
|
|
|
|
console_rc_name = 'gimp-console-'+ gimp_app_version
|
|
|
|
gimp_app_console_rc = configure_file(
|
Issue #7327: Cannot build GIMP3 on MSYS2 using Meson.
This is untested on my side, because the bug only happens on native
builds with meson (our CI has cross-builds with meson and native builds
with autotools and I only do cross-builds locally) but I think/hope it
will work.
Basically we were using .full_path() because these rc files were also
used as input of some configure_file() calls which doesn't like custom
target objects as input (it wants strings or file objects). Yet a bug
in meson didn't like the colon used in native Windows full paths ('C:'
and such) when used in windows.compile_resources(). This has been fixed
by Luca Bacci in: https://github.com/mesonbuild/meson/pull/9368
Yet we just cannot depend on very early meson (or worse dev meson code).
On the other hand, if the input is a custom_tgt object, it uses the
object ID which we give as first parameter of custom_target() so we know
it's appropriately named without colons (such as 'gimp_plugins_rc').
Thus we should not bump into this issue again.
For the few usage in configure_file(), I just add a .full_path() only
when needed at call time.
Last but not least, I replace the bogus `meson --version` call by a
`python3 -c 'exit()'` as advised by Eli Schwartz:
https://gitlab.gnome.org/GNOME/gimp/-/commit/2afa019c708869ef84a2d24c96552b380a504d4d#note_1284951
The reason is that it is apparently possible (or will be when some
reimplementation of meson will be done) that the `meson` executable
itself does not exist. On the other hand, `python3` should always be
there, as a mandatory dependency of the build tool.
In order to use an appropriate `python3`, I made the
pythonmod.find_installation() check required in our build (which should
not be a problem since it's a meson requirement as well), even when the
-Dpython option is false (this one depends on other requirements too
anyway, such as version and pygobject). This way I can call this meson
variable of discovered python in my bogus call, instead of calling a
(potentially different) python from PATH environment.
2021-10-12 16:00:33 +02:00
|
|
|
input : gimp_plugins_rc.full_path(),
|
2017-11-01 14:27:13 +01:00
|
|
|
output: console_rc_name + '.rc',
|
|
|
|
copy: true,
|
|
|
|
)
|
|
|
|
console_rc_file = windows.compile_resources(
|
|
|
|
gimp_app_console_rc,
|
|
|
|
args: [
|
|
|
|
'--define', 'ORIGINALFILENAME_STR="@0@"'.format(console_rc_name+'.exe'),
|
|
|
|
'--define', 'INTERNALNAME_STR="@0@"' .format(console_rc_name),
|
2022-08-31 01:07:27 +02:00
|
|
|
'--define', 'TOP_SRCDIR="@0@"' .format(meson.project_source_root()),
|
2017-11-01 14:27:13 +01:00
|
|
|
],
|
|
|
|
include_directories: [
|
|
|
|
rootInclude, appInclude,
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
gui_rc_name = 'gimp-'+ gimp_app_version
|
|
|
|
gimp_app_gui_rc = configure_file(
|
Issue #7327: Cannot build GIMP3 on MSYS2 using Meson.
This is untested on my side, because the bug only happens on native
builds with meson (our CI has cross-builds with meson and native builds
with autotools and I only do cross-builds locally) but I think/hope it
will work.
Basically we were using .full_path() because these rc files were also
used as input of some configure_file() calls which doesn't like custom
target objects as input (it wants strings or file objects). Yet a bug
in meson didn't like the colon used in native Windows full paths ('C:'
and such) when used in windows.compile_resources(). This has been fixed
by Luca Bacci in: https://github.com/mesonbuild/meson/pull/9368
Yet we just cannot depend on very early meson (or worse dev meson code).
On the other hand, if the input is a custom_tgt object, it uses the
object ID which we give as first parameter of custom_target() so we know
it's appropriately named without colons (such as 'gimp_plugins_rc').
Thus we should not bump into this issue again.
For the few usage in configure_file(), I just add a .full_path() only
when needed at call time.
Last but not least, I replace the bogus `meson --version` call by a
`python3 -c 'exit()'` as advised by Eli Schwartz:
https://gitlab.gnome.org/GNOME/gimp/-/commit/2afa019c708869ef84a2d24c96552b380a504d4d#note_1284951
The reason is that it is apparently possible (or will be when some
reimplementation of meson will be done) that the `meson` executable
itself does not exist. On the other hand, `python3` should always be
there, as a mandatory dependency of the build tool.
In order to use an appropriate `python3`, I made the
pythonmod.find_installation() check required in our build (which should
not be a problem since it's a meson requirement as well), even when the
-Dpython option is false (this one depends on other requirements too
anyway, such as version and pygobject). This way I can call this meson
variable of discovered python in my bogus call, instead of calling a
(potentially different) python from PATH environment.
2021-10-12 16:00:33 +02:00
|
|
|
input : gimp_plugins_rc.full_path(),
|
2017-11-01 14:27:13 +01:00
|
|
|
output: gui_rc_name + '.rc',
|
|
|
|
copy: true,
|
|
|
|
)
|
|
|
|
gui_rc_file = windows.compile_resources(
|
|
|
|
gimp_app_rc,
|
|
|
|
args: [
|
|
|
|
'--define', 'ORIGINALFILENAME_STR="@0@"'.format(gui_rc_name+'.exe'),
|
|
|
|
'--define', 'INTERNALNAME_STR="@0@"' .format(gui_rc_name),
|
2022-08-31 01:07:27 +02:00
|
|
|
'--define', 'TOP_SRCDIR="@0@"' .format(meson.project_source_root()),
|
2017-11-01 14:27:13 +01:00
|
|
|
],
|
|
|
|
include_directories: [
|
|
|
|
rootInclude, appInclude,
|
|
|
|
],
|
|
|
|
)
|
|
|
|
else
|
|
|
|
console_rc_file = []
|
|
|
|
gui_rc_file = []
|
2020-01-18 23:38:26 +01:00
|
|
|
endif
|
2017-11-01 14:27:13 +01:00
|
|
|
|
2022-08-29 13:41:08 +00:00
|
|
|
if enable_console_bin
|
2024-02-26 15:56:40 +01:00
|
|
|
gimpconsole_exe = executable(gimpconsole_exe_name,
|
2022-08-29 13:41:08 +00:00
|
|
|
'main.c',
|
|
|
|
libapp_sources,
|
|
|
|
console_rc_file,
|
2023-06-11 17:39:33 +02:00
|
|
|
c_args: [ libapp_c_args, '-DGIMP_CONSOLE_COMPILATION', ],
|
|
|
|
dependencies: gimpconsole_deps,
|
2022-08-29 13:41:08 +00:00
|
|
|
link_with: [
|
2023-06-11 17:39:33 +02:00
|
|
|
app_libgimps,
|
|
|
|
console_libapps
|
2022-08-29 13:41:08 +00:00
|
|
|
],
|
2023-06-11 17:39:33 +02:00
|
|
|
include_directories: [
|
|
|
|
rootInclude,
|
|
|
|
rootAppInclude,
|
|
|
|
],
|
2024-11-18 14:52:47 +09:00
|
|
|
win_subsystem: 'console',
|
2023-06-11 17:39:33 +02:00
|
|
|
link_args: link_args,
|
2022-08-29 13:41:08 +00:00
|
|
|
install: true,
|
|
|
|
)
|
|
|
|
endif
|
2017-11-01 14:27:13 +01:00
|
|
|
|
2024-02-26 15:56:40 +01:00
|
|
|
gimpmain_exe = executable(gimpmain_exe_name,
|
2017-11-01 14:27:13 +01:00
|
|
|
'main.c',
|
|
|
|
gui_rc_file,
|
2023-06-11 17:39:33 +02:00
|
|
|
c_args: libapp_c_args,
|
2020-05-11 05:55:37 +02:00
|
|
|
dependencies: libapp_dep,
|
2017-11-01 14:27:13 +01:00
|
|
|
link_with: [
|
2023-06-11 17:39:33 +02:00
|
|
|
app_libgimps,
|
|
|
|
gui_libapps,
|
2017-11-01 14:27:13 +01:00
|
|
|
],
|
2024-11-18 14:52:47 +09:00
|
|
|
win_subsystem: 'windows',
|
2017-11-01 14:27:13 +01:00
|
|
|
install: true,
|
|
|
|
)
|
2022-08-29 13:41:08 +00:00
|
|
|
|
2024-06-05 09:40:30 -03:00
|
|
|
if enable_default_bin
|
|
|
|
if not platform_windows
|
|
|
|
install_symlink(fs.name(gimpmain_exe.full_path()).replace(exec_ver, ''),
|
2024-11-03 22:47:21 +01:00
|
|
|
pointing_to: fs.name(gimpmain_exe.full_path()),
|
|
|
|
install_dir: get_option('bindir'))
|
|
|
|
install_symlink(fs.name(gimpmain_exe.full_path()).replace(exec_ver, '-@0@'.format(api_version_major)),
|
|
|
|
pointing_to: fs.name(gimpmain_exe.full_path()),
|
|
|
|
install_dir: get_option('bindir'))
|
2024-06-05 09:40:30 -03:00
|
|
|
else
|
2025-05-18 11:46:12 +02:00
|
|
|
meson.add_install_script(python, '-c', 'from shutil import copy2; from pathlib import Path; from sys import argv; import os; copy2(argv[1], str(Path(os.environ.get("MESON_INSTALL_DESTDIR_PREFIX")) / "bin" / argv[2]))',
|
|
|
|
gimpmain_exe.full_path(), fs.name(gimpmain_exe.name()).replace(exec_ver, '.exe'))
|
|
|
|
meson.add_install_script(python, '-c', 'from shutil import copy2; from pathlib import Path; from sys import argv; import os; copy2(argv[1], str(Path(os.environ.get("MESON_INSTALL_DESTDIR_PREFIX")) / "bin" / argv[2].replace("@0@", argv[3])))',
|
|
|
|
gimpmain_exe.full_path(), fs.name(gimpmain_exe.name()).replace(exec_ver, '-@0@.exe'), api_version_major.to_string())
|
2024-06-05 09:40:30 -03:00
|
|
|
endif
|
|
|
|
if enable_console_bin
|
|
|
|
if not platform_windows
|
|
|
|
install_symlink(fs.name(gimpconsole_exe.full_path()).replace(exec_ver, ''),
|
2024-11-03 22:47:21 +01:00
|
|
|
pointing_to: fs.name(gimpconsole_exe.full_path()),
|
|
|
|
install_dir: get_option('bindir'))
|
|
|
|
install_symlink(fs.name(gimpconsole_exe.full_path()).replace(exec_ver, '-@0@'.format(api_version_major)),
|
|
|
|
pointing_to: fs.name(gimpconsole_exe.full_path()),
|
|
|
|
install_dir: get_option('bindir'))
|
2024-06-05 09:40:30 -03:00
|
|
|
else
|
2025-05-18 11:46:12 +02:00
|
|
|
meson.add_install_script(python, '-c', 'from shutil import copy2; from pathlib import Path; from sys import argv; import os; copy2(argv[1], str(Path(os.environ.get("MESON_INSTALL_DESTDIR_PREFIX")) / "bin" / argv[2]))',
|
|
|
|
gimpconsole_exe.full_path(), fs.name(gimpconsole_exe.name()).replace(exec_ver, '.exe'))
|
|
|
|
meson.add_install_script(python, '-c', 'from shutil import copy2; from pathlib import Path; from sys import argv; import os; copy2(argv[1], str(Path(os.environ.get("MESON_INSTALL_DESTDIR_PREFIX")) / "bin" / argv[2].replace("@0@", argv[3])))',
|
|
|
|
gimpconsole_exe.full_path(), fs.name(gimpconsole_exe.name()).replace(exec_ver, '-@0@.exe'), api_version_major.to_string())
|
2024-06-05 09:40:30 -03:00
|
|
|
endif
|
2022-08-29 13:41:08 +00:00
|
|
|
endif
|
|
|
|
endif
|